/* Reader redesign: flat editorial surfaces, one green accent, sharp media.
   Kept separate from the editorial workspace's component styles.
   Layering remains in styles.css: header 10, menus 30, native dialogs above. */
:root {
  --bg: #f8f9f6;
  --paper: #f8f9f6;
  --paper-soft: #f0f3ee;
  --ink: #18251e;
  --muted: #59675e;
  --line: #d5ddd6;
  --line-strong: #b4c1b7;
  --green: #00634a;
  --green-strong: #004c38;
  --green-soft: #e5eee8;
  --brand: #0b382b;
  --body-copy: #35463c;
  --lead-copy: #35463c;
  --topbar-bg: #f8f9f6;
  --sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --reader-width: 1280px;
  --reader-gutter: clamp(20px, 4.4vw, 64px);
}

[data-theme="dark"] {
  --bg: #111a15;
  --paper: #111a15;
  --paper-soft: #19251e;
  --ink: #e8eee8;
  --muted: #a5b4a8;
  --line: #324239;
  --line-strong: #506458;
  --green: #81d5ad;
  --green-strong: #a1e4c3;
  --green-soft: #213b2d;
  --brand: #e0f3e6;
  --body-copy: #c6d2c8;
  --lead-copy: #c6d2c8;
  --topbar-bg: #111a15;
}

body .shell .topbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand nav actions";
  gap: 24px;
  min-height: 80px;
  padding: 12px max(var(--reader-gutter), calc((100vw - var(--reader-width)) / 2));
  border-bottom-color: var(--line-strong);
  backdrop-filter: none;
}

.topbar .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  font-size: 34px;
  letter-spacing: -1.4px;
}
.brand-name { line-height: 1; }
.topbar .brand-tagline { font-family: var(--sans); color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.4; letter-spacing: .02em; white-space: nowrap; }
.topbar .nav-link { text-decoration: none; }
.footer > a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); font-size: 13px; text-decoration: none; }
.footer > a:hover { color: var(--green-strong); text-decoration: underline; }
.no-js-note { max-width: 720px; margin: 20px auto; padding: 0 20px; color: var(--muted); font-size: 13px; }

.topbar .nav {
  gap: 16px;
  justify-content: center;
}

.topbar .nav-link {
  position: relative;
  border-radius: 0;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

.topbar .nav-link.active,
.topbar .nav-link:hover,
.topbar .nav-link:focus-visible {
  background: transparent;
  color: var(--green-strong);
  box-shadow: inset 0 -2px var(--green);
  transform: none;
}

.topbar .topbar-actions { gap: 8px; }
.topbar .segmented-control { border: 0; background: transparent; padding: 0; }
.topbar .segment { min-width: 28px; min-height: 36px; border-radius: 2px; }
.topbar .segment.active { background: var(--green-soft); color: var(--green-strong); }
.topbar .theme-toggle { border: 0; background: transparent; width: 36px; padding: 0; justify-content: center; }
.topbar .theme-label, .topbar .editor-label { display: none; }
.topbar .search { min-width: 80px; width: 90px; border-bottom-color: var(--line); }
.topbar .search input { width: 100%; font-size: 13px; }
.topbar .search input::placeholder { color: var(--muted); opacity: 1; }
.topbar .editor-menu { min-height: 44px; padding: 0; gap: 6px; }
.topbar .avatar { width: 32px; height: 32px; min-width: 32px; flex-basis: 32px; }
.topbar .editor-shortcut { border-radius: 2px; min-height: 36px; }

body .shell .main-news {
  width: min(100%, calc(var(--reader-width) + 2 * var(--reader-gutter)));
  margin: 0 auto;
  padding: 36px var(--reader-gutter) 60px;
  border: 0;
  background: transparent;
}

body .shell .lead-grid {
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: 40px;
  padding-bottom: 30px;
  border-bottom-color: var(--line-strong);
  align-items: center;
}

.lead-copy { min-width: 0; }
.lead-copy .kicker {
  margin-bottom: 14px;
  font-size: 13px;
  letter-spacing: .04em;
}

body .shell .lead-title {
  max-width: none;
  margin-bottom: 16px;
  font-size: clamp(30px, 3.1vw, 44px);
  line-height: 1.08;
  letter-spacing: -.025em;
  text-wrap: pretty;
}

body .shell .lead-summary {
  margin-bottom: 16px;
  font-size: 17px;
  line-height: 1.6;
}

.lead-copy .meta { gap: 8px 16px; font-size: 12px; }
.lead-copy .meta > span + span { border-left: 1px solid var(--line-strong); padding-left: 16px; }
.lead-copy .lead-actions { gap: 20px; margin-top: 20px; align-items: center; }
.lead-actions .button { min-height: 42px; border-radius: 2px; padding-inline: 18px; font-size: 14px; white-space: nowrap; }
.lead-actions .secondary { padding-inline: 0; border-color: transparent; background: transparent; color: var(--green-strong); }

body .shell .image-link,
body .shell .lead-grid figure .image-link,
body .shell .lead-photo,
body .shell .article-photo {
  border-radius: 0;
  box-shadow: none;
}

body .shell .lead-photo { aspect-ratio: 16 / 10; }
body .shell .article-photo { aspect-ratio: 16 / 9; }

/* Explanatory visuals must retain their labels/arrows, not be photo-cropped. */
body .shell img.image-contained {
  object-fit: contain;
  background: #f4f4f0;
}
.main-news .photo-credit { margin-top: 7px; font-size: 11px; line-height: 1.4; }

body .shell .content-grid {
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  padding-top: 26px;
}

.main-news .section-head {
  margin-bottom: 20px;
  padding: 0 0 12px;
  border-top: 0;
  border-bottom: 1px solid var(--line-strong);
  align-items: baseline;
}

.main-news .section-head h2,
.main-news .section-head h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.025em;
  text-transform: none;
  line-height: 1.2;
}

body .shell .article-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 28px;
  border-bottom: 0;
}

body .shell .article-row,
body .shell .article-row-major {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 24px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}

.article-copy { display: flex; flex: 1; flex-direction: column; }
.story-category {
  display: block;
  margin-bottom: 8px;
  color: var(--green-strong);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 750;
  letter-spacing: .045em;
  text-transform: uppercase;
}

body .shell .article-row h3 {
  font-size: clamp(23px, 1.85vw, 27px);
  line-height: 1.16;
  letter-spacing: -.018em;
  text-wrap: pretty;
}

body .shell .article-row p {
  display: block;
  margin: 10px 0 16px;
  font-size: 15px;
  line-height: 1.6;
}

.story-footer { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 4px; }
.story-footer .meta { font-size: 12px; }
.story-footer .article-actions { margin-top: 0; gap: 14px; flex-wrap: nowrap; }
.main-news .link-button { color: var(--green-strong); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.main-news .link-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.read-arrow { display: inline-block; transition: transform 160ms ease; }
.link-button:hover .read-arrow { transform: translateX(3px); }
.older-stories-label { margin: 0; border: 0; padding: 0; font-size: 12px; text-transform: none; letter-spacing: 0; }

body .shell .briefs { display: grid; padding-left: 26px; border-left: 1px solid var(--line); gap: 32px; }
.briefs .section-head h2 { font-size: 25px; }
.briefs .section-head { margin-bottom: 0; }
.briefs .brief { padding: 16px 0; }
.briefs .brief h3 { font-size: 19px; line-height: 1.3; font-weight: 500; }
.briefs .brief time { color: var(--muted); font-size: 12px; font-weight: 400; }
.briefs .brief-category { letter-spacing: 0; text-transform: none; }

body[data-active-filter="latest"] .shell .content-grid { grid-template-columns: 1fr; padding-top: 0; }
body[data-active-filter="latest"] .shell .article-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-active-filter="latest"] .shell .briefs { display: none; }

body .shell .article-page-view { padding: 32px var(--reader-gutter) 64px; }
body .shell .article-page-shell { width: min(100%, 1000px); }
.article-page-nav { margin-bottom: 26px; }
.article-page-nav .link-button { font-size: 13px; font-weight: 600; text-decoration: none; }
.article-page-nav .link-button::before { content: "←"; margin-right: 8px; }
.article-page-header { gap: 16px; border: 0; padding-bottom: 0; }
.article-page-header .eyebrow { margin: 0; letter-spacing: .04em; font-size: 12px; }
body .shell .article-page-header h1 { max-width: 1000px; font-size: clamp(32px, 3.5vw, 50px); line-height: 1.1; letter-spacing: -.025em; text-wrap: pretty; }
body .shell .article-page-header p { max-width: 820px; font-size: 19px; line-height: 1.6; }
.article-page-header .meta { font-size: 12px; }
.article-page-header .meta > strong { display: none; }
.article-page-header .meta > .dot:first-of-type { display: none; }
.article-page-media { margin: 26px 0 34px; }
.article-page-media img { display: block; height: auto; aspect-ratio: 16 / 9; max-height: none; border: 0; background: var(--paper-soft); }
.article-page-media figcaption { font-weight: 400; line-height: 1.5; }
body .shell .article-page-body { max-width: 720px; gap: 22px; }
body .shell .article-page-body p { font-family: var(--serif); font-size: 20px; line-height: 1.75; color: var(--body-copy); }
.article-page-body h2 { font-size: 29px; line-height: 1.2; }
.article-page-sources, .article-page-comments { max-width: 720px; }
.article-page-sources .article-source-card { border: 0; border-radius: 0; padding: 18px 0; background: transparent; }

body .shell .about-view { padding: 42px var(--reader-gutter) 64px; }
.about-copy { width: min(100%, 1000px); margin-inline: auto; }
.about-copy h1 { font-size: clamp(36px, 4vw, 54px); line-height: 1.1; }
.about-copy .principles { gap: 28px; }
.about-copy .principles article { border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; padding: 20px 0; background: transparent; }
.about-copy .principles h2 { font-family: var(--serif); font-size: 25px; }
body .shell .footer { flex-wrap: wrap; min-height: 80px; gap: 12px 28px; padding: 18px max(var(--reader-gutter), calc((100vw - var(--reader-width)) / 2)); }
.footer button { min-height: 40px; font-weight: 500; }

a:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
button:disabled { cursor: not-allowed; }
[data-theme="dark"] .button.primary { color: #10281a; }
[data-theme="dark"] .count { color: #10281a; }

@media (max-width: 1350px) {
  body .shell .topbar { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand actions" "nav nav"; gap: 0 20px; padding-top: 12px; padding-bottom: 0; }
  .topbar .nav { justify-content: flex-start; gap: 28px; }
  .topbar .nav-link { min-height: 44px; font-size: 14px; }
  .topbar .search { width: 160px; }
  body .shell .lead-grid { gap: 28px; }
  body .shell .lead-title { font-size: 36px; }
}

@media (max-width: 1050px) {
  body .shell .content-grid { grid-template-columns: 1fr; }
  body .shell .briefs { display: none; }
  body .shell .lead-grid { gap: 24px; }
  body .shell .lead-title { font-size: 32px; }
  body .shell .lead-summary { font-size: 16px; }
  body[data-active-filter="latest"] .shell .article-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body .shell .topbar { position: static; grid-template-columns: 72px 40px minmax(0, 1fr) 44px; grid-template-areas: "brand brand brand profile" "nav nav nav nav" "lang theme search search"; gap: 8px; padding: 16px 20px 14px; }
  .topbar .brand { font-size: 33px; letter-spacing: -1.3px; }
  .topbar .topbar-actions { display: contents; }
  .topbar .segmented-control { grid-area: lang; height: 40px; }
  .topbar .segment { min-width: 36px; min-height: 40px; }
  .topbar .theme-toggle { grid-area: theme; width: 40px; min-height: 40px; }
  .topbar .search { grid-area: search; flex: none; width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 2px; background: transparent; }
  .topbar .search input { font-size: 14px; }
  .topbar .profile { grid-area: profile; margin-left: 0; }
  .topbar .editor-menu { min-width: 44px; min-height: 44px; }
  .topbar .editor-menu .chevron { display: none; }
  .topbar .editor-shortcut { grid-column: 3; grid-row: 1; justify-self: end; width: 38px; max-width: 38px; padding: 0; }
  .topbar .editor-shortcut #queueJumpLabel { display: none; }
  .topbar .nav { gap: 22px; padding-bottom: 0; }
  .topbar .nav-link { padding: 10px 0; min-height: 44px; font-size: 14px; }
  body .shell .main-news { padding-top: 26px; padding-bottom: 36px; }
  body .shell .lead-grid { grid-template-columns: 1fr; gap: 20px; padding-bottom: 26px; }
  body .shell .lead-grid > figure { order: 0; }
  body .shell .lead-title { margin-bottom: 14px; font-size: 32px; line-height: 1.12; }
  body .shell .lead-summary { margin-bottom: 14px; font-size: 16px; line-height: 1.6; }
  .lead-copy .kicker { margin-bottom: 10px; }
  .lead-copy .lead-actions { margin-top: 14px; }
  body .shell .lead-photo { aspect-ratio: 16 / 9; }
  body .shell .content-grid { padding-top: 26px; gap: 0; }
  .main-news .section-head h2 { font-size: 28px; }
  body .shell .article-list,
  body[data-active-filter="latest"] .shell .article-list { grid-template-columns: 1fr; gap: 26px; }
  body .shell .article-row, body .shell .article-row-major { gap: 14px; padding-bottom: 24px; }
  body .shell .article-row h3 { font-size: 26px; line-height: 1.16; }
  body .shell .article-row p { font-size: 16px; margin-bottom: 12px; }
  body .shell .article-row .photo-credit { display: flex; }
  .story-footer .article-actions .link-button { display: inline-flex; align-items: center; min-height: 44px; }
  .story-footer .meta { margin-top: 0; }
  body .shell .article-page-view { padding-top: 26px; padding-bottom: 44px; }
  body .shell .article-page-header h1 { font-size: 34px; line-height: 1.14; }
  body .shell .article-page-header p { font-size: 17px; }
  .article-page-header { gap: 14px; }
  .article-page-media { margin: 22px 0 28px; }
  body .shell .article-page-body p { font-size: 18px; line-height: 1.75; }
  body .shell .about-view { padding-top: 28px; }
  body .shell .footer { flex-direction: row; align-items: center; gap: 4px 20px; }
  .footer > span:first-child { flex-basis: 100%; padding-bottom: 8px; }
  .footer-right { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .read-arrow { transition: none; }
  .link-button:hover .read-arrow { transform: none; }
}
