/* ==========================================================================
   Hessel Digital Library - hdl.jas2.com (staging: /var/www/hdl-staging)
   Visual system: v2.1 black, white, and oxblood; Source Serif prose on the
   human layer, Roboto Mono on the machine layer (brand v2, 2026-11-12).
   Accessibility: WCAG 2.1 AA contrast, visible :focus, reduced-motion
   support, no content in pseudo-elements, 16px+ body text.
   Fonts: Source Serif 4 self-hosted (P3); system stacks as fallback.
   ========================================================================== */

/* CSS-level assets must resolve under BOTH the /hdl/ staging path and the
   domain root: urls are relative to this file, so ../fonts works for both. */
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
/* Brand v2 (2026-11-12): Roboto Mono = the voice of the machine layer
   (nav, labels, counts, identifiers, provenance, buttons). Serif = prose. */
@font-face {
  font-family: "Roboto Mono";
  src: url("../fonts/roboto-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("../fonts/roboto-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("../fonts/roboto-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}

:root {
  /* Palette v2.1: black, white, and oxblood. All pairs tested >= 4.5:1. */
  --paper:        #ffffff;   /* white field */
  --paper-deep:   #f4f4f4;    /* neutral band */
  --ink:          #000000;    /* black, body text 21:1 */
  --ink-soft:     #4a4a4a;    /* secondary text 9.0:1 */
  --rule:         #e4e4e4;    /* hairlines */
  --accent:       #7a2018;    /* oxblood: links, focus rings 9.9:1 on white */
  --accent-deep:  #5c170f;    /* hover state */
  --gold:         #7a2018;   /* retired in v2.1: kickers/counts now oxblood */
  --focus-ring:   #7a2018;

  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --space: 8px;            /* everything in multiples of 8 */
  --max: 72rem;            /* content width */
  --max-text: 38rem;       /* prose measure ~65ch */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.75rem; }  /* sticky header (58px) clearance on all widths */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Visible focus for keyboard users: never removed */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem; z-index: 100;
  font-family: var(--font-sans); font-weight: 600;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.prose { max-width: var(--max-text); }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.band { background: var(--paper-deep); border-block: 1px solid var(--rule); }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); font-weight: 400; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 400; }
h3 { font-size: 1.25rem; font-family: var(--font-sans); font-weight: 600; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.55; color: var(--ink-soft); max-width: 48rem; }
.small { font-size: .9rem; }
.muted { color: var(--ink-soft); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); text-decoration-color: currentColor; }

.kicker {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold);
  margin: 0 0 var(--space);
}
.byline-rule { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0 2rem; }
.byline-rule::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.6rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 2.15rem; height: 2.15rem; flex: none;
  display: block;
  /* the tile form (ink tile + paper h) is carried by the inline SVG:
     corners, fills, and print behavior all come from the path itself */
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-name { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 400; letter-spacing: .01em; }
.brand-sub { display: block; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }

.nav { margin-left: auto; }
.nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav a { text-decoration: none; color: var(--ink-soft); font-family: var(--font-mono); font-size: .85rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 620px) {
  .site-header .wrap { flex-wrap: wrap; padding-block: .5rem; gap: .6rem; }
  .brand-sub { display: none; }               /* tagline hidden: header compacts */
  .nav { width: 100%; }
  .nav ul { flex-wrap: wrap; gap: .2rem 1.1rem; }
  /* Thumb-sized tap targets: vertical padding on *inline* links extends the
     hit area (~34-38px tall) without shifting text layout; the negative margin
     compensates so spacing looks unchanged. Horizontal padding is nav-only,
     where labels sit in flex gaps. */
  .nav a, .site-footer a, .section a, .prose a, .small a {
    padding-block: .5rem; margin-block: -.5rem;
  }
  .nav a { padding-inline: .3rem; margin-inline: -.3rem; font-size: .9rem; }
  /* anchored targets must clear the sticky two-row header */
  html { scroll-padding-top: 7.5rem; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem); }
/* Phase 3.2 (Alan): both hero columns top-aligned. With natural-shape
   hero images the right column's height varies per pick; centering made
   the text block drift to a different vertical position on every load. */
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero .count {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .1em;
  color: var(--gold); text-transform: uppercase; margin-top: 1.6rem;
}

/* Hero player card */
.player {
  border: 1px solid var(--rule); background: #fff;
  box-shadow: 0 1px 2px rgb(28 25 23 / 6%), 0 10px 32px -18px rgb(28 25 23 / 25%);
}
.player iframe { width: 100%; aspect-ratio: 1 / 1; border: 0; display: block; }
.player-body { border-top: 1px solid var(--rule); padding: 1rem 1.1rem; display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; }
.player-body h2 { font-size: 1.05rem; margin: 0; font-family: var(--font-serif); }
.player-body .muted { font-size: .8rem; }

/* ---------- Item cards / results ---------- */
.grid-cards { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: flex; flex-direction: column; text-decoration: none;
  background: #fff; border: 1px solid var(--rule); color: var(--ink);
  padding: 1.15rem 1.25rem 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover, .card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgb(28 25 23 / 5%), 0 12px 28px -20px rgb(28 25 23 / 30%);
  color: var(--ink);
}
.card h3 { margin: 0 0 .2rem; font-family: var(--font-serif); font-size: 1.06rem; font-weight: 600; }
.card p  { margin: 0; font-size: .9rem; color: var(--ink-soft); flex: 1; }
.card .count {
  font-family: var(--font-mono); font-size: .75rem; color: var(--gold);
  letter-spacing: .08em; margin-top: .8rem; text-transform: uppercase;
}

/* ---------- Browse / search ---------- */
/* Phase 3.2 (Alan): search bar lives right above the items it searches;
   full wrap width so long queries fit on one line. */
.search-form { display: flex; gap: .6rem; max-width: none; margin-block: 1.2rem 1.5rem; flex-wrap: wrap; }
.search-form label { position: absolute; left: -9999px; }
.search-form input[type="search"] {
  flex: 1 1 14rem; padding: .7rem .9rem; border: 1px solid var(--rule);
  background: #fff; border-radius: 2px; min-width: 0;
}
.search-form select { padding: .7rem .5rem; border: 1px solid var(--rule); background: #fff; border-radius: 2px; }
.search-form button {
  background: var(--ink); color: var(--paper); border: 0; padding: .7rem 1.3rem;
  font-family: var(--font-mono); font-weight: 500; font-size: .85rem;
  border-radius: 2px;
}
.search-form button:hover { background: var(--accent-deep); }
.search-form button[disabled] { opacity: .45; cursor: default; }

.result-grid { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 1.5rem; }
.result {
  border: 1px solid var(--rule); background: #fff; color: var(--ink);
  display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
}
.result:hover, .result:focus-visible { border-color: var(--accent); color: var(--ink); }
.result img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--paper-deep); }
.result-body { padding: .8rem .9rem .9rem; }
.result-body h3 { font-size: .95rem; margin: 0 0 .15rem; font-family: var(--font-sans); font-weight: 600; }
.result-body .muted { font-size: .8rem; }

.status {
  font-family: var(--font-mono); font-size: .85rem; color: var(--ink-soft);
  margin-block: 1rem;
}
.status[data-state="error"] { color: #8a1f11; }

/* ---------- Feature rows (About / collection pages) ---------- */
.feature-row { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; padding-block: 2.5rem; }
@media (min-width: 820px) { .feature-row { grid-template-columns: 220px 1fr; } }
.feature-thumb { border: 1px solid var(--rule); background: var(--paper-deep); }
.feature-thumb img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }

/* ---------- Statistics ---------- */
.stat-list { display: grid; gap: .7rem; max-width: 34rem; }
.stat-row {
  display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--rule); padding-block: .55rem;
}
.stat-row dt { color: var(--ink-soft); margin: 0; }
.stat-row dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--paper-deep); }
.site-footer .wrap { padding-block: 2.5rem 3rem; display: grid; gap: 2rem; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h3 { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.site-footer a { color: var(--ink); text-decoration: none; font-size: .93rem; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-note { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: .83rem; color: var(--ink-soft); display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Screen-reader-only (visually hidden, still announced) --------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Radio (the 78 rpm station page) ---------- */
.hero-side { display: grid; gap: 1.5rem; align-self: start; }
.hero-shelf-card {
  border: 1px solid var(--rule); background: #fff;
  box-shadow: 0 1px 2px rgb(28 25 23 / 6%), 0 10px 32px -18px rgb(28 25 23 / 25%);
  display: grid; text-decoration: none;
}
.hero-shelf-card img {
  /* phase 3.1 (Alan): show the whole image in its natural shape, not a
     square crop. width 100% + height auto follow the intrinsic ratio that
     site.js sets from hero-images.json (w/h), so the box never shifts. */
  width: 100%; display: block; height: auto; background: var(--paper);
}
.hero-shelf-caption { padding: .8rem 1rem .95rem; display: grid; gap: .3rem; }
.hero-shelf-caption .kicker { margin: 0; }
.hero-shelf-title { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.35; color: var(--ink); }
.radio-card {
  border: 1px solid var(--rule); background: #fff;
  box-shadow: 0 1px 2px rgb(28 25 23 / 6%), 0 10px 32px -18px rgb(28 25 23 / 25%);
  padding: 1.4rem 1.5rem; display: grid; gap: .4rem;
}
.radio-controls { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.radio-btn {
  background: var(--ink); color: var(--paper); border: 0;
  padding: .8rem 1.6rem; font-weight: 600; border-radius: 2px; min-width: 6.5rem;
}
.radio-btn:hover { background: var(--accent-deep); }
.now-line { font-family: var(--font-serif); font-size: 1.3rem; margin: 0 0 .2rem; }
.now-line a { color: var(--ink); text-decoration: none; }
.now-line a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.radio-artist { margin: 0; }
.recent-list { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; gap: 0; max-width: 46rem; }
.recent-list li {
  display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule); padding-block: .45rem;
}
.recent-list a { min-inline-size: 0; }
.recent-time { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-soft); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- Print (P3) ---------- */
@media print {
  .site-header, .site-footer, .search-form,
  .player iframe, .skip-link, #result-pager, .radio-card, .recent-list { display: none !important; }
  body { font-size: 12pt; line-height: 1.5; background: #fff; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: var(--ink-soft); word-break: break-all; }
  .section, .hero { padding-block: 1rem !important; }
}

/* ---------- Touch targets (a11y phase 0, WCAG 2.5.8 comfort) ----------
   AA-legal at 24px, but coarse pointers deserve the 44px comfort line.
   Scoped to the small interactive chrome: nav + footer links, buttons,
   and the search submit. Card links are already large. */
@media (pointer: coarse) {
  .site-nav a, .site-footer a, button, input[type="submit"] {
    min-height: 44px;
  }
  .site-nav a, .site-footer a {
    display: inline-flex;
    align-items: center;
  }
  button, input[type="submit"] {
    padding-block: 0.7rem;
  }
}
/* Rights chips (2026-11-16, phase 1): each wing's published license, visible
   at a glance. oxblood = museum publishes NC terms; mirror carries them
   exactly, never marked public domain. */
.chip {
  display: inline-block;
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace;
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid var(--ink-soft);
  color: var(--ink);
  padding: .15rem .5rem;
  margin-left: .4rem;
  vertical-align: middle;
  white-space: nowrap;
}
.chip--nc { border-color: var(--accent); color: var(--accent); }
@media (pointer: coarse) { .chip { min-height: 0; padding: .25rem .5rem; } }

/* ---------- Tour pages in print (phase 3, D3) ----------
   The global print block already hides chrome and prints link URLs.
   Tours add: two-column print grid, cards never split across pages. */
@media print {
  .result-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .result, .result img { break-inside: avoid; page-break-inside: avoid; }
  .result img { width: 100%; }
}

/* ---------- Radio liveness upgrade (2026-11-16, Alan) ----------
   The stream is live 24/7 whether or not this tab is playing: the LIVE badge
   states that permanently; the 78 disc spins only while this tab plays
   (CSS :has on the toggle's aria-pressed; static fallback in older engines).
   Oxblood badge, mono chrome, white-on-oxblood = 9.9:1 (AAA). */
.radio-head { display: flex; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.radio-head-text { display: grid; gap: .35rem; justify-items: start; }
.live-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; padding: .24rem .6rem .24rem .55rem; border-radius: 2px;
}
.live-dot {
  width: .5rem; height: .5rem; border-radius: 50%; background: #fff;
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.radio-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.3rem; line-height: 1.25; color: var(--ink); }
.radio-sub { line-height: 1.45; }
.vinyl { flex: 0 0 auto; width: 68px; height: 68px; }
.radio-head-large .vinyl { width: 100px; height: 100px; }
[data-radio-player]:has([data-radio-toggle][aria-pressed="true"]) .vinyl {
  animation: vinylSpin 4s linear infinite;
}
@keyframes vinylSpin { to { transform: rotate(360deg); } }
.onair {
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  background: #fff; padding: .7rem .95rem .8rem; margin-top: .7rem;
  display: grid; gap: .3rem;
}
.onair-label { color: var(--accent); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; margin: 0; }
.onair .now-line { font-size: 1.4rem; }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .vinyl { animation: none !important; }
}

/* --- v9: video spotlight (homepage left column) ---------------------- */
.spotlight { margin-top: 2.2rem; max-width: 38rem; }
.spotlight .kicker { color: var(--accent); margin-bottom: .7rem; }
.spot-card {
  border: 1px solid var(--rule);
  background: #fff;
  box-shadow: 0 1px 2px rgb(28 25 23 / 6%), 0 10px 32px -18px rgb(28 25 23 / 25%);
  display: grid;
  text-decoration: none;
}
.spot-cover {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: #000;
  line-height: 0;
  cursor: pointer;
  overflow: hidden;
}
.spot-cover img { width: 100%; height: auto; display: block; }
.spot-cover:hover img, .spot-cover:focus-visible img { opacity: .93; }
.spot-play {
  position: absolute;
  left: .9rem;
  bottom: .9rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .45rem .75rem;
  border-radius: 2px;
  line-height: 1;
}
.spot-cover:hover .spot-play,
.spot-cover:focus-visible .spot-play { background: var(--accent-deep); }
.spot-iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; display: block; }
.spot-caption {
  display: grid;
  gap: .35rem;
  padding: .95rem 1.1rem 1.1rem;
  margin: 0;
  align-content: start;
}
a.spot-title, .spot-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a.spot-title:hover, a.spot-title:focus-visible { color: var(--accent-deep); }
.spot-meta {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
