/* Static project pages (/projects/<slug>/, /zh/projects/<slug>/; written by jan-chi-builders-tools/seo-build)
   Hero on ink: breadcrumb, title, the facts strip (the home page's title block), the early call to action, then the
   lead photograph or typographic panel at full width. The 'On site' note, summary and scope on paper, the
   photographs and the before / after pair on ink, previous / next on paper, the call to action on ink.
   Loaded after tokens, base and sections (and work.css on pages with a panel). Nothing moves: the page reads as written. */

/* the shared header sits on ink from the start: these pages have no scroll-driven header */
.pp-page .site-header { background: var(--ink); box-shadow: 0 1px 0 rgba(var(--on-rgb), 0.12); }
/* the phone menu needs js/project-page.js; without it the breadcrumb and footer links lead on */
.no-js .pp-page .menu-toggle { display: none; }

/* ---------- hero ---------- */
/* the crumbs' 44 px tap targets hold the space above and below their text */
.pp-hero { padding-block: calc(var(--header-h) + clamp(4px, 1vw, 16px)) clamp(48px, 6vw, 96px); background: var(--bg); color: var(--fg); }
.pp-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: clamp(24px, 3.4vw, 48px); padding-bottom: 2px; border-bottom: 1px solid var(--line); font-size: var(--fs-label, 0.75rem); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pp-crumbs { min-width: 0; }
.pp-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; }
.pp-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.pp-crumbs li + li::before { content: "/"; margin: 0 10px; color: var(--line-strong); }
.pp-crumbs a { position: relative; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; transition: color var(--t-fast) var(--ease); }
/* a short crumb (Home, 首页) still takes a 44 px wide tap: the hit area grows into the separator gap, the text stays put */
.pp-crumbs a::after { content: ""; position: absolute; inset-block: 0; inset-inline: min(0px, calc(50% - 22px)); }
@media (hover: hover) { .pp-crumbs a:hover { color: var(--fg); text-decoration: underline; } }
.pp-crumbs [aria-current] { color: var(--fg); }
.pp-count { flex: none; color: var(--amber); }

.pp-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 20px; font-size: var(--fs-label, 0.75rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pp-cat { padding: 4px 8px 3px; border: 1px solid var(--amber); color: var(--amber); }
.pp-title { font-size: var(--fs-2xl); text-wrap: balance; }
.pp-sub { margin: 18px 0 0; max-width: 56ch; font-size: var(--fs-lg); line-height: 1.4; color: var(--muted); text-wrap: pretty; }
/* the Chinese title breaks only at the <wbr> in its markup (keep-all, css/sections.css), so a line never ends one
   character short; the subtitle likewise breaks only at its spaces */
.lang-zh .pp-title { line-height: 1.15; }
.lang-zh .pp-sub { word-break: keep-all; overflow-wrap: anywhere; }

/* facts: a strip of cells like the home page's sheet title block (css/hero.css), label above value */
.pp-facts-wrap { margin-top: clamp(28px, 3.4vw, 44px); }
.pp-facts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; margin: 0;
  border: 1px solid var(--line-strong); background: var(--line-strong); /* shows through the 1 px gaps as hairline cell rules */ }
.pp-facts > div { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 12px 14px 14px; background: var(--bg); }
.pp-facts dt { font-family: var(--font-mono); font-size: var(--fs-label, 0.75rem); font-weight: 500; line-height: 1.3; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pp-facts dd { margin: 0; font-family: var(--font-body); font-size: var(--fs-support, 0.9375rem); font-weight: 600; line-height: 1.3; color: var(--fg); text-wrap: pretty; }
/* the location (second of Client / Location / Period / Role, jan-chi-builders-tools/seo-build) breaks at its comma:
   美芝路， / 甘榜格南保留区, not inside 保留区. Not the others: an unpunctuated role kept whole left 程 alone (1024 px) */
.lang-zh .pp-facts > div:nth-child(2) dd { word-break: keep-all; overflow-wrap: anywhere; }

/* early call to action, straight under the facts */
.pp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: clamp(20px, 2.4vw, 28px); }
.pp-actions .link-arrow { position: relative; }
.pp-actions .link-arrow::before { content: ""; position: absolute; inset: -12px -10px; /* a 44 px tap target; the underline stays put */ }

/* the lead at full width: a landscape in a 3:2 frame; a portrait (4:5) centred, as wide as 80vh of height allows */
.pp-hero .pp-lead { margin: clamp(36px, 4.4vw, 64px) 0 0; }
.pp-lead .pp-frame { aspect-ratio: 3 / 2; }
.pp-lead .pp-frame img { height: 100%; object-fit: cover; }
.pp-hero .pp-lead--portrait { width: min(100%, 64vh); margin-inline: auto; }
.pp-lead--portrait .pp-frame { aspect-ratio: auto; }
.pp-lead--portrait .pp-frame img { height: auto; max-height: 80vh; }

/* ---------- figures: photographs keep their own proportion (width / height in the markup) unless framed ---------- */
.pp-fig { margin: 0; }
.pp-frame { position: relative; background: var(--ink-2); }
.pp-frame img { width: 100%; height: auto; font-size: var(--fs-xs); color: var(--muted); /* alt text, should a file fail */ }
/* registration corners, as on the Work cards */
.pp-frame::after { --c: rgba(var(--on-rgb), 0.6); --l: 14px; content: ""; position: absolute; inset: 8px; pointer-events: none; opacity: 0.8;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--l) 1px, linear-gradient(var(--c), var(--c)) left top / 1px var(--l),
    linear-gradient(var(--c), var(--c)) right top / var(--l) 1px, linear-gradient(var(--c), var(--c)) right top / 1px var(--l),
    linear-gradient(var(--c), var(--c)) left bottom / var(--l) 1px, linear-gradient(var(--c), var(--c)) left bottom / 1px var(--l),
    linear-gradient(var(--c), var(--c)) right bottom / var(--l) 1px, linear-gradient(var(--c), var(--c)) right bottom / 1px var(--l);
  background-repeat: no-repeat; }
.pp-cap { display: flex; align-items: baseline; gap: 14px; padding-top: 12px; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); text-wrap: pretty; } /* 天窗 stays whole */
.pp-cap-no { flex: none; font-size: var(--fs-label, 0.75rem); letter-spacing: 0.1em; color: var(--amber); }

/* projects without photography: the Work cards' typographic panel (css/work.css), on raised slate */
.pp-panel { --grid: transparent; position: relative; aspect-ratio: 4 / 3; container-type: inline-size; color: var(--blueprint-line);
  background-color: var(--blueprint); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; }
/* "Site record" in amber, the scope count beside it */
.pp-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 14px; font-size: var(--fs-label, 0.75rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.pp-note::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--amber); }
/* Windows High Contrast paints the amber dot as Canvas, leaving a blank gap: draw it in the text colour */
@media (forced-colors: active) { .pp-note::before { forced-color-adjust: none; background: CanvasText; } }
.pp-note-n { margin-left: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- summary, scope and credits (paper) ---------- */
.pp-text { --focus: var(--cobalt); padding-block: clamp(56px, 7vw, 120px); background: var(--paper); color: var(--ink); }
.pp-text-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(32px, 5vw, 88px); row-gap: 48px; align-items: start; }
/* 'On site': the one condition the job was built around, on the light raised sheet above the summary */
.pp-onsite { max-width: 46ch; margin: 0 0 clamp(24px, 3vw, 36px); padding: 16px 20px 18px; border: 1px solid var(--line); border-left: 2px solid var(--amber-deep); background: var(--sheet); }
.pp-onsite-k { margin: 0; font-size: var(--fs-label, 0.75rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pp-onsite-t { margin: 6px 0 0; font-size: var(--fs-md); line-height: 1.45; text-wrap: pretty; }
.lang-zh .pp-onsite-t { word-break: keep-all; overflow-wrap: anywhere; } /* breaks at its own punctuation (，；) */
.pp-summary { margin: 0; max-width: 42ch; font-size: var(--fs-lg); line-height: 1.55; text-wrap: pretty; } /* no 气 / 楼。 */
.pp-h { margin: 0 0 12px; font-family: var(--font-mono); font-size: var(--fs-label, 0.75rem); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pp-lists > * + .pp-h { margin-top: 36px; }
.pp-scope { border-top: 1px solid var(--line-strong); }
.pp-scope li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.pp-scope-no { padding-top: 2px; font-size: var(--fs-label, 0.75rem); color: var(--cobalt); }
.pp-credits li { padding: 4px 0; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- photographs and before / after (ink) ---------- */
.pp-gallery, .pp-compare { padding-block: clamp(56px, 7vw, 112px); background: var(--bg); color: var(--fg); }
.pp-gallery + .pp-compare { padding-top: 0; }
.pp-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: clamp(24px, 3vw, 40px); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pp-h2 { font-size: var(--fs-xl); }
/* the gallery's heading is a label with the photograph count ("Photographs · 06") */
.pp-h2--label { font-family: var(--font-mono); font-size: var(--fs-label, 0.75rem); font-weight: 500; line-height: 1.4; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pp-sec-note { margin: 0; font-size: var(--fs-label, 0.75rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
/* two across, in consistent frames: landscapes cropped to 4:3, portraits paired at 4:5 */
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3.5vw, 56px) clamp(16px, 2.2vw, 32px); align-items: start; }
.pp-grid .pp-frame { aspect-ratio: 4 / 3; }
.pp-grid .is-portrait .pp-frame { aspect-ratio: 4 / 5; }
.pp-grid .pp-frame img { height: 100%; object-fit: cover; }
/* an odd last photograph takes the row alone, in its own proportion (3:2 or 4:5), centred and as wide as 80vh of
   height allows */
.pp-grid > .is-solo { grid-column: 1 / -1; }
.pp-grid > .is-solo .pp-fig { width: min(100%, 120vh); margin-inline: auto; }
.pp-grid > .is-solo.is-portrait .pp-fig { width: min(100%, 64vh); }
.pp-grid > .is-solo .pp-frame { aspect-ratio: auto; }
.pp-grid > .is-solo .pp-frame img { height: auto; max-height: 80vh; }
.pp-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 32px); }
.pp-tag { padding: 4px 10px 3px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: var(--fs-label, 0.75rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg); }
.pp-pair .pp-fig + .pp-fig .pp-tag { border-color: var(--amber); color: var(--amber); }

/* ---------- previous / next (paper) ---------- */
.pp-pager { --focus: var(--cobalt); border-top: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.pp-pager-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pp-pager-link { display: grid; align-content: center; justify-items: start; gap: 4px; min-height: 132px; padding: 24px 24px 24px 0; text-decoration: none; }
.pp-pager-link + .pp-pager-link { justify-items: end; padding: 24px 0 24px 24px; border-left: 1px solid var(--line); text-align: right; }
.pp-pager-k { font-size: var(--fs-label, 0.75rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pp-pager-t { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); line-height: 1.1; background: linear-gradient(currentColor, currentColor) left 100% / 0 1px no-repeat; padding-bottom: 3px; transition: background-size 500ms var(--ease), color var(--t-fast) var(--ease); }
.pp-pager-link + .pp-pager-link .pp-pager-t { background-position: right 100%; }
.pp-pager-link:focus-visible .pp-pager-t { background-size: 100% 1px; color: var(--cobalt); }
@media (hover: hover) { .pp-pager-link:hover .pp-pager-t { background-size: 100% 1px; color: var(--cobalt); } }
.pp-pager-s { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- call to action (ink; a hairline parts it from the ink footer below) ---------- */
.pp-cta { padding-block: clamp(64px, 8vw, 128px); border-bottom: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.pp-cta-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(32px, 5vw, 88px); row-gap: 40px; align-items: end; }
.pp-cta-copy h2 { margin: 18px 0 20px; max-width: 13ch; }
.pp-cta-copy .lede { margin-bottom: 28px; }
.lang-zh .pp-cta-copy h2 { max-width: none; }
/* the direct lines are the home page's row links (.cd-link in css/sections.css), lit amber on the ink band */
@media (hover: hover) {
  .pp-cta .cd-link:hover, .pp-cta .cd-link:hover .cd-go { color: var(--amber); }
}
.pp-cta .cd-link:active { background-color: rgba(255, 255, 255, 0.06); }

/* ---------- Chinese labels: the CJK floor ---------- */
.lang-zh :is(.pp-bar, .pp-kicker, .pp-facts dt, .pp-cap-no, .pp-note, .pp-onsite-k, .pp-h, .pp-scope-no, .pp-h2--label, .pp-sec-note, .pp-tag, .pp-pager-k) { font-size: var(--fs-label-zh, 0.8125rem); letter-spacing: 0.04em; }

/* ---------- smaller screens ---------- */
@media (min-width: 960px) {
  .pp-panel { aspect-ratio: 3 / 2; }
}
@media (max-width: 959px) {
  .pp-text-grid, .pp-cta-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .pp-facts { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .pp-grid, .pp-pair { grid-template-columns: minmax(0, 1fr); }
  .pp-grid .pp-frame, .pp-grid .is-portrait .pp-frame { aspect-ratio: auto; }
  .pp-grid .pp-frame img { height: auto; }
  .pp-pager-grid { grid-template-columns: minmax(0, 1fr); }
  .pp-pager-link, .pp-pager-link + .pp-pager-link { min-height: 104px; padding: 20px 0; }
  .pp-pager-link + .pp-pager-link { border-left: 0; border-top: 1px solid var(--line); }
  .pp-panel { aspect-ratio: 4 / 3.4; }
}
@media (max-width: 420px) {
  .pp-facts { grid-template-columns: minmax(0, 1fr); }
  .pp-count { display: none; }
}
