/* ============================================================
   PoliKnowledge — styles.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --color-bg: #0c0e14;
  --color-bg-alt: #111318;
  --color-bg-card: #161922;
  --color-bg-hover: #1d2130;
  --color-border: #242838;
  --color-border-subtle: #1a1e2a;
  --color-text: #d8dde8;
  --color-text-muted: #7e8799;
  --color-text-dim: #4a5168;

  /* Simplified, more sophisticated palette */
  --color-economic: #e8a045;
  --color-economic-dim: rgba(232,160,69,0.15);
  --color-political: #5b8def;
  --color-political-dim: rgba(91,141,239,0.15);
  --color-government: #45c98a;
  --color-government-dim: rgba(69,201,138,0.15);
  --color-ideological: #a67cf0;
  --color-ideological-dim: rgba(166,124,240,0.15);
  --color-historical: #e86f6f;
  --color-historical-dim: rgba(232,111,111,0.15);
  --color-compare: #f0a76b;
  --color-compare-dim: rgba(240,167,107,0.15);
  --color-glossary: #45c9c9;
  --color-glossary-dim: rgba(69,201,201,0.15);

  --color-pro: #45c98a;
  --color-con: #e86f6f;
  --color-accent: #5b8def;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Crimson Pro', Georgia, serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 1px 8px rgba(0,0,0,0.35);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 12px 48px rgba(0,0,0,0.6);

  --transition: 0.16s ease;
  --max-width: 1200px;
  --article-width: 820px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 {
  line-height: 1.2;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p { color: var(--color-text); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; color: var(--color-text); }
li { margin-bottom: 0.35rem; }

strong { color: #fff; font-weight: 600; }
em { color: var(--color-text-muted); font-style: italic; }

code {
  font-family: var(--font-mono);
  background: var(--color-bg-card);
  padding: 0.1em 0.45em;
  border-radius: 5px;
  font-size: 0.87em;
  color: var(--color-glossary);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* --- Layout Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.75rem;
}

.article-container {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 0 1.75rem;
}

.section { padding: 4rem 0; }
.section-sm { padding: 2rem 0; }
.section-lg { padding: 6rem 0; }

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* --- Navigation --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 14, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  height: 58px;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.75rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.navbar-brand span { color: var(--color-political); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0;
  flex: 1;
  justify-content: center;
}

.nav-item { position: relative; }

.nav-link {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: 7px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: var(--color-bg-card);
}

.nav-dropdown { position: relative; }

.nav-dropdown > .nav-link::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 3.5px solid currentColor;
  margin-left: 5px;
  vertical-align: middle;
  opacity: 0.5;
  transition: transform var(--transition);
}

.nav-dropdown:hover > .nav-link::after {
  transform: rotate(180deg);
  opacity: 0.8;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.4rem;
  min-width: 195px;
  box-shadow: var(--shadow-xl);
  list-style: none;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 450;
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
  letter-spacing: -0.01em;
}

.nav-dropdown-menu a:hover {
  color: #fff;
  background: var(--color-bg-hover);
}

/* Search */
.navbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.search-input {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 0.35rem 1rem 0.35rem 2rem;
  font-size: 0.82rem;
  color: var(--color-text);
  width: 160px;
  transition: width var(--transition), border-color var(--transition), background var(--transition);
  outline: none;
  font-family: var(--font-sans);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%234a5168' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 8px center;
}

.search-input:focus {
  width: 220px;
  border-color: var(--color-political);
  background-color: var(--color-bg-hover);
}

.search-input::placeholder { color: var(--color-text-dim); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 7px;
  border: none;
  background: none;
  border-radius: 8px;
  transition: background var(--transition);
}

.hamburger:hover { background: var(--color-bg-card); }

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-muted);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Search Results */
#search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 380px;
  overflow-y: auto;
  z-index: 300;
}

#search-results.active { display: block; }

.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background var(--transition);
}

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

.search-result-item:hover {
  background: var(--color-bg-hover);
}

.search-result-title { font-size: 0.88rem; color: #fff; font-weight: 600; letter-spacing: -0.01em; }
.search-result-desc { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.2rem; line-height: 1.4; }
.search-result-tag {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 99;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
  flex-direction: column;
  gap: 0.3rem;
}

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

.mobile-nav a {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 450;
  color: var(--color-text-muted);
  letter-spacing: -0.01em;
  transition: color var(--transition), background var(--transition);
}

.mobile-nav a:hover {
  color: #fff;
  background: var(--color-bg-card);
}

.mobile-nav-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  padding: 0 0.5rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 1rem 0;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { color: var(--color-text-dim); }

/* --- Hero --- */
.hero {
  padding: 6rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(91,141,239,0.09) 0%, transparent 65%),
    radial-gradient(ellipse 30% 30% at 80% 50%, rgba(166,124,240,0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* Subtle grid texture */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border-subtle) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, black 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-political);
  margin-bottom: 1.5rem;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-political);
  opacity: 0.6;
}

.hero h1 {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-political);
  font-weight: 400;
  font-size: 1.05em;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 520px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

.hero-actions { display: flex; gap: 0.875rem; flex-wrap: wrap; align-items: center; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.625rem 1.35rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  font-family: var(--font-sans);
}

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

.btn-primary {
  background: var(--color-political);
  color: #fff;
  box-shadow: 0 2px 10px rgba(91,141,239,0.3);
}

.btn-primary:hover {
  background: #4a7de0;
  color: #fff;
  box-shadow: 0 4px 16px rgba(91,141,239,0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  background: var(--color-bg-card);
  color: #fff;
  border-color: var(--color-bg-hover);
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 0.95rem; }

/* --- Cards --- */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-link {
  display: block;
}

.card-link:hover { text-decoration: none; }

/* Hover accent border per category */
.card-link.accent-economic:hover { border-color: rgba(232,160,69,0.35); background: rgba(232,160,69,0.03); }
.card-link.accent-political:hover { border-color: rgba(91,141,239,0.35); background: rgba(91,141,239,0.03); }
.card-link.accent-government:hover { border-color: rgba(69,201,138,0.35); background: rgba(69,201,138,0.03); }
.card-link.accent-ideological:hover { border-color: rgba(166,124,240,0.35); background: rgba(166,124,240,0.03); }
.card-link.accent-historical:hover { border-color: rgba(232,111,111,0.35); background: rgba(232,111,111,0.03); }
.card-link.accent-compare:hover { border-color: rgba(240,167,107,0.35); background: rgba(240,167,107,0.03); }
.card-link.accent-glossary:hover { border-color: rgba(69,201,201,0.35); background: rgba(69,201,201,0.03); }

/* Card icon — SVG-based, no emoji */
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  flex-shrink: 0;
}

.icon-bg-economic { background: var(--color-economic-dim); }
.icon-bg-political { background: var(--color-political-dim); }
.icon-bg-government { background: var(--color-government-dim); }
.icon-bg-ideological { background: var(--color-ideological-dim); }
.icon-bg-historical { background: var(--color-historical-dim); }
.icon-bg-compare { background: var(--color-compare-dim); }
.icon-bg-glossary { background: var(--color-glossary-dim); }

.card-icon svg { width: 20px; height: 20px; }

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.45rem;
  letter-spacing: -0.015em;
}

.card-desc {
  font-size: 0.845rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

/* Tag colors */
.tag-economic { background: var(--color-economic-dim); color: var(--color-economic); }
.tag-political { background: var(--color-political-dim); color: var(--color-political); }
.tag-government { background: var(--color-government-dim); color: var(--color-government); }
.tag-ideological { background: var(--color-ideological-dim); color: var(--color-ideological); }
.tag-historical { background: var(--color-historical-dim); color: var(--color-historical); }
.tag-compare { background: var(--color-compare-dim); color: var(--color-compare); }
.tag-glossary { background: var(--color-glossary-dim); color: var(--color-glossary); }

/* --- Section Header --- */
.section-header { margin-bottom: 2.5rem; }
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { color: var(--color-text-muted); max-width: 560px; font-size: 0.95rem; }

/* --- Article Layout --- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 265px;
  gap: 3rem;
  align-items: start;
}

.article-content { min-width: 0; }

.article-sidebar {
  position: sticky;
  top: 78px;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.article-header .tag { margin-bottom: 1rem; }
.article-header h1 { margin-bottom: 1rem; }

.article-header .lead {
  font-size: 1.08rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.article-section { margin-bottom: 2.5rem; }
.article-section h2 { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); }
.article-section h3 { margin-bottom: 0.75rem; margin-top: 1.5rem; }
.article-section p { margin-bottom: 1rem; }
.article-section ul, .article-section ol { margin-bottom: 1rem; }

/* --- Takeaway Box --- */
.takeaway-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-political);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.takeaway-box.economic { border-left-color: var(--color-economic); }
.takeaway-box.political { border-left-color: var(--color-political); }
.takeaway-box.government { border-left-color: var(--color-government); }
.takeaway-box.ideological { border-left-color: var(--color-ideological); }
.takeaway-box.historical { border-left-color: var(--color-historical); }

.takeaway-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-political);
  margin-bottom: 0.45rem;
}

.takeaway-box.economic .takeaway-label { color: var(--color-economic); }
.takeaway-box.government .takeaway-label { color: var(--color-government); }
.takeaway-box.ideological .takeaway-label { color: var(--color-ideological); }
.takeaway-box.historical .takeaway-label { color: var(--color-historical); }

.takeaway-box p { color: var(--color-text); font-size: 0.93rem; }

/* --- Tables --- */
.table-wrapper { overflow-x: auto; margin-bottom: 1.5rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.table-pro { color: var(--color-pro); font-weight: 600; }
.table-con { color: var(--color-con); font-weight: 600; }

/* Pros/Cons Grid */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pros-box, .cons-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.pros-box { border-top: 2px solid var(--color-pro); }
.cons-box { border-top: 2px solid var(--color-con); }

.pros-box h4 { color: var(--color-pro); margin-bottom: 0.75rem; }
.cons-box h4 { color: var(--color-con); margin-bottom: 0.75rem; }

.pros-box li::marker { color: var(--color-pro); }
.cons-box li::marker { color: var(--color-con); }

/* --- Sidebar Widgets --- */
.sidebar-widget {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.sidebar-widget h4 {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 0.875rem;
}

.sidebar-links { list-style: none; padding: 0; }
.sidebar-links li { margin-bottom: 0.15rem; }

.sidebar-links a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 7px;
  font-size: 0.855rem;
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
}

.sidebar-links a:hover {
  color: #fff;
  background: var(--color-bg-hover);
}

.sidebar-links a.active { color: var(--color-political); }

.toc-list { list-style: none; padding: 0; counter-reset: toc; }
.toc-list li { counter-increment: toc; margin-bottom: 0.2rem; }
.toc-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.825rem;
  color: var(--color-text-muted);
  padding: 0.3rem 0;
  transition: color var(--transition);
}
.toc-list a::before {
  content: counter(toc);
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--color-text-dim);
  min-width: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.toc-list a:hover { color: #fff; }

/* --- Stat Cards --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 3rem 0;
}

.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--stat-color, var(--color-political));
  opacity: 0.5;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

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

/* --- Quote Block --- */
.quote-block {
  border-left: 2px solid var(--color-border);
  padding: 0.875rem 1.5rem;
  margin: 1.75rem 0;
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 1rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.quote-block cite {
  display: block;
  font-size: 0.8rem;
  font-style: normal;
  font-family: var(--font-sans);
  color: var(--color-text-dim);
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
}

/* --- Timeline --- */
.timeline { position: relative; padding-left: 2rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.575rem;
  top: 0.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-political);
  box-shadow: 0 0 0 3px var(--color-bg);
}

.timeline-date {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-dim);
  margin-bottom: 0.3rem;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.timeline-desc {
  font-size: 0.86rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* --- Comparison Tool --- */
.compare-selectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.compare-select-group label {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.compare-select-group select {
  width: 100%;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.65rem 2.5rem 0.65rem 1rem;
  font-size: 0.88rem;
  color: var(--color-text);
  outline: none;
  cursor: pointer;
  appearance: none;
  font-family: var(--font-sans);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5168' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  transition: border-color var(--transition), background var(--transition);
}

.compare-select-group select:focus { border-color: var(--color-political); background-color: var(--color-bg-hover); }

#compare-table-wrapper { overflow-x: auto; }

.compare-table { width: 100%; border-collapse: collapse; }

.compare-table th {
  background: var(--color-bg-alt);
  padding: 1rem;
  text-align: left;
  min-width: 160px;
}

.compare-table th:first-child { min-width: 160px; }

.compare-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: top;
  font-size: 0.88rem;
}

.compare-table .row-label {
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rating-dots { display: flex; gap: 3px; }

.rating-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
}

.rating-dot.filled { background: var(--color-political); }

/* --- Spectrum Chart --- */
#spectrum-chart {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

#spectrum-svg { width: 100%; height: auto; }

.ideology-tooltip {
  position: absolute;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  pointer-events: none;
  max-width: 210px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 50;
}

.ideology-tooltip.visible { opacity: 1; }
.ideology-tooltip strong { display: block; color: #fff; margin-bottom: 0.25rem; font-size: 0.88rem; }

/* --- Glossary --- */
.glossary-search {
  position: relative;
  margin-bottom: 2rem;
}

.glossary-search input {
  width: 100%;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 0.95rem;
  color: var(--color-text);
  outline: none;
  font-family: var(--font-sans);
  transition: border-color var(--transition), background var(--transition);
}

.glossary-search input:focus {
  border-color: var(--color-glossary);
  background: var(--color-bg-hover);
}

.glossary-search input::placeholder { color: var(--color-text-dim); }

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

.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.alpha-nav a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.alpha-nav a:hover {
  color: #fff;
  background: var(--color-bg-hover);
  border-color: var(--color-bg-hover);
}

.glossary-letter-section { margin-bottom: 3rem; }

.glossary-letter-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-glossary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.glossary-term {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.glossary-term:last-child { border-bottom: none; }

.glossary-term dt {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.glossary-term dd {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin-left: 0;
  line-height: 1.6;
}

.glossary-term.hidden { display: none; }

/* --- Overview Index Pages --- */
.overview-hero {
  padding: 3.5rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}

.overview-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, var(--hero-glow, rgba(91,141,239,0.08)) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Footer --- */
footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.footer-brand span { color: var(--color-political); }
.footer-desc { font-size: 0.84rem; color: var(--color-text-muted); line-height: 1.65; }

.footer-col h5 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 0.875rem;
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.35rem; }

.footer-col a {
  font-size: 0.855rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
  letter-spacing: -0.01em;
}

.footer-col a:hover { color: #fff; }

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

.footer-bottom p { font-size: 0.8rem; color: var(--color-text-dim); margin: 0; }

/* --- Highlights/accents --- */
.highlight-economic { color: var(--color-economic); }
.highlight-political { color: var(--color-political); }
.highlight-government { color: var(--color-government); }
.highlight-ideological { color: var(--color-ideological); }
.highlight-historical { color: var(--color-historical); }

/* --- Info boxes --- */
.info-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.info-box-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 0.5rem;
}

/* Chips/badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: -0.01em;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

/* --- Three Questions section --- */
.questions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.question-card {
  padding: 2rem 1.5rem;
}

.question-number {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 1rem;
}

.question-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* --- Sections divider --- */
.section-divider {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .navbar-nav { gap: 0; }
  .nav-link { padding: 0.4rem 0.55rem; font-size: 0.8rem; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.35rem; }
  .hero h1 { font-size: 2.4rem; }
  .hero { padding: 3.5rem 0 3rem; }

  .navbar-nav { display: none; }
  .navbar-search { display: none; }
  .hamburger { display: flex; }

  .grid-2, .grid-3, .questions-grid { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .compare-selectors { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { justify-content: center; width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Print */
@media print {
  .navbar, footer, .article-sidebar, .hamburger { display: none; }
  body { background: #fff; color: #000; }
  .card, .takeaway-box, .info-box { border: 1px solid #ccc; }
}
