/* Proof Pending, "the proof sheet, dark". The shared system: a photographer's contact sheet on a dark table.
   Every page builds on these tokens and components; page stylesheets add only what their view needs. See DESIGN.md. */

@font-face { font-family: Archivo; src: url(/fonts/Archivo-normal.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: Newsreader; src: url(/fonts/Newsreader-normal.woff2) format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: Newsreader; src: url(/fonts/Newsreader-italic.woff2) format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --table: #15191a; --glow: #222829; --film: #050505; --blank: #131313; --edge: #cdbb8c;
  --ink: #eceee9; --dim: #98a19d; --rule: #2c3334; --paper: #f1f2ee; --paper-ink: #141614; --paper-dim: #5d6461;
  --ok: #4fd08f; --part: #f2bd3a; --no: #ff5a47; --q: #7c8581;
  --serif: Newsreader, Georgia, serif;
  --gut: clamp(16px, 3.2vw, 40px); --maxw: 1320px;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--table); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); font: 16px/1.5 Archivo, system-ui, sans-serif;
  background: radial-gradient(ellipse 90% 560px at 50% 0, var(--glow), transparent) no-repeat, var(--table); overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
main { flex: 1; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin: 0; }
h1, h2 { font-stretch: 62%; font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: .005em; text-wrap: balance; }
h1 { font-size: clamp(46px, 7vw, 84px); }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
img, video, iframe { max-width: 100%; }
img, video { height: auto; }
:where(a) { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:where(button, input, select) { font: inherit; color: inherit; }
code { font-size: .9em; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- type ---------- */
.cond { font-stretch: 62%; font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: .005em; }
.edge { font-stretch: 125%; font-weight: 500; font-size: 10.5px; letter-spacing: .08em; line-height: 1.3; color: var(--edge); text-transform: uppercase; }
.serif { font-family: var(--serif); }
.dim { color: var(--dim); }

/* ---------- accessibility ---------- */
:focus-visible { outline: 2px solid var(--part); outline-offset: 3px; }
.paper :focus-visible { outline-color: var(--paper-ink); }
h1[tabindex]:focus-visible, main:focus-visible { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 20; background: var(--ink); color: #000; padding: 8px 14px; font-weight: 600; }
.skip-link:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- header ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 18px var(--gut); font-size: 15px; }
.brand { display: block; margin-right: auto; }
.brand img { display: block; height: 30px; width: auto; }
.nav { display: flex; gap: 26px; order: 1; }
.find { order: 2; position: relative; }
/* header suggestions (js/find.js) */
.find-list { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; list-style: none; margin: 0; padding: 4px 0; background: var(--film); border: 1px solid var(--rule); box-shadow: 0 12px 30px #000a; }
.find-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 14px; cursor: pointer; font-size: 14.5px; line-height: 1.3; }
.find-list small { flex: none; color: var(--edge); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-stretch: 125%; }
.find-list li:hover, .find-list [aria-selected="true"] { background: #1c2223; }
.find-list [aria-selected="true"] { box-shadow: inset 3px 0 var(--no); }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--dim); }
.nav a[aria-current] { border-bottom-color: var(--no); }
.find input { width: 230px; max-width: 100%; border: 0; border-bottom: 1.5px solid var(--ink); background: none; padding: 6px 2px; border-radius: 0; }
.find input::placeholder { color: var(--dim); opacity: 1; }
.find input:focus-visible { outline-offset: 2px; }
.menu { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.menu svg { display: block; width: 24px; height: 24px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); margin-top: 64px; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; padding-top: 22px; padding-bottom: 32px; font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot .edge { margin-left: auto; }

/* ---------- marks: drawn in grease pencil, shape and colour both differ ---------- */
.marks { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mk { width: var(--mk, 18px); height: var(--mk, 18px); flex: none; overflow: visible; }
.mk-confirmed { stroke: var(--ok); }
.mk-partly-confirmed { stroke: var(--part); }
.mk-unaddressed { stroke: var(--q); }
.mk-denied, .mk-refuted { stroke: var(--no); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--dim); text-decoration: none; --mk: 16px; }
.legend span { display: flex; gap: 6px; align-items: center; }
.legend:hover { color: var(--ink); }

/* ---------- the film frame ---------- */
.neg { position: relative; display: block; background: var(--film); padding: 7px 7px 9px; color: var(--ink); text-decoration: none; --mk: 15px; }
.neg-top, .neg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; }
.neg-top { padding: 0 2px 6px; }
.neg-foot { padding: 8px 2px 0; min-height: 25px; }
/* top right print wraps beside the number; the foot label stays on one line, sized to the frame, and drops below the marks when they leave no room */
.neg-top > .edge:last-child { flex: 1 1 0; margin-left: auto; text-align: right; }
.neg-foot { container-type: inline-size; }
.neg-foot > .marks { flex: none; flex-wrap: nowrap; max-width: 100%; }   /* marksHTML caps at 7, so one line fits */
.neg-foot > .edge:last-child { flex: none; margin-left: auto; white-space: nowrap; font-stretch: 100%; letter-spacing: .06em; font-size: min(10.5px, 5cqi); }
.neg-body { position: relative; display: flex; flex-direction: column; flex: 1; }
.neg-pic { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #1b1b19; container-type: inline-size; }
.neg-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.neg-pic .cond { position: absolute; left: 5cqi; right: 5cqi; bottom: 4cqi; color: #fff; font-size: clamp(15px, 11cqi, 76px); text-shadow: 0 1px 12px #000; }
.neg-cap { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.2; padding: 8px 1px 0; }
/* a scrim under the title, so it reads over pale archive scans as well as dark frames */
.neg:not(.neg-paper) .neg-pic:has(img)::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / .78)); }
.neg-pic .cond { z-index: 1; }
.neg-blank .neg-pic { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #0c0c0c 0 10px, var(--blank) 10px 20px); }
.neg-blank .neg-pic .cond { position: static; padding: 0 6cqi; text-align: center; text-shadow: none; }
.neg-paper .neg-pic { background: var(--paper); }
.neg-paper .neg-pic img { left: auto; right: 4%; top: 7%; width: auto; height: 86%; border: 1px solid #bbb; transform: rotate(2deg); }
.neg-paper .neg-pic .cond { color: var(--paper-ink); text-shadow: none; right: 45%; }
.neg-big { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; --mk: 22px; }
.neg-big .neg-pic { flex: 1; aspect-ratio: auto; min-height: 220px; }
.neg-big .neg-pic .cond { font-size: clamp(30px, 13cqi, 76px); }
.neg-small { padding: 6px 6px 8px; }
a.neg:hover .neg-pic img { filter: brightness(1.12); }

/* ---------- the ring: "start here", at most one per screen, always with its reason ---------- */
/* the ring circles the whole frame from outside, reaching 13px past its edges (15px on big frames, 10px on phones):
   over the gaps and a neighbour's black padding, never a neighbour's picture or text, never inside the circled frame's content */
.pick { position: absolute; left: calc(-1 * var(--ring-out, 13px)); top: calc(-1 * var(--ring-out, 13px)); width: calc(100% + 2 * var(--ring-out, 13px)); height: calc(100% + 2 * var(--ring-out, 13px)); pointer-events: none; overflow: visible; z-index: 2; }
.neg-big { --ring-out: 15px; }
.is-picked, :has(> .pick) { position: relative; z-index: 2; }
.pick-why { color: var(--no); font-weight: 700; }

/* ---------- contact sheet ---------- */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px 10px; }
.sheet-dense { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 8px; }

/* ---------- surfaces ---------- */
.paper { background: var(--paper); color: var(--paper-ink); color-scheme: light; }
.paper .edge { color: var(--paper-dim); }
.paper mark { color: #c4271a; }
mark { background: none; color: var(--no); font-weight: inherit; }

/* ---------- controls ---------- */
.page-h { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; padding: 26px 0 22px; }
.page-h p { color: var(--dim); font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { border: 1px solid currentColor; padding: 1px 7px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.btn { display: inline-block; border: 1.5px solid var(--ink); background: none; padding: 8px 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); color: #000; }

/* ---------- one-line rows ---------- */
.rows { list-style: none; padding: 0; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--rule); color: inherit; text-decoration: none; --mk: 22px; }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row p { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.row small { color: var(--dim); font-size: 13px; }

/* ---------- markup emitted by lib.js helpers. Every selector sits in :where(), so a page stylesheet adjusts it with any class ---------- */
/* tags and filter chips (chip(), tagOf(), filter rows) */
:where(.chip) { display: inline-block; border: 1px solid var(--rule); background: none; padding: 6px 12px; font-size: 14px; line-height: 1.3; white-space: nowrap; color: inherit; text-decoration: none; }
:where(a.chip, button.chip) { cursor: pointer; }
:where(a.chip, button.chip):hover { border-color: var(--dim); }
:where(.chip.on, .chip[aria-pressed="true"], .chip[aria-current]) { background: var(--ink); color: #000; border-color: var(--ink); }
:where(.tags) { display: flex; flex-wrap: wrap; gap: 6px; }
:where(.tags .chip) { padding: 2px 8px; font-size: 12px; }
:where(.chip.strong) { border-color: currentColor; font-weight: 600; }
:where(.chip.amber) { border-color: var(--part); color: var(--part); }
:where(.chip.contested) { border-color: var(--no); color: var(--no); }
:where(.paper .chip) { border-color: #b9bcb6; }
:where(.paper .chip.amber) { color: #8a5d00; }
:where(.paper .chip.contested) { color: #b3261e; border-color: #b3261e; }

/* small print the helpers use */
:where(.prose) { font-family: var(--serif); font-size: 18px; line-height: 1.5; max-width: 68ch; }
:where(.small) { font-size: 13px; }
:where(.quiet, .prov) { color: var(--dim); }
:where(.prov) { font-size: 13px; }
:where(.paper .quiet, .paper .prov) { color: var(--paper-dim); }
:where(.num) { font-variant-numeric: tabular-nums; }

/* key and value list (scaleSheetHTML, provenanceHTML) */
:where(.kv) { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; font-size: 14px; }
:where(.kv dt) { color: var(--dim); }
:where(.kv dd) { margin: 0; }
:where(.paper .kv dt) { color: var(--paper-dim); }

/* scale sheet: "As described" (scaleSheetHTML) */
:where(.scale-sheet) { display: grid; gap: 10px; padding: 16px 18px; border: 1px dashed var(--q); }
:where(.scale-sheet h3) { font-stretch: 125%; font-weight: 500; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--edge); }

/* disclosure (provenanceHTML; any details.disclose) */
:where(.disclose) { border-top: 1px solid var(--rule); padding: 10px 0; font-size: 14px; }
:where(.disclose > summary) { cursor: pointer; font-weight: 600; }
:where(.disclose[open] > summary) { margin-bottom: 10px; }
:where(.disclose > :not(summary) + *) { margin-top: 10px; }
:where(.disclose ul) { padding-left: 18px; }

/* source list (srcList) */
:where(.srcs) { list-style: none; padding: 0; font-size: 14px; line-height: 1.4; }
:where(.srcs li) { padding: 8px 0; border-top: 1px solid var(--rule); }
:where(.srcs small) { color: var(--dim); }

/* a released record, as released (thumb()): paper scan, page scan, or a typed slip when there is no image */
:where(.duo) { display: block; flex: none; aspect-ratio: 3 / 4; overflow: hidden; background: #fff; border: 1px solid #bbb; }
:where(.duo img) { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(.duo.paper img) { object-fit: contain; }
:where(.duo.none) { display: grid; place-items: center; padding: 6px; background: #e4e5e0; color: var(--paper-dim); font-size: 11px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }

/* government file rows on paper (paperRecord inside ul.rec) */
:where(ul.rec) { list-style: none; padding: 0; display: grid; gap: 8px; }
:where(ul.rec li > a) { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; background: var(--paper); color: var(--paper-ink); text-decoration: none; }
:where(ul.rec li > a:hover) { outline: 1px solid var(--paper-dim); }
:where(ul.rec .t) { display: grid; gap: 4px; font-size: 14px; line-height: 1.35; }
:where(ul.rec .t > b) { font-size: 15.5px; }
:where(ul.rec .t > span:not(.tags)) { color: var(--paper-dim); }

/* videos (videoCard): a film frame with channel and length as edge print; the player loads on click */
:where(.vid) { display: flex; flex-direction: column; background: var(--film); padding: 7px 7px 9px; }
:where(.vid-face) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
:where(.vid-face)::before, :where(.vid-still, .vid-play) { grid-area: 2 / 1 / 3 / 3; }
:where(.vid-face)::before { content: ''; aspect-ratio: 16 / 9; background: #1b1b19; }
:where(.vid-still) { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(.vid-ch, .vid-len) { grid-row: 1; padding: 0 2px 6px; font-stretch: 125%; font-weight: 500; font-size: 10.5px; letter-spacing: .08em; line-height: 1.3; color: var(--edge); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:where(.vid-len) { grid-column: 2; }
:where(.vid-play) { place-self: center; width: 52px; height: 52px; border-radius: 50%; background: #000a; border: 1.5px solid var(--ink); }
:where(.vid-play)::after { content: ''; display: block; margin: 15px 0 0 20px; border: 11px solid transparent; border-left: 16px solid var(--ink); border-right: 0; }
:where(.vid-face:hover .vid-still) { filter: brightness(1.12); }
:where(.vid-face:hover .vid-play) { background: var(--no); border-color: var(--no); }
:where(.vid-frame) { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
:where(.vid h4) { font-size: 14.5px; font-weight: 600; line-height: 1.25; padding: 8px 1px 0; }
:where(.vid > p:not([class])) { font-family: var(--serif); font-size: 16px; line-height: 1.35; padding: 6px 1px 0; color: var(--dim); }
:where(.vid .tags) { margin-top: auto; padding: 8px 1px 0; }
:where(.vid-ctx, .vid-yt) { font-size: 12.5px; color: var(--dim); padding: 4px 1px 0; }

/* detail view frame (frameHTML): the full label prints on the edge; a depth canvas (js/depth.js) lies over the picture */
:where(.frame) { background: var(--film); padding: 7px; }
:where(.frame .slate, .frame .chyron) { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 2px 2px 6px; font-stretch: 125%; font-weight: 500; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--edge); }
:where(.frame .chyron) { padding: 7px 2px 0; }
:where(.frame .slate b, .frame .chyron b) { font-weight: 700; }
:where(.frame .right) { margin-left: auto; }
:where(.frame-img) { position: relative; overflow: hidden; }
:where(.frame-img img, .frame-img video) { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(canvas.depth) { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* "Back to results" (router.js, after a search) */
:where(.search-return) { display: block; max-width: var(--maxw); margin: 0 auto; padding: 4px var(--gut) 10px; font-size: 14px; color: var(--dim); }

/* ---------- not found ---------- */
.lost { padding-top: 60px; padding-bottom: 40px; display: grid; gap: 20px; justify-items: start; }
.lost p { color: var(--dim); }

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .top { padding: 14px 16px; gap: 10px 12px; }
  .brand img { height: 24px; }
  .find { order: 0; flex: 1; min-width: 0; max-width: 190px; }
  .find-list { position: fixed; top: calc(var(--header-height, 56px) - 6px); left: 16px; right: 16px; width: auto; }
  .find input { width: 100%; }
  .menu { display: block; }
  .nav { display: none; order: 9; flex-basis: 100%; flex-direction: column; gap: 0; border-top: 1px solid var(--rule); font-size: 17px; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .nav a[aria-current] { border-bottom-color: var(--rule); box-shadow: inset 3px 0 var(--no); padding-left: 12px; }
  .menu[aria-expanded="true"] + .nav { display: flex; }
  .foot .edge { margin-left: 0; }
  .edge { font-size: 8.5px; }
  .neg { --mk: 11px; }
  .neg-big { --mk: 18px; }
  .neg { --ring-out: 10px; }
  .neg-big .neg-pic { min-height: 200px; }
  .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 6px; }
  /* one row that scrolls; the right edge fades to say there is more, and end padding lets the last chip clear the fade */
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 36px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
  .filters > * { flex: none; }
  .row p { font-size: 17px; }
  :where(.vid-ch, .vid-len, .scale-sheet h3, .frame .slate, .frame .chyron) { font-size: 8.5px; }
  :where(ul.rec li > a) { grid-template-columns: 64px minmax(0, 1fr); }
}
