
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #222; background: #fafaf7; line-height: 1.55; font-size: 15px;
}
h1, h2, h3, h4 { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; color: #0f2a44; margin-top: 0; }
a { color: #0f2a44; text-decoration: none; }
a:hover { color: #b8860b; text-decoration: underline; }
a:focus-visible { outline: 2px solid #b8860b; outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { position: static; background: #b8860b; color: #fff; padding: 8px 12px; }

.topbar { background: #0f2a44; color: #fff; font-size: 12px; padding: 6px 0; }
.topbar .container { display: flex; justify-content: flex-end; gap: 18px; }
.topbar a { color: #fff; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 500; }
.topbar a:hover { color: #f0d78a; text-decoration: none; }

header.site-header { background: #fff; padding: 12px 0; border-bottom: 1px solid #e5e5e0; }
.header-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo { font-family: "Source Serif 4", Georgia, serif; font-size: 34px; font-weight: 700; color: #0f2a44; letter-spacing: -0.02em; line-height: 1; }
.logo span { color: #b8860b; }
.tagline { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.15em; margin-top: 6px; }
.subscribe-btn { display: inline-block; background: #b8860b; color: #fff !important; padding: 9px 18px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; border-radius: 2px; transition: background 0.15s; }
.subscribe-btn:hover { background: #9c710a; text-decoration: none; }

nav.primary { background: #0f2a44; }
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: 10px 20px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
nav.primary a { color: #fff; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 0; }
nav.primary a:hover { color: #f0d78a; text-decoration: none; }

.ad-slot { background: #ececec; border: 1px dashed #bbb; text-align: center; padding: 14px; margin: 12px 0; color: #999; font-size: 11px; }
.ad-slot .ad-label { display: block; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 4px; font-weight: 600; }
.ad-slot .ad-size { font-family: monospace; }
.ad-leaderboard { min-height: 90px; display: flex; flex-direction: column; justify-content: center; }
.ad-billboard { min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
.ad-rectangle { min-height: 200px; display: flex; flex-direction: column; justify-content: center; }

.hero { padding: 8px 0 4px; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.hero-main-link { color: inherit; }
.hero-main-link:hover { text-decoration: none; }
.hero-main { padding: 0; }
.hero-content { padding: 4px 0; }
.hero-content h1 { font-size: 32px; line-height: 1.2; margin: 8px 0 10px; color: #0f2a44; font-weight: 700; }
.hero-content p { color: #444; font-size: 15px; line-height: 1.55; }
.hero-content .byline { color: #888; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 8px; font-weight: 500; }
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.hero-side a { color: inherit; }
.hero-side a:hover { text-decoration: none; }
.side-story { padding: 12px 0; border-top: 1px solid #e5e5e0; }
.side-story:first-child { border-top: none; padding-top: 0; }
.side-story h3 { font-size: 17px; line-height: 1.3; margin: 6px 0; color: #0f2a44; font-family: "Source Serif 4", Georgia, serif; }
.side-story-meta { color: #888; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; font-weight: 500; }

.category-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #b8860b; padding: 2px 0; }

/* ===== "Today's Featured" header ===== */
.today-featured-header {
  padding: 14px 0 6px;
  border-bottom: 2px solid #0f2a44;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.today-featured-header.against-grain-header {
  border-bottom: 2px solid #8b2635;
  margin-top: 18px;
  justify-content: flex-start;
  gap: 12px;
}
.today-featured-header.against-grain-header h2 {
  display: inline-block;
  background: #8b2635;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  margin: 0;
  line-height: 1.4;
}
.today-featured-header h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  color: #0f2a44;
  font-weight: 600;
  margin: 0;
}
.today-featured-sub {
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* ===== Digest rows (data-driven homepage) ===== */
.digest-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 12px 0 20px;
}
.digest-col { display: flex; flex-direction: column; }
.digest-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  gap: 12px;
  margin: 0;
  border: none;
}
.digest-header h2 {
  font-size: 22px;
  color: #ffffff;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.digest-header h2 a { color: #ffffff; text-decoration: none; }
.digest-header h2 a:hover { color: #f0d78a; }
.digest-header-archive {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #ffffff; font-family: "Inter", sans-serif;
  white-space: nowrap;
  position: relative; z-index: 1;
  padding: 4px 8px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 2px;
  transition: background 0.15s;
}
.digest-header-archive:hover { background: rgba(255,255,255,0.3); color: #ffffff; text-decoration: none; }
.digest-list { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid #e5e5e0; border-top: none; }
.digest-item { padding: 14px 16px; border-bottom: 1px solid #ececec; transition: background 0.1s; }
.digest-item:last-child { border-bottom: none; }
.digest-item:hover { background: #faf8f2; }
.digest-date {
  color: #888; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px; font-family: "Inter", sans-serif;
}
.digest-tag {
  display: inline-block;
  background: #8b2635; color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; margin-right: 6px;
  letter-spacing: 0.06em; border-radius: 2px;
  text-transform: uppercase; vertical-align: 1px;
  font-family: "Inter", sans-serif;
}
.digest-headline {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 15px; line-height: 1.35;
  color: #0f2a44; display: block; margin-bottom: 6px;
  font-weight: 600;
}
.digest-headline:hover { color: #b8860b; text-decoration: none; }
.digest-source {
  font-size: 10px; color: #b8860b;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; font-family: "Inter", sans-serif;
}
.digest-meta, .curation-meta {
  display: flex; align-items: center;
  gap: 8px; margin-top: 4px;
  flex-wrap: wrap;
}
.read-time {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  color: #666; font-family: "Inter", sans-serif;
  padding: 1px 6px; background: #f0efe8;
  border-radius: 2px; letter-spacing: 0.03em;
  white-space: nowrap;
}
html[data-theme="dark"] .read-time { background: #262a33; color: #b8b8b0; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .read-time { background: #262a33; color: #b8b8b0; }
}
.arc-readtime {
  font-family: "Inter", sans-serif; font-size: 12px;
  color: #666; font-weight: 600;
  white-space: nowrap; width: 90px;
}
html[data-theme="dark"] .arc-readtime { color: #b8b8b0; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .arc-readtime { color: #b8b8b0; }
}
@media (max-width: 640px) {
  /* On mobile card layout, hide the readtime cell's implicit label — show only value */
  .archive-table td.arc-readtime { width: auto; font-size: 11px; color: #888; }
  .archive-table td.arc-readtime::before { content: "Read time: "; font-weight: 400; color: #999; }
}

@media (max-width: 900px) {
  .digest-row { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .digest-row { grid-template-columns: 1fr; gap: 20px; }
  .digest-header h2 { font-size: 20px; }
  .digest-headline { font-size: 14px; }
  .today-featured-header h2 { font-size: 18px; }
  .hero-content h1 { font-size: 24px; }
}

/* ===== Category gradients (used for hero-image, topic-image, article-hero-image, digest-header) ===== */
.cat-leadership { background: linear-gradient(135deg, #0f2a44 0%, #1a3a5c 60%, #24547f 100%); position: relative; overflow: hidden; }
.cat-turnarounds { background: linear-gradient(135deg, #4a1810 0%, #6b2818 60%, #8a3820 100%); position: relative; overflow: hidden; }
.cat-ai { background: linear-gradient(135deg, #2d1e40 0%, #4a2f65 60%, #6a4a88 100%); position: relative; overflow: hidden; }
.cat-innovation { background: linear-gradient(135deg, #14453a 0%, #1e6350 60%, #2a7f68 100%); position: relative; overflow: hidden; }
.cat-brand { background: linear-gradient(135deg, #5c1e40 0%, #7a2a55 60%, #9c3a70 100%); position: relative; overflow: hidden; }
.cat-sustainability { background: linear-gradient(135deg, #2c4a1a 0%, #446826 60%, #5f8a32 100%); position: relative; overflow: hidden; }
.cat-leadership::after, .cat-turnarounds::after, .cat-ai::after, .cat-innovation::after, .cat-brand::after, .cat-sustainability::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 8px);
  pointer-events: none;
}

.hero-image { height: 104px; border-radius: 4px; }
.topic-image { height: 56px; border-radius: 4px; }
.article-hero-image { height: 128px; border-radius: 4px; margin: 12px 0 18px; }

/* ===== Topic pages ===== */
.topic-page-header {
  padding: 18px 0; margin: 0 auto 14px;
  max-width: 1160px; text-align: center;
  border-bottom: 2px solid #0f2a44;
}
.topic-page-header h1 {
  font-size: 30px; margin: 0 0 6px; color: #0f2a44;
  font-family: "Source Serif 4", Georgia, serif; font-weight: 700;
}
.topic-page-header .topic-desc {
  font-size: 13px; color: #666;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.article-wrap.topic-page-wrap { max-width: 1240px; }
.curation-list { list-style: none; padding: 0; margin: 0; }
.curation-item {
  padding: 12px 0; border-bottom: 1px solid #e5e5e0;
  padding-left: 0;
}
.curation-item .cur-date {
  font-size: 10px; color: #888; text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 600; margin-bottom: 4px;
}
.curation-item .cur-headline {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 17px; font-weight: 600;
  color: #0f2a44; line-height: 1.35; display: block; margin-bottom: 4px;
}
.curation-item .cur-headline:hover { color: #b8860b; text-decoration: none; }
.curation-item .cur-source { font-size: 11px; color: #b8860b; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.curation-item .cur-summary { font-size: 14px; color: #444; margin-top: 6px; line-height: 1.5; }
.curation-item .cur-tag {
  display: inline-block; background: #8b2635; color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 6px; margin-right: 6px;
  letter-spacing: 0.06em; border-radius: 2px;
  text-transform: uppercase; vertical-align: 1px;
  font-family: "Inter", sans-serif;
}
.topic-archive-link {
  display: inline-block; margin: 14px 0;
  padding: 8px 16px; border: 2px solid #b8860b;
  color: #b8860b; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  border-radius: 2px;
}
.topic-archive-link:hover { background: #b8860b; color: #fff; text-decoration: none; }

/* ===== Topic rows (homepage — legacy) ===== */
.topic-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 14px 0; border-top: 1px solid #e5e5e0; }
.topic-card { background: #fff; border: 1px solid #e5e5e0; padding: 12px; }
.topic-card h3 { font-size: 16px; margin: 6px 0; }
.topic-card p { font-size: 13px; color: #666; }

/* ===== Article page ===== */
.article-wrap { padding: 12px 0 24px; max-width: 1240px; margin: 0 auto; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
@media (max-width: 900px) { .article-grid { grid-template-columns: 1fr; } .sidebar { display: none; } }
.article-body-wrap { min-width: 0; }
.breadcrumb { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #888; margin-bottom: 8px; }
.breadcrumb a { color: #666; }
.article-body-wrap h1 { font-size: 30px; line-height: 1.25; margin: 6px 0 10px; color: #0f2a44; }
.article-deck { font-size: 17px; color: #444; line-height: 1.5; margin: 0 0 8px; font-family: "Source Serif 4", Georgia, serif; }
.article-byline { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; font-weight: 500; }
.prose { font-size: 16px; line-height: 1.65; color: #222; }
.prose p { margin: 0 0 14px; }
.prose h2 { font-size: 22px; margin: 24px 0 10px; color: #0f2a44; }
.prose h3 { font-size: 18px; margin: 20px 0 8px; }
.prose blockquote { border-left: 3px solid #b8860b; padding: 6px 16px; margin: 16px 0; color: #444; font-style: italic; font-family: "Source Serif 4", Georgia, serif; font-size: 17px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-block { background: #fff; border: 1px solid #e5e5e0; padding: 14px; }
.sidebar-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: #b8860b; margin: 0 0 10px; font-family: "Inter", sans-serif; font-weight: 700; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { padding: 4px 0; border-bottom: 1px solid #ececec; }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a { font-size: 13px; }

/* ===== Newsletter band (single-click CTA) ===== */
.newsletter-band { background: #0f2a44; color: #fff; padding: 20px 0; text-align: center; margin: 20px 0; }
.newsletter-band h3 { color: #fff; font-size: 20px; margin: 0 0 8px; }
.newsletter-band p { color: #d0d8e0; font-size: 13px; margin: 0 0 12px; }
.newsletter-band .newsletter-band-desc { font-size: 15px; line-height: 1.5; max-width: 720px; margin-left: auto; margin-right: auto; }
.newsletter-cta { display: inline-block; background: #b8860b; color: #fff !important; padding: 10px 22px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; border-radius: 2px; }
.newsletter-cta:hover { background: #9c710a; text-decoration: none; }
.sidebar-newsletter-cta { display: block; text-align: center; background: #b8860b; color: #fff !important; padding: 10px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; border-radius: 2px; }
.sidebar-newsletter-cta:hover { background: #9c710a; text-decoration: none; }

/* ===== Page nav (back to top / back to home) ===== */
.page-nav-links { padding: 12px 0; text-align: center; }
.page-nav-links a { display: inline-block; margin: 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #b8860b; font-weight: 600; }

/* ===== Footer ===== */
footer { background: #0f2a44; color: #d0d8e0; padding: 24px 0 18px; margin-top: 20px; font-size: 12px; }
footer .container { display: block; }
.footer-brand {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #2a4666;
}
.footer-tagline {
  margin: 6px 0 0;
  opacity: 0.85;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.footer-grid > div { min-width: 0; }
.footer-grid h5 {
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a4666;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid ul li { padding: 3px 0; font-size: 12px; }
.footer-bottom {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #2a4666;
  text-align: center;
  font-size: 11px;
  color: #9aa8b4;
}
footer a { color: #f0d78a; }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}
.ai-credit { font-style: italic; color: #9aa8b4; font-size: 11px; text-align: center; padding: 8px 0 4px; }

/* ===== Dark mode ===== */
/* ===== Dark mode — explicit override via [data-theme="dark"] (falls back to OS pref when no choice) ===== */
html[data-theme="dark"] body { background: #14171c; color: #e5e5e0; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4 { color: #e5c785; }
html[data-theme="dark"] a { color: #e5c785; }
html[data-theme="dark"] .digest-list { background: #1e2128; border-color: #2d323b; }
html[data-theme="dark"] .digest-item { border-bottom-color: #2d323b; }
html[data-theme="dark"] .digest-item:hover { background: #262a33; }
html[data-theme="dark"] .digest-headline { color: #e5c785; }
html[data-theme="dark"] .today-featured-header h2 { color: #e5c785; }
html[data-theme="dark"] .today-featured-header.against-grain-header h2 { color: #ffffff; background: #8b2635; }
html[data-theme="dark"] .sidebar-block { background: #1e2128; border-color: #2d323b; }
html[data-theme="dark"] header.site-header { background: #1e2128; border-bottom-color: #2d323b; }
html[data-theme="dark"] .topic-card { background: #1e2128; border-color: #2d323b; }
html[data-theme="dark"] .digest-item, html[data-theme="dark"] .curation-item { color: #d8d8d0; }
html[data-theme="dark"] .archive-table thead { background: #0a1a2a; }
html[data-theme="dark"] .archive-table td.arc-title { color: #e5c785; }
html[data-theme="dark"] .archive-table td.arc-title a { color: #e5c785; }
html[data-theme="dark"] .archive-table tbody tr:hover { background: #262a33; }
html[data-theme="dark"] .archive-table-wrap { background: #1e2128; border-color: #2d323b; }
html[data-theme="dark"] .archive-toolbar #arc-search { background: #1e2128; color: #e5e5e0; border-color: #2d323b; }
html[data-theme="dark"] .arc-agt-filter { background: #1e2128; color: #e5e5e0; border-color: #2d323b; }
html[data-theme="dark"] .arc-agt-text { color: #e5e5e0; }
html[data-theme="dark"] .digest-headline { color: #f0d78a; }
html[data-theme="dark"] .side-story h3 { color: #e5c785; }
html[data-theme="dark"] .hero-content h1 { color: #e5c785; }
html[data-theme="dark"] .hero-content p { color: #c8c8c0; }
html[data-theme="dark"] .prose { color: #d8d8d0; }
html[data-theme="dark"] .article-body-wrap h1 { color: #e5c785; }
html[data-theme="dark"] .article-deck { color: #c8c8c0; }
html[data-theme="dark"] .side-story { border-top-color: #2d323b; }
html[data-theme="dark"] .curation-item { border-bottom-color: #2d323b; }
html[data-theme="dark"] .curation-item .cur-headline { color: #e5c785; }
html[data-theme="dark"] .curation-item .cur-headline:hover { color: #f0d78a; }
html[data-theme="dark"] .curation-item .cur-summary { color: #c8c8c0; }
html[data-theme="dark"] .today-featured-sub { color: #b8b8b0; }

/* Fallback: also honor OS preference when user hasn't chosen (data-theme="auto") */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] body { background: #14171c; color: #e5e5e0; }
  html[data-theme="auto"] h1, html[data-theme="auto"] h2, html[data-theme="auto"] h3, html[data-theme="auto"] h4 { color: #e5c785; }
  html[data-theme="auto"] a { color: #e5c785; }
  html[data-theme="auto"] .digest-list { background: #1e2128; border-color: #2d323b; }
  html[data-theme="auto"] .digest-item { border-bottom-color: #2d323b; }
  html[data-theme="auto"] .digest-item:hover { background: #262a33; }
  html[data-theme="auto"] .digest-headline { color: #f0d78a; }
  html[data-theme="auto"] .today-featured-header h2 { color: #e5c785; }
  html[data-theme="auto"] .today-featured-header.against-grain-header h2 { color: #ffffff; background: #8b2635; }
  html[data-theme="auto"] .sidebar-block { background: #1e2128; border-color: #2d323b; }
  html[data-theme="auto"] header.site-header { background: #1e2128; border-bottom-color: #2d323b; }
  html[data-theme="auto"] .side-story h3 { color: #e5c785; }
  html[data-theme="auto"] .hero-content h1 { color: #e5c785; }
  html[data-theme="auto"] .hero-content p { color: #c8c8c0; }
  html[data-theme="auto"] .curation-item .cur-headline { color: #e5c785; }
  html[data-theme="auto"] .curation-item .cur-summary { color: #c8c8c0; }
  html[data-theme="auto"] .prose { color: #d8d8d0; }
  html[data-theme="auto"] .article-body-wrap h1 { color: #e5c785; }
  html[data-theme="auto"] .archive-table thead { background: #0a1a2a; }
  html[data-theme="auto"] .archive-table td.arc-title, html[data-theme="auto"] .archive-table td.arc-title a { color: #e5c785; }
  html[data-theme="auto"] .archive-table tbody tr:hover { background: #262a33; }
  html[data-theme="auto"] .archive-table-wrap { background: #1e2128; border-color: #2d323b; }
  html[data-theme="auto"] .archive-toolbar #arc-search { background: #1e2128; color: #e5e5e0; border-color: #2d323b; }
  html[data-theme="auto"] .arc-agt-filter { background: #1e2128; color: #e5e5e0; border-color: #2d323b; }
  html[data-theme="auto"] .arc-agt-text { color: #e5e5e0; }
}

/* ===== Theme toggle button in top bar ===== */
.theme-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,0.3);
  color: #fff; cursor: pointer;
  font-size: 14px; padding: 3px 10px;
  border-radius: 3px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.2;
  min-height: 26px;
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: auto;
}
.theme-toggle:hover { background: rgba(255,255,255,0.15); border-color: #f0d78a; }
.theme-toggle-icon { font-size: 13px; }
.theme-toggle-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
@media (max-width: 640px) {
  .theme-toggle-label { display: none; }
}

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

/* ===== Archive page: compact, centered, high-contrast top banner ===== */
.topic-page-header.archive-header {
  padding: 14px 0;
  margin: 0 auto 8px;
  border-bottom: none;
  text-align: center;
}
.topic-page-header.archive-header .topic-page-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
}
.topic-page-header.archive-header .archive-label {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  line-height: 1;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
  text-align: center;
}
.topic-page-header.archive-header .archive-topic {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 2px;
  position: relative;
  z-index: 1;
  text-align: center;
}
.topic-page-header.archive-header .archive-desc {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #ffffff;
  opacity: 0.98;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  line-height: 1.4;
  max-width: 720px;
  position: relative;
  z-index: 1;
  text-align: center;
}
@media (max-width: 640px) {
  .topic-page-header.archive-header { padding: 12px 0; }
  .topic-page-header.archive-header .archive-label { font-size: 19px; }
  .topic-page-header.archive-header .archive-topic { font-size: 11px; padding: 3px 10px; }
  .topic-page-header.archive-header .archive-desc { font-size: 12px; }
}

/* ===== Archive pages (sortable/filterable table) ===== */
.topic-archive-wrap { padding-top: 8px; }
.archive-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin: 4px 0 14px;
}
.archive-toolbar #arc-search {
  flex: 1 1 260px; min-width: 200px;
  padding: 10px 14px; font-size: 14px;
  border: 1px solid #c8c8c0; border-radius: 3px;
  background: #fff; color: #222;
  font-family: "Inter", sans-serif;
  min-height: 44px;
}
.archive-toolbar #arc-search:focus { outline: 2px solid #b8860b; outline-offset: 1px; border-color: #b8860b; }
.arc-back-link { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: #b8860b; font-weight: 700; }

.arc-agt-filter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: #fff; border: 1px solid #c8c8c0;
  border-radius: 3px; cursor: pointer; user-select: none;
  font-family: "Inter", sans-serif; min-height: 44px;
}
.arc-agt-filter:hover { border-color: #8b2635; }
.arc-agt-filter input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer; margin: 0;
  accent-color: #8b2635;
}
.arc-agt-badge {
  display: inline-block; background: #8b2635; color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  letter-spacing: 0.06em; border-radius: 2px; text-transform: uppercase;
}
.arc-agt-text { font-size: 12px; color: #333; font-weight: 600; }
.arc-agt-count { color: #8b2635; font-weight: 700; }

/* Footer + sidebar archive shortcut link */
.footer-archive-link, .sidebar-list .footer-archive-link {
  font-size: 10px !important;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #b8860b !important; font-weight: 700;
  margin-left: 4px; white-space: nowrap;
  opacity: 0.85; font-family: "Inter", sans-serif;
}
.footer-archive-link:hover { opacity: 1; text-decoration: underline; }
footer .footer-archive-link { color: #f0d78a !important; }
.footer-topic-list li { margin-bottom: 3px; }

.archive-table-wrap { background: #fff; border: 1px solid #e5e5e0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.archive-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.archive-table thead { background: #0f2a44; color: #fff; }
.archive-table th.arc-th {
  text-align: left; padding: 12px 14px;
  font-family: "Inter", sans-serif; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: #fff;
  cursor: pointer; user-select: none;
  border-bottom: 2px solid #b8860b;
  white-space: nowrap;
}
.archive-table th.arc-th:hover { background: #1a3a5c; }
.archive-table th.arc-th[aria-sort="ascending"], .archive-table th.arc-th[aria-sort="descending"] { color: #f0d78a; }
.arc-sort-icon { display: inline-block; margin-left: 6px; font-size: 12px; opacity: 0.7; }
.archive-table tbody tr { border-bottom: 1px solid #ececec; transition: background 0.1s; }
.archive-table tbody tr:hover { background: #faf8f2; }
.archive-table tbody tr:last-child { border-bottom: none; }
.archive-table td { padding: 12px 14px; vertical-align: top; }
.archive-table td.arc-date {
  white-space: nowrap; font-family: "Inter", sans-serif;
  font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.05em;
  width: 130px;
}
.archive-table td.arc-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 15px; line-height: 1.4; color: #0f2a44; font-weight: 600;
}
.archive-table td.arc-title a { color: #0f2a44; }
.archive-table td.arc-title a:hover { color: #b8860b; text-decoration: underline; }
.archive-table td.arc-source {
  font-family: "Inter", sans-serif; font-size: 11px;
  color: #b8860b; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  white-space: nowrap; width: 160px;
}
.arc-tag {
  display: inline-block; background: #8b2635; color: #fff;
  font-size: 8px; font-weight: 700; padding: 1px 5px; margin-right: 6px;
  letter-spacing: 0.06em; border-radius: 2px;
  text-transform: uppercase; vertical-align: 1px;
  font-family: "Inter", sans-serif;
}
.arc-empty { padding: 20px; text-align: center; color: #888; font-style: italic; }
.arc-empty-state {
  padding: 32px 24px; margin: 12px 0; text-align: center;
  background: #f7f6f0; border: 1px dashed #c8c8c0; border-radius: 3px;
  color: #666; font-size: 14px; line-height: 1.5;
}
.arc-empty-state strong { color: #0f2a44; }
html[data-theme="dark"] .arc-empty-state { background: #1e2128; border-color: #2d323b; color: #b8b8b0; }
html[data-theme="dark"] .arc-empty-state strong { color: #e5c785; }
.arc-count {
  margin-top: 12px; font-size: 12px; color: #888;
  text-align: center; font-style: italic;
}
.arc-count span { color: #0f2a44; font-weight: 700; font-style: normal; }

/* ===== Mobile: card layout for archive table ===== */
@media (max-width: 640px) {
  .archive-table-wrap { border: none; background: transparent; overflow: visible; }
  .archive-table thead { display: none; }
  .archive-table, .archive-table tbody, .archive-table tr, .archive-table td { display: block; width: auto; }
  .archive-table tr {
    background: #fff; border: 1px solid #e5e5e0; margin-bottom: 10px;
    padding: 12px 14px;
  }
  .archive-table td { padding: 4px 0; border: none; }
  .archive-table td.arc-date { width: auto; font-size: 11px; color: #888; margin-bottom: 4px; }
  .archive-table td.arc-title { font-size: 16px; line-height: 1.35; margin-bottom: 6px; }
  .archive-table td.arc-source { width: auto; font-size: 11px; }
}

/* ===== Comprehensive mobile optimization ===== */
@media (max-width: 900px) {
  .container { padding: 0 14px; }
  .header-row { flex-wrap: wrap; gap: 10px; }
  .logo { font-size: 28px; }
  .tagline { font-size: 11px; margin-top: 4px; }
  nav.primary .nav-row {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; padding: 10px 14px;
  }
  nav.primary a { white-space: nowrap; padding: 8px 0; }
  .hero-content h1 { font-size: 26px; line-height: 1.22; }
  .side-story h3 { font-size: 15px; }
  .article-body-wrap h1 { font-size: 26px; }
  .prose { font-size: 15px; }
  .prose h2 { font-size: 20px; }
  .topic-page-header h1 { font-size: 24px; }
  .topic-page-header { padding: 14px 0; }
}

@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  .container { padding: 0 12px; }
  /* Header stacks: logo on top, subscribe button below */
  .header-row { flex-direction: column; align-items: flex-start; }
  .subscribe-btn { width: 100%; text-align: center; padding: 12px 18px; min-height: 44px; box-sizing: border-box; }
  .topbar .container { justify-content: center; gap: 14px; }
  .topbar a { font-size: 10px; }
  /* Bigger tap targets on all interactive elements */
  nav.primary a { padding: 12px 0; min-height: 44px; display: flex; align-items: center; }
  .digest-headline { font-size: 15px; padding: 4px 0; }
  .digest-item { padding: 16px 14px; }
  .sidebar-newsletter-cta, .newsletter-cta { padding: 14px 18px; min-height: 44px; display: block; box-sizing: border-box; }
  .topic-archive-link a { display: inline-block; padding: 12px 16px; min-height: 44px; }
  .page-nav-links a { display: inline-block; padding: 12px 14px; margin: 4px; min-height: 44px; }
  /* Hero simpler on small screens */
  .hero { padding: 4px 0; }
  .hero-content h1 { font-size: 22px; margin: 6px 0 8px; }
  .hero-content p { font-size: 14px; }
  /* Topic page header more compact */
  .topic-page-header h1 { font-size: 22px; }
  .topic-page-header p { font-size: 13px; }
  /* Ads smaller footprint */
  .ad-leaderboard, .ad-billboard { min-height: 60px; }
  .ad-slot { padding: 10px; margin: 8px 0; }
  /* Article grid single column already handled */
  .article-wrap { padding: 8px 0 16px; }
  .article-body-wrap h1 { font-size: 22px; }
  .article-deck { font-size: 15px; }
  /* Footer stacks */
  footer .container { flex-direction: column; text-align: center; }
}

@media (max-width: 400px) {
  .logo { font-size: 24px; }
  .digest-header h2 { font-size: 18px; }
  .digest-header { padding: 10px 12px; }
  .digest-header-archive { font-size: 10px; padding: 4px 6px; }
  .today-featured-header h2 { font-size: 16px; }
  .hero-content h1 { font-size: 20px; }
}

/* Better touch behavior on iOS */
@supports (-webkit-touch-callout: none) {
  input, textarea, button { font-size: 16px; }  /* Prevents iOS auto-zoom on focus */
}

/* ===== Print ===== */
@media print {
  .topbar, nav.primary, .ad-slot, .newsletter-band, .subscribe-btn, .page-nav-links, footer, .today-featured-header, .digest-row, .hero-side, .sidebar, .archive-toolbar { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .archive-table thead { background: #fff !important; color: #000 !important; }
  .archive-table th.arc-th { color: #000 !important; }
}

/* ===== Topic page header: light text on the dark category backgrounds (added Sep 28, 2026) ===== */
.topic-page-header:not(.archive-header) .topic-page-header-inner { position: relative; z-index: 1; }
.topic-page-header:not(.archive-header) h1 {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.topic-page-header:not(.archive-header) p,
.topic-page-header:not(.archive-header) .topic-desc {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.topic-page-header:not(.archive-header) .category-tag {
  color: #f5d77a;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* ===== Feature stories: Against the Grain badge on its own line above the headline (added Sep 28, 2026) ===== */
.hero-content .feature-atg, .side-story .feature-atg { display: block; margin: 8px 0 -2px; line-height: 1; }
.hero-content .feature-atg .digest-tag, .side-story .feature-atg .digest-tag { margin: 0; }
