/* Film preview pages (films/<id>.html, generated by ../scripts/build_film_pages.mjs). Builds on home.css,
   store.css and ../film-bay.css: same tones, surfaces told apart by tone, text at 15px and up. */
.fp-wrap { max-width: 1000px; margin: 0 auto; padding-bottom: clamp(56px, 7vw, 104px); }
.fp-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Head: the shelf icon, the name, what it does in one sentence, where it comes from, one action */
.fp-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 20px clamp(20px, 3vw, 40px); padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 44px); }
.fp-icon { width: 120px; height: 120px; image-rendering: pixelated; }
.fp-title h1 { margin: 0; font-size: clamp(44px, 1rem + 5.2vw, 96px); font-weight: 500; letter-spacing: -.045em; line-height: .95; text-wrap: balance; }
.fp-lead { max-width: 26em; margin: 16px 0 0; color: var(--ink); font-size: clamp(19px, .9rem + .6vw, 24px); line-height: 1.45; text-wrap: pretty; }
.fp-pack { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.fp-cta { align-self: end; }

/* Before / after: the film half sits on top, clipped at --split */
.fp-ba { position: relative; margin: 0; overflow: hidden; border-radius: var(--r-m); background: var(--surface-2); touch-action: pan-y; user-select: none; }
.fp-ba img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.fp-ba-film { clip-path: inset(0 0 0 var(--split)); }
.fp-ba-line { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: var(--paper); box-shadow: 0 0 0 1px rgb(0 0 0 / .25); pointer-events: none; }
.fp-ba-line::after { content: ""; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); transform: translate(-50%, -50%); box-shadow: 0 2px 10px rgb(0 0 0 / .35); }
.fp-ba-line::before { content: "‹ ›"; position: absolute; z-index: 1; top: 50%; left: 50%; color: var(--ink-on-light); font: 600 17px/1 var(--font); letter-spacing: .2em; transform: translate(-46%, -55%); }
.fp-ba-tag { position: absolute; top: 14px; padding: 6px 10px; border-radius: var(--r-s); background: rgb(19 19 19 / .82); color: var(--ink); font-size: 15px; pointer-events: none; }
.fp-ba-tag.left { left: 14px; }
.fp-ba-tag.right { right: 14px; color: var(--amber); }
.fp-ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.fp-ba:has(.fp-ba-range:focus-visible) { outline: 2px solid var(--amber); outline-offset: 3px; }
.fp-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fp-refs button { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-s); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; transition: background-color var(--t-feedback) var(--ease-out), color var(--t-feedback) var(--ease-out); }
.fp-refs button:hover { color: var(--ink); }
.fp-refs button:active { transform: translateY(1px); }
.fp-refs button[aria-pressed="true"] { background: #2a2925; color: var(--ink); }
.fp-refs button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.fp-note { margin: 12px 0 0; }

/* Sections */
.fp-section { margin-top: clamp(64px, 8vw, 120px); }
.fp-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 18px; }
.fp-section-head h2 { margin: 0; font-size: clamp(28px, 1rem + 2.7vw, 52px); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; text-wrap: balance; }
:lang(en) .fp-section-head h2 { text-transform: lowercase; }
.fp-section-head p { margin: 0; }

/* Scores: two open columns, the rating set large */
.fp-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(32px, 6vw, 88px); }
.fp-score h3 { margin: 0; font-size: 17px; font-weight: 600; }
.fp-score-value { display: flex; align-items: center; gap: 16px; min-height: 48px; margin: 12px 0 10px; font-size: clamp(24px, 1rem + 1vw, 32px); }
.fp-score-value b { font-weight: 600; }
.fp-score-na { color: var(--muted); }
.fp-score-note { max-width: 30em; margin: 0; color: var(--ink); font-size: 17px; line-height: 1.6; text-wrap: pretty; }
.fp-stars, .fp-bars { display: inline-flex; gap: 6px; }
.fp-stars span { width: 30px; height: 30px; background: #3a3833; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.fp-stars span.on { background: var(--amber); }
.fp-bars span { width: 12px; height: 32px; border-radius: 2px; background: #3a3833; }
.fp-bars { align-items: flex-end; }
.fp-bars span:nth-child(1) { height: 12px; }
.fp-bars span:nth-child(2) { height: 17px; }
.fp-bars span:nth-child(3) { height: 22px; }
.fp-bars span:nth-child(4) { height: 27px; }
.fp-bars span.on { background: var(--amber); }
.fp-numbers { margin-top: 12px; font-size: 15px; }
.fp-numbers summary { min-height: 44px; display: flex; align-items: center; color: var(--amber); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.fp-numbers summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.fp-numbers dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 4px 0 12px; }
.fp-numbers dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); }
.fp-numbers dt { color: var(--muted); }
.fp-numbers dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.fp-numbers p { margin: 0; color: var(--muted); line-height: 1.6; }

/* Character: five rows, a five-step scale with Standard in the middle */
.fp-traits { display: grid; gap: 2px; margin: 0; padding: 10px 24px; border-radius: var(--r-m); background: var(--surface-2); }
.fp-trait { display: grid; grid-template-columns: 6em minmax(0, 1fr); align-items: center; gap: 16px; min-height: 60px; }
.fp-trait dt { font-size: 17px; }
.fp-trait dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px clamp(20px, 4vw, 48px); margin: 0; }
.fp-trait dd b { font-size: 17px; font-weight: 600; }
.fp-scale { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.fp-scale i { min-width: 2.5em; font-style: normal; }
.fp-scale i:first-child { text-align: right; }
.fp-dots { display: inline-flex; align-items: center; gap: 10px; }
.fp-dots span { width: 12px; height: 12px; border-radius: 50%; background: #3a3833; }
.fp-dots span.mid { box-shadow: 0 0 0 2px #5a5751; }
.fp-dots span.on { width: 16px; height: 16px; background: var(--amber); box-shadow: none; }

/* Tone and colour charts */
.fp-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(32px, 5vw, 64px); align-items: start; }
.fp-chart { margin: 0; }
.fp-chart img { display: block; width: 100%; height: auto; }
.fp-tone { position: relative; }
/* Axis labels under the picture: -6 EV at the left edge of the plot, mid grey (0 EV) 60% across, +4 EV at the right */
.fp-axis { position: relative; display: block; height: 22px; margin-top: 6px; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.fp-axis i { position: absolute; top: 0; font-style: normal; white-space: nowrap; }
.fp-axis i:nth-child(1) { left: 2.5%; }
.fp-axis i:nth-child(2) { left: 59.5%; transform: translateX(-50%); }
.fp-axis i:nth-child(3) { right: 2.5%; }
.fp-chart figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.fp-key { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--amber); }
.fp-key.standard { margin-left: 8px; border-top: 2px dashed var(--muted); }
.fp-caption-rest { flex-basis: 100%; }

/* Samples, other films */
.fp-sample-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.fp-sample-grid figure { margin: 0; }
.fp-sample-grid img { display: block; width: 100%; height: auto; border-radius: var(--r-s); }
.fp-sample-grid figcaption { margin-top: 8px; color: var(--muted); font-size: 15px; }
.fp-sibling { color: var(--ink); text-decoration: none; }
.fp-sibling:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

@media (max-width: 960px) {
  .fp-head { grid-template-columns: auto minmax(0, 1fr); }
  .fp-cta { grid-column: 2; justify-self: start; }
}
@media (max-width: 760px) {
  .fp-head { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .fp-icon { width: 80px; height: 80px; image-rendering: auto; }
  .fp-title { display: contents; }
  .fp-title h1 { grid-column: 2; }
  .fp-lead, .fp-pack { grid-column: 1 / -1; margin-top: 0; }
  .fp-cta { grid-column: 1 / -1; }
  .fp-scores, .fp-charts { grid-template-columns: 1fr; }
  .fp-trait { grid-template-columns: 1fr; gap: 6px; padding: 12px 0; }
  .fp-ba-tag { top: 10px; padding: 4px 8px; }
  .fp-traits { padding: 6px 18px; }
}
@media (prefers-reduced-motion: reduce) { .fp-refs button { transition: none; } .fp-refs button:active { transform: none; } }

/* Inside the film library's preview layer (?embed=1, set by film-page.js): only the film, no site chrome. */
.fp-embed .site-header, .fp-embed .site-footer, .fp-embed .legal-footer, .fp-embed .fp-cta, .fp-embed .fp-siblings { display: none; }
.fp-embed .fp-head { grid-template-columns: auto minmax(0, 1fr); padding-top: clamp(20px, 3vw, 32px); }
.fp-embed .fp-icon { width: 96px; height: 96px; }
.fp-embed .fp-title h1 { font-size: clamp(36px, 1rem + 3.4vw, 64px); }
.fp-embed .fp-wrap { padding-bottom: 40px; }
