/* ================================================================
   perfectpaw.css — Perfect Paw Blog Theme
   Neutral dark gray palette — GitHub-style charcoal, soft blue accents
   ================================================================ */

/* ─── CSS Custom Properties ─── */
:root {
  --bg: #0d1117; /* neutral dark gray (GitHub dark) */
  --surface: #161b22; /* slightly lighter surface */
  --surface2: #1c2128; /* hover surface */
  --accent: #5b84ce; /* muted blue — subtle, not electric */
  --accent-hover: #7aa6e0; /* lighter muted blue — hover state */
  --warm: #f59e0b; /* amber — pain callouts */
  --danger: #ef4444; /* red — severe pain */
  --text: #f0f6fc; /* near-white — crisp headings */
  --text-body: #c9d1d9; /* readable body text */
  --muted: #8b949e; /* de-emphasized metadata */
  --border: #30363d; /* neutral gray border */
  --tag-text: #7a9bc2; /* tag chip foreground */
  --card-bg: #161b22;
  --card-hover: #1c2128;
  --code-bg: #1c2128;
  --nav-bg: #010409; /* near-black header/footer */
  --hero-bg: #010409;
  --hero-grad-a: #010409; /* dark neutral */
  --hero-grad-b: #0d1117;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --radius: 8px;
  --radius-lg: 14px;
}

/* ─── Light Mode ─── */
[data-theme="light"] {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface2: #eaedf0;
  --accent: #3b6abf;
  --accent-hover: #2d55a0;
  --warm: #b45309; /* darkened from #d97706 for AA contrast on white */
  --danger: #dc2626;
  --text: #0d1117;
  --text-body: #24292f;
  --muted: #57606a;
  --border: #d0d7de;
  --tag-text: #3d6098; /* darkened from #4a6fa8 for AA contrast */
  --card-bg: #ffffff;
  --card-hover: #f0f3f6;
  --code-bg: #f6f8fa;
  --nav-bg: #ffffff;
  --hero-bg: #e8edf5;
  --hero-grad-a: #dce5f0;
  --hero-grad-b: #f0f4f8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.10);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .hero-shape::after {
  /* Flat light scrim in light mode — no directional gradient needed */
  background: rgba(210, 225, 245, 0.45);
}

[data-theme="light"] .hero-title {
  text-shadow: none;
}

[data-theme="light"] .hero-description {
  color: var(--text-body);
  opacity: 1;
}

[data-theme="light"] .hero-stat-divider {
  background: var(--border);
}

[data-theme="light"] .tag-chip {
  background: rgba(59, 106, 191, 0.07);
  border-color: rgba(59, 106, 191, 0.2);
  color: var(--tag-text);
}

[data-theme="light"] .tag-chip:hover {
  background: rgba(59, 106, 191, 0.13);
  border-color: rgba(59, 106, 191, 0.35);
  color: var(--accent);
}

[data-theme="light"] .subscribe-button {
  color: #ffffff;
}

[data-theme="light"] .subscribe-button:hover {
  color: #ffffff;
}

[data-theme="light"] .newsletter-btn {
  color: #ffffff;
}

[data-theme="light"] .newsletter-btn:hover {
  color: #ffffff;
}

[data-theme="light"] .site-footer {
  background: #e8ecf0;
}

[data-theme="light"] .nav-dropdown-menu {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ─── Global Focus Visible ─── */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Smooth Theme Transition ─── */
body,
.site-wrapper,
.site-nav,
.site-footer,
.newsletter-strip,
.post-toc,
.author-card,
.readnext-card,
.topic-card,
.tag-chip {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

[data-theme="light"] .lead-story-content {
  background: linear-gradient(
    to top right,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.3) 80%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

/* ─── Skip Link ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only-focusable:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  width: auto;
  height: auto;
  padding: 0.8rem 1.6rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--accent);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
}

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

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

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none;  }

[data-theme="light"] .theme-toggle .icon-moon { display: none;  }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }

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

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ─── Base ─── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

::selection {
  background: rgba(91, 132, 206, 0.3);
  color: var(--text);
}

[data-theme="light"] ::selection {
  background: rgba(59, 106, 191, 0.25);
  color: var(--text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

hr {
  border-color: var(--border);
}

/* ─── Site Header / Navigation ─── */
.site-header {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: 0;
  padding-bottom: 0;
}

.home-template .site-header {
  position: relative;
  background: transparent;
  border-bottom: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 1.5rem;
}

.site-nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav-logo img {
  height: 32px;
  width: auto;
}

.site-nav-logo-text {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-nav-logo-text:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.2rem;
}

.nav li a {
  display: block;
  padding: 0.4rem 1rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius);
  transition:
    color 0.2s,
    background 0.2s;
}

.nav li a:hover,
.nav li.nav-current a {
  color: var(--text);
  background: var(--surface2);
  text-decoration: none;
}

/* ─── External Link Indicator ─── */
.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-external {
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.external-link:hover .icon-external {
  opacity: 1;
}

/* ─── Nav Dropdown ─── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 1rem;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: inherit;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s;
  font-family: inherit;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.is-open .nav-dropdown-toggle,
.nav-dropdown.nav-current .nav-dropdown-toggle {
  color: var(--text);
  background: var(--surface2);
}

.nav-chevron {
  transition: transform 0.2s;
}

.nav-dropdown.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 200px;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s,
    visibility 0.15s,
    transform 0.15s;
  z-index: 200;
}

.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu li a {
  display: block;
  padding: 0.6rem 1.4rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-body);
  white-space: nowrap;
  transition:
    color 0.15s,
    background 0.15s;
}

.nav-dropdown-menu li a:hover,
.nav-dropdown-menu li.nav-current a {
  color: var(--text);
  background: var(--surface2);
  text-decoration: none;
}

.site-nav-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.social-links {
  display: flex;
  gap: 0.8rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  border-radius: var(--radius);
  transition:
    color 0.2s,
    background 0.2s;
}

.social-link:hover {
  color: var(--accent);
  background: var(--surface2);
  text-decoration: none;
}

.subscribe-button {
  padding: 0.5rem 1.4rem;
  background: var(--accent);
  color: #0d1117;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 20px;
  transition: opacity 0.2s;
}

.subscribe-button:hover {
  opacity: 0.85;
  text-decoration: none;
  color: #0d1117;
}

/* ─── Hero Section ─── */
.hero-section {
  position: relative;
  overflow: hidden;
  padding: 7rem 0 5.5rem;
  background: linear-gradient(
    160deg,
    var(--hero-grad-a) 0%,
    var(--hero-grad-b) 100%
  );
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 45% at 8% 20%, rgba(91, 132, 206, 0.06) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 65% 55%, rgba(91, 132, 206, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-shape {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#vitals-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
}

/* dark scrim between canvas and hero content */
.hero-shape::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Gradient scrim: darker on the left (text side) so the heading reads clearly,
     lighter on the right so the phone mockup and ECG animation stay visible */
  background: linear-gradient(
    100deg,
    rgba(1, 4, 9, 0.72) 0%,
    rgba(1, 4, 9, 0.52) 45%,
    rgba(1, 4, 9, 0.30) 100%
  );
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(5vw, 24px);
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text {
  flex: 1 1 55%;
  animation: fadeInUp 0.7s ease both;
}

.hero-logo {
  max-width: 120px;
  max-height: 48px;
  width: auto;
  height: auto;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  /* lifts heading off the canvas lines in dark mode */
  text-shadow: 0 2px 28px rgba(1, 4, 9, 0.9);
}

.hero-description {
  font-size: 1.75rem;
  color: var(--text);
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: 2rem;
  opacity: 0.88;
}

.hero-cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.hero-btn:hover {
  text-decoration: none;
}

.hero-btn-primary {
  background: var(--accent);
  color: #0d1117;
  border: 1px solid var(--accent);
  font-weight: 600;
}

.hero-btn-primary:hover {
  background: var(--accent-hover);
  color: #0d1117;
  border-color: var(--accent-hover);
}

.hero-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-body);
  border: 1px solid var(--border);
  box-shadow: none;
}

.hero-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="light"] .hero-btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

[data-theme="light"] .hero-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

[data-theme="light"] .hero-btn-ghost {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-body);
  border-color: var(--border);
}

[data-theme="light"] .hero-btn-ghost:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero visual card */
.hero-visual-col {
  flex: 1 1 48%;
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.7s 0.15s ease both;
}

.hero-vitals-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}

.vitals-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.vitals-header-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.vitals-label {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.vitals-sublabel {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  /* no opacity reduction — the muted color already de-emphasises sufficiently */
}

.vitals-dog-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
}

.vitals-dog-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.vitals-dog-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.vitals-dog-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.vitals-dog-meta {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1;
}

.vitals-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 1.5s ease-in-out infinite;
}

.vitals-live-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.vitals-demo-dot {
  background: var(--muted);
  animation: none;
}

.vitals-demo-dot + .vitals-live-text {
  color: var(--muted);
}

.vitals-scale {
  display: flex;
  gap: 2px;
  margin-bottom: 0.6rem;
}

.vitals-scale-segment {
  flex: 1;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3px;
}

.scale-num {
  font-size: 1.1rem;
  font-weight: 600;
}

.scale-none {
  background: rgba(34, 197, 94, 0.15);
  color: #3fb950;
}
.scale-mild {
  background: rgba(34, 197, 94, 0.3);
  color: #3fb950;
}
.scale-moderate {
  background: rgba(245, 158, 11, 0.35);
  color: var(--warm);
}
.scale-severe {
  background: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

/* Light-mode scale: darker text for AA contrast on light backgrounds */
[data-theme="light"] .scale-none {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}
[data-theme="light"] .scale-mild {
  background: rgba(22, 163, 74, 0.2);
  color: #15803d;
}
[data-theme="light"] .scale-moderate {
  background: rgba(180, 83, 9, 0.15);
  color: var(--warm);
}
[data-theme="light"] .scale-severe {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}

.vitals-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.vitals-insight {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1.5;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.vitals-insight svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent-hover);
}

/* ─── Topics Section ─── */
.topics-section {
  padding-top: 0;
  padding-bottom: 4rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.topic-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  text-decoration: none;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.15s;
  animation: cardFadeIn 0.5s ease both;
}

.topic-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.topic-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topic-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* Each topic pillar gets its own health-meaningful color */
.topic-icon-pain {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
}
.topic-icon-vet {
  background: rgba(16, 185, 129, 0.10);
  color: #10b981;
}
.topic-icon-product {
  background: rgba(139, 92, 246, 0.10);
  color: #8b5cf6;
}
.topic-icon-company {
  background: rgba(59, 130, 246, 0.10);
  color: #3b82f6;
}
.topic-icon-guides {
  background: rgba(245, 158, 11, 0.10);
  color: #f59e0b;
}
.topic-icon-research {
  background: rgba(6, 182, 212, 0.10);
  color: #06b6d4;
}

.topic-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.topic-desc {
  font-size: 1.35rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}


/* ─── Main Section ─── */
.site-main {
  flex: 1;
  background: var(--surface);
  padding-top: 0;
  padding-bottom: 4rem;
}

.home-template .site-main {
  padding-top: 0;
}

.section-header {
  padding: 3rem 0 2rem;
}

.section-label {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
}

.section-description {
  font-size: 1.6rem;
  color: var(--muted);
}

/* ─── Tag Chips ─── */
.tag-chip {
  display: inline-block;
  background: rgba(91, 132, 206, 0.10);
  border: 1px solid rgba(91, 132, 206, 0.22);
  color: var(--tag-text);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.1rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.tag-chip:hover {
  background: rgba(91, 132, 206, 0.18);
  border-color: rgba(91, 132, 206, 0.4);
  color: var(--accent-hover);
  text-decoration: none;
}

.tag-chip-sm {
  font-size: 1rem;
  padding: 0.08rem 0.45rem;
}

/* ═══════════════════════════════════════════════════════════
   ARTICLE LISTING  (al-* prefix)
   Zone 1 · Hero Duo  |  Zone 2 · Grid  |  Zone 3 · Digest
   ═══════════════════════════════════════════════════════════ */

/* ── Stretched link pattern: card-level click via pseudo-element ── */
.stretched-link {
  color: inherit;
  text-decoration: none;
}

.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

.post-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  position: relative;
  z-index: 2;
}

/* ── Lead Story ── */
.lead-story {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  animation: cardFadeIn 0.5s ease-out 0.05s both;
}

.lead-story:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.lead-story-image {
  position: absolute;
  inset: 0;
}

.lead-story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.lead-story:hover .lead-story-image img {
  transform: scale(1.03);
}

.lead-story-placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(91, 132, 206, 0.06) 0%, transparent 70%),
    linear-gradient(135deg, var(--surface2) 0%, var(--border) 100%);
}

.lead-story-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 360px;
  padding: 2.5rem 3rem;
  background: linear-gradient(
    to top right,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.9) 50%,
    rgba(0, 0, 0, 0.5) 80%,
    rgba(0, 0, 0, 0.2) 100%
  );
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lead-story-badge {
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.lead-story-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: #fff !important;
  margin: 0 0 0.8rem;
  max-width: 720px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.lead-story-excerpt {
  font-size: 1.6rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lead-story-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.lead-story-meta time,
.lead-story-meta .reading-time {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
}

.lead-story-meta .tag-chip {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.75);
}

.lead-story-meta .tag-chip:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* ── Spotlight Row ── */
.spotlight-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.spotlight-card {
  position: relative;
  display: flex;
  flex-direction: row;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: cardFadeIn 0.5s ease-out both;
}

.spotlight-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.spotlight-card-thumb {
  flex: 0 0 38%;
  overflow: hidden;
}

.spotlight-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: grayscale(15%);
}

.spotlight-card:hover .spotlight-card-thumb img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.spotlight-thumb-placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(91, 132, 206, 0.06) 0%, transparent 70%),
    linear-gradient(135deg, var(--surface2) 0%, var(--border) 100%);
}

.spotlight-card-body {
  flex: 1;
  padding: 1.6rem 1.8rem;
  display: flex;
  flex-direction: column;
}

.spotlight-card-title {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: var(--text) !important;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-card-excerpt {
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0.6rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-card-meta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 1.2rem;
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* ── More Articles ── */
.more-articles {
  margin-top: 2.5rem;
  animation: cardFadeIn 0.5s ease-out 0.2s both;
}

.more-articles-heading {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0 0 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.more-articles-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.more-article-item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.more-article-item:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.more-article-body {
  flex: 1;
}

.more-article-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text) !important;
  margin: 0 0 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.more-article-excerpt {
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.more-article-footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.more-article-footer time,
.more-article-footer .reading-time {
  font-size: 1.2rem;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.more-article-item:hover {
  background: var(--surface);
}

.more-article-item:hover .more-article-title {
  color: var(--accent) !important;
}

.reading-time::before {
  content: "·";
  margin-right: 0.5rem;
}


/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2.5rem 0 0;
}

.newer-posts,
.older-posts {
  padding: 0.6rem 1.4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 600;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.newer-posts:hover,
.older-posts:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.page-number {
  font-size: 1.3rem;
  color: var(--muted);
}

/* ─── Single Post ─── */
.post-template .site-main {
  padding-top: 4vw;
}

.post-full {
  max-width: 680px;
  margin: 0 auto;
}

/* ── Header ── */
.post-full-header {
  text-align: center;
  margin-bottom: 3.5rem;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.post-full-tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.post-full-dateline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.meta-sep {
  color: var(--border);
}

.post-full-title {
  font-size: 4.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 1.8rem;
}

.post-full-description {
  font-size: 1.9rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

/* ── Featured Image ── */
.post-full-image {
  margin: 0 -6vw 3.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: calc(100% + 12vw);
}

.post-full-image img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

/* ── Figure Caption ── */
.post-full-image figcaption {
  font-size: 1.3rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.8rem;
  line-height: 1.5;
}

/* ── Reading Progress Bar ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  transition: width 50ms linear;
}

/* ── Table of Contents ── */
.post-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem 2.2rem;
  margin-bottom: 3rem;
}

.post-toc-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.post-toc #TableOfContents > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.post-toc #TableOfContents > ul > li {
  counter-increment: toc;
}

.post-toc #TableOfContents ul ul {
  list-style: none;
  padding-left: 2rem;
  margin: 0;
}

.post-toc #TableOfContents a {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.5rem 0;
  font-size: 1.5rem;
  color: var(--text-body);
  text-decoration: none;
  border-bottom: 1px solid rgba(48, 54, 61, 0.4);
  transition: color 0.15s;
}

.post-toc #TableOfContents > ul > li:last-child > a {
  border-bottom: none;
}

.post-toc #TableOfContents > ul > li > a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.post-toc #TableOfContents ul ul a {
  font-size: 1.4rem;
  color: var(--muted);
  padding: 0.35rem 0;
  border-bottom: none;
}

.post-toc #TableOfContents a:hover {
  color: var(--accent);
}

.post-toc #TableOfContents a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Article Body ── */
.post-full-content {
  margin-bottom: 3rem;
}

.kg-card-markdown {
  font-size: 1.85rem;
  line-height: 1.7;
  color: var(--text-body);
}

.kg-card-markdown > p:first-child::first-letter {
  float: left;
  font-size: 4rem;
  line-height: 0.85;
  font-weight: 800;
  color: var(--text);
  margin-right: 0.08em;
  margin-top: 0.12em;
}

.kg-card-markdown p {
  margin-bottom: 1.6em;
}

/* ── Headings ── */
.kg-card-markdown h1,
.kg-card-markdown h2,
.kg-card-markdown h3,
.kg-card-markdown h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  scroll-margin-top: 5rem;
}

.kg-card-markdown h2 {
  font-size: 2.8rem;
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.kg-card-markdown h3 {
  font-size: 2.2rem;
  margin-top: 2.8rem;
  margin-bottom: 0.8rem;
}

.kg-card-markdown h4 {
  font-size: 1.9rem;
  margin-top: 2.2rem;
  margin-bottom: 0.6rem;
}

/* ── Links ── */
.kg-card-markdown a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(91, 132, 206, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}
.kg-card-markdown a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.kg-card-markdown a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Heading Anchors ── */
.heading-anchor {
  color: var(--border);
  text-decoration: none;
  margin-left: 0.4em;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.15s;
}

.kg-card-markdown h2:hover .heading-anchor,
.kg-card-markdown h3:hover .heading-anchor,
.kg-card-markdown h4:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--accent);
}

.heading-anchor:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Lists ── */
.kg-card-markdown ul,
.kg-card-markdown ol {
  margin: 1.5em 0;
  padding-left: 1.6em;
}

.kg-card-markdown li {
  margin-bottom: 0.6em;
  padding-left: 0.3em;
}

.kg-card-markdown li strong {
  color: var(--text);
}

/* ── Code ── */
.kg-card-markdown code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--accent-hover);
  border-radius: 4px;
  font-size: 0.88em;
  padding: 0.15em 0.4em;
}

.kg-card-markdown pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
}

.kg-card-markdown pre code {
  background: none;
  border: none;
  color: var(--text-body);
  font-size: 1.4rem;
  padding: 0;
}

/* ── Blockquotes ── */
.kg-card-markdown blockquote {
  border-left: 3px solid var(--accent);
  color: var(--text-body);
  background: rgba(91, 132, 206, 0.06);
  padding: 1.2rem 1.8rem;
  margin: 2em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.7rem;
  line-height: 1.7;
}

.kg-card-markdown blockquote p:last-child {
  margin-bottom: 0;
}

/* ── Tables ── */
.kg-card-markdown table {
  width: 100%;
  margin: 2em 0;
  border-collapse: collapse;
  font-size: 1.5rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kg-card-markdown thead {
  background: var(--surface2);
}

.kg-card-markdown th {
  font-weight: 700;
  color: var(--text);
  text-align: left;
  padding: 1rem 1.4rem;
  border-bottom: 2px solid var(--border);
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kg-card-markdown td {
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
}

.kg-card-markdown tbody tr:last-child td {
  border-bottom: none;
}

.kg-card-markdown tbody tr:hover {
  background: rgba(91, 132, 206, 0.04);
}

/* ── Horizontal Rules ── */
.kg-card-markdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ── Images in Content ── */
.kg-card-markdown img {
  border-radius: var(--radius);
  max-width: 100%;
  margin: 1.5em 0;
}

/* ─── Pain Level Shortcode ─── */
.pain-level-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warm);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
}

.pain-level-widget.pain-none {
  border-left-color: #22c55e;
}
.pain-level-widget.pain-mild {
  border-left-color: #22c55e;
}
.pain-level-widget.pain-moderate {
  border-left-color: var(--warm);
}
.pain-level-widget.pain-severe {
  border-left-color: var(--danger);
}

.pain-level-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.pain-level-score {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
}

.pain-level-widget.pain-none .pain-level-score {
  color: #22c55e;
}
.pain-level-widget.pain-mild .pain-level-score {
  color: #22c55e;
}
.pain-level-widget.pain-moderate .pain-level-score {
  color: var(--warm);
}
.pain-level-widget.pain-severe .pain-level-score {
  color: var(--danger);
}

.pain-level-info {
  flex: 1;
}

.pain-level-label {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.pain-level-sublabel {
  font-size: 1.3rem;
  color: var(--muted);
}

.pain-level-bar {
  display: flex;
  gap: 3px;
  margin-bottom: 1rem;
}

.pain-level-bar-segment {
  height: 8px;
  flex: 1;
  border-radius: 4px;
  background: var(--border);
}

.pain-level-bar-segment.active-pain-none {
  background: #22c55e;
}
.pain-level-bar-segment.active-pain-mild {
  background: #22c55e;
}
.pain-level-bar-segment.active-pain-moderate {
  background: var(--warm);
}
.pain-level-bar-segment.active-pain-severe {
  background: var(--danger);
}

.pain-level-description {
  font-size: 1.45rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 0;
}

/* Light-mode pain widget: darker green text for contrast on white */
[data-theme="light"] .pain-level-widget.pain-none .pain-level-score,
[data-theme="light"] .pain-level-widget.pain-mild .pain-level-score {
  color: #15803d;
}
[data-theme="light"] .pain-level-widget.pain-none { border-left-color: #16a34a; }
[data-theme="light"] .pain-level-widget.pain-mild { border-left-color: #16a34a; }
[data-theme="light"] .pain-level-bar-segment.active-pain-none { background: #16a34a; }
[data-theme="light"] .pain-level-bar-segment.active-pain-mild { background: #16a34a; }

/* ─── Author Card ─── */
.post-full-footer {
  border-top: 1px solid var(--border);
  padding-top: 3rem;
  margin-top: 2rem;
}

.author-card {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.4rem;
}

.author-profile-image {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  flex-shrink: 0;
}

.author-card-content {
  flex: 1;
}

.author-card-name {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.author-card-title {
  display: block;
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.author-card-bio {
  font-size: 1.45rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* ─── Post Topics ─── */
.post-topics {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-topics-label {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.post-topics-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── Read Next ─── */
.read-next {
  background: var(--bg);
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.readnext-heading {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.read-next-feed {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.readnext-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.15s;
}

.readnext-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.readnext-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.readnext-card-image {
  height: 140px;
  overflow: hidden;
}

.readnext-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.readnext-card:hover .readnext-card-image img {
  transform: scale(1.04);
}

.readnext-card-body {
  padding: 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.readnext-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

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

.readnext-card-excerpt {
  font-size: 1.35rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.readnext-card time {
  font-size: 1.2rem;
  color: var(--muted);
}

/* ─── Taxonomy & Term ─── */
.topic-count {
  display: block;
  margin-top: 0.6rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--muted);
}

.topic-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.6rem;
  padding: 3rem 0 2rem;
}

.topic-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3.5rem;
}

.topic-hero-text {
  flex: 1;
  min-width: 0;
}

.topic-hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
}

.topic-hero-desc {
  font-size: 1.6rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ─── Footer ─── */
.site-footer {
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding-top: 4rem;
  padding-bottom: 0;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1.2rem;
}

.footer-brand .footer-logo img {
  height: 28px;
  width: auto;
}

.footer-brand .footer-logo:hover {
  color: var(--accent);
}

.footer-description {
  font-size: 1.3rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 36rem;
}

.footer-nav-group h4 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
}

.footer-nav-group nav {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-nav-group nav a {
  font-size: 1.3rem;
  color: var(--muted);
  transition: color 0.2s;
}

.footer-nav-group nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.copyright {
  font-size: 1.3rem;
  color: var(--muted);
}

.copyright a {
  color: var(--muted);
}
.copyright a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ─── 404 Error ─── */
.error-content {
  text-align: center;
  padding: 6rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}

.error-icon {
  color: var(--warm);
  margin-bottom: 1.5rem;
}
.error-icon svg {
  margin: 0 auto;
}

.error-code {
  font-size: 8rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 0;
}

.error-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
}

.error-description {
  font-size: 1.6rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

/* ─── Hero Trust Signal + Stats ─── */
.hero-trust-block {
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  color: var(--text-body);
  margin: 0;
}

.hero-trust svg {
  flex-shrink: 0;
  color: var(--accent-hover);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero-stat-label {
  font-size: 1.1rem;
  color: var(--text-body);
  line-height: 1.2;
}

.hero-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* ─── Vitals Card: Current Reading Row ─── */
.vitals-current-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.vitals-current-score {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.vitals-current-num {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--accent-hover);
  letter-spacing: -0.04em;
  line-height: 1;
  transition: color 0.4s;
}

.vitals-current-num.score-none,
.vitals-current-num.score-minimal,
.vitals-current-num.score-mild     { color: #3fb950; }
.vitals-current-num.score-moderate { color: var(--warm); }
.vitals-current-num.score-severe   { color: var(--danger); }

.vitals-current-unit {
  font-size: 1.4rem;
  color: var(--muted);
  font-weight: 600;
}

.vitals-score-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.vitals-current-label {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(91, 132, 206, 0.1);
  border: 1px solid rgba(91, 132, 206, 0.2);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  transition: color 0.4s, background 0.4s, border-color 0.4s;
}

.vitals-current-label.badge-none,
.vitals-current-label.badge-minimal,
.vitals-current-label.badge-mild {
  color: #3fb950;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
}

.vitals-current-label.badge-moderate {
  color: var(--warm);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.vitals-current-label.badge-severe {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

.vitals-trend {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  transition: color 0.4s;
}

.vitals-trend.trend-up     { color: var(--danger); }
.vitals-trend.trend-down   { color: #3fb950; }
.vitals-trend.trend-stable { color: var(--muted); }

.vitals-context {
  font-size: 1.2rem;
  color: var(--text-body);
  line-height: 1.5;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  margin-top: 0.3rem;
  margin-bottom: 1.1rem;
  border-left: 3px solid var(--border);
  background: var(--surface2);
  transition: border-color 0.4s;
}

.vitals-context.ctx-none,
.vitals-context.ctx-minimal,
.vitals-context.ctx-mild     { border-left-color: #3fb950; }
.vitals-context.ctx-moderate { border-left-color: var(--warm); }
.vitals-context.ctx-severe   { border-left-color: var(--danger); }

/* Light-mode vitals: darker green for contrast on light surfaces */
[data-theme="light"] .vitals-current-num.score-none,
[data-theme="light"] .vitals-current-num.score-minimal,
[data-theme="light"] .vitals-current-num.score-mild     { color: #15803d; }

[data-theme="light"] .vitals-current-label.badge-none,
[data-theme="light"] .vitals-current-label.badge-minimal,
[data-theme="light"] .vitals-current-label.badge-mild {
  color: #15803d;
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.25);
}

[data-theme="light"] .vitals-trend.trend-down   { color: #15803d; }

[data-theme="light"] .vitals-context.ctx-none,
[data-theme="light"] .vitals-context.ctx-minimal,
[data-theme="light"] .vitals-context.ctx-mild     { border-left-color: #16a34a; }

/* active segment highlight */
.vitals-scale-segment.vitals-seg-active {
  outline: 2px solid rgba(122, 166, 224, 0.7);
  outline-offset: 1px;
  border-radius: 4px;
}


/* ─── Mobile Nav Hamburger ─── */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition:
    border-color 0.2s,
    color 0.2s;
  order: -1; /* show before social links */
}

.nav-hamburger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-hamburger .close-icon {
  display: none;
}
.nav-hamburger[aria-expanded="true"] .hamburger-icon {
  display: none;
}
.nav-hamburger[aria-expanded="true"] .close-icon {
  display: block;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem max(5vw, 24px) 1.5rem;
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav-list {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}

.mobile-nav-list li a {
  display: block;
  padding: 0.9rem 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-body);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: color 0.2s;
}

.mobile-nav-list li a.external-link {
  display: flex;
}

.mobile-nav-list li:last-child a {
  border-bottom: none;
}

.mobile-nav-list li a:hover,
.mobile-nav-list li.nav-current a {
  color: var(--accent);
}

.mobile-subscribe {
  align-self: flex-start;
}

/* ─── Newsletter Strip ─── */
.newsletter-strip {
  margin-top: 4rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(91, 132, 206, 0.08) 0%, var(--surface) 50%, rgba(91, 132, 206, 0.05) 100%);
  border: 1px solid rgba(91, 132, 206, 0.25);
  border-top: 3px solid var(--accent);
  padding: 2.8rem 3.2rem;
  position: relative;
  overflow: hidden;
}

.newsletter-strip::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(91, 132, 206, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.newsletter-icon {
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.8;
}

.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.newsletter-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.newsletter-desc {
  font-size: 1.45rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.newsletter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 2.2rem;
  background: var(--accent);
  color: #0d1117;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: var(--radius);
  white-space: nowrap;
  transition:
    background 0.2s,
    transform 0.15s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(91, 132, 206, 0.25);
}

.newsletter-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: #0d1117;
  box-shadow: 0 4px 12px rgba(91, 132, 206, 0.35);
}


/* ─── Sidebar TOC on wide screens ─── */
.post-body-wrap {
  position: relative;
}

@media (min-width: 1200px) {
  .post-toc {
    position: sticky;
    top: 76px; /* 56px navbar + 20px breathing room */
    float: left;
    width: 220px;
    margin-left: -260px;
    margin-bottom: 2rem;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 1.4rem 1.6rem;
    font-size: 0.92em;
  }

  .post-toc-title {
    font-size: 1.2rem;
  }

  .post-toc #TableOfContents a {
    font-size: 1.35rem;
    padding: 0.4rem 0;
  }

  .post-toc #TableOfContents > ul > li > a::before {
    font-size: 1.1rem;
  }

  .post-toc #TableOfContents ul ul a {
    font-size: 1.25rem;
  }

  .post-toc #TableOfContents ul ul {
    padding-left: 1.6rem;
  }

  .post-toc #TableOfContents a.toc-active {
    color: var(--accent);
  }

  .post-toc #TableOfContents > ul > li > a.toc-active::before {
    color: var(--accent);
  }
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    gap: 3rem;
  }
  .hero-text {
    flex: none;
    width: 100%;
  }
  .hero-visual-col {
    flex: none;
    width: 100%;
    max-width: 420px;
  }
  /* Remove 3D perspective once hero stacks vertically */
  .phone-shell {
    transform: none;
    border: 1.5px solid rgba(255, 255, 255, 0.09);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.10),
      0 20px 60px rgba(0, 0, 0, 0.5);
  }
  .phone-mockup::after {
    display: none;
  }
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lead-story-content {
    min-height: 280px;
  }
  .read-next-feed {
    grid-template-columns: 1fr;
  }
  .spotlight-row {
    grid-template-columns: 1fr;
  }
  .spotlight-card {
    flex-direction: row;
  }
  .more-articles-list {
    grid-template-columns: 1fr;
  }
  .more-article-item:nth-child(odd) {
    border-right: none;
  }
  .newsletter-strip {
    padding: 2rem 2.4rem;
  }
  .newsletter-icon {
    display: none;
  }
  .newsletter-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .newsletter-btn {
    width: 100%;
    justify-content: center;
  }
  .site-footer {
    padding-top: 3rem;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }

  .post-full-title {
    font-size: 3.4rem;
    margin-bottom: 1.4rem;
  }
  .post-full-image {
    margin-left: -3vw;
    margin-right: -3vw;
    max-width: calc(100% + 6vw);
  }
}

@media (max-width: 650px) {
  html {
    font-size: 56.25%;
  }

  /* Prevent horizontal scroll from any element leaking outside viewport */
  body {
    overflow-x: hidden;
  }

  .site-nav .nav {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
  .social-links {
    display: none;
  } /* hide on mobile to reduce nav clutter */

  h1 {
    font-size: 3.6rem;
  }
  h2 {
    font-size: 2.8rem;
  }

  .hero-section {
    padding: 3.5rem 0 2.5rem;
  }
  .hero-logo {
    max-width: 100px;
  }
  .hero-title {
    font-size: 3rem;
  }
  .hero-description {
    font-size: 1.5rem;
    max-width: none;
  }
  .hero-cta-row {
    flex-direction: column;
  }
  .hero-btn {
    justify-content: center;
  }
  /* Allow hero stats to wrap on narrow screens */
  .hero-stats {
    flex-wrap: wrap;
    gap: 0.8rem;
  }
  .hero-stat-divider {
    display: none;
  }
  .vitals-scale-segment {
    height: 26px;
  }

  .topics-section {
    padding-bottom: 2rem;
  }
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    padding: 2rem 0 1.4rem;
  }
  .section-title {
    font-size: 2.4rem;
  }

  .topic-hero {
    padding: 2rem 0 1.4rem;
  }
  .topic-hero-icon {
    width: 44px;
    height: 44px;
  }
  .topic-hero-icon svg {
    width: 24px;
    height: 24px;
  }
  .topic-hero-title {
    font-size: 2.4rem;
  }
  .topic-hero-desc {
    font-size: 1.4rem;
  }

  .lead-story-content {
    min-height: 220px;
    padding: 1.8rem 2rem;
  }
  .lead-story-title {
    font-size: 2.2rem;
  }
  .lead-story-excerpt {
    font-size: 1.4rem;
    -webkit-line-clamp: 2;
  }
  .spotlight-card {
    flex-direction: column;
  }
  .spotlight-card-thumb {
    flex: none;
    height: 160px;
  }

  .newsletter-strip {
    padding: 1.6rem;
  }

  .post-template .site-main {
    padding-top: 2rem;
  }
  .post-full-header {
    text-align: left;
  }
  .post-full-tags,
  .post-full-dateline {
    justify-content: flex-start;
  }
  .post-full-title {
    font-size: 2.8rem;
    line-height: 1.22;
    margin-bottom: 1.2rem;
  }
  .post-full-dateline {
    margin-bottom: 1.4rem;
  }
  .post-full-description {
    font-size: 1.6rem;
  }
  .post-full-image {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
  .kg-card-markdown {
    font-size: 1.7rem;
    line-height: 1.7;
  }
  .kg-card-markdown h2 {
    font-size: 2.3rem;
    margin-top: 2.5rem;
  }
  .kg-card-markdown h3 {
    font-size: 1.9rem;
  }
  .kg-card-markdown > p:first-child::first-letter {
    font-size: 3.4rem;
  }
  .kg-card-markdown table {
    font-size: 1.35rem;
  }
  .kg-card-markdown th,
  .kg-card-markdown td {
    padding: 0.7rem 0.8rem;
  }

  .author-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .author-profile-image {
    width: 64px;
    height: 64px;
  }

  .site-footer {
    padding-top: 2rem;
  }
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    padding-bottom: 1.5rem;
  }
  .footer-brand {
    grid-column: auto;
  }
  .footer-description {
    max-width: 100%;
  }
  .footer-brand .footer-logo {
    justify-content: center;
  }
  .footer-nav-group nav {
    align-items: center;
  }
  .footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
  }
}

/* ─── Static Pages (About, Privacy, etc.) ─── */
.static-template .site-main {
  padding-top: 4vw;
}

.static-page {
  max-width: 680px;
  margin: 0 auto;
}

.static-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.static-page-title {
  font-size: 3.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.static-page-description {
  font-size: 1.8rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

.static-page-divider {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto 3rem;
}

.static-page-content {
  margin-bottom: 3rem;
}

/* Suppress drop cap on static pages — they start with headings */
.static-page-content .kg-card-markdown > p:first-child::first-letter {
  float: none;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
  color: inherit;
  margin-right: 0;
  margin-top: 0;
}

@media (max-width: 600px) {
  .static-page-title {
    font-size: 2.8rem;
  }
  .static-page-description {
    font-size: 1.6rem;
  }
}

/* ─── Breadcrumbs ─── */
.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1.3rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--muted);
}

.breadcrumb li:not(:last-child)::after {
  content: "\203A";
  color: var(--muted);
  margin-left: 0.2rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb li[aria-current="page"] {
  color: var(--text-body);
  font-weight: 500;
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
