@font-face { font-family: 'Fraunces'; src: url('./fonts/fraunces-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('./fonts/fraunces-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('./fonts/fraunces-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('./fonts/newsreader-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('./fonts/newsreader-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('./fonts/newsreader-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --paper:   #f4efe6;
  --paper-2: #ebe4d6;
  --ink:     #1f1b17;
  --ink-2:   #4a423a;
  --muted:   #8a7f72;
  --rule:    #d6ccbb;
  --ochre:   #9a7621;
  --rust:    #a4482c;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-text:    'Newsreader', 'Iowan Old Style', Georgia, serif;
}

html, body { background: var(--paper); }

main {
  position: relative;   /* containing block for .sr-only, so it can't extend the page past the scroller */
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.kicker {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-no { margin-right: 10px; color: var(--ochre); }

/* ── Issue (index) ─────────────────────────────────────────────────────── */

.issue {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 64px;
}

.masthead {
  padding: clamp(36px, 7vw, 80px) 0 28px;
  border-bottom: 3px double var(--ink);
  text-align: center;
}

.issue-no {
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.mast-title {
  margin: 10px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(56px, 13vw, 168px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.9;
}

.tagline {
  color: var(--ink-2);
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
}

.filters {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 28px;
  padding: 14px 0;
  margin-bottom: 36px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filters a { color: var(--muted); padding: 2px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.filters a:hover { color: var(--ink); }
.filters a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Spread: newspaper columns (up to 3, never narrower than 280px) with
   vertical rules between them; each entry is ruled off underneath. */
.spread {
  columns: 280px 3;
  column-gap: 56px;
  column-rule: 1px solid var(--rule);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  break-inside: avoid;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.card-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.deck    { color: var(--ink-2); }
.excerpt { color: var(--ink-2); font-style: italic; }

.kind-fiction .card-title { font-weight: 400; font-style: italic; }

/* Lead story: big type, two columns on wide screens, closed by a double rule */
.card-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 10px 56px;
  padding: 12px 0 48px;
  margin-bottom: 48px;
  border-bottom: 3px double var(--ink);
}

.card-lead .kicker     { grid-column: 1 / -1; }
.card-lead .card-title { grid-row: span 3; font-size: clamp(44px, 7vw, 96px); line-height: 0.98; }
.card-lead .excerpt    { font-size: 21px; line-height: 1.55; }
.card-lead .excerpt::first-letter {
  float: left;
  margin: 6px 10px 0 0;
  font-family: var(--font-display);
  font-size: 4.2em;
  font-style: normal;
  font-weight: 600;
  line-height: 0.8;
  color: var(--rust);
}

.read-more { color: var(--rust); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.pub-note  { color: var(--muted); font-size: 15px; font-style: italic; }

/* Full-width band: breaks the columns into sections, for big visual pieces */
.card-band {
  column-span: all;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-content: end;
  gap: 10px 40px;
  padding: 40px 0;
  margin: 8px 0 40px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.card-band .art        { grid-row: span 3; aspect-ratio: 16 / 8; }
.card-band .kicker     { align-self: end; }
.card-band .card-title { font-size: clamp(28px, 3.4vw, 40px); }

/* Review cards */
.subject { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink); }
.subject span { color: var(--muted); }
.verdict { color: var(--ink-2); font-family: var(--font-display); font-style: italic; font-size: 19px; }

/* Visual cards */
.art {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.play {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  padding-left: 4px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
}

.empty { color: var(--muted); font-style: italic; text-align: center; column-span: all; }

/* Colophon */
.colophon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 64px;
  margin-top: 80px;
  padding-top: 28px;
  border-top: 3px double var(--ink);
}

.colophon h2 {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.colophon-note { color: var(--ink-2); font-style: italic; margin-bottom: 14px; }

.elsewhere { list-style: none; }
.elsewhere a { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.elsewhere a:hover { color: var(--rust); }
.elsewhere span { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }

.letter, .rss {
  display: inline-block;
  margin-right: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
}

.letter { color: var(--rust); }
.rss    { color: var(--muted); }

/* ── Reading view ──────────────────────────────────────────────────────── */

.piece {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 32px) 80px;
}

.back {
  display: inline-block;
  margin-bottom: clamp(28px, 6vw, 64px);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.back:hover { color: var(--ink); }

.piece-head { margin-bottom: 40px; }

.piece-title {
  margin: 14px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 72px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.kind-fiction .piece-title { font-weight: 400; font-style: italic; }

.piece-deck { color: var(--ink-2); font-size: 22px; font-style: italic; line-height: 1.45; }

.prose p,
.prose li { margin-bottom: 1.2em; font-size: 20px; line-height: 1.7; hyphens: auto; }

.prose > p:first-of-type::first-letter {
  float: left;
  margin: 8px 12px 0 0;
  font-family: var(--font-display);
  font-size: 4.4em;
  font-weight: 600;
  line-height: 0.78;
  color: var(--rust);
}

/* Markdown from the vault: headings, quotes, lists, links, footnotes. */

.prose h2,
.prose h3 {
  margin: 1.8em 0 0.6em;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
}
.prose h2 { font-size: 30px; }
.prose h3 { font-size: 24px; }
.prose h3::first-letter { text-transform: uppercase; }
.prose > h2:first-child,
.prose > h3:first-child { margin-top: 0; }

.prose a { color: var(--rust); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }

.prose ul,
.prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin-bottom: 0.6em; }
.prose li::marker { color: var(--ochre); }

.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--ochre);
  color: var(--ink-2);
  font-style: italic;
}
.prose blockquote p { margin-bottom: 0.4em; }

.prose sup a[data-footnote-ref] {
  padding: 0 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
}

.prose .footnotes {
  margin-top: 3em;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
}
.prose .footnotes p,
.prose .footnotes li { margin-bottom: 0.3em; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.prose .footnotes a { overflow-wrap: anywhere; }
.prose .footnotes a[data-footnote-backref] { text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.subject-card {
  margin: 0 0 40px;
  padding: 20px 24px;
  border-left: 4px solid var(--rust);
  background: var(--paper-2);
}

.subject-name    { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.subject-meta    { color: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.subject-verdict { margin-top: 8px; color: var(--rust); font-family: var(--font-display); font-style: italic; font-size: 20px; }

.figure { margin: 0 0 40px; }
.art-large { aspect-ratio: 16 / 10; }
.figure figcaption { margin-top: 10px; color: var(--muted); font-size: 15px; font-style: italic; }
.play.big { width: 76px; height: 76px; font-size: 24px; cursor: pointer; }
.media-note { position: absolute; bottom: 12px; left: 0; right: 0; color: rgba(255, 255, 255, 0.85); font-size: 13px; text-align: center; font-style: italic; }

.published { color: var(--muted); font-style: italic; }
.published a { border-bottom: 1px solid currentColor; }

.piece-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 56px 0;
  text-align: center;
}

.fleuron { color: var(--rust); font-size: 18px; }

.piece-end a {
  color: var(--rust);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
}

.turn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.turn a { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-display); font-size: 19px; line-height: 1.25; }
.turn a:hover { color: var(--rust); }
.turn span { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.turn-next { text-align: right; align-items: flex-end; }

/* ── Cinematic pieces: dark, letterboxed title card ─────────────────────── */

main.cinematic {
  --ink:   #ece6da;
  --ink-2: #b9b1a3;
  --muted: #7d766b;
  --rule:  #2c2a26;
  --paper-2: #1b1a18;
  --rust:  #d69a5a;
  background: #111;
  color: var(--ink);
}

main.cinematic .piece-head {
  margin: 0 calc(50% - 50vw) 48px;
  padding: clamp(48px, 12vh, 120px) clamp(16px, 4vw, 32px);
  background: #000;
  text-align: center;
  box-shadow: 0 -14px 0 #000, 0 14px 0 #000;
}

main.cinematic .piece-title { font-weight: 400; letter-spacing: 0.02em; text-transform: uppercase; font-size: clamp(30px, 5vw, 56px); }

/* ── Same-page transitions (index ↔ piece) ─────────────────────────────── */

html:active-view-transition-type(page)::view-transition-old(app) { animation: fade-out 0.25s ease both; }
html:active-view-transition-type(page)::view-transition-new(app) { animation: fade-in 0.4s ease 0.1s both; }

::view-transition-group(piece-title) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes fade-out { to   { opacity: 0; } }
@keyframes fade-in  { from { opacity: 0; } }

/* ── Narrow screens ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .card-lead, .card-band { grid-template-columns: 1fr; }
  .card-lead .card-title, .card-band .art { grid-row: auto; }
}

@media (max-width: 600px) {
  .colophon { grid-template-columns: 1fr; }
  .turn { grid-template-columns: 1fr; }
  .turn-next { text-align: left; align-items: flex-start; }
}
