/* Free-audiobook catalogue (/audiobooks), on top of alternatives.css: same tokens, fonts and chrome.
   Versioned file: /assets/ is cached immutable for a year, so a change ships as catalogue.v2.css. */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.catalogue .crumbs { padding-top: 26px; }
.cat-hero { padding: 18px 0 26px; }
.cat-hero h1 { max-width: 22ch; margin: 0; font-family: var(--font-display); font-size: clamp(36px, 5.6vw, 64px); font-weight: 450; line-height: 1.03; letter-spacing: -.04em; text-wrap: balance; }
.byline-line { margin: 14px 0 0; color: var(--paper-dim); font-size: 17px; }
.hub-lede { max-width: 62ch; margin: 18px 0 0; color: var(--paper-dim); font-size: clamp(17px, 2vw, 19px); line-height: 1.6; }
.hub-lede a { color: var(--amber); text-underline-offset: 3px; text-decoration-color: rgba(243, 192, 121, .42); }

/* ---------- listen: player + figures, chapter list beside (stacked on phones) ---------- */
.listen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.listen-main { display: grid; gap: 22px; min-width: 0; }
@media (min-width: 960px) {
  .listen { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 36px; }
  .chapters { position: sticky; top: 84px; }
}

.player { position: relative; min-width: 0; padding: 22px 22px 18px; border: 1px solid rgba(243, 192, 121, .24); border-radius: 26px; background: radial-gradient(120% 90% at 0% 0%, rgba(243, 192, 121, .12), transparent 60%), linear-gradient(160deg, var(--surface-2), var(--ink-2)); box-shadow: 0 30px 80px -50px var(--glow); }
.native { display: block; width: 100%; color-scheme: dark; }
.deck { display: none; }
.js .native { display: none; }
.js .deck { display: block; }

.deck-top { display: flex; align-items: center; gap: 16px; }
.play { flex: none; display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(180deg, var(--amber-2), var(--amber-deep)); color: #241704; cursor: pointer; box-shadow: 0 12px 30px -14px var(--glow); }
.play svg { width: 28px; height: 28px; fill: currentColor; }
.play .i-play { transform: translateX(2px); }
.play .i-pause, .player.playing .play .i-play { display: none; }
.player.playing .play .i-pause { display: block; }
.player.loading .play { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(243, 192, 121, .14); } }

.now { min-width: 0; display: grid; gap: 2px; }
.now-n { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.now-title { overflow: hidden; color: var(--paper); font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 24px); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }

.seek { --p: 0%; display: block; width: 100%; height: 28px; margin: 18px 0 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.seek::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--amber) var(--p), rgba(245, 238, 227, .14) var(--p)); }
.seek::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(245, 238, 227, .14); }
.seek::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--amber); }
.seek::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6px; border: 3px solid var(--ink); border-radius: 50%; background: var(--amber-2); -webkit-appearance: none; appearance: none; }
.seek::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid var(--ink); border-radius: 50%; background: var(--amber-2); }
.seek:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 12px; }
.ctl, .speed { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(245, 238, 227, .04); color: var(--paper); cursor: pointer; font: 700 14px/1 var(--font-body); }
.ctl:hover, .speed:hover { border-color: rgba(243, 192, 121, .45); }
.ctl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctl[data-act="prev"] svg path, .ctl[data-act="next"] svg path { fill: currentColor; }
.jump { display: inline-flex; align-items: center; gap: 4px; }
.jump span { font-variant-numeric: tabular-nums; }
.speed { min-width: 64px; color: var(--amber); font-variant-numeric: tabular-nums; }
.ctl:disabled { opacity: .35; cursor: default; }
.status { min-height: 0; margin: 8px 0 0; color: var(--amber-2); font-size: 14px; }
.status:empty { display: none; }

/* Whole book, one segment per chapter, width by running time. */
.book-strip { display: flex; gap: 2px; height: 8px; margin-top: 18px; }
.book-strip.dense { gap: 0; }
.book-strip i { flex-basis: 0; min-width: 1px; border-radius: 2px; background: rgba(245, 238, 227, .14); }
.book-strip.dense i { min-width: 0; border-radius: 0; }
.book-strip i:first-child { border-radius: 4px 2px 2px 4px; }
.book-strip i:last-child { border-radius: 2px 4px 4px 2px; }
.book-strip i.done { background: rgba(243, 192, 121, .5); }
.book-strip i.on { background: linear-gradient(90deg, var(--amber) var(--p, 0%), rgba(243, 192, 121, .28) var(--p, 0%)); }
.js .book-strip { display: flex; }
.book-strip { display: none; }

/* Figures: plain numbers, sentence-case labels. */
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; margin: 0; }
.figures div { padding-top: 12px; border-top: 1px solid var(--line); }
.figures dt { color: var(--muted); font-size: 13px; }
.figures dd { margin: 2px 0 0; color: var(--paper); font-size: clamp(20px, 2.4vw, 26px); font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }

/* Chapter list: real links to each MP3; scrolls in its own box. */
.chapters h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 22px; font-weight: 520; letter-spacing: -.015em; }
.chapter-list { max-height: min(560px, 70vh); margin: 0; padding: 4px; overflow-y: auto; list-style: none; border: 1px solid var(--line); border-radius: 18px; background: rgba(245, 238, 227, .02); overscroll-behavior: contain; scrollbar-color: rgba(245, 238, 227, .2) transparent; }
.chapter-list a { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 11px 12px; border-radius: 12px; color: var(--paper-dim); text-decoration: none; font-size: 15px; line-height: 1.4; }
.chapter-list a:hover { background: rgba(245, 238, 227, .05); color: var(--paper); }
.chapter-list a:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.chapter-list a[aria-current] { background: rgba(243, 192, 121, .12); color: var(--paper); }
.chapter-list a[aria-current] .ch-n { color: var(--amber); }
.ch-n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.ch-t { overflow-wrap: anywhere; }
.ch-d { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- body sections ---------- */
.cat-body { padding-bottom: 96px; }
.cat-body h2 { margin: 64px 0 16px; font-size: clamp(26px, 3.4vw, 36px); }
.cat-body > section:first-child h2 { margin-top: 56px; }
.cat-body p { font-size: 17px; line-height: 1.65; }

.measures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 22px 0 0; }
.measure { padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(245, 238, 227, .025); }
.measure dt { color: var(--muted); font-size: 13px; }
.measure dd { margin: 0; }
.m-value { display: block; margin-top: 2px; color: var(--paper); font-size: 22px; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
.m-detail { display: block; color: var(--paper-dim); font-size: 14px; line-height: 1.4; }
.m-compare { margin-top: 8px !important; color: var(--paper-dim); font-size: 15px; line-height: 1.5; }
.dots { position: relative; height: 40px; margin-top: 8px; }
.dots svg { display: block; width: 100%; height: 24px; overflow: visible; }
.dots line { stroke: rgba(245, 238, 227, .32); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.dots .axis { stroke: rgba(245, 238, 227, .1); }
.dot { position: absolute; top: 4px; width: 16px; height: 16px; margin-left: -8px; border: 3px solid var(--ink); border-radius: 50%; background: var(--amber); }
.end { position: absolute; bottom: 0; left: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.end-r { right: 0; left: auto; }
.method { margin-top: 14px; color: var(--muted) !important; font-size: 14px !important; }

.opening { margin: 24px 0 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--amber); }
.opening p { margin: 0; color: var(--paper) !important; font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 24px) !important; font-style: italic; line-height: 1.45 !important; }
.opening footer { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; }

.facts { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line-soft); }
.facts div { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 0; color: var(--paper); font-size: 16px; }
.facts a { color: var(--amber); text-underline-offset: 3px; text-decoration-color: rgba(243, 192, 121, .42); }

.app { margin-top: 64px; padding: clamp(22px, 4vw, 34px); border: 1px solid rgba(243, 192, 121, .25); border-radius: 26px; background: linear-gradient(145deg, rgba(243, 192, 121, .1), rgba(166, 201, 169, .035)); }
.app h2 { margin-top: 0 !important; }
.app p { margin: 0; color: var(--paper) !important; }
.app-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Chapters after the free ones: same row, dimmed, with a lock. They open the app dialog. */
.chapter-list .ch-locked { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto 14px; gap: 10px; align-items: baseline; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 15px; line-height: 1.4; text-align: left; cursor: pointer; }
.chapter-list .ch-locked:hover { background: rgba(245, 238, 227, .05); color: var(--paper-dim); }
.chapter-list .ch-locked:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.ch-lock { align-self: center; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.ch-locked:hover .ch-lock { color: var(--amber); opacity: 1; }
.book-strip i.locked { background: rgba(245, 238, 227, .06); }

/* "Get the app" dialog. The QR code is for someone at a computer; a phone gets the store buttons. */
.get-app { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: clamp(24px, 5vw, 34px); overflow: auto; border: 1px solid rgba(243, 192, 121, .3); border-radius: 26px; background: #14110e; color: var(--paper); text-align: center; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.get-app::backdrop { background: rgba(8, 6, 5, .72); backdrop-filter: blur(3px); }
.get-app h2 { margin: 0 28px; font-family: var(--font-display); font-size: clamp(24px, 4vw, 30px); font-weight: 450; line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.get-app p { margin: 12px 0 0; color: var(--paper-dim); font-size: 16px; line-height: 1.55; }
.get-app-qr { display: block; width: 180px; height: 180px; margin: 22px auto 0; padding: 14px; border-radius: 22px; background: var(--paper); }
.get-app .app-links { justify-content: center; margin-top: 22px; }
.get-app-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--paper-dim); font-size: 26px; line-height: 1; cursor: pointer; }
.get-app-close:hover { background: rgba(245, 238, 227, .08); color: var(--paper); }
.get-app-close:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 640px), (pointer: coarse) { .get-app-qr { display: none; } }

.similar, .reading { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.similar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.similar a { display: grid; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(245, 238, 227, .025); color: var(--paper) !important; text-decoration: none; }
.similar a:hover { border-color: rgba(243, 192, 121, .4); }
.s-title { font-family: var(--font-display); font-size: 19px; line-height: 1.25; }
.s-meta { color: var(--muted); font-size: 14px; }
.reading a { font-size: 17px; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.pager a { color: var(--paper) !important; text-decoration: none; font-size: 16px; line-height: 1.35; }
.pager a span { display: block; color: var(--muted); font-size: 13px; }
.pager a:hover { color: var(--amber) !important; }
.pager a[rel="next"] { text-align: right; }
.pager-all { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px !important; white-space: nowrap; }

/* ---------- hub ---------- */
.hub-list { padding-bottom: 8px; }
.sort { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.sort[hidden] { display: none; }
.sort button { min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(245, 238, 227, .03); color: var(--paper-dim); cursor: pointer; font: 650 14px/1 var(--font-body); }
.sort button:hover { color: var(--paper); border-color: rgba(243, 192, 121, .4); }
.sort button[aria-pressed="true"] { border-color: transparent; background: var(--amber); color: #241704; }
.books { max-width: 1000px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.books li { border-bottom: 1px solid var(--line); }
.books a { display: grid; grid-template-columns: minmax(0, 1fr) 12em 6em; grid-template-areas: "title len pace" "who len pace"; gap: 2px 24px; align-items: center; padding: 16px 10px; border-radius: 12px; color: inherit; text-decoration: none; }
.books a:hover { background: rgba(245, 238, 227, .04); }
.books a:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.r-title { grid-area: title; color: var(--paper); font-family: var(--font-display); font-size: clamp(19px, 2.2vw, 23px); line-height: 1.25; letter-spacing: -.01em; }
.books a:hover .r-title { color: var(--amber); }
.r-who { grid-area: who; color: var(--muted); font-size: 14px; }
.r-len { grid-area: len; display: grid; gap: 6px; color: var(--paper); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.r-len i { display: block; height: 4px; border-radius: 4px; background: rgba(243, 192, 121, .55); }
.r-pace { grid-area: pace; color: var(--paper-dim); font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.r-pace abbr { color: var(--muted); font-size: 13px; text-decoration: none; }

@media (max-width: 820px) {
  .similar { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .measures { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .books a { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title title" "who who" "len pace"; gap: 4px 16px; padding: 14px 4px; }
  .r-len { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
}
@media (max-width: 420px) {
  .player { padding: 18px 16px 16px; border-radius: 22px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { gap: 4px; }
  .ctl { min-width: 44px; height: 44px; padding: 0 8px; }
  .speed { min-width: 54px; height: 44px; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-all { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .player.loading .play { animation: none; }
}
/* Body sections keep the page's left edge (alternatives.css centres a narrower .content). */
.cat-body.content { max-width: none; }
.cat-body > section, .cat-body > nav { max-width: 880px; }
