/* Photography in the Lav look (2026-10-25). Tokens from /assets/tokens.css ([data-look="lav"]),
   header and footer from /assets/chrome.css. The page follows the homepage's grid (12 columns,
   16 px gap, 56 px gutter, max 1440; one column on a 20 px gutter under 860 px) and its frame
   treatment: 28 px radius, a short dark fade, the Title word and a UI line inside.
   Each series opens with the frame the homepage shows for it, then the photographs follow in
   rows. A row shares one height: each photograph grows by its own aspect (--ar, as width/height),
   so every picture keeps its shape and the row heights give the rhythm. Rows are written by hand
   in the HTML. Under 860 px the rows become one column. */

/* ── Base (same as the homepage) ── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; font-optical-sizing: auto; font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[data-look="lav"] { color-scheme: light; }
[data-look="lav"][data-theme="dark"] { color-scheme: dark; }
body { margin: 0; min-width: 320px; min-height: 100svh; font-size: var(--t-body); line-height: var(--lh-body); letter-spacing: var(--tr-body); font-weight: 400; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
p, h1, h2, h3, ul, figure { margin: 0; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.t-title { font-size: var(--t-title); line-height: var(--lh-title); letter-spacing: var(--tr-title); font-weight: 300; }
.t-body { font-size: var(--t-body); line-height: var(--lh-body); letter-spacing: var(--tr-body); font-weight: 400; }
.t-ui { font-size: var(--t-ui); line-height: var(--lh-ui); letter-spacing: 0; font-weight: 400; }
.t-caption { font-size: var(--t-caption); line-height: var(--lh-caption); letter-spacing: var(--tr-caption); font-weight: 400; }

.sec { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* The header's Photography link points at the homepage section; on this page it is the current one. */
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ── The page opens on one word, a short line and the list of series. ── */
.intro { padding-top: 120px; }
.intro__title { margin-left: var(--tr-title); color: var(--ink); }
.intro__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; align-items: start; margin-top: 56px; }
.intro__lead { grid-column: 7 / span 6; max-width: 30em; color: var(--muted); text-wrap: pretty; }
/* The contents list: series on the left, the count in tabular figures at the right of a fixed column. */
.toc { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 2px; list-style: none; padding: 0; }
.toc a { display: grid; grid-template-columns: 9em 3ch; column-gap: 24px; width: max-content; padding: 6px 0; color: var(--ink); border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.toc a:hover { border-bottom-color: var(--ink); }
.toc__n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ── A series: the lead frame with its word, the note beside it, then the rows. ── */
.series { padding-top: 168px; scroll-margin-top: 88px; }
.series__top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; align-items: end; }
.series__note { grid-column: 9 / span 4; margin: 0 0 32px; max-width: 24em; color: var(--muted); text-wrap: pretty; }

.frame { position: relative; display: block; overflow: hidden; border-radius: 28px; background: #2C332D; color: #EEF1EC; isolation: isolate; }
.frame--lead { grid-column: 1 / span 8; aspect-ratio: calc(var(--ar)); }
.frame__btn { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: zoom-in; border-radius: 28px; }
.frame__btn:focus-visible { outline-offset: -3px; border-radius: 28px; }
.frame__img { width: 100%; height: 100%; object-fit: cover; }
.frame__fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52%; pointer-events: none;
  background: linear-gradient(to top, rgba(18,22,18,.72) 0%, rgba(18,22,18,.42) 45%, rgba(18,22,18,0) 100%);
}
.frame__text { position: absolute; left: 30px; right: 30px; bottom: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; pointer-events: none; }
.frame__word { display: block; margin-left: var(--tr-title); color: #EEF1EC; }
.frame__line { display: block; color: #D3D9D2; }
/* Lead crops, the same as the homepage's frames (desktop shows the whole photograph; these matter on phones). */
.p-vietnam .frame__img { object-position: 32% 50%; }
.p-lomond .frame__img { object-position: 50% 40%; }
.p-owls .frame__img { object-position: 50% 35%; }
.p-misc .frame__img { object-position: 50% 50%; }

/* The rows. Each photograph is a button that opens the lightbox. */
.rows { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.row { display: flex; gap: 16px; }
.ph { position: relative; flex: calc(var(--ar)) 1 0%; min-width: 0; aspect-ratio: calc(var(--ar)); overflow: hidden; border-radius: 28px; background: var(--surface); cursor: zoom-in; }
.ph:focus-visible { outline-offset: 4px; border-radius: 28px; }
.ph img { width: 100%; height: 100%; object-fit: cover; }

/* Room under the last series before the footer, as on the homepage. */
.gallery { padding-bottom: 200px; }

/* ── Lightbox: a native dialog in the page's ground colour. The photograph sits between a
   top row (Close, right) and a bottom row (the caption left on the gutter, Previous and Next
   right). Arrow keys and swipe step, Escape closes, focus returns to the photograph pressed. ── */
.lb { position: fixed; inset: 0; width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.lb::backdrop { background: transparent; }
.lb[open] { display: grid; grid-template-rows: 64px minmax(0, 1fr) 72px; }
.lb__in { display: contents; }
.lb__top, .lb__bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.lb__top { justify-content: flex-end; }
.lb__btn { padding: 6px 0; color: var(--ink); border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.lb__btn:hover { border-bottom-color: var(--ink); }
.lb__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.lb__stage { position: relative; display: grid; place-items: center; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter); min-height: 0; touch-action: pan-y; }
.lb__fig { display: contents; }
.lb__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; }
.lb__cap { display: flex; gap: 16px; color: var(--muted); white-space: nowrap; }
.lb__nav { display: flex; gap: 28px; }
/* Ground stays scrollable only behind a closed dialog. */
html.lb-open, html.lb-open body { overflow: hidden; }

/* ── Phones and narrow widths ── */
@media (max-width: 1199px) {
  .series__note { grid-column: 9 / span 4; }
}
@media (max-width: 860px) {
  .intro { padding-top: 88px; }
  .intro__grid { display: flex; flex-direction: column-reverse; gap: 36px; margin-top: 32px; }
  .intro__lead { max-width: 34em; }
  .toc { gap: 0; }
  .toc a { padding: 11px 0; }

  .series { padding-top: 112px; scroll-margin-top: 72px; }
  .series__top { display: block; }
  .frame--lead { aspect-ratio: 4 / 3; }
  .frame__fade { height: 56%; }
  .frame__text { left: 20px; right: 20px; bottom: 22px; gap: 8px; }
  .p-lomond .frame__img { object-position: 22% 50%; }
  .p-owls .frame__img { object-position: 74% 30%; }
  .p-misc .frame__img { object-position: 40% 50%; }
  .series__note { margin: 20px 0 0; max-width: 34em; }

  .rows { gap: 12px; margin-top: 12px; }
  .row { flex-direction: column; gap: 12px; }
  .ph { flex: none; }
  .gallery { padding-bottom: 140px; }

  .lb[open] { grid-template-rows: 56px minmax(0, 1fr) 64px; }
  .lb__top, .lb__bottom { padding: 0 8px 0 var(--gutter); }
  .lb__bottom { padding-right: var(--gutter); }
  .lb__stage { padding: 4px var(--gutter); }
  .lb__btn { min-height: 44px; padding: 11px 0; }
  .lb__top .lb__btn { padding: 11px 12px; }
  .lb__cap { flex-direction: column; gap: 0; }
  .lb__nav { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toc a, .lb__btn { transition: none; }
}
