/* ============================================
   TETSUYA HARA - tetsuyahara.com
   B-Side: Portraits of public figures
   Main Stylesheet
   ============================================ */

/* --- RESET & BASE --- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  opacity: 0;
  transition: opacity 0.4s ease-in;
}

body.ready {
  opacity: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* --- NO-SELECT --- */
.sidebar, .sidebar a,
.mobile-header, .mobile-header a,
.mobile-nav, .mobile-nav a {
  -webkit-user-select: none;
  user-select: none;
}

/* --- SIDEBAR (PC) --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #000;
  padding: 20px 0 0 42px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 9999;
  border-right: 1px solid #1f1f1f;
}

.sidebar-title {
  text-decoration: none;
  display: block;
  margin-bottom: 28px;
}

.sidebar-title span {
  display: block;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 4px;
  line-height: 1.3em;
  color: #fff;
  white-space: nowrap;
}

/* sidebar internal scroll for long person list */
.sidebar-inner {
  width: 100%;
  height: calc(100vh - 20px);
  overflow-y: auto;
  padding-right: 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.sidebar-inner::-webkit-scrollbar { display: none; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-nav a {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #777;
  letter-spacing: 0;
  line-height: 1.8em;
  display: block;
  transition: color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
}

/* Sub-navigation: list of sitters */
.sidebar-section {
  margin-bottom: 22px;
}

.sitters {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 0;
  margin-bottom: 6px;
}

.sitters a {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #555;
  line-height: 1.8em;
  letter-spacing: 0;
  display: block;
  transition: color 0.2s;
}
.sitters a:hover,
.sitters a.active {
  color: #fff;
}

/* --- MOBILE HEADER --- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #000;
  padding: 16px 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 9999;
  border-bottom: 1px solid #1f1f1f;
}

.mobile-title {
  text-decoration: none;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 3px;
  color: #fff;
  white-space: nowrap;
}

.menu-btn {
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
}

.menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: #fff;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(14, 14, 14, 0.97);
  z-index: 10000;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 「流」を背景に薄く表示 */
.mobile-nav::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: 110%;
  background-image: url('../images/nagare_logo_white.webp');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 90% auto;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  padding: 22px 24px 10px;
  cursor: pointer;
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #888;
  background: transparent;
  border: none;
  text-transform: uppercase;
  z-index: 1;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 60px;
  position: relative;
  z-index: 1;
}

/* "Portraits" ラベル */
.mobile-nav-label {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555;
  padding: 8px 0 12px;
  display: block;
  text-align: center;
}

/* 人物名 */
.mobile-nav-inner a {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 400;
  font-style: italic;
  color: #ccc;
  padding: 10px 0;
  display: block;
  text-align: center;
  letter-spacing: 0.02em;
  width: 100%;
}

.mobile-nav-inner a.active {
  color: #fff;
}

/* Statement / About / Contact (区切り線の後) */
.mobile-nav-divider {
  display: block;
  width: 40px;
  height: 1px;
  background: #333;
  margin: 24px auto;
}

/* Statement / About / Contact を少し大きく */
.mobile-nav-inner a:nth-last-child(-n+3) {
  font-size: 24px;
  color: #fff;
  padding: 14px 0;
}

/* --- MAIN (PC: offset by sidebar width) --- */
main {
  padding-left: 260px;
}

/* --- COVER (used by JS to render book "流" logo on first slide) --- */

/* --- SLIDESHOW (PC) --- */
.slideshow {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  overflow: hidden;
}

.slide-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.slide-img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.slide-caption {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 14px;
  color: #aaa;
  margin-top: 18px;
  text-align: center;
  min-height: 20px;
  letter-spacing: 0.05em;
}

.slide-meta {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #555;
  margin-top: 6px;
  text-align: center;
}

/* --- COVER as first slide on portraits page (book "流" logo) --- */
.slide-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-cover img {
  max-width: 92%;
  height: 92vh;
  width: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* --- STATEMENT --- */
.statement-page {
  width: 100%;
}

.statement-hero {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 60px;
}

.statement-hero span {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 2px;
  color: #fff;
  text-align: center;
  display: inline-block;
  line-height: 1.6em;
}

.mobile-only-br {
  display: none;
}
.mobile-only-br::before {
  content: " ";
}

.statement-body {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 60px 120px;
}

.statement-text {
  max-width: 640px;
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  font-weight: 400;
  color: #ccc;
  line-height: 1.9em;
}

.statement-text p {
  margin: 0 0 1.6em 0;
}

.statement-text p.quote {
  margin: 1.2em 0;
  padding: 0.8em 0;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  font-style: italic;
  letter-spacing: 0.5px;
  line-height: 2em;
  color: #fff;
}

.statement-text p.emphasized {
  margin: 0 0 2em 0;
  font-weight: 500;
  color: #fff;
}

/* --- ABOUT --- */
.about-page {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 80px 60px 120px;
}

.about-inner {
  display: flex;
  gap: 60px;
  max-width: 960px;
  width: 100%;
  align-items: flex-start;
}

.about-photo {
  flex: 0 0 380px;
}

.about-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.about-text {
  flex: 1;
}

.about-name {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  color: #fff;
  margin-bottom: 6px;
}

.about-birth {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 400;
  color: #888;
  margin-bottom: 32px;
  font-style: italic;
}

.about-bio {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 400;
  color: #ccc;
  line-height: 1.8em;
  margin: 0 0 1.2em 0;
}

/* --- CONTACT --- */
.contact-page {
  width: 100%;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-email {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #888;
  transition: color 0.2s;
}

.contact-email:hover {
  color: #fff;
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 767px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  main {
    padding-left: 0;
    padding-top: 52px;
  }

  /* SLIDESHOW on mobile: scrollable */
  .slideshow {
    height: auto;
    min-height: calc(100vh - 52px);
    padding: 0;
    overflow: visible;
    justify-content: flex-start;
  }

  .slide-item {
    width: 100%;
    padding: 12px 16px 28px;
  }

  .slide-item.first {
    height: calc(100vh - 52px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  /* カバー: 9:16画像 → 全画面高さで表示 */
  .slide-item.cover-item.first {
    height: calc(100vh - 52px);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .slide-item.cover-item.first .slide-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .slide-item.cover-item.first img {
    height: 100%;
    width: auto;
    display: block;
    max-width: 100%;
  }

  .slide-item:not(.first) img {
    width: 100%;
    height: auto;
    display: block;
  }

  .slide-item:not(.cover-item) img {
    width: 100%;
    max-height: 80vh;
    height: auto;
    object-fit: contain;
  }

  .slide-item.last {
    padding-bottom: 0;
  }

  .slide-item .caption {
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 13px;
    color: #aaa;
    margin-top: 10px;
    letter-spacing: 0.05em;
  }

  .slide-tap-cue {
    display: block;
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-style: normal;
    font-size: 10px;
    color: #555;
    letter-spacing: 0.12em;
    margin-top: 5px;
  }

  .slide-item .meta {
    font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #555;
    margin-top: 4px;
  }

  /* STATEMENT on mobile */
  .statement-hero {
    padding: 0 28px;
    align-items: center;
    justify-content: center;
  }

  .statement-hero span {
    font-size: 24px;
    text-align: center;
  }

  .mobile-only-br {
    display: inline;
  }
  .mobile-only-br::before {
    content: none;
  }

  .statement-body {
    padding: 0 24px 80px;
  }

  .statement-text p.quote {
    font-size: 16px;
  }

  /* ABOUT on mobile */
  .about-page {
    padding: 30px 20px 80px;
  }

  .about-inner {
    flex-direction: column;
    gap: 28px;
    align-items: flex-start;
  }

  .about-photo {
    flex: none;
    width: 100%;
  }
}

/* ============================================
   PERSON PAGE
   ============================================ */
.person-page {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 80px 60px 120px;
}

.person-inner {
  width: 100%;
}

.person-header {
  max-width: 720px;
  margin-bottom: 80px;
}

.person-name {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 14px 0;
}

.person-birth {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  color: #888;
  margin-bottom: 22px;
}

.person-role {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #ccc;
  line-height: 1.7em;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.person-known {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  color: #fff;
  line-height: 1.6em;
  margin-bottom: 28px;
}

.person-bio {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  color: #fff;
  line-height: 1.6em;
  margin-bottom: 14px;
}

.person-bio em,
.person-known em {
  font-style: italic;
}

.person-shoot {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #777;
  letter-spacing: 0.05em;
  line-height: 1.7em;
  padding-top: 18px;
  border-top: 1px solid #1f1f1f;
}

.person-photos {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-bottom: 100px;
}

.person-photo {
  display: block;
  width: 100%;
  margin: 0;
}

.person-photo img {
  width: 100%;
  height: auto;
  max-height: none;
  display: block;
}

.person-photo-caption {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 13px;
  color: #888;
  margin-top: 12px;
  letter-spacing: 0.03em;
}

.person-nav {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding-top: 40px;
  border-top: 1px solid #1f1f1f;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 14px;
}

.person-nav a {
  color: #888;
  transition: color 0.2s;
}
.person-nav a:hover {
  color: #fff;
}

.person-nav .prev::before { content: '\2190  '; }
.person-nav .next::after  { content: '  \2192'; }

@media (max-width: 767px) {
  .person-page {
    padding: 30px 20px 80px;
  }
  .person-header {
    margin-bottom: 50px;
  }
  .person-photos {
    gap: 40px;
    margin-bottom: 60px;
  }
  .person-photo {
    display: block;
    width: 100%;
  }
  .person-photo img {
    width: 100%;
    height: auto;
    max-height: none;
  }
}

/* --- UTILS --- */
.no-scroll {
  overflow: hidden;
}

/* ============================================
   PATTERN C — Slideshow + scrollable portrait detail
   （PC only。モバイルは従来の縦スクロール一覧のまま）
   ============================================ */

/* パターンC有効時はスクロールを解禁する。
   従来の no-scroll はこのクラスが付くと使われない。 */
body.has-portrait-detail,
body.has-portrait-detail .no-scroll {
  overflow-y: auto;
}

/* スライドショーは画面いっぱい(100vh)を維持。
   position:relative で scroll-cue の絶対配置の基準にする。 */
body.has-portrait-detail .slideshow {
  position: relative;
}

/* 「下に続く」サイン。.slideshow 下部に絶対配置で浮かせ、
   画像エリアの高さを一切食わないようにする。
   caption（画像直下・通常フロー）と重ならないよう、
   サイン全体をコンパクトにして画面最下部に置く。 */
.scroll-cue {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #5e5e5e;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 5;
}
.scroll-cue-line {
  width: 1px;
  height: 16px;
  background: linear-gradient(to bottom, transparent, #5e5e5e);
  animation: scrollcue 2.4s ease-in-out infinite;
}
@keyframes scrollcue {
  0%, 100% { opacity: 0.25; transform: scaleY(0.65); transform-origin: top; }
  50%      { opacity: 1;    transform: scaleY(1);    transform-origin: top; }
}
/* スクロールし始めたら cue を消す */
body.scrolled .scroll-cue {
  opacity: 0;
}

/* 詳細セクション：スライドショーの真下に地続きで繋がる */
.portrait-detail {
  width: 100%;
  border-top: 1px solid #1f1f1f;
  background: #000;
}
.portrait-detail.is-empty {
  border-top: none;
}
/* .person-page は既存では display:flex。だが詳細セクション内では
   flexアイテム（.person-inner）が min-width:auto で約89px縮み、
   写真が小さくなっていた。詳細セクション内では block に変え、
   .person-inner を margin auto で中央寄せする（見た目は同じ・幅は正しい）。 */
.portrait-detail .person-page {
  display: block;
  animation: detailfade 0.5s ease;
}
.portrait-detail .person-inner {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
}
@keyframes detailfade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 「スライドに戻る」リンク */
.back-to-slide {
  display: block;
  text-align: center;
  padding: 20px 0 90px;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 14px;
  color: #777;
  transition: color 0.2s;
}
.back-to-slide:hover {
  color: #fff;
}
.back-to-slide::before {
  content: '\2191  ';
}

/* モバイルでは詳細セクションを使わない（従来の縦一覧のまま） */
@media (max-width: 767px) {
  .portrait-detail {
    display: none;
  }
  .scroll-cue {
    display: none;
  }
}
