/* ============================================
   ToothAnswers.com — Design System
   Clean, fast, mobile-first dental blog
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Light Mode (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-nav: rgba(255, 255, 255, 0.92);
  --bg-footer: #0f172a;
  --bg-code: #f1f5f9;
  --bg-hero: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #6366f1 100%);
  --bg-badge: #f0fdfa;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;
  --text-link: #0d9488;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #ccfbf1;
  --accent-glow: rgba(13, 148, 136, 0.15);

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;

  --max-width: 1200px;
  --content-width: 780px;
  --nav-height: 64px;

  --transition: 0.2s ease;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-nav: rgba(15, 23, 42, 0.95);
  --bg-footer: #020617;
  --bg-code: #1e293b;
  --bg-hero: linear-gradient(135deg, #134e4a 0%, #164e63 50%, #312e81 100%);
  --bg-badge: #134e4a;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-link: #2dd4bf;

  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-light: #134e4a;
  --accent-glow: rgba(45, 212, 191, 0.15);

  --border: #334155;
  --border-light: #1e293b;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo svg {
  width: 32px;
  height: 32px;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links > li {
  position: relative;
}

.nav-links > li > a {
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Dropdown arrow */
.nav-links .dropdown-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.nav-links > li:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* Mega Dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 32px;
  min-width: 520px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 1001;
}

.nav-links > li:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-group h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.nav-dropdown-group a {
  display: block;
  padding: 6px 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-dropdown-group a:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

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

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

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

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 900px) {
  .mobile-menu-btn { display: block; }

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    z-index: 999;
  }

  .nav-links.open {
    max-height: 100vh;
    overflow-y: auto;
  }

  .nav-links > li {
    border-bottom: 1px solid var(--border-light);
  }

  .nav-links > li > a {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    border-radius: 0;
    text-align: left;
  }

  .nav-dropdown {
    position: static;
    transform: none;
    max-height: 0;
    overflow: hidden;
    grid-template-columns: 1fr;
    min-width: unset;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    padding: 0 20px;
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .nav-dropdown.mobile-open {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 16px;
    max-height: 500px;
    padding: 16px 20px;
  }

  .nav-links > li:hover .nav-dropdown {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
}

/* --- Main Content --- */
main {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

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

.content-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Hero Section (Homepage) --- */
.hero {
  background: var(--bg-hero);
  padding: 80px 20px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--bg-primary));
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 24px;
}

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

.hero-stat-num {
  font-size: 2rem;
  font-weight: 800;
  display: block;
}

.hero-stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .hero { padding: 50px 20px; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 20px; }
  .hero-stat-num { font-size: 1.5rem; }
}

/* --- Hub Cards (Homepage) --- */
.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin: 60px 0 8px;
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 60px;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  color: var(--text-primary);
}

.hub-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.hub-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.hub-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hub-card .article-count {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 10px;
  border-radius: 20px;
}

/* --- Article Cards Grid --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  color: var(--text-primary);
}

.article-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
}

.article-card-body {
  padding: 20px;
}

.article-card-hub {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.article-card h3 {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 8px;
}

.article-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 40px 0 60px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

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

/* --- Article Page --- */
.article-header {
  padding: 48px 0 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

.breadcrumb svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.article-header h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .article-header h1 { font-size: 1.8rem; }
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.browse-articles-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.browse-articles-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.browse-articles-btn svg {
  transition: transform 0.25s ease;
}

.browse-articles-btn:hover svg {
  transform: translateY(2px);
}

.article-meta svg {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -2px;
}

/* Quick Answer Box */
.quick-answer {
  background: var(--accent-glow);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.quick-answer strong {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 8px;
}

/* Featured Image */
.article-featured-img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin: 28px 0;
  box-shadow: var(--shadow-md);
}

/* Article Content */
.article-content {
  padding-bottom: 40px;
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--text-primary);
  line-height: 1.3;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-content img {
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .article-content table {
    display: table;
  }
  .article-content th,
  .article-content td {
    white-space: normal;
  }
}

.article-content th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.article-content td {
  color: var(--text-secondary);
}

/* Table of Contents */
.toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 24px 0 32px;
}

.toc-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc ol {
  list-style: none;
  padding: 0;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  margin-bottom: 6px;
}

.toc li::before {
  content: counter(toc) ".";
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
  font-size: 0.85rem;
}

.toc a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition);
}

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

/* FAQ Section */
.faq-section {
  margin: 40px 0;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item:hover {
  border-color: var(--accent);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  font-family: var(--font-body);
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--bg-card-hover);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 20px 16px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* --- Related Articles --- */
.related-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.related-card {
  display: flex;
  align-items: start;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.related-card img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.related-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.related-card span {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* --- Hub Page (Pillar) --- */
.hub-header {
  background: var(--bg-hero);
  padding: 60px 20px 80px;
  text-align: center;
  color: #fff;
  position: relative;
}

.hub-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-primary));
}

.hub-header h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.hub-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .hub-header { padding: 40px 20px 60px; }
  .hub-header h1 { font-size: 1.8rem; }
}

/* Hub TOC — Spoke Listing */
.hub-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin: -30px auto 40px;
  max-width: var(--content-width);
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.hub-toc h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hub-toc ul {
  list-style: none;
  padding: 0;
}

.hub-toc li {
  margin-bottom: 8px;
}

.hub-toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.hub-toc a:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

.hub-toc a::before {
  content: '→';
  color: var(--accent);
  font-weight: 600;
}

/* --- Footer --- */
.footer {
  background: var(--bg-footer);
  color: var(--text-inverse);
  padding: 60px 20px 30px;
  margin-top: 60px;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-top: 12px;
}

.footer h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  color: #e2e8f0;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer li {
  margin-bottom: 8px;
}

.footer a {
  color: #94a3b8;
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer a:hover {
  color: #2dd4bf;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
}

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 20px;
  background: var(--bg-badge);
  color: var(--accent);
}

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Back to Hub CTA */
.hub-cta {
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin: 32px 0;
}

.hub-cta a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition);
  margin-top: 8px;
}

.hub-cta a:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Disclaimer */
.disclaimer {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 32px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.disclaimer strong {
  color: var(--text-secondary);
}

/* Inline image in article */
.content-img-wrap {
  margin: 28px 0;
  text-align: center;
}

.content-img-wrap img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: inline-block;
}

.content-img-wrap figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* Print styles */
@media print {
  .nav, .footer, .theme-toggle, .mobile-menu-btn, .toc, .related-section, .hub-cta { display: none; }
  main { margin-top: 0; }
  body { font-size: 12pt; color: #000; }
}
