/* Existing INFORMATION and legacy layout styles */
/* ========================================
   Base
   ======================================== */

:where(:root:not(.single-top)) * { box-sizing: border-box; }
html:where(:root:not(.single-top)), :where(:root:not(.single-top)) body { height: 100%; }

/* 背景色: overview.css と同じ（:root { --bg: #fff; background: var(--bg) }） */
:root:where(:root:not(.single-top)){
  --bg: #fff;
  background: var(--bg);
}

:where(:root:not(.single-top)) body{
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
  background: var(--bg);
  color: #111;
}

/* ========================================
   Layout
   ======================================== */

:where(:root:not(.single-top)) .layout{
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
}

:where(:root:not(.single-top)) .main{
  padding: 24px;
}

/* ========================================
   NAV (shared)
   ======================================== */

:where(:root:not(.single-top)) .nav{
  background: var(--bg);
  transition: opacity 0.3s ease;
  will-change: opacity;
}

:where(:root:not(.single-top)) .nav.is-faded{
  opacity: 1;
  pointer-events: auto;
}

:where(:root:not(.single-top)) .nav-inner{
  padding: 24px 18px;
}

:where(:root:not(.single-top)) .nav-top{
  display: flex;
  align-items: flex-start;
}

/* ブランド表記（名前・職業）: HOME / Overview / Information で共通の値。
   Cormorant Garamond 300 は Helvetica より小さく見えるため、Overview の旧サイズ
   (Helvetica 28px / 16px) とキャップハイトが揃う 8/7 倍に設定。 */
:root:where(:root:not(.single-top)){
  --brand-font: "Cormorant Garamond", "Helvetica Neue", Helvetica, Arial, serif;
  --brand-font-weight: 300;
  --brand-name-size: 32px;
  --brand-role-size: 18px;
  --brand-line-height: 1.2;
}
@media (max-width: 767px){
  :root:where(:root:not(.single-top)){
    --brand-name-size: 26px;
    --brand-role-size: 18px;
  }
}

.brand,
.brand-sub,
:where(:root:not(.single-top)) .hp-name span{
  display: block;
  font-family: var(--brand-font);
  font-weight: var(--brand-font-weight);
  line-height: var(--brand-line-height);
  letter-spacing: normal;
  color: #111;
  text-decoration: none;
}

.brand,
:where(:root:not(.single-top)) .hp-name .hp-name__name{ font-size: var(--brand-name-size); }

.brand-sub,
:where(:root:not(.single-top)) .hp-name .hp-name__role{ font-size: var(--brand-role-size); }

:where(:root:not(.single-top)) .nav-menu{
  margin-top: 24px; /* 18 → 24: ブランド表記の拡大に合わせて作品タイトルとの間を確保 */
  display: flex;
  flex-direction: column;
}

:where(:root:not(.single-top)) .nav-label {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  opacity: 0.55;
  margin-bottom: 4px; /* リンク群との距離 */
  pointer-events: none; /* クリック不可 */
}

/* NEWEST WORKS 直下の現在のプロジェクト名（スクロール位置に連動） */
:where(:root:not(.single-top)) .nav-current{
  font-size: 0.7rem;
  padding: 3px 0;
  min-height: calc(0.7rem * 1.35 + 6px); /* 切替時も高さを固定 */
  line-height: 5.35;
}

:where(:root:not(.single-top)) .nav-menu .nav-link[href*="overview"] {
  margin-top: 50px;
}


:where(:root:not(.single-top)) .nav-link{
  display: inline-block;
  text-decoration: none;
  color: #111;
  font-size: 0.7rem;
  padding: 3px 0;
  opacity: 0.85;
}

:where(:root:not(.single-top)) .nav-link:hover{ opacity: 1; }

.nav-link.is-active,
:where(:root:not(.single-top)) .nav-link[aria-current="page"]{
  text-decoration: underline;
  opacity: 1;
}

/* “Information” link (same look/feel as nav) */
:where(:root:not(.single-top)) .nav .js-info{
  font-size: 0.7rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  padding-top: 10px;
}
:where(:root:not(.single-top)) .nav .js-info:hover{ opacity: 0.75; }

/* ========================================
   Info page (shared)
   ======================================== */

:where(:root:not(.single-top)) .info-page{
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  z-index: 1200;
}

:where(:root:not(.single-top)) body.info-open .info-page{ display: block; }
:where(:root:not(.single-top)) body.info-open{ overflow: hidden; }

/* 独立ページ（info.html）では内容が画面を超えた場合にスクロールできるように */
:where(:root:not(.single-top)) .info-page{ overflow-y: auto; }

:where(:root:not(.single-top)) .info-page__inner{
  padding: 16px;
  line-height: 1.5;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.hp-label,
.hp-list,
:where(:root:not(.single-top)) .hp-note{
  margin: 0 0 26px;
}

:where(:root:not(.single-top)) .hp-pdflink{ margin: 56px 0; }

:where(:root:not(.single-top)) .hp-copyright{
  margin-top: 60px;
  font-size: 0.6rem;
  font-weight: 100;
  letter-spacing: 0.06em;
}

:where(:root:not(.single-top)) .info-page a{
  color: inherit;
  text-decoration: none;
}
:where(:root:not(.single-top)) .info-page a:hover{ opacity: 0.75; }

:where(:root:not(.single-top)) .info-back{
  display: inline-block;
  margin-bottom: 32px;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}
:where(:root:not(.single-top)) .info-back:hover{ opacity: 0.7; }

/* ========================================
   Responsive nav layout (shared)
   ======================================== */

@media (min-width: 861px){
  :where(:root:not(.single-top)) .nav{
    position: fixed;
    left: 0;
    top: 0;
    width: 180px;
    height: 100svh;
    z-index: 1000;
  }

  :where(:root:not(.single-top)) .nav-inner{
    height: 100svh;
    overflow: auto;
  }

  :where(:root:not(.single-top)) .nav-top{
    flex-direction: column;
    align-items: flex-start;
  }

  :where(:root:not(.single-top)) .main{
    padding: 24px;
    padding-left: calc(180px + 24px);
    transition: padding-left 0.25s ease;
  }

  :where(:root:not(.single-top)) .layout.is-nav-faded .main{
    padding-left: 24px;
  }
}

/* ========================================
   Mobile header + caption (<= 860px)
   Overview (overview.css) のヘッダーと画像下キャプションに数値を合わせる:
   左=名前/職業、右=Overview/Information（職業の行と下揃え）、
   下端固定のキャプション=作品タイトル/フォトグラファー。
   ======================================== */

/* Overview の --header-edge / --nav-size / --header-top / --header-pad-bottom / --edge と同値 */
:root:where(:root:not(.single-top)){
  --m-header-edge: 24px;
  --m-nav-size: 13px;
  --m-header-top: max(18px, env(safe-area-inset-top));
  --m-header-pad-bottom: 12px;
  --m-caption-edge: 14px;
}
@media (max-width: 767px){
  :root:where(:root:not(.single-top)){
    --m-header-edge: 20px;
    --m-nav-size: 10px;
    --m-header-top: max(12px, env(safe-area-inset-top));
    --m-header-pad-bottom: 8px;
    --m-caption-edge: 10px;
  }
}

/* 画像下キャプション（PC ではサイドナビにタイトルを出すので非表示） */
:where(:root:not(.single-top)) .m-caption{ display: none; }

@media (max-width: 860px){
  :where(:root:not(.single-top)) .nav{
    position: sticky;
    top: 0;
    z-index: 1000;
    /* overview.css .header-bg と同じ半透明のすりガラス帯 */
    background: rgba(255, 255, 255, 0.555);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  :where(:root:not(.single-top)) .nav-inner{
    display: flex;
    align-items: flex-end; /* リンクの行を職業の行と下揃え */
    justify-content: space-between;
    gap: 16px;
    padding: var(--m-header-top) max(var(--m-header-edge), env(safe-area-inset-right)) var(--m-header-pad-bottom) max(var(--m-header-edge), env(safe-area-inset-left));
  }

  :where(:root:not(.single-top)) .nav-top{
    display: flex;
    flex-direction: column; /* Overview と同じく名前の下に職業 */
    align-items: flex-start;
    gap: 0;
  }

  :where(:root:not(.single-top)) .nav-menu{
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: flex-end;
    margin-left: auto;
    white-space: nowrap;
  }

  /* 作品タイトルは下端のキャプションに表示 */
  :where(:root:not(.single-top)) .nav-current{ display: none; }

  .nav-link,
  :where(:root:not(.single-top)) .nav .js-info{
    font-size: var(--m-nav-size);
    line-height: 1.2;
    padding: 0;
    margin: 0;
    opacity: 1;
  }
  :where(:root:not(.single-top)) .nav-menu .nav-link[href*="overview"]{ margin-top: 0; }

  /* 下端固定キャプションの高さ分、最後の画像が隠れないように余白を確保 */
  :where(:root:not(.single-top)) .main{
    padding: 16px;
    padding-bottom: calc(46px + 16px + env(safe-area-inset-bottom));
  }

  :where(:root:not(.single-top)) .m-caption{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 9px max(var(--m-caption-edge), env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(var(--m-caption-edge), env(safe-area-inset-left));
    /* overview.css .bottom-nav と同じ背景処理 */
    background: var(--bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-size: 11px;
    line-height: 1.25;
    text-transform: uppercase;
    text-align: left;
  }

  :where(:root:not(.single-top)) .m-caption__inner{ min-height: 30px; }
  :where(:root:not(.single-top)) .m-caption__inner span{ display: block; }
}

/* ========================================
   horizontal scroll: page-specific (Main / Grid)
   目的:
   - portrait (mobile/tablet): 縦スクロールで1カラム
   - desktop landscape (>=900px): 横スクロール
   - nav は上で “shared” として完結している前提
   ======================================== */

/* --- Main defaults (portrait / base) --- */
/* 注意: shared側で .main padding は既に定義されているので
   ここでは “上書きしない” ほうが整理しやすい。
   ただし portrait 時のギャラリー幅だけはここで定義する。 */

:where(:root:not(.single-top)) .grid{
  width: min(980px, 100%);
  margin: 0 auto;
}

:where(:root:not(.single-top)) .grid-inner{
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

:where(:root:not(.single-top)) .grid-inner::before{
  content: none;
}

:where(:root:not(.single-top)) .card{
  margin: 0;
  width: 100%;
}

:where(:root:not(.single-top)) .card img{
  display: block;
  width: 100%;
  height: auto;
}

/* portrait/mobile spacing tweak (optional) */
@media (max-width: 860px){
  :where(:root:not(.single-top)) .grid{ width: 100%; }
  :where(:root:not(.single-top)) .grid-inner{ gap: 16px; }
}

/* --- Horizontal scroll mode (desktop landscape) --- */
@media (min-width: 900px) and (orientation: landscape){

  /* main の left padding は shared 側(= nav幅ぶん)を維持する想定。
     横モードだけ、縦スクロール混入を防ぐために overflow を切る。 */
  :where(:root:not(.single-top)) .main{
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    overflow: hidden;
  }

  :where(:root:not(.single-top)) .grid{
    width: 100%;
    margin: 0;
  }

  :where(:root:not(.single-top)) .grid-inner{
    display: flex;
    gap: 48px;

    height: 100svh;

    padding: 24px 0;

    overflow-x: auto;
    overflow-y: hidden;

    align-items: center;
    -webkit-overflow-scrolling: touch;

    scroll-snap-type: x proximity;
  }

  /* 左余白スペーサー（nav幅ぶん） */
  :where(:root:not(.single-top)) .grid-inner::before{
    content: none;
  }

  :where(:root:not(.single-top)) .card{
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    scroll-snap-align: start;
  }

  :where(:root:not(.single-top)) .card img{
    width: auto;
    height: calc(100svh - 48px);
    max-height: 900px;
  }
}










/* マウスホイール（縦）→ 横スクロール変換中は snap を一時停止（script.js） */
:where(:root:not(.single-top)) .grid-inner.is-wheeling{
  scroll-snap-type: none;
}

/* Information: Biography 本文（Helvetica Neue。ラベル類 0.6rem より一段大きく、読みやすい行幅に制限） */
:where(:root:not(.single-top)) .hp-bio{
  max-width: 34em;
  margin: 0 0 44px; /* 問い合わせ先との間 */
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  text-align: left;
}
:where(:root:not(.single-top)) .hp-bio p{ margin: 0 0 1em; }
:where(:root:not(.single-top)) .hp-bio p:last-child{ margin-bottom: 0; }

/* Single Top HOME */
html:where(:root.single-top), :where(:root.single-top) body {
  min-height: 100%;
  background: #fff;
}
:where(:root.single-top) body {
  box-sizing: border-box;
  width: min(100%, 1180px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(clamp(22px, 6vh, 50px), env(safe-area-inset-top))
    max(var(--header-edge), env(safe-area-inset-right))
    max(clamp(20px, 5vh, 40px), env(safe-area-inset-bottom))
    max(var(--header-edge), env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto minmax(80px, 1fr) auto;
  row-gap: clamp(12px, 3vh, 26px);
}

:where(:root.single-top) .home-header {
  position: relative;
  pointer-events: none;
}
/* Brand floats left; the bio (one paragraph) starts beside it and wraps under it to the left edge.
   The same gap is used to the right of and below the brand so the two read as one margin. */
/* HOME only: brand smaller than Overview's (32/18, mobile 26/18) so it sits beside ~3–4 lines of bio.
   Scales linearly from 16 / 11.5px at 375px to 28 / 16px at 1440px. Overview / Information keep their sizes. */
:where(:root.single-top) .home-header {
  --brand-gap: clamp(8px, 1.2vw, 18px);
  --brand-name-size: clamp(16px, 11.77px + 1.127vw, 28px);
  --brand-role-size: clamp(11.5px, 9.92px + 0.4225vw, 16px);
}
:where(:root.single-top) .home-header .brand {
  position: relative; z-index: 3; /* in front of the photo, and of the bio box that runs under the float (keeps the link clickable) */
  inset: auto; /* cancel overview.css .brand left / top (they would shift a relative box) */
  float: left;
  margin: 0 var(--brand-gap) var(--brand-gap) 0;
  pointer-events: auto;
}
:where(:root.single-top) .brand-sub { font-size: var(--brand-role-size); }
:where(:root.single-top) .home-bio {
  /* In front of the photo and blended with it: white + difference reads black on the white page
     and inverts where it overlaps the photo. The header must not be a stacking context, or the
     blend would be isolated from the photo. */
  position: relative; z-index: 2;
  color: #fff;
  mix-blend-mode: difference;
  /* Same family / weight as the brand (overview.css --brand-font, Cormorant Garamond 300) */
  font: var(--brand-font-weight) 14px / 1.2 var(--brand-font); /* mobile: 11px (below) */
  pointer-events: auto;
}
:where(:root.single-top) .home-bio p { margin: 0; }
:where(:root.single-top) .home-nav {
  position: relative; z-index: 2; /* in front of the photo */
  clear: both;
  margin-top: clamp(14px, 3vh, 28px);
  text-align: right;
  font: 400 9px / 1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
}
:where(:root.single-top) .home-nav a { pointer-events: auto; }

/* The stage is fixed to the viewport so the photo is always at the centre of the screen,
   regardless of the bio's height (it may overlap the text). Only the image itself takes pointer input. */
:where(:root.single-top) .scrubber-stage {
  position: fixed; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  container-type: size;
}
:where(:root.single-top) .scrubber {
  width: min(53.82vw, 72cqh); /* mobile: 46vw x 1.3, then x 0.9; the cqh cap keeps the 4:5 box inside the screen height */
  aspect-ratio: 4 / 5;
  display: flex; align-items: center; justify-content: center;
}
:where(:root.single-top) .scrubber:focus-visible { outline: 1px solid #000; outline-offset: 6px; }
:where(:root.single-top) .scrubber-img {
  display: block;
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  pointer-events: auto; cursor: ew-resize;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}

:where(:root.single-top) .home-contact {
  position: relative;
  margin: 0;
  font: 400 9px / 1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #000;
  pointer-events: none;
  grid-row: 3; /* keep it at the bottom now that the stage is out of the grid */
}
:where(:root.single-top) .home-contact a {
  pointer-events: auto;
  text-decoration: underline;
  text-underline-offset: 1px;
}

@media (min-width: 768px) {
  :where(:root.single-top) .scrubber { width: min(46vw, 36.8dvh, 80cqh); }
}
@media (max-width: 767px) {
  :where(:root.single-top) .home-bio { font-size: 11px; }
  /* Mobile: brand and bio in bold (Cormorant Garamond 700, loaded in index.html) */
  :where(:root.single-top) .home-header .brand,
  :where(:root.single-top) .home-header .brand-sub,
  :where(:root.single-top) .home-bio { font-weight: 700; }
}
/* iPhone (Pro Max 440px wide and narrower): bio slightly larger */
@media (max-width: 440px) {
  :where(:root.single-top) .home-bio { font-size: 12px; }
}
/* iPhone SE class (375 x 667 or shorter): scrubber kept at 80% of the earlier mobile size (59.8vw / 80cqh x 0.8) */
@media (max-width: 375px) and (max-height: 667px) {
  :where(:root.single-top) .scrubber { width: min(47.84vw, 64cqh); }
}
