/* Read-aloud prototype (Library of Congress proposal). Neutral Cloudology palette, not the
   Library's brand. Every text/background pairing meets WCAG 2.2 AA contrast. */
@font-face { font-family: Figtree; src: url("/assets/figtree-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
	--accent: #8a2432;       /* burgundy: 8.83:1 with white */
	--accent-dark: #6f1c28;  /* 11.21:1 with white */
	--brand: #1f2d3d;        /* slate navy: 13.99:1 with white */
	--link: #1d4f91;         /* 8.14:1 on white */
	--brand-light: #b9d2f5;  /* 9.06:1 on brand */
	--ink: #1b1f2a;
	--ink-2: #4a5160;        /* 7.18:1 on paper */
	--line: #d9dee8;
	--mist: #f5f3ee;         /* paper */
	--focus: #ffbf47;
	--hl-sentence: #fff1bf;  /* ink on this: 15.1:1 */
	--hl-word: #ffd23f;      /* ink on this: 12.0:1 */
	--pass: #0b6b3a;
	--fail: #b00b26;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font: 400 1.0625rem/1.6 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: #fff; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1 0 auto; }
main:focus { outline: none; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 6px var(--brand); }
h1, h2, h3 { color: var(--brand); line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 12px; font-weight: 800; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.5rem; font-weight: 800; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 10; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 8px; font-weight: 700; }
.skip:focus { top: 0; color: #fff; }

/* Header */
.site { background: var(--brand); color: #fff; }
.site__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.wordmark { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.wordmark:hover { color: #fff; }
.wordmark__mark { width: 46px; height: 46px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.wordmark__text strong { display: block; font-size: 1.05rem; line-height: 1.2; }
.wordmark__text span { font-size: 0.9rem; color: var(--brand-light); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nav a { display: block; padding: 8px 12px; border-radius: 8px; color: #fff; text-decoration: none; font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: underline; }
.nav a[aria-current="page"] { background: #fff; color: var(--brand); }

/* Page content */
.content { padding-top: 40px; padding-bottom: 56px; }
.badge { display: inline-block; margin: 0 0 16px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 8px; }
.tts-text { max-width: 70ch; }
.tts-text p { margin: 0 0 1rem; font: 1.2rem/1.75 Georgia, "Times New Roman", serif; }
.source { margin: 0 0 20px; color: var(--ink-2); font-size: 0.95rem; max-width: 70ch; }
.tts-s { border-radius: 3px; cursor: pointer; }
.tts-s.is-current { background: var(--hl-sentence); box-shadow: 0 0 0 3px var(--hl-sentence); }
.tts-w.is-current { background: var(--hl-word); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; border-radius: 2px; }

/* Player */
.player { max-width: 70ch; border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: 12px; padding: 18px 20px; margin: 8px 0 28px; background: var(--mist); }
.player__title { margin: 0; font-size: 1.15rem; }
.player__voice { margin: 2px 0 14px; font-size: 0.9rem; color: var(--ink-2); }
.player__controls, .player__progress, .player__options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.player__progress { margin-top: 14px; }
.player__progress label { font-weight: 600; font-size: 0.95rem; }
.player__progress input[type="range"] { flex: 1 1 200px; accent-color: var(--brand); min-height: 24px; }
.player__time { font-variant-numeric: tabular-nums; font-size: 0.95rem; color: var(--ink-2); min-width: 7ch; }
.player__options { margin-top: 10px; justify-content: space-between; font-size: 0.95rem; }
.player__speed { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-weight: 600; font-size: 0.95rem; }
.player select { font: inherit; padding: 8px 10px; border: 1px solid #6b7385; border-radius: 8px; background: #fff; color: var(--ink); }
.check { display: inline-flex; align-items: center; gap: 8px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 2px solid var(--brand); background: #fff; color: var(--brand); font: 700 0.95rem Figtree, system-ui, sans-serif; cursor: pointer; }
.btn:hover { background: var(--brand); color: #fff; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; min-width: 130px; justify-content: center; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.icon--pause { display: none; }
.player.is-playing .icon--pause { display: block; }
.player.is-playing .icon--play { display: none; }

/* Footer */
.site-footer { background: var(--brand); color: #e8eeff; font-size: 0.9rem; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer p { margin: 0; max-width: 90ch; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--brand-light); }

/* Results page */
.lede { font-size: 1.15rem; max-width: 70ch; color: var(--ink-2); margin: 0 0 24px; }
.meta { color: var(--ink-2); font-size: 0.95rem; }
.cards { list-style: none; margin: 16px 0 28px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; border-top: 5px solid var(--pass); }
.card.is-fail { border-top-color: var(--fail); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card .big { font-size: 1.8rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.card p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.95rem; }
.status { font-weight: 700; }
.status--pass { color: var(--pass); }
.status--fail { color: var(--fail); }
table { border-collapse: collapse; width: 100%; margin: 8px 0 24px; font-size: 0.95rem; }
caption { text-align: left; font-weight: 700; color: var(--brand); padding: 4px 0 8px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
thead th { background: var(--brand); color: #fff; }
tbody tr:nth-child(even) td, tbody tr:nth-child(even) th { background: var(--mist); }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 6px var(--brand); }
.shots { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 24px; }
.shot { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.shot h3 { margin: 0 0 4px; font-size: 1.05rem; }
.shot__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.shot figure { margin: 0; }
.shot img { width: 100%; height: auto; max-height: 420px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 6px; display: block; background: var(--mist); }
.shot figcaption { font-size: 0.85rem; color: var(--ink-2); margin-top: 4px; }
.live-check { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--mist); margin: 8px 0 28px; }
.live-check ul { margin: 10px 0 0; padding-left: 20px; }
details { margin: 0 0 24px; }
summary { cursor: pointer; font-weight: 700; color: var(--brand); }

@media (max-width: 760px) {
	.player__speed { margin-left: 0; }
	.shot__grid { grid-template-columns: 1fr; }
}
