/* Cashiers du Cinemart — site stylesheet.
   Tokens and components follow docs/design-handoff/README.md. Scale: 12 14 16 18 20 24 32 44 56. */

/* ---------- Fonts (self-hosted, Latin subset) ---------- */
@font-face { font-family: "Special Elite"; src: url("/assets/fonts/SpecialElite-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/DMSans-var.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/SourceSerif4-var.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/SourceSerif4-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --ink: #141210;
  --page: #f4efe3;
  --surface: #fffdf8;
  --card: #fffaf0;
  --muted: #5d574c;
  --placeholder: #6b6556;
  --body-2: #4d473c;
  --body-3: #3a352c;
  --link: #b3380a;
  --accent-dark: #fb5b1a;
  --rule: #cfc7b2;
  --rule-soft: #e0d9c6;
  --mark-bg: #f5d93f;
  --mark-ink: #141210;
  --ok-ink: #1d5f4a; --ok-bg: #e3efe8;
  --warn-ink: #7a5a00; --warn-bg: #f7ecc4;
  --no-ink: #5d574c; --no-bg: #e7e1d1;
  --book-ink: #ffffff; --book-bg: #b3380a;
  --resume-bg: #f5ecd3; --resume-border: #7a5a00;
  --header-ink: #f4efe3; --header-muted: #d9d2c1; --footer-muted: #b9b1a0;
  --skeleton: #dcd5c2;
  --btn-primary-bg: #141210; --btn-primary-ink: #f4efe3;
  --focus: #141210;                /* 15:1 on the cream page; the orange used before was only 2.8:1 */

  --font-display: "Special Elite", "Courier New", monospace;
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --gutter: 48px;
  --max: 1100px;
  --reading-size: 1.125rem;
  --reading-lh: 1.7;
  --reading-max: 42.5rem;
}
@media (max-width: 1000px) { :root { --gutter: 32px; } }
@media (max-width: 600px)  { :root { --gutter: 18px; } }

/* Display preferences (set on <html> by site.js, remembered in localStorage).
   Text size scales every rem value on the site, so it works on every page, not just articles. */
html { font-size: 100%; }
html[data-size="s"]  { font-size: 90%; }
html[data-size="l"]  { font-size: 118%; }
html[data-size="xl"] { font-size: 138%; }
html[data-spacing="tight"] { --reading-lh: 1.5; }
html[data-spacing="loose"] { --reading-lh: 1.9; }
html[data-width="narrow"]  { --reading-max: 36rem; }
html[data-width="wide"]    { --reading-max: 51rem; }

/* Dark theme: explicit, or system preference unless the reader picked light. */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"],
:root:not([data-theme="light"]):not([data-theme="dark"]) { }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --ink: #f4efe3; --page: #1b1814; --surface: #1f1b17; --card: #26221d;
    --muted: #c9c2b0; --placeholder: #a79f8c; --body-2: #d9d2c1; --body-3: #e4ddcc;
    --link: #ff9a6c; --rule: #4a443a; --rule-soft: #3a352c;
    --ok-ink: #8fd3b4; --ok-bg: #1f3a30; --warn-ink: #f5d93f; --warn-bg: #3a3010;
    --no-ink: #c9c2b0; --no-bg: #34302a; --resume-bg: #2e2816; --resume-border: #c9a227;
    --skeleton: #3a352c; --btn-primary-bg: #f4efe3; --btn-primary-ink: #141210; --focus: #ff9a6c;
    --mark-bg: #f5d93f; --mark-ink: #141210;
    color-scheme: dark;
  }
}
html[data-theme="dark"] {
  --ink: #f4efe3; --page: #1b1814; --surface: #1f1b17; --card: #26221d;
  --muted: #c9c2b0; --placeholder: #a79f8c; --body-2: #d9d2c1; --body-3: #e4ddcc;
  --link: #ff9a6c; --rule: #4a443a; --rule-soft: #3a352c;
  --ok-ink: #8fd3b4; --ok-bg: #1f3a30; --warn-ink: #f5d93f; --warn-bg: #3a3010;
  --no-ink: #c9c2b0; --no-bg: #34302a; --resume-bg: #2e2816; --resume-border: #c9a227;
  --skeleton: #3a352c; --btn-primary-bg: #f4efe3; --btn-primary-ink: #141210; --focus: #ff9a6c;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1rem/1.5 var(--font-ui); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.1; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* On the black header, footer and reading bar the ring is cream (16:1) instead. */
.site-header :focus-visible, .site-footer :focus-visible, .reading-bar :focus-visible, .mobile-search :focus-visible, .mobile-menu :focus-visible { outline-color: #f4efe3; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.print-only { display: none; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--page); font-weight: 600; }
.skip-link:focus { top: 12px; outline-color: var(--page); }
mark { background: var(--mark-bg); color: var(--mark-ink); padding: 0 1px; }

.label { font: 600 0.75rem/1.5 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }
.meta { font-size: 0.875rem; color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; }
.linkish--strong { font-weight: 600; }
.chip { display: inline-block; border: 1px solid var(--ink); border-radius: 99px; padding: 6px 14px; font-size: 0.875rem; color: var(--ink); text-decoration: none; margin: 0 6px 6px 0; }
.chip:hover { background: var(--ink); color: var(--page); }

.btn { display: inline-block; font: 600 1rem/1.2 var(--font-ui); text-decoration: none; text-align: center; cursor: pointer; border-radius: 0; }
.btn--primary { background: var(--btn-primary-bg); color: var(--btn-primary-ink); padding: 12px 20px; border: 2px solid var(--btn-primary-bg); }
.btn--primary:hover { background: var(--link); border-color: var(--link); color: #fff; }
.btn--secondary { background: transparent; color: var(--ink); padding: 10px 18px; border: 2px solid var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--page); }
.btn--light { background: transparent; color: var(--header-ink); padding: 10px 14px; border: 1px solid var(--header-ink); }
.btn--sm { font-size: 0.875rem; padding: 9px 14px; }
.btn--secondary.btn--sm { padding: 7px 12px; }
.btn--block { display: block; width: 100%; }
.tool { background: transparent; color: var(--ink); border: 1px solid var(--ink); padding: 8px 14px; font-size: 0.875rem; white-space: nowrap; cursor: pointer; }
.tool:hover, .tool[aria-pressed="true"], .tool[aria-expanded="true"] { background: var(--ink); color: var(--page); }
.tool--sm { padding: 6px 12px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: #141210; color: var(--header-ink); }
.site-header a { color: inherit; text-decoration: none; }
.site-header__row { max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter); display: flex; align-items: center; gap: 24px; min-height: 64px; }
.wordmark { font: 400 1.5rem/1 var(--font-display); white-space: nowrap; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 24px; list-style: none; }
.site-nav a { font-size: 1rem; padding: 6px 0; display: inline-block; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--header-muted); }
.site-nav a[aria-current="page"] { color: var(--accent-dark); font-weight: 600; }
.site-header-search { position: relative; display: flex; align-items: center; width: 220px; transition: width .15s ease; }
.site-header-search:focus-within { width: 260px; }
.search-icon { position: absolute; left: 12px; color: var(--header-muted); pointer-events: none; display: flex; }
.site-header-search .search-input { width: 100%; padding: 8px 12px 8px 34px; font: 400 0.875rem/1.4 var(--font-ui); color: var(--header-ink); background: transparent; border: 1px solid var(--header-ink); border-radius: 0; appearance: none; }
.site-header-search .search-input::placeholder { color: var(--header-muted); opacity: 1; }
.site-header-search .search-input:focus { background: #fffaf0; color: #141210; border: 2px solid var(--accent-dark); outline: none; padding: 7px 11px 7px 33px; }
.site-header-search .search-input:focus::placeholder { color: #6b6556; }
.site-header-search:focus-within .search-icon { color: #141210; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.saved-link { position: absolute; right: -92px; font-size: 0.875rem; color: var(--header-muted); white-space: nowrap; }
.saved-link[hidden] { display: none; }
.header-buttons { display: none; margin-left: auto; gap: 10px; }
.hbtn { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--header-ink); border: 1px solid var(--header-ink); padding: 8px 12px; font-size: 0.875rem; cursor: pointer; min-height: 36px; }
.hbtn[aria-expanded="true"] { background: var(--header-ink); color: #141210; }
.mobile-search, .mobile-menu { background: #141210; color: var(--header-ink); border-top: 1px solid #3a352c; }
.mobile-search[hidden], .mobile-menu[hidden] { display: none; }
.mobile-search .search-form { position: relative; display: flex; gap: 10px; padding: 14px var(--gutter); max-width: var(--max); margin: 0 auto; }
.mobile-search .search-input { flex: 1; padding: 12px 14px; font: 400 1rem/1.3 var(--font-ui); color: var(--header-ink); background: transparent; border: 1px solid var(--header-ink); border-radius: 0; appearance: none; }
.mobile-search .search-input::placeholder { color: var(--header-muted); opacity: 1; }
.mobile-menu__list { list-style: none; max-width: var(--max); margin: 0 auto; padding: 8px var(--gutter) 24px; font-size: 1.125rem; }
.mobile-menu__list > li { border-bottom: 1px solid #3a352c; }
.mobile-menu__list > li:last-child { border-bottom: 0; }
.mobile-menu__list a, .mobile-menu__expander { display: block; width: 100%; text-align: left; padding: 16px 0; background: none; border: 0; color: inherit; font-size: 1.125rem; cursor: pointer; }
.mobile-menu__expander { display: flex; justify-content: space-between; }
.mobile-menu__expander[aria-expanded="true"], .mobile-menu a[aria-current="page"] { color: var(--accent-dark); font-weight: 600; }
.mobile-issues { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 0 0 14px; font-size: 1rem; }
.mobile-issues[hidden] { display: none; }
.mobile-issues a { padding: 9px 0; font-size: 1rem; }

/* Search panel (dropdown) */
.search-panel { position: absolute; top: calc(100% + 8px); right: 0; width: min(560px, calc(100vw - 2 * var(--gutter))); background: var(--card); color: var(--ink); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: 18px 22px; z-index: 40; text-align: left; }
.search-panel[hidden] { display: none; }
.search-panel--hero { left: 0; right: auto; width: min(620px, 100%); top: calc(100% + 10px); }
.mobile-search .search-panel { left: var(--gutter); right: var(--gutter); width: auto; }
.search-panel__head { display: flex; justify-content: space-between; align-items: baseline; }
.search-panel__list { list-style: none; }
.search-panel__item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule); }
.search-panel__item a { color: inherit; text-decoration: none; font: 500 1.0625rem/1.3 var(--font-ui); }
.search-panel__item[aria-selected="true"] { background: var(--page); margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.search-panel__meta { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }
.search-panel__foot { border-top: 1px solid var(--ink); padding-top: 10px; margin-top: 6px; font-size: 0.8125rem; color: var(--muted); display: flex; justify-content: space-between; }
.search-panel__recent { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: 1rem; }
.search-panel__recent a { color: inherit; text-decoration: none; }
.search-panel__recent button { font-size: 0.875rem; }
.search-panel__chips { display: flex; flex-wrap: wrap; gap: 0; }
body.search-open::after { content: ""; position: fixed; inset: 0; background: rgba(20, 18, 16, .35); z-index: 25; pointer-events: none; }

/* ---------- Layout ---------- */
.page { max-width: var(--max); margin: 0 auto; padding: 44px var(--gutter) 56px; }
.page--narrow { max-width: calc(700px + 2 * var(--gutter)); }
.page-title { font: 400 2.75rem/1.1 var(--font-display); }
.page-title--xl { font-size: 3.5rem; }
.page-intro { font-size: 1rem; color: var(--muted); margin: 8px 0 28px; }
.breadcrumb { font-size: 0.875rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb a:hover { color: var(--ink); }
.subtitle { font: italic 1.25rem/1.4 var(--font-serif); color: var(--body-2); margin: 8px 0; }
.byline { font-size: 1rem; color: var(--muted); margin: 0 0 18px; }
.notice { background: var(--card); border: 1px solid var(--ink); padding: 16px 20px; margin: 16px 0 22px; line-height: 1.5; }
.empty { color: var(--muted); padding: 24px 0; }
.links-row a { margin-right: 18px; }
.backlink { font-size: 0.875rem; display: inline-block; margin-bottom: 10px; }
.plain-list { list-style: none; line-height: 2; }
.prose { font-size: 1rem; line-height: 1.6; color: var(--ink); }
.prose--serif { font-family: var(--font-serif); font-size: 1.125rem; line-height: 1.7; }
.prose--lead { margin-top: 24px; }
.prose p { margin: 0 0 1.1em; }
.prose a { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: #141210; color: var(--header-muted); font-size: 0.875rem; line-height: 1.5; }
.site-footer__row { max-width: var(--max); margin: 0 auto; padding: 22px var(--gutter) 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__disclosure { max-width: var(--max); margin: 8px auto 0; padding: 0 var(--gutter) 22px; color: var(--footer-muted); }

/* ---------- Covers ---------- */
.cover { display: block; position: relative; aspect-ratio: 7 / 10; box-shadow: 5px 5px 0 #141210; background: var(--card); text-decoration: none; color: inherit; }
.cover--s { width: 80px; } .cover--m { width: 140px; } .cover--l { width: 240px; box-shadow: 4px 4px 0 #141210; } .cover--fluid { width: 100%; }
/* The real covers run from about 0.63 to 0.81 wide-to-tall; a 7:10 frame trims the least and keeps the masthead. */
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.cover__placeholder { position: absolute; inset: 0; background: var(--cover-bg, #141210); color: var(--cover-ink, #f4efe3); padding: 9px; display: flex; flex-direction: column; justify-content: space-between; font-family: var(--font-display); }
.cover__brand { font-size: 0.75rem; line-height: 1.1; text-transform: uppercase; }
.cover__num { font-size: clamp(2.75rem, 46cqw, 6.875rem); line-height: 1; }
.cover { container-type: inline-size; }
.cover__placeholder--book { position: relative; display: flex; aspect-ratio: 3 / 4; width: 100%; box-shadow: 5px 5px 0 #141210; color: #141210; }
.cover__placeholder--book .cover__title { font: 400 0.875rem/1.15 var(--font-display); }
.cover__placeholder--large .cover__title { font-size: 1.5rem; }
.cover__placeholder--large .cover__brand { font-size: 0.875rem; }
a.cover:focus-visible { outline-offset: 4px; }

/* ---------- Status tags ---------- */
.status-tag { display: inline-block; font: 600 0.75rem/1.5 var(--font-ui); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.status-tag--online { color: var(--ok-ink); background: var(--ok-bg); }
.status-tag--scan { color: var(--warn-ink); background: var(--warn-bg); }
.status-tag--offline { color: var(--no-ink); background: var(--no-bg); }
.status-tag--book { color: var(--book-ink); background: var(--book-bg); }

/* ---------- Contents rows ---------- */
.contents-list { list-style: none; }
.contents-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--rule); }
.contents-row .title { font: 500 1.125rem/1.3 var(--font-ui); color: var(--ink); text-decoration: none; }
.contents-row a.title:hover { color: var(--link); text-decoration: underline; }
.contents-row.unavailable .title { color: var(--placeholder); }
.contents-row .meta { margin-top: 2px; }
.contents-row__tags { display: flex; gap: 8px; align-items: center; }
.request-inline { margin-top: 8px; font-size: 0.875rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.request-button { display: inline-block; border: 1px solid var(--ink); padding: 6px 12px; font-size: 0.875rem; color: var(--ink); text-decoration: none; }
.request-button:hover { background: var(--ink); color: var(--page); }

/* ---------- Home ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: 44px var(--gutter) 16px; }
.hero__title { font: 400 clamp(2rem, 5vw, 3.5rem)/1.1 var(--font-display); max-width: 780px; margin-bottom: 18px; }
.hero-search { position: relative; display: flex; max-width: 780px; }
.search-input--hero { flex: 1; width: 100%; background: var(--card); color: var(--ink); border: 2px solid var(--ink); padding: 16px 56px 16px 20px; font: 400 1.125rem/1.3 var(--font-ui); border-radius: 0; appearance: none; }
.search-input--hero::placeholder { color: var(--placeholder); opacity: 1; }
.search-input--hero:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.hero-search__go { position: absolute; right: 6px; top: 6px; bottom: 6px; width: 46px; background: transparent; border: 0; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hero-search__go:hover { background: var(--ink); color: var(--page); }
.hero__try { margin-top: 14px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
.hero__try .label { margin: 0 4px 6px 0; }
.home-section { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 8px; }
.home-section--split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; padding-bottom: 48px; align-items: start; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head__link { font-size: 0.875rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { border: 1px solid var(--ink); background: var(--card); padding: 16px 20px; display: flex; flex-direction: column; }
.feature-card__title { font: 400 1.5rem/1.1 var(--font-display); }
.feature-card__blurb { font-size: 0.875rem; color: var(--muted); margin: 6px 0 10px; }
.feature-card__list { list-style: decimal; padding-left: 20px; font-size: 0.9375rem; line-height: 1.45; flex: 1; }
.feature-card__list li { margin-bottom: 6px; }
.feature-card__list a { color: var(--ink); text-decoration: none; }
.feature-card__list a:hover { color: var(--link); text-decoration: underline; }
.feature-card__more { font-size: 0.875rem; margin-top: 10px; }
.cover-row { list-style: none; display: flex; gap: 22px; overflow-x: auto; padding: 8px 8px 12px 0; scroll-snap-type: x proximity; }
.cover-row__item { flex: 0 0 140px; scroll-snap-align: start; }
.cover-row__caption { margin-top: 10px; font: 500 0.9375rem/1.3 var(--font-ui); }
.cover-row__caption a { color: var(--ink); text-decoration: none; }
.cover-row__caption a:hover { color: var(--link); text-decoration: underline; }
.archive-note { border: 1px solid var(--ink); padding: 16px 20px; background: var(--card); }
.archive-note p { line-height: 1.5; }
.resume-banner { max-width: calc(var(--max) - 2 * var(--gutter)); margin: 12px auto 0; background: var(--resume-bg); border: 1px solid var(--resume-border); padding: 16px 20px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: 1rem; }
.resume-banner[hidden] { display: none; }
.resume-banner__actions { display: flex; gap: 18px; align-items: center; }
.resume-banner__go { font-weight: 600; text-decoration: none; }
.page--article .resume-banner { margin: 0 0 24px; max-width: none; font-size: 0.875rem; }

/* ---------- Issues overview ---------- */
.issue-grid { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 28px 22px; }
.issue-grid__item { position: relative; }
.issue-grid__name { margin-top: 12px; font: 500 1rem/1.3 var(--font-ui); }
.issue-grid__name a { color: var(--ink); text-decoration: none; }
.issue-grid__name a:hover { color: var(--link); text-decoration: underline; }
.issue-grid__status { margin-top: 5px; }
.cover-preview { position: absolute; left: 0; top: 100%; z-index: 20; width: 260px; background: var(--card); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 14px 16px; font-size: 0.875rem; }
.cover-preview[hidden] { display: none; }
.cover-preview__meta { color: var(--muted); margin-bottom: 6px; }
.cover-preview__intro { margin: 0 0 8px; line-height: 1.45; }

/* ---------- Issue page ---------- */
.issue-layout { display: grid; grid-template-columns: 240px 1fr; gap: 44px; align-items: start; }
.issue-side .cover { margin-bottom: 20px; }
.issue-intro { font-size: 1rem; line-height: 1.5; color: var(--body-2); max-width: 560px; margin: 0 0 22px; }
.issue-page .page-intro { margin: 8px 0 14px; }
.issue-section { margin-top: 18px; }
.issue-section-title { font: 600 0.75rem/1.5 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; padding-bottom: 6px; border-bottom: 1px solid var(--ink); margin: 20px 0 0; }
.issue-section-note { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.issue-history { margin-top: 36px; border-top: 1px solid var(--ink); padding-top: 18px; }
.issue-book { margin-top: 32px; }
.buy-box { background: var(--card); border: 2px solid var(--ink); padding: 16px; }
.buy-box__meta { font-size: 0.875rem; color: var(--muted); margin-bottom: 12px; }
.buy-box__actions { display: flex; flex-direction: column; gap: 10px; }
.buy-box__actions .btn { display: block; }
.buy-box__note { font-size: 0.75rem; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.buy-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.buy-row:last-child { border-bottom: 0; }
.buy-row b { font-size: 1.125rem; }

/* ---------- Article ---------- */
.progress { position: sticky; top: 64px; z-index: 20; height: 4px; background: var(--rule); }
.progress__bar { height: 4px; width: 0; background: var(--link); transition: width .1s linear; }
.reading-surface { background: var(--surface); }
.page--article { padding-top: 20px; }
.article-layout { display: block; }
.article-layout.has-outline { display: grid; grid-template-columns: 200px 1fr; gap: 48px; }
.outline { font-size: 0.875rem; }
.outline__sticky { position: sticky; top: 90px; }
.outline__details summary { cursor: pointer; list-style: none; }
.outline__details summary::-webkit-details-marker { display: none; }
.outline__list { list-style: none; border-left: 2px solid var(--rule); padding-left: 14px; display: flex; flex-direction: column; gap: 10px; }
.outline__list a { color: var(--muted); text-decoration: none; display: block; margin-left: -16px; padding-left: 12px; border-left: 4px solid transparent; }
.outline__list a:hover { color: var(--ink); }
.outline__list a.is-active { color: var(--link); font-weight: 600; border-left-color: var(--link); }
.outline__time { margin-top: 22px; }
.article { max-width: var(--reading-max); }
.article__title { font: 400 2.75rem/1.1 var(--font-display); margin: 14px 0 8px; }
.article__subtitle { font-size: 1.375rem; }
.article__byline { margin-bottom: 18px; }
.article-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-start; }
.popover-wrap { position: relative; }
.popover { position: absolute; left: 0; top: calc(100% + 8px); z-index: 25; width: min(420px, calc(100vw - 2 * var(--gutter))); background: var(--card); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 16px 18px; }
.popover[hidden] { display: none; }
.cite-row { border-top: 1px solid var(--rule); padding: 8px 0; }
.cite-row__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.875rem; }
.cite-text { font: 0.875rem/1.5 var(--font-serif); margin: 4px 0 0; word-break: break-word; }
.reading-settings .setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.875rem; }
.seg { display: flex; }
.seg button { background: transparent; border: 1px solid var(--ink); border-left-width: 0; padding: 6px 12px; font-size: 0.875rem; cursor: pointer; min-width: 44px; }
.seg button:first-child { border-left-width: 1px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.article-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.correction-link { font-size: 0.875rem; }
.article-body { font-size: var(--reading-size); line-height: var(--reading-lh); color: var(--ink); text-align: left; hyphens: manual; }
.article-body p { margin: 0 0 1.1em; }
.article-body h2, .article-body h3, .article-body h4, .article-body h5, .article-body h6 { font: 600 1.05em/1.3 var(--font-ui); margin: 1.6em 0 .5em; scroll-margin-top: 90px; }
.article-body h2 { font-size: 1.3em; }
.article-body h3 { font-size: 1.15em; }
.article-body p.note { font-size: 0.9em; color: var(--body-2); }
.article-body blockquote { margin: 1.2em 0 1.2em 1.2em; padding-left: .9em; border-left: 2px solid var(--ink); color: var(--body-2); }
.article-body hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6em 0; }
.article-body table { border-collapse: collapse; width: 100%; font-size: .9em; margin: 1em 0; }
.article-body td, .article-body th { border-bottom: 1px solid var(--rule); padding: .4em .5em; text-align: left; vertical-align: top; }
.article-body img { margin: 1em 0; }
.article-body ul, .article-body ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.article-body sup { line-height: 0; }
.article-body p.is-target { background: var(--mark-bg); color: var(--mark-ink); outline: 6px solid var(--mark-bg); }
.article-book { margin: 36px 0 0; }
.prev-next { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 1rem; }
.prev-next__item { display: flex; flex-direction: column; gap: 2px; }
.prev-next__item--next { text-align: right; }
.prev-next a { color: var(--ink); text-decoration: none; font-weight: 500; }
.prev-next a:hover { color: var(--link); text-decoration: underline; }
.related { margin-top: 36px; }
.share-quote { position: absolute; z-index: 50; background: #141210; color: #f4efe3; display: flex; gap: 0; font-size: 0.875rem; transform: translate(-50%, -100%); margin-top: -10px; }
.share-quote[hidden] { display: none; }
.share-quote button { background: none; border: 0; color: inherit; padding: 8px 14px; cursor: pointer; }
.share-quote button:hover { background: var(--link); }

/* ---------- Archive & search ---------- */
.archive-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin-bottom: 8px; }
.filter-search { flex: 1 1 220px; }
.filter-search input, .select select { width: 100%; height: 100%; min-height: 48px; background: var(--card); color: var(--ink); border: 1px solid var(--ink); padding: 12px 16px; font: 400 1rem/1.3 var(--font-ui); border-radius: 0; appearance: none; }
.select { position: relative; display: inline-block; }
.select select { padding-right: 36px; cursor: pointer; }
.select::after { content: "▾"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.select--sm select { min-height: 36px; padding: 6px 30px 6px 12px; font-size: 0.875rem; background: transparent; }
.result-count { margin: 10px 0 0; }
.results { list-style: none; }
.result { padding: 18px 0; border-top: 1px solid var(--rule); }
.result__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.result .title { font: 500 1.25rem/1.3 var(--font-ui); color: var(--ink); text-decoration: none; }
.result a.title:hover { color: var(--link); text-decoration: underline; }
.result.unavailable .title { color: var(--placeholder); }
.result__tags { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.save-button { background: none; border: 0; color: var(--link); font-size: 0.875rem; cursor: pointer; padding: 0; white-space: nowrap; }
.save-button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.snippet { font: 1rem/1.5 var(--font-serif); color: var(--body-3); margin: 5px 0 4px; }
.search-layout { display: grid; grid-template-columns: 220px 1fr; gap: 44px; align-items: start; }
.search-filters fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.search-filters legend { padding: 0; }
.check { display: block; font-size: 1rem; line-height: 2; cursor: pointer; }
.check input { margin-right: 6px; accent-color: var(--ink); }
.search-book { margin-top: 10px; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.results-tools { display: flex; gap: 10px; align-items: center; }
.inline { display: inline; }
.no-results { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 24px; }
.tips { padding-left: 18px; line-height: 1.7; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); }
.pagination__status { font-size: 0.875rem; color: var(--muted); }
.skeleton { background: var(--skeleton); height: 14px; margin: 10px 0; }

/* ---------- Books ---------- */
.book-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.book-row { display: grid; grid-template-columns: 110px 1fr; gap: 20px; border-top: 1px solid var(--ink); padding-top: 20px; }
.book-row__cover { display: block; width: 110px; }
.book-row__cover img { box-shadow: 5px 5px 0 #141210; }
.book-row__title { font: 400 1.5rem/1.1 var(--font-display); }
.book-row__title a { color: var(--ink); text-decoration: none; }
.book-row__title a:hover { color: var(--link); text-decoration: underline; }
.book-row .meta { margin: 6px 0 8px; }
.book-row__blurb { font-size: 1rem; line-height: 1.5; margin-bottom: 14px; }
.buy-links { display: flex; gap: 10px; flex-wrap: wrap; }
.kindle-issues { margin-top: 44px; border-top: 1px solid var(--ink); padding-top: 24px; }
.kindle-grid { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 28px 22px; margin-top: 18px; }
.kindle-item__name { margin-top: 12px; font: 500 1rem/1.3 var(--font-ui); }
.kindle-item__name a { color: var(--ink); text-decoration: none; }
.kindle-item .btn { margin-top: 8px; }
.book-layout { display: grid; grid-template-columns: 260px 1fr; gap: 52px; align-items: start; }
.book-page__cover img, .book-page__cover .cover__placeholder--book { box-shadow: 5px 5px 0 #141210; }
.book-page__desc { max-width: 600px; margin-bottom: 22px; }
.book-page .buy-box { max-width: 540px; padding: 6px 20px; }
.book-page__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; border-top: 1px solid var(--ink); margin-top: 28px; padding-top: 28px; }
.praise { margin-top: 28px; }
.praise__quote { font: 400 1.25rem/1.5 var(--font-serif); margin: 0; max-width: 700px; }

/* ---------- Book card ---------- */
.book-card { display: grid; grid-template-columns: 96px 1fr; gap: 18px; background: var(--card); border: 2px solid var(--ink); padding: 16px 18px; align-items: start; }
.book-card__cover img, .book-card__cover .cover__placeholder--book { box-shadow: 4px 4px 0 #141210; }
.book-card__title { font: 400 1.375rem/1.1 var(--font-display); }
.book-card__title a { color: var(--ink); text-decoration: none; }
.book-card__pitch { font-size: 0.9375rem; line-height: 1.45; margin: 6px 0 12px; }

/* ---------- Contact, saved ---------- */
.contact-email a { font: 400 1.75rem/1.3 var(--font-display); word-break: break-all; }
.saved-tools { display: flex; gap: 8px; margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .site-nav, .site-header-search { display: none; }
  .header-buttons { display: flex; }
  .wordmark { font-size: 1.25rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .home-section--split { grid-template-columns: 1fr; }
  .issue-grid, .kindle-grid { grid-template-columns: repeat(4, 1fr); }
  .issue-layout { grid-template-columns: 1fr; gap: 20px; }
  .issue-side { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: end; }
  .issue-side .cover { width: 110px; margin: 0; }
  .issue-side .buy-box { grid-column: 1 / -1; }
  .article-layout.has-outline { grid-template-columns: 1fr; gap: 20px; }
  .outline__sticky { position: static; }
  .outline__details { border: 1px solid var(--ink); padding: 10px 14px; }
  .outline__details:not([open]) summary { margin: 0; }
  .outline__time { display: none; }
  .search-layout { grid-template-columns: 1fr; gap: 20px; }
  .search-filters fieldset { display: inline-block; vertical-align: top; margin-right: 24px; }
  .book-grid { grid-template-columns: 1fr; }
  .book-layout { grid-template-columns: 180px 1fr; gap: 24px; }
  .book-page__grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
  .site-header__row { gap: 10px; padding-top: 14px; padding-bottom: 14px; }
  .wordmark { font-size: clamp(0.9375rem, 4.8vw, 1.25rem); min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
  .header-buttons { flex: 0 0 auto; gap: 8px; }
  .hbtn { padding: 8px 10px; }
  .page { padding-top: 24px; }
  .page-title { font-size: 2rem; }
  .page-title--xl { font-size: 2.5rem; }
  .article__title { font-size: 2rem; }
  .issue-grid, .kindle-grid { grid-template-columns: repeat(3, 1fr); gap: 20px 14px; }
  .book-row { grid-template-columns: 80px 1fr; gap: 14px; }
  .book-row__cover { width: 80px; }
  .buy-links .btn { flex: 1 1 100%; }
  .book-layout { grid-template-columns: 1fr; }
  .book-page__cover { width: 160px; }
  .book-card { grid-template-columns: 72px 1fr; gap: 12px; padding: 14px; }
  .prev-next { grid-template-columns: 1fr; }
  .prev-next__item--next { text-align: left; }
  .no-results { grid-template-columns: 1fr; }
  .archive-filters .select, .archive-filters .btn { flex: 1 1 45%; }
  .hero__try { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; padding-bottom: 4px; }
  .site-footer__row { flex-direction: column; }
  .article-actions .tool { flex: 1 1 auto; }
  .popover { position: fixed; left: var(--gutter); right: var(--gutter); top: auto; bottom: 16px; width: auto; }
}
@media (max-width: 420px) {
  /* Keep the full wordmark: the search button keeps its accessible name, only the visible word goes. */
  .hbtn__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [data-search-toggle] { min-width: 40px; justify-content: center; }
  [data-search-toggle] svg { width: 16px; height: 16px; }
}
@media (max-width: 360px) {
  .issue-grid, .kindle-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Display settings (text size, theme, spacing, width) ---------- */
.display-toggle { display: inline-flex; align-items: center; gap: 0.375rem; background: transparent; color: var(--header-ink); border: 1px solid var(--header-ink); padding: 0.5rem 0.75rem; font-size: 0.875rem; cursor: pointer; min-height: 2.25rem; white-space: nowrap; }
.display-toggle[aria-expanded="true"] { background: var(--header-ink); color: #141210; }
.display-toggle .aa { font: 600 1rem/1 var(--font-ui); }
.popover--right { left: auto; right: 0; }
.popover-wrap--header { position: relative; flex: 0 0 auto; }
.display-settings .setting { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-top: 1px solid var(--rule); font-size: 0.875rem; }
.display-settings .setting:first-of-type { border-top: 0; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--ink); }
.stepper button { background: transparent; border: 0; padding: 0.375rem 0.75rem; font-size: 1rem; font-weight: 600; cursor: pointer; min-width: 2.75rem; min-height: 2.75rem; color: var(--ink); }
.stepper button:hover:not(:disabled) { background: var(--ink); color: var(--page); }
.stepper button:disabled { opacity: 0.45; cursor: not-allowed; }
.stepper output { display: inline-flex; align-items: center; justify-content: center; min-width: 6.25rem; padding: 0 0.5rem; font-size: 0.875rem; border-inline: 1px solid var(--ink); color: var(--ink); }
.display-settings .seg button { min-height: 2.75rem; }
.reading-mode-toggle { width: 100%; margin-top: 0.5rem; justify-content: center; }
.display-settings__reset { margin-top: 0.5rem; font-size: 0.875rem; }
.mobile-menu .display-settings { padding: 0.5rem var(--gutter) 1.5rem; max-width: var(--max); margin: 0 auto; color: var(--header-ink); }
.mobile-menu .display-settings .setting { border-color: #3a352c; }
.mobile-menu .stepper, .mobile-menu .seg button { border-color: var(--header-ink); }
.mobile-menu .stepper button, .mobile-menu .stepper output, .mobile-menu .seg button { color: var(--header-ink); }
.mobile-menu .stepper button:hover:not(:disabled), .mobile-menu .seg button[aria-pressed="true"] { background: var(--header-ink); color: #141210; }
.mobile-menu .stepper output { border-color: var(--header-ink); }
.mobile-menu__heading { font: 600 0.75rem/1.5 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--header-muted); padding: 1rem var(--gutter) 0; max-width: var(--max); margin: 0 auto; }

/* Large text: use the compact header and fewer grid columns even on wide screens. */
html[data-size="l"] .site-nav, html[data-size="xl"] .site-nav,
html[data-size="l"] .site-header-search, html[data-size="xl"] .site-header-search,
html[data-size="l"] .popover-wrap--header, html[data-size="xl"] .popover-wrap--header { display: none; }
html[data-size="l"] .header-buttons, html[data-size="xl"] .header-buttons { display: flex; }
html[data-size="l"] .feature-grid, html[data-size="xl"] .feature-grid { grid-template-columns: 1fr; }
html[data-size="l"] .home-section--split, html[data-size="xl"] .home-section--split { grid-template-columns: 1fr; }
html[data-size="l"] .issue-grid, html[data-size="l"] .kindle-grid { grid-template-columns: repeat(4, 1fr); }
html[data-size="xl"] .issue-grid, html[data-size="xl"] .kindle-grid { grid-template-columns: repeat(3, 1fr); }
html[data-size="xl"] .book-grid, html[data-size="l"] .book-grid { grid-template-columns: 1fr; }
html[data-size="l"] .issue-layout, html[data-size="xl"] .issue-layout { grid-template-columns: 1fr; gap: 1.25rem; }
html[data-size="l"] .issue-side, html[data-size="xl"] .issue-side { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; align-items: end; }
html[data-size="l"] .issue-side .cover, html[data-size="xl"] .issue-side .cover { width: 110px; margin: 0; }
html[data-size="l"] .issue-side .buy-box, html[data-size="xl"] .issue-side .buy-box { grid-column: 1 / -1; }
html[data-size="l"] .article-layout.has-outline, html[data-size="xl"] .article-layout.has-outline { grid-template-columns: 1fr; gap: 1.25rem; }
html[data-size="l"] .outline__sticky, html[data-size="xl"] .outline__sticky { position: static; }
html[data-size="l"] .search-layout, html[data-size="xl"] .search-layout { grid-template-columns: 1fr; }
html[data-size="l"] .book-layout, html[data-size="xl"] .book-layout { grid-template-columns: 11.25rem 1fr; gap: 1.5rem; }
html[data-size="l"] .book-page__grid, html[data-size="xl"] .book-page__grid { grid-template-columns: 1fr; }
html[data-size="xl"] .site-footer__row { flex-direction: column; }
html[data-size="xl"] .article-actions .tool { flex: 1 1 auto; }

/* ---------- Reading mode: just the article ---------- */
.reading-bar { display: none; }
html[data-reading="on"] body.page-article .reading-bar {
  display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  background: #141210; color: #f4efe3; padding: 0.625rem var(--gutter);
}
.reading-bar__exit { background: transparent; color: #f4efe3; border: 1px solid #f4efe3; padding: 0.5rem 0.875rem; font-size: 0.875rem; cursor: pointer; min-height: 2.75rem; }
.reading-bar__exit:hover { background: #f4efe3; color: #141210; }
.reading-bar .stepper, .reading-bar .stepper button, .reading-bar .stepper output { border-color: #f4efe3; color: #f4efe3; }
.reading-bar .stepper button:hover:not(:disabled) { background: #f4efe3; color: #141210; }
html[data-reading="on"] body.page-article :is(.site-header, .site-footer, .print-masthead, .progress, .outline, .article-actions, .article-strip, .breadcrumb,
  .article-book, .prev-next, .related, .resume-banner, .share-quote, .print-citation) { display: none !important; }
html[data-reading="on"] body.page-article .article-layout.has-outline { display: block; }
html[data-reading="on"] body.page-article .page--article { padding-top: 2.5rem; padding-bottom: 4rem; }
html[data-reading="on"] body.page-article .article { margin-inline: auto; }
html[data-reading="on"] body.page-article .article__title { margin-top: 0; }
html[data-reading="on"] body.page-article .reading-surface { background: var(--surface); min-height: 100vh; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; padding: 0;
  background: #141210; color: #f4efe3; border: 2px solid #f4efe3; border-radius: 0; cursor: pointer;
  box-shadow: 0 0 0 1px #141210, 4px 4px 0 #141210;
  opacity: 0; visibility: hidden; transform: translateY(0.5rem);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.back-to-top:hover { background: #f4efe3; color: #141210; border-color: #141210; }
.back-to-top:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Never sit on top of an open panel on a small screen. */
body:has([data-popover][aria-expanded="true"]) .back-to-top,
body:has(.search-panel:not([hidden])) .back-to-top { visibility: hidden; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; transform: none; } }

/* ---------- Narrow screens with large text: no sideways scrolling (WCAG 1.4.10 reflow) ---------- */
body { overflow-wrap: break-word; }
.archive-filters > *, .results-head > *, .result__head > * { min-width: 0; }
.select select, .filter-search input { max-width: 100%; }
.saved-tools { flex-wrap: wrap; }
@media (max-width: 600px) {
  .result__head { flex-direction: column; gap: 0.5rem; }
  .result__tags { flex-wrap: wrap; }
  .issue-grid__status .status-tag, .contents-row__tags .status-tag { white-space: normal; }
  .contents-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .contents-row__tags { flex-wrap: wrap; }
  .book-row { grid-template-columns: 1fr; }
  html[data-size="l"] .issue-grid, html[data-size="l"] .kindle-grid { grid-template-columns: repeat(3, 1fr); }
  html[data-size="xl"] .issue-grid, html[data-size="xl"] .kindle-grid { grid-template-columns: repeat(2, 1fr); }
  html[data-size="l"] .book-layout, html[data-size="xl"] .book-layout { grid-template-columns: 1fr; }
  html[data-size="l"] .book-card, html[data-size="xl"] .book-card { grid-template-columns: 1fr; }
  .book-card__cover { max-width: 6rem; }
  .article-actions .tool, .results-tools .tool { white-space: normal; }
  .popover { max-height: 80vh; overflow-y: auto; }
}
.buy-row { flex-wrap: wrap; }
.buy-row > * { min-width: 0; }
.buy-links .btn, .buy-box__actions .btn { white-space: normal; }

