:root {
  --sand: #e6d8bf;
  --paper: #f7f1e6;
  --paper-deep: #efe5d3;
  --terracotta: #a7472c;
  --terracotta-dark: #78311f;
  --olive: #596239;
  --olive-light: #a8ab82;
  --ink: #182019;
  --muted: #655f55;
  --line: #918774;
  --white: #fffdf8;
  --max: 1280px;
  --reading: 760px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--sand);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--terracotta-dark); }
button, input { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  border-top: 8px solid var(--terracotta);
  background: var(--sand);
}

.utility-bar,
.masthead,
.main-nav__inner,
.page-shell,
.site-footer__inner {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.utility-bar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.utility-bar p { margin: 0; }

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  padding: 22px 0 18px;
}

.brand {
  display: inline-block;
  width: fit-content;
  color: var(--ink);
  font-size: clamp(38px, 7vw, 92px);
  font-weight: 700;
  line-height: 0.86;
  text-decoration: none;
}

.brand span { color: var(--terracotta); }

.masthead__note {
  max-width: 330px;
  margin: 0;
  padding-left: 18px;
  border-left: 5px solid var(--olive);
  font-size: 13px;
  line-height: 1.45;
}

.main-nav {
  border-block: 1px solid var(--ink);
  background: var(--paper);
}

.main-nav__inner {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.main-nav a[aria-current="page"] { color: var(--terracotta-dark); }

.nav-action,
.menu-button,
.dialog-close {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-action {
  margin-left: auto;
  padding: 9px 0 9px 18px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.menu-button { display: none; }

.page-shell { padding-block: 28px 72px; }

.issue-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.issue-line p { margin: 0; }

.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
  gap: 28px;
  padding: 28px 0 38px;
  border-bottom: 3px solid var(--ink);
}

.lead-story { display: grid; gap: 18px; }

.lead-story__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sand);
}

.lead-story__image img,
.story-row__image img,
.side-story__image img,
.category-story__image img,
.related-story img,
.article-hero img,
.search-hit__image img {
  height: 100%;
  object-fit: cover;
}

.lead-story h1,
.section-heading,
.category-intro h1,
.article-header h1 {
  margin: 0;
  letter-spacing: 0;
  text-wrap: balance;
}

.lead-story h1 {
  max-width: 980px;
  font-size: clamp(34px, 5.2vw, 70px);
  line-height: 0.98;
}

.lead-story h1 a { text-decoration: none; }
.lead-story__summary { max-width: 850px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.55; }

.eyebrow,
.story-meta,
.breadcrumb,
.article-kicker {
  margin: 0;
  color: var(--terracotta-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.story-meta { color: var(--muted); }

.side-stack {
  display: grid;
  align-content: start;
}

.side-stack__label {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 5px solid var(--olive);
  font-size: 12px;
  text-transform: uppercase;
}

.side-story {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.side-story__image { aspect-ratio: 1; overflow: hidden; }
.side-story h2 { margin: 5px 0 9px; font-size: 20px; line-height: 1.15; }
.side-story h2 a { text-decoration: none; }

.section-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 42px 0 12px;
  border-bottom: 1px solid var(--ink);
}

.section-heading { font-size: clamp(27px, 4vw, 44px); line-height: 1; }
.section-bar a { font-size: 12px; font-weight: 700; text-transform: uppercase; }

.story-list { display: grid; }

.story-row {
  display: grid;
  grid-template-columns: 120px minmax(220px, 0.75fr) minmax(260px, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.story-row__number { color: var(--terracotta); font-size: 42px; line-height: 1; }
.story-row__image { aspect-ratio: 16 / 10; overflow: hidden; }
.story-row h3 { margin: 0 0 9px; font-size: 25px; line-height: 1.15; }
.story-row h3 a { text-decoration: none; }
.story-row__copy { margin: 0; font-family: Georgia, "Times New Roman", serif; color: #3f4138; }
.story-row__arrow { color: var(--olive); font-size: 26px; text-decoration: none; }

.topic-band {
  margin-top: 52px;
  padding: 32px 0;
  border-block: 8px solid var(--olive);
  background: var(--sand);
}

.topic-band__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.topic-link {
  min-width: 0;
  padding: 10px 28px;
  border-right: 1px solid var(--line);
  text-decoration: none;
}

.topic-link:first-child { padding-left: 0; }
.topic-link:last-child { padding-right: 0; border-right: 0; }
.topic-link span { display: block; margin-bottom: 10px; color: var(--terracotta-dark); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.topic-link strong { display: block; font-size: 23px; line-height: 1.15; }
.topic-link p { margin: 10px 0 0; font-family: Georgia, "Times New Roman", serif; color: var(--muted); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 24px;
  color: var(--muted);
}

.category-intro {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.45fr);
  gap: 40px;
  align-items: end;
  padding: 30px 0 34px;
  border-bottom: 3px solid var(--ink);
}

.category-intro h1 { max-width: 900px; font-size: clamp(40px, 6vw, 76px); line-height: 0.96; }
.category-intro p { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 19px; }

.category-list { display: grid; }

.category-story {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
  gap: 34px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.category-story__image { aspect-ratio: 16 / 9; overflow: hidden; }
.category-story__body { align-self: center; }
.category-story h2 { margin: 8px 0 14px; font-size: clamp(27px, 3.6vw, 45px); line-height: 1.04; }
.category-story h2 a { text-decoration: none; }
.category-story__body > p:not(.eyebrow):not(.story-meta) { font-family: Georgia, "Times New Roman", serif; font-size: 18px; }

.article-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: end;
  padding: 26px 0 32px;
}

.article-header h1 { margin: 9px 0 20px; font-size: clamp(39px, 6vw, 78px); line-height: 0.96; }
.article-deck { max-width: 900px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 21px; line-height: 1.5; }
.article-facts { padding-left: 18px; border-left: 5px solid var(--olive); }
.article-facts p { margin: 5px 0; font-size: 12px; text-transform: uppercase; }

.article-hero {
  aspect-ratio: 16 / 8;
  margin-bottom: 42px;
  overflow: hidden;
  background: var(--sand);
}

.article-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, var(--reading)) 1fr;
  gap: 34px;
  align-items: start;
}

.article-aside {
  position: sticky;
  top: 20px;
  padding-top: 14px;
  border-top: 5px solid var(--terracotta);
  color: var(--muted);
  font-size: 12px;
}

.article-aside p { margin: 0 0 12px; }
.article-aside a { font-weight: 700; }

.article-body {
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.72;
}

.article-body .lead {
  margin-top: 0;
  color: #30362d;
  font-size: 23px;
  line-height: 1.55;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0;
  text-wrap: balance;
}

.article-body h2 { margin: 2.1em 0 0.65em; font-size: 35px; line-height: 1.08; }
.article-body h3 { margin: 1.7em 0 0.55em; font-size: 24px; line-height: 1.16; color: var(--terracotta-dark); }
.article-body h4 { margin: 1.5em 0 0.5em; font-size: 18px; line-height: 1.25; text-transform: uppercase; }
.article-body p { margin: 0 0 1.15em; }
.article-body li { margin-bottom: 0.45em; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body strong { color: var(--ink); }
.article-body table { width: 100%; margin: 1.5em 0; border-collapse: collapse; font-family: "Courier New", Courier, monospace; font-size: 14px; line-height: 1.4; }
.article-body th, .article-body td { padding: 12px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { background: var(--sand); }

.article-rail { min-width: 0; padding-top: 14px; border-top: 5px solid var(--olive); }
.article-rail h2 { margin: 0 0 14px; font-size: 14px; text-transform: uppercase; }
.related-story { margin-bottom: 24px; }
.related-story img { aspect-ratio: 16 / 10; }
.related-story h3 { margin: 9px 0 4px; font-size: 17px; line-height: 1.2; }
.related-story h3 a { text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 42px 0;
}

.footer-brand { margin: 0 0 12px; font-size: 32px; font-weight: 700; }
.footer-brand span { color: #d77353; }
.site-footer p { max-width: 540px; color: #d6cebf; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; align-content: start; }
.footer-links a { color: var(--paper); font-size: 13px; }

.search-dialog {
  width: min(calc(100% - 32px), 850px);
  max-height: 88vh;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}

.search-dialog::backdrop { background: rgba(24, 32, 25, 0.76); }
.search-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.search-dialog__head h2 { margin: 0; font-size: 22px; }
.dialog-close { width: 42px; height: 42px; border: 1px solid var(--line); font-size: 24px; line-height: 1; }
.search-form { padding: 22px; }
.search-form label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.search-form input { width: 100%; padding: 14px; border: 2px solid var(--ink); border-radius: 0; background: var(--white); color: var(--ink); font-size: 18px; }
.search-results { padding: 0 22px 22px; }
.search-status { margin: 0; padding: 20px 0; color: var(--muted); }
.search-hit { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.search-hit__image { aspect-ratio: 16 / 10; overflow: hidden; }
.search-hit h3 { margin: 5px 0; font-size: 19px; line-height: 1.2; }
.search-hit h3 a { text-decoration: none; }
.search-hit p:last-child { margin: 0; font-family: Georgia, "Times New Roman", serif; color: var(--muted); }

@media (max-width: 980px) {
  .lead-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; gap: 24px; }
  .side-stack__label { grid-column: 1 / -1; margin-bottom: -8px; }
  .story-row { grid-template-columns: 80px minmax(200px, 0.8fr) minmax(240px, 1fr); }
  .story-row__arrow { display: none; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .article-aside { position: static; grid-column: 1 / -1; display: flex; gap: 24px; }
  .article-body { grid-column: 1; grid-row: 2; }
  .article-rail { grid-column: 2; grid-row: 2; }
}

@media (max-width: 760px) {
  .utility-bar,
  .masthead,
  .main-nav__inner,
  .page-shell,
  .site-footer__inner { width: min(calc(100% - 28px), var(--max)); }

  .utility-bar p:last-child { display: none; }
  .masthead { grid-template-columns: 1fr; gap: 14px; }
  .masthead__note { max-width: none; }
  .brand { max-width: 100%; font-size: clamp(36px, 12vw, 54px); }

  .main-nav__inner { position: relative; flex-wrap: wrap; gap: 0; }
  .menu-button { display: block; min-height: 48px; padding: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; }
  .nav-action { min-height: 48px; }
  .main-nav a { display: none; width: 100%; padding: 12px 0; border-top: 1px solid var(--line); }
  .nav-open .main-nav a { display: block; }
  .nav-open .main-nav__inner { padding-bottom: 8px; }

  .page-shell { padding-block: 20px 50px; }
  .issue-line { display: block; }
  .issue-line p + p { margin-top: 4px; }
  .lead-grid { padding-top: 20px; }
  .lead-story h1 { font-size: clamp(28px, 8.8vw, 38px); }
  .lead-story__summary { font-size: 18px; }
  .side-stack { grid-template-columns: 1fr; gap: 0; }
  .side-story { grid-template-columns: 110px 1fr; }

  .section-bar { align-items: start; flex-direction: column; }
  .story-row { grid-template-columns: 52px 1fr; align-items: start; gap: 14px; }
  .story-row__number { font-size: 30px; }
  .story-row__image, .story-row__body { grid-column: 2; }
  .story-row__copy { font-size: 16px; }
  .topic-band__grid { grid-template-columns: 1fr; }
  .topic-link, .topic-link:first-child, .topic-link:last-child { padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .topic-link:last-child { border-bottom: 0; }

  .category-intro { grid-template-columns: 1fr; gap: 18px; }
  .category-intro h1 { font-size: clamp(38px, 12vw, 58px); }
  .category-story { grid-template-columns: 1fr; gap: 18px; }

  .article-header { grid-template-columns: 1fr; gap: 22px; }
  .article-header h1 { font-size: clamp(28px, 8.8vw, 38px); }
  .article-facts { max-width: 400px; }
  .article-hero { aspect-ratio: 4 / 3; margin-inline: -14px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .article-aside { display: block; }
  .article-body, .article-rail { grid-column: 1; grid-row: auto; }
  .article-body { font-size: 18px; line-height: 1.68; }
  .article-body .lead { font-size: 21px; }
  .article-body h2 { font-size: 30px; }
  .article-body table { display: block; max-width: 100%; overflow-x: auto; }
  .article-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .article-rail h2 { grid-column: 1 / -1; }

  .site-footer__inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 520px) {
  .side-story { grid-template-columns: 96px 1fr; }
  .side-story h2 { font-size: 18px; }
  .story-row { grid-template-columns: 38px 1fr; }
  .story-row h3 { font-size: 22px; }
  .article-rail { grid-template-columns: 1fr; }
  .search-hit { grid-template-columns: 96px 1fr; }
  .search-hit p:last-child { display: none; }
  .footer-links { grid-template-columns: 1fr; }
}

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

/* visual-quality-baseline-v1 */
img {
  height: auto;
}

.visual-refresh-feed {
  margin-block: clamp(40px, 6vw, 84px);
}

.visual-refresh-feed > :is(
  ul,
  ol,
  [class*="grid"],
  [class*="list"],
  [class*="run"],
  [class*="feed"],
  [class*="articles"],
  [class*="stories"],
  [class*="cards"]
) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(16px, 2.2vw, 28px) !important;
}

.visual-refresh-feed > :is(
  ul,
  ol,
  [class*="grid"],
  [class*="list"],
  [class*="run"],
  [class*="feed"],
  [class*="articles"],
  [class*="stories"],
  [class*="cards"]
) > * {
  min-width: 0;
}

.visual-refresh-feed img {
  width: 100%;
  height: auto;
  max-height: 260px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

@media (max-width: 720px) {
  .visual-refresh-feed > :is(
    ul,
    ol,
    [class*="grid"],
    [class*="list"],
    [class*="run"],
    [class*="feed"],
    [class*="articles"],
    [class*="stories"],
    [class*="cards"]
  ) {
    grid-template-columns: 1fr !important;
  }
}

/* visual-quality-targeted-v2 */
:is(h1, h2, h3) {
  overflow-wrap: anywhere;
}

.visual-refresh-feed {
  overflow: hidden;
}

.visual-refresh-feed:has(> article) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(18px, 2.4vw, 32px) !important;
  align-items: start;
}

.visual-refresh-feed:has(> article) > :is(
  h1, h2, h3, p, header, .section-heading, .section-head, .heading
) {
  grid-column: 1 / -1;
}

.visual-refresh-feed:has(> article) > article {
  display: block !important;
  grid-column: auto !important;
  min-width: 0;
  min-height: 0 !important;
}

.visual-refresh-feed > .visual-refresh-feed {
  grid-column: 1 / -1 !important;
  width: 100%;
}

.visual-refresh-feed :is(
  .story-grid, .article-grid, .post-grid, .card-grid, .cards,
  [class*="article-list"], [class*="story-list"], [class*="post-list"]
) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(18px, 2.4vw, 32px) !important;
}

.visual-refresh-feed :is(article, li, [class*="card"]) {
  min-width: 0;
}

.visual-refresh-feed img {
  width: 100% !important;
  height: auto !important;
  max-height: 260px !important;
  aspect-ratio: 16 / 10;
  object-fit: cover !important;
}

@media (max-width: 720px) {
  .visual-refresh-feed:has(> article),
  .visual-refresh-feed :is(
    .story-grid, .article-grid, .post-grid, .card-grid, .cards,
    [class*="article-list"], [class*="story-list"], [class*="post-list"]
  ) {
    grid-template-columns: 1fr !important;
  }
}
