/* SeriesStack — one stylesheet, no framework. Headings in Newsreader (self-hosted, OFL), text in the
   platform sans. Every colour is a token, redefined for dark mode; contrast pairs are listed beside
   the tokens they constrain. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #faf7f2;
  --paper-2: #f2ede4;
  --ink: #1d1b18;
  --ink-2: #57524a;
  --ink-3: #6b645a;       /* ≥4.9:1 on paper, paper-2, accent-soft and soon-soft */
  --rule: #e2dbcf;
  --rule-strong: #cfc6b6;
  --accent: #1f5f5b;
  --accent-ink: #ffffff;
  --accent-soft: #e3efed;
  --accent-line: #b9d3cf;
  --soon: #8a4b12;
  --soon-soft: #f7ead9;
  --soon-line: #e4c39d;
  --star: #a8690f;
  --radius: 10px;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tap: 38px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161513;
    --paper-2: #1f1d1a;
    --ink: #ece7df;
    --ink-2: #b5ada1;
    --ink-3: #9c958a;     /* ≥4.8:1 on paper, paper-2, accent-soft and soon-soft */
    --rule: #2f2c28;
    --rule-strong: #46423c;
    --accent: #6cc0b8;
    --accent-ink: #0d1f1e;
    --accent-soft: #1c2e2c;
    --accent-line: #2f4e4a;
    --soon: #e7a766;
    --soon-soft: #2e2217;
    --soon-line: #5a4126;
    --star: #e0a94a;
    color-scheme: dark;
  }
}
/* A finger is not a cursor. */
@media (pointer: coarse) { :root { --tap: 44px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-strong) var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  caret-color: var(--accent);
  accent-color: var(--accent);
}
::selection { background: var(--accent); color: var(--accent-ink); }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 {
  font-family: var(--serif); font-optical-sizing: auto; line-height: 1.12; font-weight: 600;
  margin: 0 0 .45em; text-wrap: balance;
}
/* 1.3 steps: body 17 → h3 22 → h2 28 → h1 up to 56. */
h1 { font-size: clamp(2.3rem, 1.5rem + 3vw, 3.5rem); letter-spacing: -.02em; font-weight: 560; }
h2 { font-size: 1.65rem; letter-spacing: -.01em; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); font-size: .9em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Positions, years, ranks and counts line up when they are drawn the same width. */
.book__pos, .ranked__n, .compact-order__pos, .upcoming time, .book__meta, .card__meta, .stars { font-variant-numeric: tabular-nums lining-nums; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.masthead__row { display: flex; align-items: center; gap: 8px 22px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.nav { display: flex; gap: 2px 4px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 0 8px; min-height: var(--tap); display: inline-flex; align-items: center; border-radius: 6px; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.search { margin-left: auto; }
.search input, .hero__search input {
  font: inherit; color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0 16px; min-height: var(--tap); width: 230px; max-width: 100%;
}
.search input::placeholder, .hero__search input::placeholder { color: var(--ink-3); }
.search input:focus, .hero__search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 720px) {
  .masthead { position: static; }
  .search { margin-left: 0; width: 100%; padding-bottom: 6px; }
  .search input { width: 100%; }
  .nav { margin-left: -8px; }
}

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 0 0; margin: 0; font-size: .88rem; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--rule-strong); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
main.wrap { padding-top: 24px; padding-bottom: 72px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 .92rem/1.1 var(--sans); padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer;
  min-height: var(--tap);
  transition: border-color .15s ease-out, background-color .15s ease-out;
}
.btn:hover { border-color: var(--ink-3); background: var(--paper-2); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); border-color: transparent; }
.buy { display: flex; gap: 8px; flex-wrap: wrap; }
.buy--compact .btn { padding: 6px 11px; font-size: .86rem; min-height: max(32px, var(--tap)); }

.byline { font-size: 1.02rem; color: var(--ink-2); margin: -.15em 0 .9em; }
.byline a { color: inherit; font-weight: 600; text-decoration-color: var(--rule-strong); }
.byline a:hover { color: var(--accent); }
.byline__sep { color: var(--rule-strong); margin: 0 .4em; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.disclosure-inline { font-size: .84rem; color: var(--ink-3); margin-top: -.4em; }
.page-head { margin-bottom: 32px; }

/* Small section labels: sentence case, set apart by weight and colour rather than capitals. */
.label { font: 600 .95rem/1.3 var(--sans); letter-spacing: 0; color: var(--ink-2); margin: 0 0 10px; }

/* Series page */
.series__head { margin-bottom: 32px; }
.series__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.series__side { position: sticky; top: 84px; display: grid; gap: 20px; }
@media (max-width: 900px) {
  .series__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* On a phone the reader came for the list: book 1 above it, the offers after it. */
  .series__side { display: contents; }
  .series__side .start { order: -1; margin-bottom: 24px; }
  .series__side .source { order: -1; }
  .series__side .offers { order: 1; margin-top: 8px; }
  .series__side .side-list { display: none; }
}
.start { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.start__title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.2; margin: 12px 0 14px; }
.start .buy .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
@media (max-width: 900px) {
  /* Cover beside the title on a phone — only where there is a cover. TV and film boxes have none. */
  .start:has(.cover--lg) { display: grid; grid-template-columns: 88px 1fr; gap: 0 16px; align-items: center; }
  .start .label { grid-column: 1 / -1; }
  .start .cover--lg { width: 88px; height: 88px; grid-row: span 2; }
  .start__title { margin: 0 0 10px; }
}

.next { border: 1px solid var(--soon-line); background: var(--soon-soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 28px; }
.next .label { color: var(--soon); }
.next__row { display: flex; gap: 16px; align-items: flex-start; }
.next__title { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.2; margin: 0 0 4px; }
.next__date { color: var(--ink-2); font-size: .92rem; margin-bottom: 12px; }
.next__date:last-child { margin-bottom: 0; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 14px; }
.list-head h2 { margin: 0; }
.more { font-size: .92rem; font-weight: 600; text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; }
.more:hover { text-decoration: underline; }
.toggle { font-size: .9rem; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; min-height: var(--tap); }
.toggle input { width: 18px; height: 18px; margin: 0; }

.order { list-style: none; padding: 0; margin: 0 0 36px; border-top: 1px solid var(--rule); }
.book { display: grid; grid-template-columns: 48px 72px minmax(0, 1fr); gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 80px; }
.book__pos { font-family: var(--serif); font-size: 2.1rem; font-weight: 500; line-height: .9; color: var(--ink-3); text-align: right; padding-top: 2px; }
.book__title { margin: 0 0 4px; }
.book__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .88rem; color: var(--ink-2); margin-bottom: 8px; }
.book__summary { color: var(--ink-2); font-size: .97rem; max-width: 64ch; margin-bottom: 12px; }
.book--novella { grid-template-columns: 48px 48px minmax(0, 1fr); padding: 12px 0; }
/* Seasons and films: the number is the picture; there is no cover to show beside it. */
.book--plain { grid-template-columns: 48px minmax(0, 1fr); }
.book--upcoming.book--plain .book__title { color: var(--ink-2); }
.book--novella .cover { width: 48px; height: 48px; }
.book--novella .book__title { font: 600 1.02rem/1.3 var(--sans); }
.book--novella .book__pos { font-size: 1.2rem; color: var(--rule-strong); }
.book--novella .book__meta { margin-bottom: 6px; }
.order.hide-novellas .book--novella { display: none; }
@media (max-width: 520px) {
  .book { grid-template-columns: 28px 60px minmax(0, 1fr); gap: 12px; }
  .book .cover--md { width: 60px; height: 60px; }
  .book__pos { font-size: 1.5rem; }
  .book__summary { display: none; }
  .book--novella { grid-template-columns: 28px 40px minmax(0, 1fr); }
  .book--plain { grid-template-columns: 32px minmax(0, 1fr); }
  .book--novella .cover { width: 40px; height: 40px; }
}
.tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); }
.tag--soon { background: var(--soon-soft); color: var(--soon); border-color: var(--soon-line); }
.stars { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.stars svg { width: 14px; height: 14px; fill: var(--star); flex: none; }
.stars__count { color: var(--ink-3); }

.cover { display: block; object-fit: cover; border-radius: 4px; background: var(--paper-2); box-shadow: 0 1px 2px rgb(0 0 0 / .14), 0 6px 14px -4px rgb(0 0 0 / .18); }
.cover--md { width: 72px; height: 72px; }
.cover--lg { width: 100%; height: auto; aspect-ratio: 1; max-width: 260px; }
.cover--blank { border: 1px solid var(--rule); box-shadow: none; }

.offers { display: grid; gap: 10px; }
.offer { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); padding: 13px 15px; background: var(--paper); transition: border-color .15s ease-out; }
.offer:hover { border-color: var(--accent); }
.offer__label { display: block; color: var(--accent); margin-bottom: 3px; }
.offer__note { display: block; font-size: .88rem; color: var(--ink-2); }
main > .offers { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 36px; }

.side-list h2 { font-size: 1.15rem; }
.side-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .95rem; }
.side-list a { display: inline-flex; min-height: max(28px, calc(var(--tap) - 8px)); align-items: center; }
.companions ul { padding-left: 1.2em; }
.about-order { color: var(--ink-2); max-width: 70ch; }
.about-order h2 { color: var(--ink); }
.related { margin-top: 56px; }

/* Cards */
.cards { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card__link { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); padding: 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); height: 100%; transition: border-color .15s ease-out, background-color .15s ease-out; }
.card__link:hover { border-color: var(--rule-strong); background: var(--paper-2); }
.card__text { display: grid; gap: 3px; min-width: 0; }
.card__title { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; line-height: 1.2; display: block; }
.card__meta { font-size: .86rem; color: var(--ink-2); display: block; }

/* Home */
.hero { padding: 32px 0 44px; }
.hero h1 { font-size: clamp(2.6rem, 1.4rem + 4.6vw, 4.6rem); max-width: 13ch; line-height: 1; letter-spacing: -.03em; }
.hero .lede { font-size: 1.2rem; }
.hero__search { display: flex; gap: 8px; max-width: 560px; margin: 22px 0 8px; }
.hero__search input { flex: 1; width: auto; min-height: 48px; padding: 0 18px; font-size: 1.05rem; }
.hero__search .btn { min-height: 48px; padding: 0 22px; border-radius: 999px; }

.genre-grid { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.genre-grid a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 13px 15px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s ease-out; }
.genre-grid a:hover { border-color: var(--rule-strong); background: var(--paper-2); }
.genre-grid__name { font-weight: 600; }

/* Indexes */
.az { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 28px; position: sticky; top: 61px; background: var(--paper); padding: 6px 0; z-index: 2; border-bottom: 1px solid var(--rule); }
.az a { min-width: var(--tap); min-height: var(--tap); display: inline-grid; place-items: center; border-radius: 6px; text-decoration: none; font-weight: 600; }
.az a:hover { background: var(--accent-soft); }
@media (max-width: 720px) { .az { position: static; } }
.az-group h2 { border-bottom: 1px solid var(--rule); padding-bottom: 6px; scroll-margin-top: 120px; }
.az-list { list-style: none; padding: 0; margin: 0 0 32px; columns: 3 260px; column-gap: 32px; }
.az-list li { break-inside: avoid; padding: 4px 0; }

.ranked { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ranked li { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; }
.ranked__n { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; color: var(--ink-3); text-align: right; }
.ranked__link { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); padding: 8px; border-radius: var(--radius); }
.ranked__link:hover { background: var(--paper-2); }

.upcoming { list-style: none; padding: 0; margin: 0; }
.upcoming > li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.upcoming time { font-weight: 600; color: var(--soon); }
.upcoming__row { display: flex; gap: 14px; }
.upcoming__row p { margin: 0 0 6px; }
@media (max-width: 600px) { .upcoming > li { grid-template-columns: 1fr; gap: 6px; } }

.toc ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.toc a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; font-size: .92rem; }
.toc a:hover { border-color: var(--accent); }
.author-series { margin-bottom: 40px; scroll-margin-top: 80px; }
.author-series h2 a { color: var(--ink); text-decoration: none; }
.author-series h2 a:hover { color: var(--accent); }
.compact-order { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.compact-order li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.compact-order__pos { font-family: var(--serif); font-size: 1.1rem; color: var(--ink-3); text-align: right; }
.compact-order__buy { font-size: .88rem; font-weight: 600; min-height: var(--tap); display: inline-flex; align-items: center; }
@media (max-width: 520px) { .compact-order li { grid-template-columns: 28px minmax(0, 1fr) auto; } .compact-order li .muted { display: none; } }

.results { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 6px; }
.results a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; min-height: var(--tap); border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; color: var(--ink); }
.results a:hover { border-color: var(--rule-strong); background: var(--paper-2); }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }

/* Footer */
.footer { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 32px 0 44px; font-size: .9rem; color: var(--ink-2); }
.footer__nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-bottom: 12px; }
.footer__nav a { min-height: var(--tap); display: inline-flex; align-items: center; }
.footer__fine { color: var(--ink-3); font-size: .85rem; max-width: 80ch; }
.footer__fine a { color: inherit; }

/* Tiles: a show's or film series' initials, standing in for artwork we have no licence to show.
   The gradient's two stops are dark enough for white text at ≥5.3:1 at every hue. */
.tile {
  display: grid; place-items: center; flex: none; border-radius: 6px;
  font: 600 1.35rem/1 var(--serif); letter-spacing: .01em; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 45% 30%), hsl(calc(var(--h) + 40) 50% 21%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08), 0 6px 14px -6px rgb(0 0 0 / .35);
}
.tile--md { width: 72px; height: 72px; }
.book--upcoming .tile { opacity: .6; }
@media (max-width: 520px) { .book .tile--md, .card .tile--md { width: 60px; height: 60px; font-size: 1.15rem; } }
.season { padding: 14px 0; }
.credit { font-size: .85rem; color: var(--ink-3); }
.credit a { color: inherit; }

/* Based on / adapted for screen: provenance, so it reads as a citation rather than an alert. */
.source { border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 14px 18px 16px; margin: 0 0 28px; background: var(--accent-soft); }
.series__side .source { margin: 0; padding: 16px 18px; }
.series__side .source .buy .btn { flex: 1 1 auto; }
.source--out { margin-top: 8px; }
.source .label { color: var(--accent); }
.source__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.source__item + .source__item { padding-top: 14px; border-top: 1px solid var(--accent-line); }
.source__what { margin: 0 0 8px; font-size: 1.02rem; }
.source__what strong { font-family: var(--serif); font-size: 1.12em; font-weight: 600; }
.source__what::first-letter { text-transform: uppercase; }
.source__titles { margin: -4px 0 8px; font-size: .86rem; color: var(--ink-2); }
.source--out .source__what { margin: 0; }
.source--out .source__item + .source__item { padding-top: 10px; }

/* Motion: only short colour fades here, and none at all for anyone who has asked for less. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* Breadcrumbs are small text on purpose; on a touch screen they still get a full-height target. */
@media (pointer: coarse) {
  .crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); }
  .crumbs ol { padding-top: 6px; }
}
