/* ============================================================
   HealthspanWire — Biotech Modern Design
   Light theme default with teal/green DNA-inspired palette
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Colour — Light (default) */
  --bg:             #f4f4f5;
  --bg-secondary:   #e9e9eb;
  --surface:        #ffffff;
  --text:           #1a1a1e;
  --muted:          #6b7280;
  --accent:         #0d9488;
  --accent-soft:    rgba(13, 148, 136, 0.1);
  --brand-health:   #0d9488;
  --brand-wire:     #4a7c59;
  --border:         rgba(0, 0, 0, 0.1);
  --card-shadow:    0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12), 0 12px 40px rgba(0, 0, 0, 0.1);
  --gradient-hero:  linear-gradient(135deg, #e8eef4 0%, #edf4f2 30%, #eaf4ee 60%, #f0f4eb 100%);
  --gradient-accent: linear-gradient(135deg, #0d9488, #4a7c59, #0f766e);
  --glass-bg:       rgba(244, 244, 245, 0.9);
  --glass-border:   rgba(0, 0, 0, 0.08);
  --featured-bg:    linear-gradient(135deg, #e8f4f2 0%, #eaf4ee 100%);
  --featured-text:  #1a1a1e;
  --featured-muted: #4b6672;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 8rem;

  /* Layout */
  --site-max-width: 1200px;
  --page-gutter:    1.5rem;
  --content-width:  760px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ── Dark Mode ──────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:             #0c0f14;
  --bg-secondary:   #111520;
  --surface:        #161b27;
  --text:           #e8ecf4;
  --muted:          #7d8aa3;
  --accent:         #4DB6AC;
  --accent-soft:    rgba(77, 182, 172, 0.1);
  --brand-health:   #4DB6AC;
  --brand-wire:     #81C784;
  --border:         rgba(255, 255, 255, 0.06);
  --card-shadow:    0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.3);
  --gradient-hero:  linear-gradient(135deg, #0a0f18 0%, #0d1520 30%, #0a1a1a 60%, #0c1510 100%);
  --gradient-accent: linear-gradient(135deg, #4DB6AC, #66BB6A, #26A69A);
  --glass-bg:       rgba(12, 15, 20, 0.85);
  --glass-border:   rgba(255, 255, 255, 0.06);
  --featured-bg:    linear-gradient(135deg, #111d2b 0%, #0f2420 100%);
  --featured-text:  #e0eaef;
  --featured-muted: #7d9aaa;
}

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

html, body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

p a, li a:not(.site-nav a):not(.footer-links a):not(.topic-pill) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 0.2s ease;
}

p a:hover, li a:not(.site-nav a):not(.footer-links a):not(.topic-pill):hover {
  text-decoration-color: var(--accent);
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  margin: var(--space-6) 0 var(--space-3);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.5rem; margin-top: var(--space-8); }
h3 { font-size: 1.2rem; }

h2 a, h3 a { text-decoration: none; }
h2 a:hover, h3 a:hover { color: var(--muted); }

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

/* ── Layout Container ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.page, .post {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ── Site Header — Glass Morphism ───────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-shell {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo — left aligned */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  text-decoration: none;
}

.logo-image {
  width: 36px;
  height: auto;
  display: block;
}

/* Show light logo by default (light theme), hide dark logo */
.logo-dark { display: none; }

/* In dark mode, swap logos */
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-health { color: var(--brand-health); }
.brand-wire   { color: var(--brand-wire); }

/* ── Navigation — Right Aligned ────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.site-nav a.active {
  color: var(--text);
  font-weight: 600;
}

/* ── Hamburger Toggle ────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: var(--accent-soft);
}

.hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
  border-radius: 1px;
}

.site-nav.is-open .nav-toggle .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-nav.is-open .nav-toggle .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.site-nav.is-open .nav-toggle .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Theme Toggle Button ────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 1rem;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* In light mode (default): show moon icon (click to go dark) */
.theme-icon--moon { display: block; }
.theme-icon--sun { display: none; }

/* In dark mode: show sun icon (click to go light) */
[data-theme="dark"] .theme-icon--sun { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }

/* ── Hero Section ───────────────────────────────────────── */
.hero {
  position: relative;
  padding: var(--space-8) 0 var(--space-6);
  text-align: center;
  overflow: hidden;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: -2;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(77, 182, 172, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(129, 199, 132, 0.06) 0%, transparent 50%);
  animation: heroGlow 15s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3%, 2%) scale(1.05); }
  100% { transform: translate(3%, -2%) scale(1); }
}

.hero-content {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.3;
  margin: 0 0 var(--space-3);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease both;
  padding: 0 0 5px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 var(--space-8);
  font-weight: 400;
  animation: fadeInUp 0.8s ease 0.15s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.06s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.18s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(n+7) { transition-delay: 0.36s; opacity: 1; transform: translateY(0); }

/* ── Topic Filter — Pills ──────────────────────────────── */
.topic-filter-panel {
  margin: var(--space-8) 0 var(--space-6);
}

.topic-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.topic-pill:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-soft);
}

.topic-pill.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Featured Article Card ──────────────────────────────── */
.featured-article {
  position: relative;
  background: var(--featured-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  margin-bottom: var(--space-8);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--border);
}

.featured-article::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(77, 182, 172, 0.12) 0%, transparent 70%);
  animation: featurePulse 8s ease-in-out infinite alternate;
}

.featured-article::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(129, 199, 132, 0.08) 0%, transparent 70%);
  animation: featurePulse 10s ease-in-out 2s infinite alternate;
}

@keyframes featurePulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

.featured-article:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.featured-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-wire);
  margin-bottom: var(--space-4);
}

.featured-badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--brand-wire);
  border-radius: 50%;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.featured-article h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--featured-text);
  margin: 0 0 var(--space-3);
}

.featured-article h2 a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.featured-article h2 a:hover {
  opacity: 0.85;
}

.featured-article .post-meta {
  position: relative;
  z-index: 1;
  color: var(--featured-muted);
}

.featured-article p:last-of-type {
  position: relative;
  z-index: 1;
  color: var(--featured-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ── Article Grid — Floating Wall ──────────────────────── */
.articles-section {
  padding: 0 0 var(--space-12);
}

.articles-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.articles-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}

.post-list {
  margin-top: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-5);
}

/* ── Article Card ───────────────────────────────────────── */
.post-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.post-card h2 {
  margin: 0 0 var(--space-2) 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  flex-grow: 1;
}

.post-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-4);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s ease;
}

.post-card:hover .read-more {
  gap: 8px;
}

/* Legacy post-preview support (topic pages) */
.post-preview {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  margin-bottom: var(--space-4);
}

.post-preview:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.post-preview:first-child {
  padding-top: var(--space-6);
}

.post-preview h2 {
  margin: 0 0 var(--space-2) 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.post-preview h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-preview h2 a:hover {
  color: var(--accent);
}

.post-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.new-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 100px;
  vertical-align: middle;
  margin-left: 0.4em;
  background: var(--accent);
  color: #ffffff;
}

/* ── Autoload (Infinite Scroll) ─────────────────────────── */
.autoload-hidden {
  display: none !important;
}

.autoload-sentinel {
  height: 1px;
}

.autoload-loader {
  display: none;
  text-align: center;
  padding: var(--space-6) 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.autoload-loader.is-active {
  display: block;
}

/* ── Signal Status & Stance Badges ──────────────────────── */
.status-badge,
.stance-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  vertical-align: middle;
}

/* supported / supports */
.status-badge--supported,
.stance-badge--supports {
  background: #d1fae5;
  color: #065f46;
}

/* mixed */
.status-badge--mixed,
.stance-badge--mixed {
  background: #fef3c7;
  color: #92400e;
}

/* emerging / mentions */
.status-badge--emerging,
.stance-badge--mentions {
  background: #e2e8f0;
  color: #334155;
}

/* challenged / contradicts */
.status-badge--challenged,
.stance-badge--contradicts {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Dark mode badge overrides ─────────────────────────── */
[data-theme="dark"] .status-badge--supported,
[data-theme="dark"] .stance-badge--supports {
  background: #14532d;
  color: #86efac;
}

[data-theme="dark"] .status-badge--mixed,
[data-theme="dark"] .stance-badge--mixed {
  background: #422006;
  color: #fde68a;
}

[data-theme="dark"] .status-badge--emerging,
[data-theme="dark"] .stance-badge--mentions {
  background: #1e293b;
  color: #94a3b8;
}

[data-theme="dark"] .status-badge--challenged,
[data-theme="dark"] .stance-badge--contradicts {
  background: #450a0a;
  color: #fca5a5;
}

/* ── Signal Shared ───────────────────────────────────────── */
.signal-tile__category {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}

.signal-tile__count {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Signal Accordion ────────────────────────────────────── */
.signal-accordion-list {
  margin: var(--space-6) 0;
}

.signal-accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.signal-accordion:hover {
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.signal-accordion__summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.signal-accordion__summary::-webkit-details-marker {
  display: none;
}

.signal-accordion__summary::marker {
  display: none;
}

.signal-accordion__summary:hover .signal-accordion__title {
  color: var(--accent);
}

.signal-accordion__title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.signal-accordion__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.signal-accordion__chevron {
  font-size: 1rem;
  color: var(--muted);
  transition: transform 0.25s ease;
  display: inline-block;
  line-height: 1;
}

details[open] .signal-accordion__chevron {
  transform: rotate(180deg);
}

.signal-accordion__body {
  padding: 0 var(--space-5) var(--space-5) calc(var(--space-5) + 0.65rem + var(--space-3));
}

/* ── Signal Cards (shared styles) ───────────────────────── */
.signal-card__empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

.signal-evidence-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
}

.signal-evidence-list li {
  padding: var(--space-2) 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.signal-evidence-list li + li {
  border-top: 1px solid var(--border);
}

.signal-evidence-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .signal-accordion__summary {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
  }

  .signal-accordion__meta {
    width: 100%;
    justify-content: space-between;
  }

  .signal-accordion__body {
    padding-left: var(--space-4);
  }
}

/* ── Scroll-to-top Button ────────────────────────────────── */
.scroll-top-button {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  pointer-events: none;
  z-index: 30;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
}

.scroll-top-button.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-button:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ── Article Pages ───────────────────────────────────────── */
article.post {
  margin-top: var(--space-8);
}

article.post h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-top: 0;
  margin-bottom: var(--space-4);
}

.post-content {
  margin-top: var(--space-6);
  font-size: 1.05rem;
}

.post-author-footer {
  margin-top: var(--space-10);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.author-logo {
  width: 48px;
  height: 48px;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.author-contact-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.author-contact-link:hover {
  text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-12) 0 var(--space-8);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.footer-shell {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  margin-bottom: var(--space-3);
}

.footer-logo-image {
  width: 32px;
  height: auto;
}

.footer-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.footer-nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.2s ease;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.footer-legal-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-4);
}

.footer-legal-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal-links a:hover {
  color: var(--text);
}

/* ── Contact Form ────────────────────────────────────────── */
.contact-form {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-submit {
  align-self: flex-start;
  padding: var(--space-3) var(--space-7);
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Glossary ────────────────────────────────────────────── */
.glossary-term {
  text-decoration: underline dotted color-mix(in srgb, var(--muted) 50%, transparent);
  cursor: help;
  position: relative;
}

.glossary-card {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  width: 240px;
  z-index: 10;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.glossary-term:hover .glossary-card,
.glossary-term:focus .glossary-card {
  display: block;
  animation: fadeInDown 0.15s ease;
}

/* ── Signal Context ──────────────────────────────────────── */
.signal-context {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.signal-context::before {
  content: "Tracking signal: ";
  font-weight: 600;
}

.signal-context a {
  color: var(--accent);
  text-decoration: none;
}

.signal-context a:hover {
  text-decoration: underline;
}

/* ── Related Articles ───────────────────────────────────── */
.related-articles {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.related-articles ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-articles li {
  padding: var(--space-3) 0;
  font-size: 0.92rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
}

.related-articles li + li {
  border-top: 1px solid var(--border);
}

.related-articles li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.related-articles li a:hover {
  color: var(--accent);
}

.related-date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Internal Links (JS-injected) ───────────────────────── */
a.internal-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  transition: border-color 0.2s ease;
}

a.internal-link:hover {
  border-bottom-style: solid;
  border-color: var(--accent);
}

/* ── Mobile Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: var(--space-10) 0 var(--space-8);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-stats {
    gap: var(--space-5);
  }

  .hero-stat-number {
    font-size: 1.5rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .featured-article {
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
    min-height: 220px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-nav-col:first-of-type {
    margin-top: var(--space-2);
  }
}

@media (max-width: 640px) {
  /* Hamburger: visible on mobile */
  .nav-toggle {
    display: flex;
  }

  .header-shell {
    height: 56px;
  }

  .site-nav {
    position: relative;
  }

  .site-nav ul {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    padding: var(--space-2);
    min-width: 200px;
    z-index: 50;
  }

  .site-nav.is-open ul {
    display: flex;
    animation: fadeInDown 0.2s ease;
  }

  .site-nav li {
    width: 100%;
  }

  .site-nav a {
    display: flex;
    padding: var(--space-2) var(--space-3);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
  }

  h1 { font-size: 1.8rem; }
  article.post h1 { font-size: 2rem; }

  .post-author-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .topic-filter-buttons {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
  }
}

/* ── Day Sections (Homepage) ────────────────────────────── */
.day-section {
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.day-section:last-of-type {
  border-bottom: none;
  margin-bottom: var(--space-4);
}

.day-header {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: var(--space-6) 0 var(--space-5);
  padding-left: var(--space-4);
  border-left: 3px solid var(--accent);
}

/* ── View All CTA ──────────────────────────────────────── */
.view-all-cta {
  text-align: center;
  padding: var(--space-8) 0 var(--space-12);
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 36px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 100px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.view-all-link:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ── Topics Page Hero ──────────────────────────────────── */
.topics-hero {
  text-align: center;
  padding: var(--space-8) 0 var(--space-4);
}

.topics-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 var(--space-3);
}

.topics-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
}

/* ── Utility: page-content wrapper ──────────────────────── */
.page-content {
  margin-top: var(--space-4);
}

/* ── Social Share ────────────────────────────────────────── */
.social-share {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.social-share__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  flex-shrink: 0;
  margin-right: var(--space-1);
}

.social-share__icons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.social-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.18s ease, transform 0.15s ease, background 0.18s ease;
  position: relative;
}

.social-share__btn svg {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
}

.social-share__btn:hover,
.social-share__btn:focus-visible {
  transform: translateY(-2px);
  background: var(--accent-soft);
  outline: none;
}

/* Brand hover colours */
.social-share__btn--x:hover,
.social-share__btn--x:focus-visible         { color: var(--text); }
.social-share__btn--linkedin:hover,
.social-share__btn--linkedin:focus-visible  { color: #0a66c2; }
.social-share__btn--facebook:hover,
.social-share__btn--facebook:focus-visible  { color: #1877f2; }
.social-share__btn--reddit:hover,
.social-share__btn--reddit:focus-visible    { color: #ff4500; }
.social-share__btn--whatsapp:hover,
.social-share__btn--whatsapp:focus-visible  { color: #25d366; }
.social-share__btn--email:hover,
.social-share__btn--email:focus-visible     { color: var(--accent); }
.social-share__btn--copy:hover,
.social-share__btn--copy:focus-visible      { color: var(--accent); }

/* Copy: copied state */
.social-share__btn--copy.social-share__btn--copied {
  color: var(--accent);
}

/* Copy: icon swap — show checkmark when copied */
.social-share__icon-check {
  display: none;
}

.social-share__btn--copy.social-share__btn--copied .social-share__icon-link {
  display: none;
}

.social-share__btn--copy.social-share__btn--copied .social-share__icon-check {
  display: block;
}

@media (max-width: 480px) {
  .social-share {
    gap: var(--space-2);
  }
  .social-share__btn {
    width: 34px;
    height: 34px;
  }
  .social-share__btn svg {
    width: 16px;
    height: 16px;
  }
}
