/* ==========================================================================
   cultusio - Evolution of World Religions (610 BCE – 2026 CE)
   Advanced Design System & Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens & CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Light Mode */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-nav: rgba(248, 250, 252, 0.85);
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  
  /* Brand Accents */
  --accent-emerald: #059669;
  --accent-emerald-light: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-gold: #d97706;
  --accent-gold-light: #f59e0b;
  --accent-gold-subtle: rgba(245, 158, 11, 0.12);
  --accent-blue: #2563eb;
  --accent-blue-subtle: rgba(37, 99, 235, 0.1);
  --accent-purple: #7c3aed;
  --accent-purple-subtle: rgba(124, 58, 237, 0.1);

  /* Status Badges */
  --badge-consensus-bg: #ecfdf5;
  --badge-consensus-text: #065f46;
  --badge-consensus-border: #a7f3d0;
  
  --badge-majority-bg: #eff6ff;
  --badge-majority-text: #1e40af;
  --badge-majority-border: #bfdbfe;
  
  --badge-contested-bg: #fffbeb;
  --badge-contested-text: #92400e;
  --badge-contested-border: #fde68a;

  --badge-political-bg: #fdf2f8;
  --badge-political-text: #9d174d;
  --badge-political-border: #fbcfe8;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Cinzel', 'Merriweather', Georgia, serif;
  --font-arabic: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout */
  --max-width: 1280px;
  --nav-height: 64px;
  --transition-speed: 0.25s ease;
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111726;
  --bg-card-subtle: #182033;
  --bg-nav: rgba(9, 13, 22, 0.88);
  --border-color: #1e293b;
  --border-hover: #334155;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.18);
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-subtle: rgba(245, 158, 11, 0.18);
  --accent-blue: #3b82f6;
  --accent-blue-subtle: rgba(59, 130, 246, 0.18);
  --accent-purple: #8b5cf6;
  --accent-purple-subtle: rgba(139, 92, 246, 0.18);

  --badge-consensus-bg: rgba(16, 185, 129, 0.15);
  --badge-consensus-text: #6ee7b7;
  --badge-consensus-border: rgba(16, 185, 129, 0.3);

  --badge-majority-bg: rgba(59, 130, 246, 0.15);
  --badge-majority-text: #93c5fd;
  --badge-majority-border: rgba(59, 130, 246, 0.3);

  --badge-contested-bg: rgba(245, 158, 11, 0.15);
  --badge-contested-text: #fcd34d;
  --badge-contested-border: rgba(245, 158, 11, 0.3);

  --badge-political-bg: rgba(236, 72, 153, 0.15);
  --badge-political-text: #f472b6;
  --badge-political-border: rgba(236, 72, 153, 0.3);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.8);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.68;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  overflow-x: hidden;
}

a {
  color: var(--accent-emerald);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--accent-emerald-light);
  text-decoration: underline;
}

p {
  margin-bottom: 1.25rem;
}

h1, h2, h3, h4, h5 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.3;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.header-top {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--nav-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none !important;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-gold));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

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

/* Main Series Navigation */
.series-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 0.5rem;
  scrollbar-width: none;
}
.series-nav::-webkit-scrollbar {
  display: none;
}

.series-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-speed);
  white-space: nowrap;
}

.series-link:hover {
  color: var(--text-main);
  background-color: var(--bg-card-subtle);
  text-decoration: none;
}

.series-link.active {
  color: var(--accent-emerald);
  background-color: var(--accent-emerald-subtle);
  font-weight: 700;
}

.series-badge-soon {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--bg-card-subtle);
  color: var(--text-faint);
  margin-left: 0.3rem;
  font-weight: 500;
  vertical-align: middle;
}

/* Action Controls (Lang & Theme) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px;
  cursor: pointer;
  user-select: none;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-btn.active {
  background-color: var(--bg-card);
  color: var(--accent-emerald);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.icon-btn:hover {
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  background-color: var(--bg-card);
}

/* Sub-header Islam Series Tracker */
.sub-header {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-main);
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.sub-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
}

.chapter-ticker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chapter-number {
  font-weight: 700;
  color: var(--accent-emerald);
  background: var(--accent-emerald-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.quick-jump-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-jump-nav::-webkit-scrollbar {
  display: none;
}

.jump-link {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.jump-link:hover {
  color: var(--accent-emerald);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Layout Grid: Sidebar TOC + Main Content
   -------------------------------------------------------------------------- */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* Sticky Sidebar Table of Contents */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 40px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.85rem;
}

.toc-list {
  list-style: none;
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-item a {
  display: block;
  font-size: 0.8125rem;
  padding: 0.35rem 0 0.35rem 0.85rem;
  color: var(--text-muted);
  transition: all var(--transition-speed);
  border-left: 2px solid transparent;
  margin-left: -2px;
  line-height: 1.4;
  text-decoration: none;
}

.toc-item a:hover {
  color: var(--text-main);
  border-left-color: var(--border-hover);
}

.toc-item.active a {
  color: var(--accent-emerald);
  border-left-color: var(--accent-emerald);
  font-weight: 700;
}

/* Main Article Content Container */
.content-area {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Hero Header Section
   -------------------------------------------------------------------------- */
.article-hero {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2.5rem;
}

.hero-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-weight: 600;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-consensus {
  background-color: var(--badge-consensus-bg);
  color: var(--badge-consensus-text);
  border: 1px solid var(--badge-consensus-border);
}

.badge-majority {
  background-color: var(--badge-majority-bg);
  color: var(--badge-majority-text);
  border: 1px solid var(--badge-majority-border);
}

.badge-contested {
  background-color: var(--badge-contested-bg);
  color: var(--badge-contested-text);
  border: 1px solid var(--badge-contested-border);
}

.badge-political {
  background-color: var(--badge-political-bg);
  color: var(--badge-political-text);
  border: 1px solid var(--badge-political-border);
}

.article-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.55;
  max-width: 900px;
  margin-bottom: 1.5rem;
}

/* History Progress Bar Slider */
.timeline-slider-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.timeline-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.history-track {
  position: relative;
  height: 10px;
  background-color: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}

.history-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 96.5%;
  background: linear-gradient(90deg, #94a3b8, var(--accent-emerald));
  border-radius: 999px;
}

.current-indicator {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3.5%;
  background: var(--accent-gold);
  border-radius: 999px;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; filter: drop-shadow(0 0 6px var(--accent-gold)); }
}

.history-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.5rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Executive Summary (In Brief) & Hero Stats Cards
   -------------------------------------------------------------------------- */
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent-emerald)), transparent);
}

.stat-card.emerald { --card-accent: var(--accent-emerald); }
.stat-card.gold { --card-accent: var(--accent-gold); }
.stat-card.blue { --card-accent: var(--accent-blue); }
.stat-card.purple { --card-accent: var(--accent-purple); }

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  font-feature-settings: "tnum";
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* In Brief Key Takeaways Box */
.in-brief-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 3.5rem;
  box-shadow: var(--shadow-md);
}

.in-brief-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.in-brief-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.in-brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.takeaway-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.takeaway-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  margin-top: 0.5rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--accent-emerald-subtle);
}

.takeaway-content h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.takeaway-content p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Article Content Sections & Typography
   -------------------------------------------------------------------------- */
.content-section {
  margin-bottom: 4rem;
  padding-top: 1rem;
}

.section-anchor {
  scroll-margin-top: calc(var(--nav-height) + 2rem);
}

.section-header {
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-number {
  font-size: 1rem;
  color: var(--accent-emerald);
  background: var(--accent-emerald-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.subsection-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  color: var(--text-main);
}

.lead-p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-main);
}

/* Callout Note Boxes */
.callout-box {
  background-color: var(--bg-card);
  border-left: 4px solid var(--accent-emerald);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-sm);
}

.callout-box.gold {
  border-left-color: var(--accent-gold);
  background-color: var(--accent-gold-subtle);
}

.callout-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-emerald);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-box.gold .callout-title {
  color: var(--accent-gold);
}

.callout-box p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Interactive Data Visualizations & Infographics
   -------------------------------------------------------------------------- */
.chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-md);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-heading h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.chart-heading p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.chart-filters {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  padding: 3px;
  border-radius: var(--radius-full);
}

.chart-filter-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.chart-filter-btn.active {
  background: var(--bg-card);
  color: var(--accent-emerald);
  box-shadow: var(--shadow-sm);
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
}

/* Visual Breakdown Bar Chart for Population */
.demographic-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.demo-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.demo-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.demo-bar-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-bar-label .flag {
  font-size: 1.1rem;
}

.demo-bar-values {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.demo-bar-track {
  height: 12px;
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.demo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-emerald-light));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Regional Distribution Cards Grid */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.region-stat-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition-speed);
}

.region-stat-pill:hover {
  border-color: var(--accent-emerald);
  transform: translateY(-2px);
  background: var(--bg-card);
}

.region-pct {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.region-name {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.region-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Interactive Timeline (1998–2026)
   -------------------------------------------------------------------------- */
.timeline-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tl-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.tl-filter-btn:hover {
  border-color: var(--accent-emerald);
  color: var(--text-main);
}

.tl-filter-btn.active {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.interactive-timeline {
  position: relative;
  padding-left: 2.5rem;
}

.interactive-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 3px;
  background-color: var(--border-color);
  border-radius: 999px;
}

.tl-node {
  position: relative;
  margin-bottom: 2.25rem;
  transition: all var(--transition-speed);
}

.tl-node-marker {
  position: absolute;
  left: -2.5rem;
  top: 4px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent-emerald);
  box-shadow: 0 0 0 4px var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--transition-speed);
}

.tl-node:hover .tl-node-marker {
  transform: scale(1.2);
  background: var(--accent-emerald);
  border-color: #ffffff;
}

.tl-node-marker svg {
  width: 14px;
  height: 14px;
  color: var(--accent-emerald);
}
.tl-node:hover .tl-node-marker svg {
  color: #ffffff;
}

.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed);
}

.tl-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.tl-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tl-date {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  background: var(--accent-emerald-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.tl-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.tl-card-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Primary Sources Showcase
   -------------------------------------------------------------------------- */
.sources-card-deck {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin: 2rem 0;
}

.source-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed);
}

.source-card:hover {
  border-color: var(--border-hover);
}

.source-header {
  padding: 1.25rem 1.75rem;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.source-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.source-meta-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.source-body {
  padding: 1.75rem;
}

.source-quote-arabic {
  font-family: var(--font-arabic);
  font-size: 1.45rem;
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: var(--text-main);
  background: var(--accent-emerald-subtle);
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border-right: 4px solid var(--accent-emerald);
}

.source-translations {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.trans-block {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding-left: 1rem;
  border-left: 3px solid var(--border-color);
  line-height: 1.6;
}

.trans-block strong {
  font-style: normal;
  color: var(--text-main);
  font-weight: 700;
}

.source-analysis {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.source-analysis strong {
  color: var(--accent-emerald);
}

/* --------------------------------------------------------------------------
   "What Changed vs What Didn't" Comparative Matrix
   -------------------------------------------------------------------------- */
.changed-matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2.5rem 0;
}

.matrix-column {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.matrix-column.unchanged {
  border-top: 5px solid var(--accent-emerald);
}

.matrix-column.changed {
  border-top: 5px solid var(--accent-gold);
}

.matrix-col-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.matrix-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
}

.matrix-column.unchanged .matrix-icon-circle {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
}

.matrix-column.changed .matrix-icon-circle {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

.matrix-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.matrix-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.matrix-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Evidence & Debates Data Tables
   -------------------------------------------------------------------------- */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin: 1.75rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  background-color: var(--bg-card);
}

.data-table th {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--bg-card-subtle);
}

.table-question {
  font-weight: 700;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   FAQ Accordions & Search
   -------------------------------------------------------------------------- */
.faq-search-box {
  margin-bottom: 1.75rem;
  position: relative;
}

.faq-search-input {
  width: 100%;
  padding: 0.9rem 1.25rem 0.9rem 2.85rem;
  font-size: 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-speed);
}

.faq-search-input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px var(--accent-emerald-subtle);
}

.faq-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-speed);
}

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

.accordion-summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  user-select: none;
  list-style: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-faint);
  transition: transform var(--transition-speed);
}

.accordion-item[open] .accordion-chevron {
  transform: rotate(180deg);
  color: var(--accent-emerald);
}

.accordion-content {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  border-top: 1px solid transparent;
}

.accordion-item[open] .accordion-content {
  border-top-color: var(--border-color);
  padding-top: 1rem;
}

/* --------------------------------------------------------------------------
   Interactive Glossary Modal / Drawer
   -------------------------------------------------------------------------- */
.gloss-term {
  color: var(--accent-emerald);
  cursor: pointer;
  border-bottom: 1px dashed var(--accent-emerald);
  font-weight: 600;
  transition: all var(--transition-speed);
}

.gloss-term:hover {
  color: var(--accent-emerald-light);
  border-bottom-style: solid;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 550px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-pop 0.25s ease-out;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   References Section
   -------------------------------------------------------------------------- */
.reference-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.ref-item {
  display: flex;
  gap: 0.75rem;
  line-height: 1.5;
}

.ref-number {
  font-weight: 700;
  color: var(--accent-emerald);
  min-width: 28px;
  font-family: var(--font-mono);
}

.ref-text a {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
  padding: 3.5rem 0 0;
  transition: background-color var(--transition-speed);
}

.footer-inner,
.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 3.5rem;
}

.footer-brand p,
.footer-desc,
.footer-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 440px;
  margin-top: 0.75rem;
  line-height: 1.6;
}

.footer-col h4,
.footer-heading {
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.footer-links,
.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0;
  margin: 0;
}

.footer-links a,
.footer-links-list a {
  color: var(--text-muted);
  transition: color var(--transition-speed);
}
.footer-links a:hover,
.footer-links-list a:hover {
  color: var(--accent-emerald);
  text-decoration: none;
}

/* Distinct Bottom Bar with Different Background Color */
.footer-bottom-bar,
.footer-bottom {
  width: 100%;
  background-color: #f1f5f9;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

[data-theme="dark"] .footer-bottom-bar,
[data-theme="dark"] .footer-bottom {
  background-color: #060911;
  border-top-color: #172033;
}

.footer-bottom-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.8125rem;
}

.footer-copy {
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-disclaimer {
  font-size: 0.8125rem;
  color: var(--text-faint);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  text-align: right;
}

.ai-disclaimer::before {
  content: "✦";
  color: var(--accent-gold);
  font-style: normal;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .page-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .toc-sidebar {
    display: none;
  }
  .changed-matrix-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .article-title {
    font-size: 2rem;
  }
  .article-subtitle {
    font-size: 1.1rem;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .header-top {
    padding: 0 1rem;
  }
  .series-nav {
    display: none; /* Accessible in mobile menu */
  }
}

/* --------------------------------------------------------------------------
   Bilingual Dynamic Display Helpers
   -------------------------------------------------------------------------- */
[data-lang="tr"] .lang-en,
[data-lang="en"] .lang-tr {
  display: none !important;
}

/* Inline language tags */
span.lang-en, span.lang-tr {
  display: inline;
}
div.lang-en, div.lang-tr,
p.lang-en, p.lang-tr,
li.lang-en, li.lang-tr,
h1.lang-en, h1.lang-tr,
h2.lang-en, h2.lang-tr,
h3.lang-en, h3.lang-tr,
h4.lang-en, h4.lang-tr {
  display: block;
}

/* --------------------------------------------------------------------------
   Historical Chapters & Grand Journey Styles
   -------------------------------------------------------------------------- */
.journey-overview-box {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card-subtle));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 3.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.journey-overview-box::after {
  content: '☪';
  position: absolute;
  right: -20px;
  bottom: -40px;
  font-size: 16rem;
  opacity: 0.03;
  pointer-events: none;
  color: var(--accent-emerald);
}

.epoch-navigator-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  margin-bottom: 2rem;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--border-color);
}

.epoch-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
}

.epoch-tab:hover {
  border-color: var(--accent-emerald);
  color: var(--text-main);
  text-decoration: none !important;
}

.epoch-tab.active {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.epoch-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.85;
}

/* Chapter Card Deck */
.chapter-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed);
}

.chapter-container:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.chapter-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.chapter-badge-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chapter-number-pill {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  font-weight: 800;
  font-size: 0.8125rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.chapter-dates-tag {
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}

.chapter-heading-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.25;
}

/* Material Archaeological Evidence Box */
.evidence-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.evidence-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
  margin-bottom: 0.45rem;
}

.evidence-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Milestone Mini Table */
.milestone-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 1.25rem 0;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.milestone-mini-table th {
  background: var(--bg-main);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.milestone-mini-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.milestone-mini-table tr:last-child td {
  border-bottom: none;
}

.milestone-year {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-emerald);
  white-space: nowrap;
}

/* Lineage Branches / Theological Schools Diagram */
.lineage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.lineage-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition-speed);
}

.lineage-card:hover {
  border-color: var(--accent-emerald);
  transform: translateY(-2px);
  background: var(--bg-card);
}

.lineage-card h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.lineage-founder {
  font-size: 0.75rem;
  color: var(--accent-emerald);
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
}

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

/* --------------------------------------------------------------------------
   Chart Visual Breakdown Companions & Resilient Data Displays
   -------------------------------------------------------------------------- */
.chart-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.breakdown-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.breakdown-country {
  color: var(--text-main);
  font-weight: 600;
}

.breakdown-val {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.775rem;
}

.breakdown-val strong {
  color: var(--accent-emerald);
}

.breakdown-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-card-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-emerald), #34d399);
  border-radius: 999px;
  transition: width 1s ease-in-out;
}

.region-grid-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.region-pill-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: all var(--transition-speed);
}

.region-pill-item:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.region-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.region-pct {
  font-size: 0.875rem;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.sect-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.sect-pill-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
}

.sect-pill-pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.sect-pill-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 600;
}

.proj-milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.proj-pill-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
}

.proj-year {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: 700;
}

.proj-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  margin: 0.2rem 0;
}

.proj-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}




/* ==========================================================================
   cultusio - Digital History Platform: Homepage Design System
   Documentary Aesthetic, Academic Credibility & Quick Discovery
   ========================================================================== */

.home-hero {
  position: relative;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  background: radial-gradient(circle at 50% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 65%),
              radial-gradient(circle at 85% 75%, rgba(217, 119, 6, 0.06) 0%, transparent 55%),
              var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

[data-theme="dark"] .home-hero {
  background: radial-gradient(circle at 50% 15%, rgba(16, 185, 129, 0.12) 0%, transparent 70%),
              radial-gradient(circle at 85% 75%, rgba(245, 158, 11, 0.09) 0%, transparent 60%),
              #080c15;
}

.home-hero-inner {
  max-width: 980px;
  margin: 0 auto;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--badge-consensus-bg);
  color: var(--badge-consensus-text);
  border: 1px solid var(--badge-consensus-border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.home-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.home-title-highlight {
  background: linear-gradient(135deg, #059669 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-top: 0.35rem;
}

[data-theme="dark"] .home-title-highlight {
  background: linear-gradient(135deg, #34d399 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 820px;
  margin: 0 auto 2.25rem;
  font-weight: 400;
}

/* Quick Jump Religion Bar in Hero */
.home-quick-religions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 2.75rem;
}

.quick-religion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all var(--transition-speed);
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
}

.quick-religion-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
}

.quick-pill-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  background: var(--bg-card-subtle);
}

.quick-pill-date {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Metric Strip in Hero */
.home-metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
}

.home-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
}

.home-metric-val {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.home-metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Homepage Main Container */
.home-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

/* Section Common Header */
.home-section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3rem;
}

.home-section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.home-section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.home-section-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* 5 Portals Grid */
.home-portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
  margin-bottom: 5rem;
}

.home-portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.home-portal-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-emerald);
}

.portal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.portal-glyph-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.home-portal-card:hover .portal-glyph-box {
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-gold));
  color: #fff;
  border-color: transparent;
}

.portal-origin-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-faint);
  font-family: var(--font-mono);
  background: var(--bg-card-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.portal-card-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.portal-card-desc {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.portal-specs-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  background: var(--bg-card-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.portal-spec-item {
  display: flex;
  flex-direction: column;
}

.portal-spec-lbl {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.portal-spec-val {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 700;
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

.portal-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all var(--transition-speed);
  text-decoration: none !important;
}

.home-portal-card:hover .portal-cta-btn {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Comparative Timeline Section */
.comp-timeline-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 5rem;
  box-shadow: var(--shadow-sm);
}

.comp-timeline-flow {
  position: relative;
  padding-left: 2rem;
  margin-top: 2rem;
  border-left: 2px solid var(--border-color);
}

.timeline-era-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-era-item:last-child {
  margin-bottom: 0;
}

.timeline-era-node {
  position: absolute;
  left: -2.6rem;
  top: 0.15rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent-emerald);
  box-shadow: 0 0 0 4px var(--bg-card);
}

.timeline-era-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.timeline-era-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

.timeline-era-desc {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.timeline-parallels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.parallel-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.parallel-rel-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 0.25rem;
}

.parallel-text {
  font-size: 0.825rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* Material Artifacts Gallery */
.artifact-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 5rem;
}

.artifact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed);
}

.artifact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-lg);
}

.artifact-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.artifact-dating-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: #b45309;
  background: var(--badge-contested-bg);
  border: 1px solid var(--badge-contested-border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .artifact-dating-pill {
  color: #fcd34d;
}

.artifact-museum {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-weight: 600;
}

.artifact-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

.artifact-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.artifact-quote {
  font-style: italic;
  font-size: 0.825rem;
  line-height: 1.5;
  color: var(--text-main);
  border-left: 2px solid var(--accent-gold);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}

.artifact-link {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--accent-emerald);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.artifact-link:hover {
  text-decoration: underline;
}

/* Demographics Portal */
.demographics-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 5rem;
  box-shadow: var(--shadow-sm);
}

.demographics-chart-wrapper {
  position: relative;
  height: 380px;
  width: 100%;
  margin-top: 2rem;
}

/* Methodology 4-Pillar Grid */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 5rem;
}

.methodology-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.method-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-emerald);
  margin-bottom: 0.75rem;
}

.method-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.method-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
}


/* ==========================================================================
   cultusio - Interactive Spatiotemporal Spread Simulator Styles
   ========================================================================== */

.geo-simulator-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 5rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

/* Control Header Console */
.geo-controls-console {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.geo-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.geo-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.geo-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-emerald);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.geo-play-btn:hover {
  background: var(--accent-emerald-light);
  transform: translateY(-1px);
}

.geo-play-btn.playing {
  background: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.geo-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.geo-icon-btn:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.geo-speed-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.geo-speed-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-emerald);
}

/* Active Year Hero Badge */
.geo-year-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.geo-year-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: -0.02em;
  background: var(--bg-card);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Religion Filter Chips Bar */
.geo-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.geo-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.geo-filter-chip:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.geo-filter-chip.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

.geo-filter-chip[data-faith="islam"].active {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #fff;
}

.geo-filter-chip[data-faith="christianity"].active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.geo-filter-chip[data-faith="judaism"].active {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}

.geo-filter-chip[data-faith="hinduism"].active {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

.geo-filter-chip[data-faith="buddhism"].active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

/* Timeline Scrubber Slider */
.geo-scrubber-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.geo-scrubber-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-color);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.geo-scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.geo-scrubber-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-gold-light);
}

.geo-scrubber-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-faint);
  font-weight: 600;
  padding: 0 4px;
}

/* Canvas Viewport */
.geo-canvas-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 520;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.15);
}

#geoSpreadCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Map Overlay Legend */
.geo-map-legend {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.72rem;
  color: #e2e8f0;
  pointer-events: none;
}

.geo-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.geo-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Synchronized Documentary HUD Card */
.geo-hud-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed);
}

.geo-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.geo-hud-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-emerald);
  letter-spacing: 0.08em;
}

.geo-hud-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.geo-hud-desc {
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .geo-simulator-box {
    padding: 1.25rem;
  }
  .geo-controls-console {
    padding: 1rem;
  }
  .geo-year-val {
    font-size: 1.15rem;
    padding: 0.25rem 0.65rem;
  }
  .geo-map-legend {
    display: none;
  }
}
