/* AI Comic Page production freshness is verified against the canonical cartoon corpus after deploy. */
:root {
  color-scheme: light;
  --paper: #f4f0e4;
  --ink: #090909;
  --red: #c40000;
  --rule: #161616;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  min-width: 280px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  border-top: 12px solid var(--red);
}

a { color: inherit; }

a:focus-visible {
  outline: 4px solid var(--red);
  outline-offset: 4px;
}

.comic-header,
main,
.comic-footer {
  width: min(100% - 28px, 1680px);
  margin-inline: auto;
}

.comic-header {
  position: relative;
  padding: 14px 0 18px;
  border-bottom: 9px double var(--ink);
  text-align: center;
}

.comic-utility {
  min-height: 18px;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.comic-edition {
  margin: 3px 0 5px;
  font: 900 0.78rem/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.14em;
}

.comic-header h1 {
  margin: 0;
  font: 900 clamp(3rem, 10vw, 10rem)/0.78 Impact, 'Arial Black', sans-serif;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.comic-header h1 span { color: var(--red); }

.comic-header h1 a { color: inherit; text-decoration: none; }
.comic-header h1 a:hover { text-decoration: underline; }

.comic-strapline {
  display: block;
  max-width: 52rem;
  margin: 10px auto 0;
  padding: 0 12px;
  color: var(--ink);
  font: italic 700 clamp(0.95rem, 1.5vw, 1.2rem)/1.2 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.01em;
}

.comic-parent {
  margin: 8px 0 0;
  font: 900 clamp(0.82rem, 1.5vw, 1.05rem)/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.13em;
}

.comic-parent a:hover { color: var(--red); }

.comic-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: start;
  gap: 34px 20px;
  padding: 22px 0 36px;
}

.comic-tile {
  min-width: 0;
  margin: 0;
  padding-top: 8px;
  border-top: 6px solid var(--ink);
}

.comic-tile:nth-child(5n + 2) { margin-top: 34px; }
.comic-tile:nth-child(5n + 4) { margin-top: 16px; }

@media (min-width: 1100px) {
  .comic-tile:first-child { grid-column: span 2; }
}

.comic-image-link,
.comic-image-link img {
  display: block;
  width: 100%;
}

.comic-image-link img {
  height: auto;
  background: #fff;
  border: 2px solid var(--ink);
}

.comic-image-link:hover img { border-color: var(--red); }

.comic-meta {
  padding: 8px 2px 0;
}

.comic-meta h2 {
  margin: 0;
  font: 900 clamp(1.05rem, 1.5vw, 1.55rem)/0.98 Impact, 'Arial Black', sans-serif;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.comic-meta h2 a:hover { color: var(--red); }

.comic-meta p {
  margin: 6px 0 0;
  font: 900 0.78rem/1.2 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Tile dek: the one-line "know the news" context. Clamped so long deks
   never blow up the wall grid; links to the canonical ANP cartoon page. */
.comic-meta .comic-dek {
  font: 400 0.85rem/1.45 Georgia, 'Times New Roman', serif;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.78;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.comic-meta .comic-dek a { color: inherit; text-decoration: none; }
.comic-meta .comic-dek a:hover { color: var(--red); }

.comic-empty {
  grid-column: 1 / -1;
  margin: 8vh 0 14vh;
  text-align: center;
  font: 900 clamp(1.5rem, 4vw, 3rem)/1 Georgia, 'Times New Roman', serif;
}

.comic-footer {
  padding: 16px 0 26px;
  border-top: 9px double var(--ink);
  font: 700 1rem/1.35 Georgia, 'Times New Roman', serif;
}

.comic-signature-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.comic-signature-lockup img {
  display: block;
  width: 84px;
  height: 85px;
  flex: none;
  object-fit: contain;
}

.comic-signature-lockup p {
  margin: 0;
  text-align: left;
}

.comic-signature-lockup a:hover { color: var(--red); }

@media (max-width: 900px) {
  .comic-wall { gap: 26px 14px; }
  .comic-tile:nth-child(n) { margin-top: 0; }
}

@media (max-width: 600px) {
  body { border-top-width: 8px; }

  .comic-header,
  main,
  .comic-footer { width: min(100% - 18px, 1680px); }

  .comic-header { padding-top: 8px; }

  .comic-utility {
    min-height: 16px;
    font-size: 0.68rem;
  }

  .comic-edition {
    margin-top: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .comic-header h1 {
    font-size: clamp(3.35rem, 19vw, 6rem);
    line-height: 0.82;
  }

  .comic-strapline {
    margin-top: 8px;
    font-size: 0.9rem;
  }

  .comic-wall {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 18px;
  }

  .comic-tile,
  .comic-tile:nth-child(n) {
    margin-bottom: 28px;
  }

  .comic-meta h2 { font-size: clamp(1.55rem, 8vw, 2.5rem); }
  .comic-meta p { font-size: 0.76rem; }
  .comic-footer { font-size: 1rem; }
  .comic-signature-lockup { gap: 9px; }
  .comic-signature-lockup img { width: 72px; height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---- Meet the cast ---- */

.cast-crumb {
  padding: 18px 0 0;
  font: 900 0.78rem/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.08em;
}

.cast-crumb a:hover { color: var(--red); }

.cast-profile {
  max-width: 640px;
  margin: 0 auto;
  padding: 26px 0 10px;
  text-align: center;
}

.cast-avatar {
  width: 168px;
  height: 168px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.cast-kind {
  margin: 12px 0 0;
  font: 900 0.72rem/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

.cast-name {
  margin: 6px 0 0;
  font: 900 clamp(2.2rem, 6vw, 4rem)/0.9 Impact, 'Arial Black', sans-serif;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.cast-tagline {
  margin: 8px 0 0;
  font: 900 clamp(1rem, 2.4vw, 1.4rem)/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.06em;
}

.cast-bio {
  margin: 12px auto 0;
  max-width: 34rem;
  font: 400 1rem/1.5 Georgia, 'Times New Roman', serif;
}

.cast-stats {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 6px solid var(--ink);
  font: 900 0.95rem/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.1em;
}

.cast-stats strong {
  font: 900 1.6rem/1 Impact, 'Arial Black', sans-serif;
  color: var(--red);
}

.cast-index { padding: 10px 0 6px; text-align: center; }

.cast-index-title {
  margin: 0;
  font: 900 clamp(2.6rem, 8vw, 6rem)/0.85 Impact, 'Arial Black', sans-serif;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.cast-index-title span { color: var(--red); }

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 28px 18px;
  padding: 26px 0 36px;
  text-align: center;
}

.cast-card {
  margin: 0;
  padding-top: 14px;
  border-top: 6px solid var(--ink);
}

.cast-card-avatar {
  width: 132px;
  height: 132px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.cast-card-link:hover .cast-card-avatar { border-color: var(--red); }

.cast-card-name {
  margin: 10px 0 0;
  font: 900 clamp(1.3rem, 2.4vw, 1.8rem)/1 Impact, 'Arial Black', sans-serif;
  text-transform: uppercase;
}

.cast-card-name a:hover { color: var(--red); }

.cast-card-tagline {
  margin: 6px 0 0;
  font: 900 0.8rem/1.2 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.06em;
}

.cast-card-count {
  margin: 8px 0 0;
  font: 900 0.72rem/1 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.14em;
  color: var(--red);
}

/* ---- Best shelf ---- */
.comic-best { padding: 22px 0 10px; border-bottom: 9px double var(--ink); }
.comic-best-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.comic-best-head h2 { margin: 0; font: 900 clamp(1.6rem, 3.4vw, 2.6rem)/1 Impact, 'Arial Black', sans-serif; letter-spacing: -0.02em; }
.comic-best-dek { margin: 0; font: italic 700 1rem/1.2 Georgia, 'Times New Roman', serif; }
.comic-best-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 300px); gap: 16px; overflow-x: auto; padding: 16px 2px 20px; scroll-snap-type: x mandatory; }
.comic-best-card { position: relative; display: block; scroll-snap-align: start; border: 2px solid var(--ink); background: #fff; text-decoration: none; }
.comic-best-card:hover { border-color: var(--red); }
.comic-best-card img { display: block; width: 100%; height: auto; }
.comic-best-rank { position: absolute; top: 6px; left: 6px; background: var(--red); color: #fff; font: 900 0.9rem/1 Arial, sans-serif; padding: 6px 8px; }
.comic-best-title { display: block; padding: 8px 10px 0; font: 900 1.05rem/1 Impact, 'Arial Black', sans-serif; text-transform: uppercase; }
.comic-best-signal { display: block; padding: 4px 10px 10px; font: 700 0.75rem/1.3 Georgia, 'Times New Roman', serif; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }

/* ---- View toggle (wall | binge). Hidden until comic-binge.js attaches behavior. ---- */
.comic-view-toggle { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px 6px; }
.comic-view-toggle[hidden] { display: none; }
/* The toggle only ever offers the OTHER view — a button for the view you're
   already in is a dead button. */
body[data-comic-view="binge"] [data-comic-view="binge"] { display: none; }
body:not([data-comic-view="binge"]) [data-comic-view="wall"] { display: none; }
/* Binge card carries the full story: receipts inline, no detail page. */
/* Binge is the blatant CTA; the wall toggle is a quiet text link beneath it. */
.comic-binge-cta { font: 900 1.15rem/1 Arial, Helvetica, sans-serif; letter-spacing: 0.05em; text-transform: uppercase; padding: 16px 34px; border: 3px solid var(--ink); background: var(--red); color: #fff; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.comic-binge-cta:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.comic-binge-cta.is-active { background: var(--ink); color: var(--paper); transform: none; box-shadow: 4px 4px 0 var(--ink); }
.comic-wall-link { font: 700 0.8rem/1 Arial, Helvetica, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; background: none; border: 0; padding: 6px; color: var(--ink); opacity: 0.55; cursor: pointer; }
.comic-wall-link:hover { opacity: 1; }
.comic-wall-link.is-active { opacity: 0.35; text-decoration: underline; }

/* Binge and the permanent pages share the same reading hierarchy:
   headline/byline, artwork, context, corrections, full factual receipts.
   Only the navigation mechanism differs. */
.comic-binge { display: none; padding: 4px 0 36px; }
body[data-comic-view="binge"] .comic-binge { display: block; }
body[data-comic-view="binge"] .comic-wall,
body[data-comic-view="binge"] .comic-best,
body[data-comic-view="binge"] .comic-header { display: none; }
.comic-binge-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 14px; }
.comic-binge-count { margin: 0; font: 900 0.85rem/1 Georgia, 'Times New Roman', serif; letter-spacing: 0.12em; }
.comic-binge-nav { font: 900 1rem/1 Arial, sans-serif; letter-spacing: 0.06em; padding: 12px 20px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.comic-binge-nav:hover:not(:disabled) { border-color: var(--red); }
.comic-binge-nav:disabled { opacity: 0.3; cursor: default; }
.comic-binge-page { max-width: 1280px; margin: 0 auto; }
.comic-binge-network { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font: 700 0.77rem/1.4 Arial, sans-serif; text-transform: uppercase; }
.comic-binge-network a { text-decoration: none; }
.comic-binge-network a:hover { color: var(--red); }
.comic-binge-heading { text-align: center; }
.comic-binge-kicker { margin: 0 0 9px; font: 900 0.78rem/1.3 Georgia, 'Times New Roman', serif; letter-spacing: 0.13em; }
.comic-binge-heading h1 { margin: 0; font: 900 clamp(1.7rem, 5vw, 3rem)/1 Impact, 'Arial Black', sans-serif; text-transform: uppercase; }
.comic-binge-heading h1 a { text-decoration: none; }
.comic-binge-heading h1 a:hover { color: var(--red); }
.comic-binge-byline { margin: 9px 0 17px; font: 700 0.85rem/1.3 Georgia, 'Times New Roman', serif; }
.comic-binge-new, .comic-new-return { font: 900 0.78rem/1.3 Georgia, 'Times New Roman', serif; letter-spacing: 0.04em; }
.comic-binge-new { margin: -9px auto 14px; text-align: center; }
.comic-new-return { margin: 0; }
/* The adjacent cartoons are full-height images behind narrow clipped windows.
   The previous one's RIGHT edge and the next one's LEFT edge remain visible.
   No thumbnails, overlays, or invented teaser art. */
.comic-binge-peek {
  display: grid;
  grid-template-columns: 12% minmax(0, 76%) 12%;
  align-items: stretch;
  width: 100%;
  margin: 0 auto;
}
.comic-binge-figure { grid-column: 2; grid-row: 1; margin: 0; min-width: 0; }
/* Explicit tracks keep the center in column 2 at the ends of the archive. */
.comic-binge-peek-prev { grid-column: 1; grid-row: 1; }
.comic-binge-peek-next { grid-column: 3; grid-row: 1; }
.comic-binge-link, .comic-binge-link img { display: block; width: 100%; }
.comic-binge-link img { height: auto; background: #fff; border: 3px solid var(--ink); }
.comic-binge-peek-side {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.comic-binge-peek-side[hidden] { display: none; }
.comic-binge-peek-side img {
  position: absolute;
  top: 0;
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  border-block: 3px solid var(--ink);
  background: #fff;
}
.comic-binge-peek-prev img { right: 0; border-right: 3px solid var(--ink); }
.comic-binge-peek-next img { left: 0; border-left: 3px solid var(--ink); }
.comic-binge-peek-side:hover { filter: brightness(0.94); }
.comic-binge-peek[data-motion="next"] .comic-binge-figure { animation: comic-arrive-next 220ms ease-out; }
.comic-binge-peek[data-motion="prev"] .comic-binge-figure { animation: comic-arrive-prev 220ms ease-out; }
@keyframes comic-arrive-next {
  from { transform: translateX(18px); opacity: 0.75; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes comic-arrive-prev {
  from { transform: translateX(-18px); opacity: 0.75; }
  to { transform: translateX(0); opacity: 1; }
}
.comic-binge-surprise {
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 8px;
  font: 900 0.81rem/1 Arial, sans-serif;
  cursor: pointer;
}
.comic-binge-surprise:hover { text-decoration: underline; }
.comic-binge-peek-side:focus-visible { outline-offset: -4px; }
@media (prefers-reduced-motion: reduce) {
  .comic-binge-peek[data-motion] .comic-binge-figure { animation: none; }
}
.comic-binge-caption { margin: 10px auto 0; max-width: 48rem; font: 400 1rem/1.5 Georgia, 'Times New Roman', serif; text-align: center; }
.comic-binge-correction { max-width: 900px; margin-inline: auto; padding: 12px; border-left: 4px solid var(--red); background: #fff; font: 400 0.95rem/1.5 Georgia, 'Times New Roman', serif; }
.comic-binge-sources { max-width: 900px; margin: 24px auto 0; padding-top: 16px; border-top: 3px double var(--ink); }
.comic-binge-sources h2 { margin: 0 0 10px; font: 900 1.15rem/1.2 Georgia, 'Times New Roman', serif; }
.comic-binge-sources ul { margin: 0; padding-left: 22px; font: 400 0.95rem/1.5 Georgia, 'Times New Roman', serif; }
.comic-binge-sources li + li { margin-top: 6px; }
.comic-binge-sources a { font-weight: 700; }
.comic-binge-field-guide { max-width: 900px; margin: 22px auto 0; padding-top: 15px; border-top: 1px solid var(--ink); }
.comic-binge-field-guide p { margin: 0 0 6px; font: 900 0.75rem/1.2 Georgia, 'Times New Roman', serif; letter-spacing: 0.12em; }
.comic-binge-field-guide a { font: 700 1rem/1.5 Georgia, 'Times New Roman', serif; }
.comic-binge [hidden] { display: none !important; }
@media (max-width: 520px) {
  .comic-binge-peek { grid-template-columns: 10% minmax(0, 80%) 10%; }
  .comic-binge-bar { gap: 6px; flex-wrap: wrap; }
  .comic-binge-surprise { order: 4; flex-basis: 100%; text-align: center; }
  .comic-binge-nav { padding: 10px 12px; font-size: 0.85rem; }
  .comic-binge-count { letter-spacing: 0; }
  .comic-binge-caption { text-align: left; }
}
/* ---- Newsletter capture (same official Substack embed as AI News Page).
   Exception to the thin-surface rule, approved 2026-10-02: the comic page is
   the highest-traffic surface and had zero capture. Same list, same embed. ---- */
.newsletter-signup {
  margin: 22px auto;
  padding: 16px 14px 14px;
  max-inline-size: 640px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  text-align: center;
}
.newsletter-heading {
  margin: 0 0 6px;
  font: 900 clamp(1.25rem, 4vw, 1.7rem)/0.95 Impact, 'Arial Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.newsletter-heading::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin: 8px auto 0;
  background: var(--red);
}
.newsletter-dek {
  margin: 0 0 10px;
  font: italic 700 0.92rem/1.35 Georgia, 'Times New Roman', serif;
}
.newsletter-embed {
  margin: 0 auto 6px;
  max-inline-size: 480px;
}
.newsletter-embed iframe {
  width: 100%;
  border: 0;
}
.newsletter-fineprint {
  margin: 0;
  font: 700 0.72rem/1.4 Georgia, 'Times New Roman', serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
}
body[data-comic-view="binge"] .newsletter-signup { display: none; }
