/* ===========================================================================
   style-v3.css — daily deep-agent edition layout (loads after style.css,
   reuses its :root tokens). Covers the #edition grid, article cards, the
   fun-story cards with images, the newsletter band, and the agent visualiser.
   =========================================================================== */

/* ── The edition: a 3-column front page ───────────────────────────────────────
   The Editor's Brief spans the top; AI analysis fills columns 1+2 (headliner
   spans both, then the two subarticles side by side, then the deepened shorts
   stack down); the fun desk is column 3. Collapses to one column on narrow
   screens. The outer grid is 2fr | 1fr — the 2fr AI block is itself split into
   two, so the page reads as three roughly-equal columns. */
.edition {
  max-width: var(--page-width);
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr;          /* AI block (cols 1+2) | fun desk (col 3) */
  grid-template-areas: "brief brief" "ai fun";
  gap: var(--gap);
  align-items: start;
}
.edition-brief { grid-area: brief; }
.edition-ai {
  grid-area: ai;
  display: grid;
  grid-template-columns: 1fr 1fr;          /* the two AI columns */
  gap: var(--gap);
  align-content: start;
}
.edition-fun { grid-area: fun; display: flex; flex-direction: column; gap: var(--gap); }
/* Headliner + the deepened shorts span both AI columns; subarticles take one each. */
.edition-ai .card--lead,
.edition-ai .card--short { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .edition { grid-template-columns: 1fr; grid-template-areas: "brief" "ai" "fun"; }
  .edition-ai { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--ink);
  padding: 1.1rem 1.2rem 1.3rem;
  border-radius: var(--radius);
}
.card--ai   { border-top-color: var(--accent); }   /* AI desk: the one red marker */
.card--fun  { border-top-color: var(--ink); background: var(--white); }
.card--ad   { border-style: dashed; border-color: var(--hairline); background: var(--paper-2); }
.card--lead { border-top-width: 3px; padding: 1.5rem 1.7rem; }

/* ── The Editor's Brief band (full width, top of the page) ─────────────────── */
.editors-brief { border-top: 3px solid var(--accent); padding: 1.5rem 1.7rem; }
.editors-brief .headline { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.brief-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.brief-portrait {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--hairline); flex: none;
}
.brief-byline { font-family: var(--font-ui); font-weight: 800; font-size: .9rem; color: var(--red-dark); }
.editors-brief .body { columns: 2; column-gap: 2rem; }
@media (max-width: 720px) { .editors-brief .body { columns: 1; } }

/* ── About the Editor page (about.html) ────────────────────────────────────── */
.about-page { max-width: 820px; margin: 1.5rem auto; padding: 0 1rem; }
.about-card { border-top: 3px solid var(--accent); padding: 1.6rem 1.8rem; }
.about-portrait {
  float: right; width: 180px; height: 180px; object-fit: cover; border-radius: 50%;
  border: 1px solid var(--hairline); margin: 0 0 1rem 1.5rem;
}
.about-card .headline { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.about-card .body { font-size: 1rem; line-height: 1.6; }
.back-link { color: var(--newsprint); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .about-portrait { float: none; display: block; margin: 0 auto 1rem; width: 140px; height: 140px; }
}

/* ── Kickers / headlines / body ───────────────────────────────────────────── */
.kicker {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: .64rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .6rem;
  color: var(--ink-soft);     /* quiet small-caps label, not a filled pill */
}
.kicker--red  { color: var(--accent); }   /* the day's one red moment per card */
.kicker--gold { color: var(--ink); }

/* QUALITY-CONTROL STAMP — the advisory per-article gate (2026-06-19) flags a fabricated
   or dead-link story rather than dropping it, and it publishes WITH this banner so the
   reader sees the caveat. A quiet red-edged band, not a scare-box. */
.qc-stamp {
  display: block;
  margin: 0 0 .7rem;
  padding: .45rem .6rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.qc-stamp__badge {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: .45rem;
  white-space: nowrap;
}
.qc-stamp__text { font-family: var(--font-ui); font-size: .68rem; line-height: 1.35; color: var(--ink-soft); }

.headline {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 .5rem;
  font-size: 1.3rem;
}
.headline--lead { font-size: clamp(2rem, 4.5vw, 3.3rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.015em; }
.card--short .headline { font-size: 1.08rem; }

.standfirst {
  font-family: var(--font-body);   /* serif italic deck under the sans headline */
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 .7rem;
}
.byline {
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 700;
  color: var(--red-dark);
  margin: 0 0 .5rem;
}
.body { font-family: var(--font-body); font-size: .92rem; line-height: 1.55; color: var(--ink); }
.body p { margin: 0 0 .65rem; }
.card--lead .body { columns: 2; column-gap: 2rem; font-size: .98rem; }
@media (max-width: 720px) { .card--lead .body { columns: 1; } }

.card-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border: var(--border-thin);
  margin-bottom: .6rem;
  background: var(--newsprint-dark);
}
/* The lead photo is a banner — crop tall square images so the text stays visible. */
.card--lead .card-img { max-height: 360px; }
.card--ai:not(.card--lead) .card-img,
.card--fun .card-img { height: 190px; }

/* ── Per-article footer: source link, model note, disclaimer ──────────────── */
.card-meta {
  margin-top: .7rem;
  padding-top: .5rem;
  border-top: 1px dotted var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: baseline;
}
.source-link { font-family: var(--font-ui); font-size: .72rem; font-weight: 700; color: var(--ink-soft); text-decoration: none; }
.source-link:hover { color: var(--accent); text-decoration: underline; }
.model-note { font-family: var(--font-ui); font-size: .68rem; color: var(--ink-soft); opacity: .85; }
.disclaimer {
  flex-basis: 100%;
  font-family: var(--font-ui);
  font-size: .62rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: .2rem 0 0;
  opacity: .8;
}

/* ── Newsletter band (inert v1) ───────────────────────────────────────────── */
.newsletter {
  max-width: var(--page-width);
  margin: 2rem auto;
  padding: 2rem 1rem;
  text-align: center;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.newsletter-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: .01em; margin: 0; }
.newsletter-sub { font-family: var(--font-body); color: var(--ink-soft); margin: .35rem 0 1.1rem; }
.newsletter-form { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.newsletter-input { font-family: var(--font-ui); padding: .55rem .8rem; border: 1px solid var(--hairline); border-radius: var(--radius); min-width: 240px; background: var(--white); color: var(--ink); }
.newsletter-btn { font-family: var(--font-ui); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: .55rem 1.2rem; border: none; border-radius: var(--radius); background: var(--ink); color: var(--paper); cursor: pointer; transition: background .15s ease; }
.newsletter-btn:hover { background: var(--accent); }
.newsletter-msg { font-family: var(--font-ui); font-size: .8rem; color: var(--accent); margin: .7rem 0 0; min-height: 1em; }

/* ── Under the Hood — agent visualiser ────────────────────────────────────── */
/* The drawer is dark (style.css), so force readable dark text on the light chips
   and inline code we add here — otherwise it's light-on-light and unreadable. */
.hood-intro { font-family: var(--font-body); font-size: .95rem; line-height: 1.6; max-width: 72ch; margin: 0 auto 1.1rem; color: var(--paper); }
.hood-intro code { background: rgba(255,255,255,0.14); color: var(--paper); padding: .05em .4em; border-radius: 2px; font-weight: 700; }
.hood-intro strong { color: var(--accent); }
.hood-stats { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.hood-stat { font-family: var(--font-ui); font-size: .78rem; font-weight: 700; background: var(--white); color: var(--ink); border-radius: 999px; padding: .3rem .8rem; }

.hood-trace { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: .4rem; }
/* Rows sit on a white chip inside the DARK drawer, so they MUST carry their own
   dark text colour — otherwise .trace-name and the plan/todo bullets inherit the
   drawer's light --newsprint text and render white-on-white (unreadable). */
.trace-row { display: grid; grid-template-columns: 1.6rem 1fr; gap: .5rem; background: var(--white); color: var(--ink); border: var(--border-thin); border-left: 4px solid var(--ink-soft); padding: .5rem .7rem; border-radius: var(--radius); text-align: left; }
.trace-row--plan       { border-left-color: var(--red); }
.trace-row--subagent   { border-left-color: var(--claude); }
.trace-row--tool       { border-left-color: var(--gemini); }
.trace-row--vfs        { border-left-color: var(--ink-soft); }
.trace-row--structured { border-left-color: #c2a76b; }   /* muted gold */
.trace-row--model      { border-left-color: var(--local); }
.trace-row--fallback   { border-left-color: var(--ink-soft); }
.trace-row--rubric     { border-left-color: #5fa8a0; }   /* the judge's verdict (muted teal) */
.trace-icon { font-size: 1rem; }
.trace-name { font-family: var(--font-ui); font-weight: 800; font-size: .8rem; }
.trace-blurb { display: block; font-family: var(--font-ui); font-size: .68rem; font-style: italic; color: var(--ink-soft); margin: .1rem 0 .25rem; }
.trace-detail { font-family: var(--font-ui); font-size: .74rem; color: var(--ink-soft); word-break: break-word; }
.trace-detail code, .trace-result code { background: var(--newsprint-dark); padding: .03em .3em; border-radius: 2px; }
.trace-result { font-family: var(--font-body); font-size: .72rem; color: var(--ink-soft); margin-top: .25rem; padding-left: .6rem; border-left: 2px solid var(--newsprint-dark); word-break: break-word; }
.trace-todos { margin: .3rem 0 0; padding-left: 1.1rem; font-family: var(--font-body); font-size: .8rem; }
.hood-placeholder { font-family: var(--font-body); font-style: italic; color: var(--ink-soft); text-align: center; }

/* Subtle per-edition version picker in the dateline — only shown (by main.js)
   when the day has more than one published version. Kept low-key on purpose. */
.version-select {
  font-family: var(--font-ui);
  font-size: .72rem;
  margin-left: .5rem;
  padding: .12rem .4rem;
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
}
.version-select:hover { color: var(--ink); border-color: var(--ink); }

/* ════════════════════════════════════════════════════════════════════════════
   AUDIO — per-article "Listen" + the daily dad↔son podcast (accessibility)
   ════════════════════════════════════════════════════════════════════════════ */
/* Subtle per-article listen control; sits in the .card-meta footer beside source. */
.audio-btn {
  font: 700 .72rem/1 var(--font-ui);
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); background: none; border: none; padding: 0;
  cursor: pointer; transition: color .15s ease;
}
.audio-btn:hover { color: var(--accent); }
.audio-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Masthead daily-podcast band (a fourth masthead row, only shown when audio exists). */
.masthead-podcast-bar {
  max-width: 1180px; margin: .4rem auto 0; padding: .6rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  background: var(--paper-2);
}
.podcast-label {
  font: 800 .8rem/1.2 var(--font-ui); text-transform: uppercase;
  letter-spacing: .03em; color: var(--ink);
}
.podcast-audio { height: 34px; flex: 1 1 260px; max-width: 520px; }
.podcast-transcript { flex-basis: 100%; font: 400 .85rem/1.5 var(--font-body); color: var(--ink-soft); }
.podcast-transcript summary { cursor: pointer; font-family: var(--font-ui); font-weight: 700; }
.transcript-text {
  white-space: pre-wrap; margin: .5rem 0 0; max-height: 320px; overflow: auto;
  padding: .6rem .8rem; background: var(--white);
  border: 1px solid var(--hairline); border-radius: var(--radius);
}

/* One shared sticky player drives every per-article reading (only one at a time). */
.sticky-player {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 50;
  display: flex; align-items: center; gap: .7rem;
  max-width: min(680px, 94vw); width: max-content;
  padding: .55rem .7rem; background: var(--ink); color: var(--white);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}
.sticky-player .np-label {
  font: 700 .82rem/1.2 var(--font-ui);
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sticky-player audio { height: 34px; }
.sticky-player .np-close {
  background: none; border: none; color: var(--white);
  font-size: 1rem; cursor: pointer; opacity: .8;
}
.sticky-player .np-close:hover { opacity: 1; }
@media (max-width: 520px) { .sticky-player .np-label { max-width: 30vw; } }

/* ── Multi-lingual: masthead language switcher + translated-page note ──────── */
.lang-switcher { position: relative; display: inline-flex; margin-left: .75rem; }
.lang-switcher .lang-trigger {
  display: inline-flex; align-items: center; gap: .32rem; cursor: pointer;
  background: none; border: 1px solid var(--hairline, #E4E2DC); border-radius: var(--radius, 2px);
  padding: .12rem .42rem; color: var(--ink, #1a1a1a);
  font-family: 'Archivo', Arial, sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .06em;
}
.lang-switcher .lang-trigger:hover { border-color: var(--accent, #B23A36); color: var(--accent, #B23A36); }
.lang-switcher .lang-trigger:focus-visible { outline: 2px solid var(--accent, #B23A36); outline-offset: 1px; }
/* The flag chip: a hairline ring so white-edged flags (Japan, the white stripes) read on the strip. */
.lang-flag {
  width: 21px; height: 14px; display: block; flex: none; object-fit: cover;
  border-radius: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.lang-switcher .lang-code { line-height: 1; color: inherit; }
.lang-switcher .lang-caret { font-size: .58rem; opacity: .55; line-height: 1; color: inherit; transition: transform .15s ease; }
.lang-switcher.is-open .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute; top: calc(100% + 5px); right: 0; z-index: 1000;
  display: flex; flex-direction: column; min-width: 9.5rem; padding: .25rem;
  text-transform: none;                 /* the strip is uppercase; let endonyms keep their case */
  background: var(--paper, #FAFAF8); border: 1px solid var(--hairline, #E4E2DC);
  border-radius: var(--radius, 2px); box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.lang-menu[hidden] { display: none; }
.lang-menu .lang-option {
  display: flex; align-items: center; gap: .5rem; padding: .32rem .45rem;
  text-decoration: none; color: var(--ink, #1a1a1a); border-radius: 1px;
  font-family: 'Archivo', Arial, sans-serif; font-size: .74rem; letter-spacing: .02em;
}
.lang-menu .lang-option:hover,
.lang-menu .lang-option:focus { background: var(--accent-tint, #b23a360f); outline: none; }
.lang-menu .lang-option .lang-code { font-weight: 700; min-width: 1.7rem; }
.lang-menu .lang-option .lang-name { color: var(--ink-soft, #565650); }
.lang-menu .lang-option.is-current,
.lang-menu .lang-option.is-current .lang-name { color: var(--accent, #B23A36); }

.translation-note {
  max-width: 1100px; margin: 1.25rem auto 0; padding: .7rem 1rem;
  border-top: 1px dashed rgba(0,0,0,.18);
  font-family: 'Source Serif 4', Georgia, serif; font-style: italic;
  font-size: .82rem; line-height: 1.5; color: #565650; text-align: center;
}
.translation-note .translation-note-link {
  font-style: normal; font-weight: 600; color: var(--red, #B23A36);
  white-space: nowrap; text-decoration: none;
}
.translation-note .translation-note-link:hover { text-decoration: underline; }
