/* TFS News: one shared stylesheet, mobile first.
   Visual system: mockup E (Modern civic). Newsreader headlines, Public Sans text,
   one accent (Capitol blue) and a gold rule under the masthead.
   Light by default. Dark follows the system setting; data-theme="light" or
   data-theme="dark" on <html> forces either scheme. */

/* ---------- Tokens ---------- */

:root {
  --page: #FAF7F0;
  --ink: #1B1D21;
  --ink-2: #4A4840;
  --accent: #1E4D8C;
  --on-accent: #FFFFFF;
  --box: #F1EBDD;
  --rule: #D8D1C2;
  --rule-strong: #1B1D21;
  --gold: #B8892B;

  --band: #15171B;
  --band-ink: #F2EFE8;
  --band-ink-2: #C3BEB4;
  --band-accent: #8FB8F0;
  --band-rule: #3A3E46;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --gutter: 16px;
  --measure: 40rem;
  --tap: 44px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #121417;
    --ink: #ECE8E0;
    --ink-2: #B9B4AA;
    --accent: #8FB8F0;
    --on-accent: #121417;
    --box: #1B1E23;
    --rule: #30343B;
    --rule-strong: #ECE8E0;
    --band: #0B0C0E;
    --band-rule: #30343B;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --page: #121417;
  --ink: #ECE8E0;
  --ink-2: #B9B4AA;
  --accent: #8FB8F0;
  --on-accent: #121417;
  --box: #1B1E23;
  --rule: #30343B;
  --rule-strong: #ECE8E0;
  --band: #0B0C0E;
  --band-rule: #30343B;
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1875rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }

img, video { display: block; max-width: 100%; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--page);
  font-weight: 700;
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* ---------- Masthead ---------- */

.masthead { padding-top: 20px; }

.wordmark {
  padding-bottom: 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 72;
}
.masthead--front .wordmark { font-size: 2.5rem; }
.wordmark a { display: inline-block; color: var(--ink); text-decoration: none; }
.brand-mark { display: inline-block; }

.mast-line {
  display: flex;
  flex-direction: column;
  padding: 8px 0 10px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 3px solid var(--gold);
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.45;
}
.mast-line .tagline { color: var(--ink); font-weight: 600; }
.folio-link { font-weight: 600; }

.site-nav { border-bottom: 1px solid var(--rule); }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -10px;
}
.site-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 10px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  background: var(--accent);
}

/* ---------- Headline ticker ----------
   ticker.css reads its colors and sizes from custom properties on #tfs-ticker.
   This selector outranks it, so the bar takes the E tokens in both schemes. */

html #tfs-ticker {
  --tfs-bg: var(--box);
  --tfs-fg: var(--ink);
  --tfs-muted: var(--ink-2);
  --tfs-source: var(--accent);
  --tfs-border: var(--rule);
  --tfs-sep: var(--ink-2);
  --tfs-focus: var(--accent);
  --tfs-height: 44px;
  --tfs-font-size: 1rem;
  --tfs-small: 0.8125rem;
  --tfs-font: var(--sans);
  color-scheme: inherit;
}

/* ---------- Shared bits ---------- */

.section-label,
.mini-label,
.glance h3,
.sources h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 10px;
}

.label {
  display: inline-block;
  padding: 1px 7px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  font: 700 0.875rem/1.3 var(--sans);
  letter-spacing: 0.02em;
}
.label--news { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.label--commentary { background: transparent; border-color: currentColor; color: inherit; }

.kicker {
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
p.kicker { margin-bottom: 6px; }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.byline {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.35;
}
.byline .sep { padding: 0 4px; }

.byline-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--page);
  font: 700 0.8125rem/1 var(--sans);
  letter-spacing: 0.04em;
}

.hed-link { color: var(--ink); text-decoration-color: var(--accent); }

.src {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.5;
}

.more-link,
.read-more {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin-top: 8px;
  font-weight: 700;
}

/* Voting box: the E "How we reported this" look. */
.vote-box {
  max-width: var(--measure);
  padding: 16px 16px 8px;
  background: var(--box);
  border-left: 4px solid var(--accent);
}
.vote-box h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
}
.vote-box ul {
  margin-top: 8px;
  padding-left: 1.25rem;
  list-style: disc;
}
.vote-box li { margin: 6px 0; font-size: 1.0625rem; line-height: 1.5; }

/* ---------- Front page: lead and top stories ---------- */

.front-top {
  display: grid;
  gap: 40px;
  padding-top: 24px;
  padding-bottom: 48px;
}

.lead-story > .kicker { margin-bottom: 10px; }

.lead-hed {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lead-dek {
  margin-top: 12px;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: 1.25rem;
  line-height: 1.45;
}

.lead-excerpt {
  margin-top: 16px;
  max-width: var(--measure);
}

.glance {
  margin-top: 20px;
  max-width: var(--measure);
  padding-top: 10px;
  border-top: 1px solid var(--rule-strong);
}
.glance dl {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  margin-top: 6px;
}
.glance dt,
.glance dd {
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.glance dt {
  padding-top: 9px;
  padding-right: 12px;
  font-size: 1rem;
  font-weight: 700;
}

.lead .vote-box { margin-top: 28px; }

/* Top stories: the E "Iowa in Brief" box. */
.top-stories {
  align-self: start;
  padding: 20px 16px 8px;
  background: var(--box);
  border-top: 3px solid var(--rule-strong);
}
.top-stories > .section-label {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.15;
  text-transform: none;
  letter-spacing: 0;
}

.stack {
  counter-reset: stack;
  margin-top: 8px;
}
.stack > li {
  counter-increment: stack;
  position: relative;
  padding: 16px 0 16px 44px;
  border-top: 1px solid var(--rule);
}
.stack > li:first-child { border-top: 0; }
.stack > li::before {
  content: counter(stack);
  position: absolute;
  left: 0;
  top: 12px;
  width: 32px;
  color: var(--accent);
  font: 700 2rem/1 var(--serif);
}

.stack-hed {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
}
.stack-dek {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.5;
}

/* ---------- The show band (front page and The Show page) ---------- */

.show {
  padding: 40px 0 32px;
  background: var(--band);
  color: var(--band-ink);
}
.show a { color: var(--band-accent); }
.show :focus-visible { outline-color: var(--band-accent); }
.show .label--commentary { color: var(--band-ink); }

.show-grid {
  display: grid;
  gap: 20px;
}

.show-poster {
  display: block;
  border: 1px solid var(--band-rule);
  background: #000;
}
.show-poster img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.show-h {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
}
.show .show-h a { color: var(--band-ink); text-decoration-color: var(--band-accent); }

.show-line {
  margin-top: 8px;
  max-width: var(--measure);
  color: var(--band-ink-2);
  font-size: 1.25rem;
  line-height: 1.45;
}

.show--page { margin-top: 40px; }

.episodes {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}
.episode { min-width: 0; }
.episode video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--band-rule);
}
.episode figcaption {
  margin-top: 8px;
  color: var(--band-ink-2);
  font-size: 1rem;
}

.show-foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--band-rule);
  color: var(--band-ink-2);
  font-size: 1rem;
  line-height: 1.5;
}
.show-foot a { font-weight: 600; }

/* ---------- Front page: beat rows ---------- */

.beats { padding-top: 16px; }

.strip {
  display: grid;
  gap: 16px;
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--rule);
}

.strip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
}
.strip-head h2 {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.strip-head h2 a { color: inherit; text-decoration: none; }
.strip-head h2 a:hover { text-decoration: underline; }
.strip-more {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: 1rem;
  font-weight: 600;
}

.cards {
  display: grid;
  gap: 28px;
}
.card { min-width: 0; }
.card-hed {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.2;
}
.card-text {
  margin-top: 8px;
  max-width: var(--measure);
}

/* ---------- Article pages ---------- */

.article-page { padding-top: 28px; }
.article { min-width: 0; }

.article-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.article-head > .kicker { margin-bottom: 10px; }

.hed {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.dek {
  margin-top: 12px;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: 1.25rem;
  line-height: 1.45;
}

.article-body {
  max-width: var(--measure);
  line-height: 1.6;
}
.article-body > * + * { margin-top: 1em; }
.article-body > :first-child { margin-top: 24px; }
.article-body h2 {
  margin-top: 1.6em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
}
.article-body h2 + * { margin-top: 0.5em; }
.article-body ul { padding-left: 1.25rem; list-style: disc; }
.article-body li + li { margin-top: 0.5em; }

.sources {
  margin-top: 40px;
  max-width: var(--measure);
  padding-top: 12px;
  border-top: 1px solid var(--rule-strong);
}
.sources ul {
  margin-top: 10px;
  padding-left: 1.25rem;
  list-style: disc;
  font-size: 1rem;
  line-height: 1.5;
}
.sources li { overflow-wrap: anywhere; }
.sources li + li { margin-top: 0.5em; }

/* AI and corrections note: the E "How we reported this" box. */
.disclosure {
  margin-top: 28px;
  max-width: var(--measure);
  padding: 16px;
  background: var(--box);
  border-left: 4px solid var(--accent);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.more-stories {
  align-self: start;
  margin-top: 48px;
  padding: 20px 16px 8px;
  background: var(--box);
  border-top: 3px solid var(--rule-strong);
}
.more-stories > .section-label {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
}
.more-stories ul { margin-top: 8px; }
.more-stories li {
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.more-stories li:first-child { border-top: 0; }
.more-stories .stack-hed { font-size: 1.1875rem; }

/* ---------- Section pages ---------- */

.section-head {
  padding: 28px 0 16px;
  border-bottom: 1px solid var(--rule-strong);
}
.section-head h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.section-head p {
  margin-top: 8px;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: 1.25rem;
  line-height: 1.45;
}

.section-layout {
  display: grid;
  gap: 32px;
}

.story-list > li {
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--rule);
}
.story-list h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.2;
}
.story-list .dek-sm {
  margin-top: 8px;
  max-width: var(--measure);
}
.story-list .byline { margin-top: 10px; }

/* ---------- Text pages (About, Standards, Contact, The Show, 404) ---------- */

.page {
  max-width: var(--measure);
  padding: 28px 0 8px;
  line-height: 1.6;
}
.page > * + * { margin-top: 1em; }
.page > .tags + h1 { margin-top: 0; }
.page h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.page .lede {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 1.25rem;
  line-height: 1.45;
}
.page h2 {
  margin-top: 1.6em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
}
.page h2 + * { margin-top: 0.5em; }
.page ul { padding-left: 1.25rem; list-style: disc; }
.page li + li { margin-top: 0.4em; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 48px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--rule-strong);
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.55;
}
.foot { display: grid; gap: 20px; }
.foot-mark {
  margin-bottom: 10px;
  color: var(--ink);
  font: 700 1.75rem/1 var(--serif);
}
.foot-brand p { max-width: var(--measure); }
.foot-brand p + p { margin-top: 8px; }
.foot-nav ul { display: flex; flex-wrap: wrap; column-gap: 20px; }
.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
}

/* ---------- Wider phones and tablets ---------- */

@media (min-width: 600px) {
  .mast-line { flex-direction: row; flex-wrap: wrap; column-gap: 10px; }
  .mast-line > span + span::before {
    content: "|";
    content: "|" / "";
    margin-right: 10px;
    color: var(--rule);
  }
  .top-stories, .more-stories { padding-inline: 20px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .episodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .episode:first-child { grid-column: 1 / -1; }
}

/* ---------- Desktop ---------- */

@media (min-width: 960px) {
  .masthead { padding-top: 28px; }
  .wordmark { font-size: 2.75rem; }
  .masthead--front .wordmark { font-size: 3.75rem; }

  .front-top {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
    padding-top: 32px;
  }
  .lead { grid-column: span 8; }
  .top-stories { grid-column: span 4; }

  .lead-hed, .hed { font-size: 2.875rem; }
  .card-hed, .story-list h2 { font-size: 1.625rem; }
  .show-h { font-size: 2.5rem; }
  .section-head h1, .page h1 { font-size: 3rem; }
  .article-body h2 { font-size: 1.75rem; }

  .show-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
    align-items: center;
  }
  .show-poster { grid-column: span 7; }
  .show-info { grid-column: span 5; }

  .episodes {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
  }
  .episode:first-child { grid-column: span 8; grid-row: span 2; }
  .episode:not(:first-child) { grid-column: span 4; }

  .strip {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
  }
  .strip-head { display: block; grid-column: span 4; }
  .cards { grid-column: span 8; }

  .article-page {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
    padding-top: 40px;
  }
  .article { grid-column: 1 / span 8; }
  .more-stories { grid-column: span 4; margin-top: 0; }

  .section-layout {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
  }
  .story-list { grid-column: span 8; }
  .section-layout > aside { grid-column: span 4; padding-top: 24px; }

  .foot {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 32px;
  }
  .foot-brand { grid-column: span 8; }
  .foot-nav { grid-column: span 4; }
  .foot-nav ul { flex-direction: column; }
  .foot-copy { grid-column: 1 / -1; }
}

/* ---------- Print (article pages first) ---------- */

@media print {
  :root {
    --page: #ffffff;
    --ink: #000000;
    --ink-2: #222222;
    --accent: #000000;
    --on-accent: #ffffff;
    --box: #ffffff;
    --rule: #999999;
    --rule-strong: #000000;
    --gold: #000000;
    --band: #ffffff;
    --band-ink: #000000;
    --band-ink-2: #222222;
    --band-accent: #000000;
    --band-rule: #999999;
    color-scheme: light;
  }
  @page { margin: 16mm 15mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .skip-link, .site-nav, #tfs-ticker, .folio, .more-stories, .more-link,
  .read-more, .strip-more, .foot-nav, .avatar { display: none !important; }
  .masthead { padding-top: 0; }
  .wordmark { font-size: 18pt; padding-bottom: 4pt; }
  .mast-line { border-bottom-width: 1px; }
  .wrap { max-width: none; padding: 0; }
  .article-page { display: block; padding-top: 10pt; }
  .page { padding: 10pt 0 0; }
  .article-body, .page, .sources, .dek, .disclosure { max-width: none; }
  .hed { font-size: 22pt; }
  .dek { font-size: 13pt; }
  .article-body, .page { font-size: 11pt; line-height: 1.5; }
  .article-body a, .disclosure a { color: #000; text-decoration: underline; }
  .sources a::after { content: " <" attr(href) ">"; font-size: 8.5pt; }
  .disclosure, .vote-box { padding: 6pt 0 0; border-left: 0; border-top: 1px solid #999; }
  .label { border-color: #000; background: #fff; color: #000; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  .sources li, .glance, .vote-box { break-inside: avoid; }
  .show { padding: 10pt 0; }
  .site-footer { margin-top: 18pt; padding: 8pt 0 0; border-top: 1px solid #000; color: #000; font-size: 9pt; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.brand-mark picture, .brand-mark img { display: block; }
.brand-mark img { height: 36px; width: auto; }
@media (min-width: 760px) { .brand-mark img { height: 48px; } }
