/* THE SHAWN DISPATCH - TECH EDITORIAL & MEDIA STYLESHEET */
/* Inspired by Wired, The Verge, MIT Tech Review, and Rest of World */

:root {
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", "Merriweather", "Noto Serif SC", Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Monaco, Menlo, Consolas, monospace;

  /* Editorial Light (Newspaper Ink on Crisp White/Newsprint) */
  --bg-page: #fbfbfb;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-contrast: #09090b;
  --bg-highlight: #fef08a;

  --text-main: #09090b;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;
  --text-inverse: #f4f4f5;

  --border-strong: #09090b;
  --border-default: #e4e4e7;
  --border-subtle: #f4f4f5;

  /* Tech Editorial Accent Colors */
  --accent-red: #e11d48;       /* Wired / Verge signature highlight */
  --accent-red-hover: #be123c;
  --accent-dark: #18181b;
  --accent-blue: #2563eb;

  --rule-width: 1px;
  --radius-sharp: 0px;
  --radius-subtle: 3px;
  --radius-badge: 2px;

  --header-height: 52px;
  --max-width: 1240px;
  --transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

[data-theme="dark"] {
  --bg-page: #0a0a0c;
  --bg-surface: #121215;
  --bg-subtle: #18181c;
  --bg-contrast: #fafafa;
  --bg-highlight: #854d0e;

  --text-main: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #09090b;

  --border-strong: #fafafa;
  --border-default: #27272a;
  --border-subtle: #18181b;

  --accent-red: #fb7185;
  --accent-red-hover: #f43f5e;
  --accent-dark: #27272a;
  --accent-blue: #60a5fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   1. TICKER BAR & MASTHEAD (经典报纸/媒体报头)
   ========================================================================== */
.ticker-bar {
  background: var(--bg-contrast);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
}

.ticker-content {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

.ticker-tag {
  background: var(--accent-red);
  color: #fff;
  font-weight: 700;
  padding: 1px 6px;
  font-size: 10px;
  flex-shrink: 0;
}

.ticker-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.ticker-link {
  color: var(--text-inverse);
  opacity: 0.8;
  cursor: pointer;
  transition: var(--transition);
}

.ticker-link:hover {
  opacity: 1;
  color: var(--accent-red);
}

/* Masthead Header */
.masthead {
  border-bottom: 2px solid var(--border-strong);
  background: var(--bg-surface);
  position: relative;
}

.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 14px;
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.masthead-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.masthead-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-ctrl {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sharp);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-ctrl:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.masthead-branding {
  text-align: center;
  padding: 8px 0 16px;
}

.brand-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 6px;
  cursor: pointer;
}

.brand-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 780px;
  margin: 0 auto;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Primary Editorial Navigation */
.editorial-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-strong);
  padding: 8px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.editorial-nav::-webkit-scrollbar {
  display: none;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
  white-space: nowrap;
}

.nav-item {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 0;
  position: relative;
  transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
  color: var(--accent-red);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-red);
}

.search-quick-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  padding: 5px 12px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.search-quick-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.kbd-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 1px 4px;
  font-size: 10px;
}

/* ==========================================================================
   2. MAIN NEWSPAPER LAYOUT (FRONT PAGE)
   ========================================================================== */
.editorial-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Section Headline Bar (科技媒体分栏标线) */
.section-rule-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-strong);
  margin-bottom: 20px;
  padding-bottom: 8px;
}

.section-rule-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-rule-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-red);
}

.section-rule-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   3. THE LEAD STORIES (头条封面要闻网格)
   ========================================================================== */
.lead-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 32px;
  margin-bottom: 36px;
}

/* Primary Cover Story (头条大稿) */
.story-lead-primary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-default);
  padding-right: 24px;
  cursor: pointer;
}

.story-lead-primary:hover .story-headline-xl {
  color: var(--accent-red);
}

.story-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.story-kicker .badge-tag {
  background: var(--accent-red);
  color: #fff;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}

.story-headline-xl {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 14px;
  transition: var(--transition);
}

.story-standfirst {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.story-lead-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Secondary Stories (二条/三条) */
.story-lead-secondary {
  border-right: 1px solid var(--border-default);
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.story-lead-secondary:hover .story-headline-md {
  color: var(--accent-red);
}

.story-headline-md {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 10px;
  transition: var(--transition);
}

.story-snippet {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Column 3: The Wire / Top Picks (快讯榜) */
.story-lead-wire {
  display: flex;
  flex-direction: column;
}

.wire-header {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.wire-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
}

.wire-item:last-child {
  border-bottom: none;
}

.wire-item:hover .wire-title {
  color: var(--accent-red);
}

.wire-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.wire-title {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  transition: var(--transition);
}

/* ==========================================================================
   4. TOPIC DISPATCHES: 分栏科技报纸流 (SECTIONS & COLUMNS)
   ========================================================================== */
.topic-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.topic-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 6px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.topic-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.topic-btn.active {
  background: var(--border-strong);
  color: var(--text-inverse);
  border-color: var(--border-strong);
}

.dispatches-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.dispatch-card {
  border-top: 2px solid var(--border-strong);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  background: transparent;
  transition: var(--transition);
}

.dispatch-card:hover .dispatch-title {
  color: var(--accent-red);
}

.dispatch-header {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dispatch-category {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.dispatch-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-red);
  font-weight: 700;
}

.dispatch-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 8px;
  transition: var(--transition);
}

.dispatch-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dispatch-insights-box {
  background: var(--bg-subtle);
  border-left: 2px solid var(--border-strong);
  padding: 6px 10px;
  margin-bottom: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dispatch-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   5. ARTICLE EDITORIAL VIEW (科技特稿深度阅读单页)
   ========================================================================== */
.article-view-container {
  display: none;
}

.article-view-container.active {
  display: block;
}

/* Sticky Action Bar on top of Article */
.article-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.back-to-frontpage {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  font-weight: 700;
  transition: var(--transition);
}

.back-to-frontpage:hover {
  color: var(--accent-red);
}

.article-view-inner {
  max-width: 840px;
  margin: 0 auto;
}

.article-header {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.article-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-red);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.article-title-headline {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 16px;
}

.article-byline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
}

.article-byline strong {
  color: var(--text-main);
}

/* Executive Briefing Summary Card */
.st-executive-lead {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
}

.st-executive-lead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-red);
}

.st-lead-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.st-lead-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.st-lead-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.st-lead-headline {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.st-lead-summary {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 !important;
}

.st-lead-divider {
  display: flex;
  align-items: center;
  margin: 32px 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.st-lead-divider::before,
.st-lead-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border-default);
}

.st-lead-divider span {
  padding: 0 16px;
}

/* Article Editorial Body */
.article-editorial-body {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text-main);
}

.article-editorial-body p {
  margin-bottom: 1.5em;
  text-align: justify;
}

.article-editorial-body img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 1.8em auto;
  border-radius: var(--radius-sharp);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.article-editorial-body section {
  box-sizing: border-box;
}

.article-editorial-body h1,
.article-editorial-body h2,
.article-editorial-body h3,
.article-editorial-body h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.8em;
  color: var(--text-main);
}

.article-editorial-body h2 {
  font-size: 24px;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 6px;
}

.article-editorial-body h3 {
  font-size: 20px;
}

.article-editorial-body blockquote {
  border-left: 3px solid var(--accent-red);
  padding: 12px 20px;
  margin: 1.8em 0;
  background: var(--bg-subtle);
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text-secondary);
  font-style: italic;
}

.article-editorial-body pre {
  background: var(--bg-contrast);
  color: var(--text-inverse);
  padding: 18px 20px;
  border-radius: var(--radius-sharp);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  margin: 1.8em 0;
  position: relative;
}

.article-editorial-body code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: var(--bg-subtle);
  padding: 2px 5px;
  color: var(--accent-red);
}

.article-editorial-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-main);
  border-radius: 2px;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
}

/* Editorial Figures & Infographics (图文混排与大刊架构图) */
.editorial-figure {
  margin: 2.5em 0;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.editorial-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: var(--bg-subtle);
  transition: transform 0.2s ease;
}

.editorial-figcaption {
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-default);
  background: var(--bg-subtle);
  line-height: 1.5;
}

.editorial-figcaption .fig-badge {
  font-weight: 800;
  color: var(--accent-red);
  margin-right: 6px;
  letter-spacing: 0.05em;
}

.editorial-pullquote {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--text-main);
  border-top: 2px solid var(--border-strong);
  border-bottom: 2px solid var(--border-strong);
  padding: 18px 0;
  margin: 2.2em 0;
  text-align: center;
  font-weight: 600;
}

.article-insights-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  padding: 18px 22px;
  margin-bottom: 30px;
}

.article-insights-banner h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 8px;
}

.article-insights-banner ul {
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.article-footer-nav {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid var(--border-strong);
  padding-top: 24px;
  margin-top: 48px;
}

/* ==========================================================================
   6. SEARCH MODAL (PRESS ARCHIVE SEARCH)
   ========================================================================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.search-box {
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  width: 90%;
  max-width: 680px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.search-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-strong);
  padding: 14px 20px;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
}

.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 0;
}

.search-hit {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  transition: var(--transition);
}

.search-hit:hover {
  background: var(--bg-subtle);
}

.search-hit-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.search-hit-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   7. FOOTER (COLOPHON & ARCHIVE)
   ========================================================================== */
.newspaper-footer {
  border-top: 2px solid var(--border-strong);
  background: var(--bg-surface);
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 30px;
  margin-bottom: 24px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  color: var(--text-main);
}

.footer-col p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.colophon-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   8. BULLETPROOF DARK MODE OVERRIDES (SOLVES UNREADABLE / BLACK TEXT)
   ========================================================================== */
[data-theme="dark"] .article-editorial-body,
[data-theme="dark"] .article-editorial-body section,
[data-theme="dark"] .article-editorial-body p,
[data-theme="dark"] .article-editorial-body span,
[data-theme="dark"] .article-editorial-body div,
[data-theme="dark"] .article-editorial-body li,
[data-theme="dark"] .article-editorial-body table,
[data-theme="dark"] .article-editorial-body td,
[data-theme="dark"] .article-editorial-body th {
  color: #e4e4e7 !important;
  background-color: transparent !important;
  border-color: #27272a !important;
}

[data-theme="dark"] .article-editorial-body strong,
[data-theme="dark"] .article-editorial-body b,
[data-theme="dark"] .article-editorial-body h1,
[data-theme="dark"] .article-editorial-body h2,
[data-theme="dark"] .article-editorial-body h3,
[data-theme="dark"] .article-editorial-body h4 {
  color: #fafafa !important;
}

[data-theme="dark"] .article-editorial-body a {
  color: #60a5fa !important;
}

[data-theme="dark"] .article-editorial-body blockquote,
[data-theme="dark"] .article-editorial-body blockquote * {
  background-color: #18181c !important;
  color: #a1a1aa !important;
  border-left-color: #fb7185 !important;
}

[data-theme="dark"] .article-editorial-body pre {
  background-color: #121215 !important;
  color: #f4f4f5 !important;
  border-color: #27272a !important;
}

[data-theme="dark"] .article-editorial-body pre * {
  background-color: transparent !important;
  color: inherit !important;
}

[data-theme="dark"] .article-editorial-body code {
  background-color: #1e1e24 !important;
  color: #fb7185 !important;
}

[data-theme="dark"] .article-editorial-body pre code {
  background-color: transparent !important;
  color: #f4f4f5 !important;
}

[data-theme="dark"] .st-executive-lead {
  background: #141418 !important;
  border-color: #27272a !important;
}

[data-theme="dark"] .st-lead-headline {
  color: #fafafa !important;
}

[data-theme="dark"] .st-lead-summary {
  color: #d4d4d8 !important;
}

[data-theme="dark"] .editorial-figure {
  background: #141418 !important;
  border-color: #27272a !important;
}

[data-theme="dark"] .editorial-figcaption {
  background: #18181c !important;
  color: #a1a1aa !important;
  border-color: #27272a !important;
}

[data-theme="dark"] .editorial-pullquote {
  color: #fafafa !important;
  border-color: #fafafa !important;
}

[data-theme="dark"] .article-insights-banner {
  background: #18181c !important;
  border-color: #27272a !important;
}

[data-theme="dark"] .article-insights-banner * {
  color: #d4d4d8 !important;
}

[data-theme="dark"] .article-insights-banner h4 {
  color: #fb7185 !important;
}

/* ==========================================================================
   9. MOBILE & RESPONSIVE COMPREHENSIVE ENGINE (SOLVES CRAMPING & SIZING)
   ========================================================================== */
@media (max-width: 768px) {
  /* Ticker Bar */
  .ticker-bar {
    padding: 6px 12px;
    font-size: 10px;
  }
  .ticker-content {
    flex: 1;
    min-width: 0;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #tickerBureau,
  .ticker-divider {
    display: none; /* Hide verbose bureau text and divider on small screens */
  }
  .ticker-actions {
    display: none; /* Mobile controls consolidated into masthead-top */
  }

  /* Masthead */
  .masthead-inner {
    padding: 14px 12px 10px;
  }
  .masthead-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }
  .masthead-meta {
    font-size: 10px;
    text-align: center;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 6px;
  }
  .masthead-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
  }
  .masthead-controls .btn-ctrl {
    padding: 6px 2px;
    font-size: 11px;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 32px;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .masthead-controls #githubNavBtn {
    display: none; /* Hide non-essential GitHub link from cramped mobile header; available in footer */
  }

  /* Brand */
  .masthead-branding {
    padding: 6px 0 10px;
  }
  .brand-kicker {
    font-size: 10px;
    letter-spacing: 0.15em;
    margin-bottom: 2px;
  }
  .brand-title {
    font-size: 26px;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 4px;
  }
  .brand-tagline {
    font-size: 12px;
    line-height: 1.5;
    padding: 0 4px;
  }

  /* Editorial Section Nav */
  .editorial-nav {
    padding: 4px 0;
  }
  .nav-links {
    gap: 14px;
    padding: 4px 2px;
  }
  .nav-item {
    font-size: 11px;
    padding: 4px 0;
  }
  .search-quick-btn {
    display: none; /* Search button already in masthead controls */
  }

  /* Main Container */
  .editorial-container {
    padding: 16px 12px 60px;
  }

  /* Lead Stories Grid */
  .lead-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 24px;
  }
  .story-lead-primary, .story-lead-secondary {
    border-right: none;
    border-bottom: 1px solid var(--border-default);
    padding-right: 0;
    padding-bottom: 18px;
  }
  .story-headline-xl {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .story-standfirst {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
  }
  .story-headline-md {
    font-size: 18px;
    line-height: 1.35;
  }
  .story-snippet {
    font-size: 13px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
  }

  /* Dispatches Layout */
  .dispatches-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .dispatch-card {
    padding-top: 10px;
  }
  .dispatch-title {
    font-size: 15.5px;
    line-height: 1.35;
  }
  .dispatch-excerpt {
    font-size: 12.5px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  /* Article View */
  .article-view-inner {
    padding: 0 2px;
  }
  .article-top-bar {
    padding: 8px 0;
    margin-bottom: 18px;
    font-size: 10.5px;
  }
  .article-header {
    padding-bottom: 16px;
    margin-bottom: 20px;
  }
  .article-title-headline {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 12px;
  }
  .article-byline {
    font-size: 10.5px;
    gap: 8px;
    padding-top: 8px;
  }
  .st-executive-lead {
    padding: 16px 14px;
    margin-bottom: 18px;
  }
  .st-lead-headline {
    font-size: 16.5px;
    line-height: 1.3;
  }
  .st-lead-summary {
    font-size: 13.5px;
    line-height: 1.6;
  }
  .article-editorial-body {
    font-size: 15.5px;
    line-height: 1.75;
  }
  .article-editorial-body h2 {
    font-size: 19px;
  }
  .article-editorial-body h3 {
    font-size: 17px;
  }
  .article-footer-nav {
    flex-direction: column;
    gap: 8px;
    padding-top: 18px;
    margin-top: 32px;
  }
  .article-footer-nav .btn-ctrl {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 12px;
  }

  /* Search Modal */
  .search-modal {
    padding-top: 20px;
    align-items: flex-start;
  }
  .search-box {
    width: 95%;
    max-height: 85vh;
  }
  .search-input {
    font-size: 15px;
  }
  .search-hit {
    padding: 10px 14px;
  }
  .search-hit-title {
    font-size: 14px;
  }

  /* Footer */
  .newspaper-footer {
    padding: 28px 14px;
    margin-top: 40px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 20px;
  }
  .colophon-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
