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

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8f9fb;
  color: #1e293b;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: #2563eb; text-decoration: none; }
a:hover { color: #1d4ed8; text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ===== LAYOUT ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #0f172a;
  z-index: 200;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.nav-logo {
  font-weight: 800;
  font-size: 18px;
  color: #ffffff;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; color: #ffffff; }
.nav-logo span { color: #60a5fa; }

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.sidebar-close:hover { color: #ffffff; }

.sidebar-links {
  list-style: none;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-links > li > a {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  padding: 10px 20px;
  text-decoration: none;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-links > li > a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.sidebar-links > li > a.active {
  color: #ffffff;
  background: rgba(37,99,235,0.15);
  border-left-color: #2563eb;
}

/* Subtopic links */
.sidebar-subs {
  list-style: none;
  padding: 2px 0 8px;
}

.sidebar-subs a {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  padding: 5px 20px 5px 32px;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
}

.sidebar-subs a:hover {
  color: #ffffff;
  text-decoration: none;
}

.sidebar-subs a.current {
  color: #60a5fa;
}

/* Mobile toggle button */
#sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 150;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#sidebar-toggle:hover { background: #1e293b; }

/* Push page content to the right */
.page-content {
  margin-left: 260px;
}

/* ===== HERO (homepage) ===== */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: #ffffff;
  padding: 72px 24px;
  text-align: center;
}

.hero-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(147,197,253,0.12);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

.hero-sub {
  font-size: 18px;
  color: #cbd5e1;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== PAGE HEADER (inner pages) ===== */
.page-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  color: #ffffff;
  padding: 56px 24px;
  text-align: center;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 900;
  line-height: 1.15;
  max-width: 800px;
  margin: 0 auto 12px;
}

.page-header .lead {
  font-size: 17px;
  color: #cbd5e1;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

.content-section + .content-section {
  border-top: 1px solid #e2e8f0;
}

.content-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 16px;
  line-height: 1.2;
}

.content-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 28px 0 10px;
}

.content-section p {
  font-size: 16px;
  color: #334155;
  margin-bottom: 16px;
  line-height: 1.8;
}

.content-section ul, .content-section ol {
  margin: 12px 0 20px 24px;
  color: #334155;
  line-height: 1.8;
}

.content-section li {
  margin-bottom: 8px;
}

.source {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

/* ===== STAT CARDS ===== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card .num {
  font-size: 38px;
  font-weight: 900;
  color: #1e3a5f;
  line-height: 1.1;
}

.stat-card .label {
  font-size: 13px;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.4;
}

.stat-card .source {
  margin-top: 8px;
}

/* ===== BAR CHART ===== */
.bar-chart { margin: 32px 0; }

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.bar-label {
  width: 180px;
  min-width: 180px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  text-align: right;
  padding-right: 16px;
}

.bar-track {
  flex: 1;
  height: 36px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  min-width: fit-content;
}

.bar-fill.red { background: #dc2626; }
.bar-fill.amber { background: #d97706; }
.bar-fill.green { background: #16a34a; }
.bar-fill.teal { background: #0891b2; }
.bar-fill.slate { background: #475569; }

.bar-value-right {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-left: 12px;
  white-space: nowrap;
}

/* ===== COMPARE BLOCK ===== */
.compare {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  margin: 40px 0;
}

.compare-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.compare-box .big {
  font-size: 44px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.compare-box .detail {
  font-size: 14px;
  color: #64748b;
  margin-top: 8px;
}

.compare-vs {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #94a3b8;
}

.compare-box.danger {
  border-color: #fca5a5;
  background: #fef2f2;
}
.compare-box.danger .big { color: #dc2626; }

/* ===== CALLOUT ===== */
.callout {
  border-radius: 12px;
  padding: 24px 28px;
  margin: 28px 0;
  font-size: 15px;
  line-height: 1.7;
}
.callout strong { color: #0f172a; }
.callout p { margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }

.callout-red {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  color: #7f1d1d;
}
.callout-blue {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  color: #1e3a5f;
}
.callout-amber {
  background: #fffbeb;
  border-left: 4px solid #d97706;
  color: #78350f;
}
.callout-green {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  color: #14532d;
}

/* ===== INFO BLOCK ===== */
.info-block {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 28px;
  margin: 24px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.info-block h4 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.info-block p {
  font-size: 14px;
  color: #475569;
  margin-bottom: 8px;
  line-height: 1.7;
}
.info-block p:last-child { margin-bottom: 0; }

/* ===== CARD GRID ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.card .card-meta {
  font-size: 13px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 12px;
}

.card .card-num {
  font-size: 36px;
  font-weight: 900;
  color: #1e3a5f;
  line-height: 1.1;
}

.card .card-detail {
  font-size: 14px;
  color: #64748b;
  margin-top: 10px;
  line-height: 1.6;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  margin: 32px 0;
  padding-left: 36px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #e2e8f0;
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #f8f9fb;
}

.timeline-item.passed::before { background: #16a34a; }
.timeline-item.active::before { background: #2563eb; }
.timeline-item.pending::before { background: #94a3b8; }
.timeline-item.revoked::before { background: #dc2626; }

.timeline-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
}

.timeline-item p {
  font-size: 14px;
  color: #475569;
  margin-bottom: 4px;
  line-height: 1.6;
}

.timeline-item ul {
  margin: 8px 0 8px 20px;
  font-size: 14px;
  color: #475569;
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 8px;
  vertical-align: middle;
}
.badge-passed { background: #dcfce7; color: #166534; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #f1f5f9; color: #64748b; }
.badge-revoked { background: #fef2f2; color: #991b1b; }

/* ===== TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 14px;
}

.data-table th {
  background: #1e3a5f;
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 14px 16px;
  font-size: 13px;
}
.data-table th:first-child { border-radius: 10px 0 0 0; }
.data-table th:last-child { border-radius: 0 10px 0 0; }

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: top;
}

.data-table tr:nth-child(even) td { background: #f8f9fb; }
.data-table tr:last-child td:first-child { border-radius: 0 0 0 10px; }
.data-table tr:last-child td:last-child { border-radius: 0 0 10px 0; }

/* ===== HOME PAGE CARDS ===== */
.page-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 48px auto;
  padding: 0 24px;
}

.page-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37,99,235,0.08);
  text-decoration: none;
  transform: translateY(-2px);
}

.page-card .card-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.page-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.page-card p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

/* ===== SOURCE LIST (sources page) ===== */
.source-group {
  margin-bottom: 40px;
}

.source-group h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

.source-entry {
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}

.source-entry:last-child { border-bottom: none; }

.source-entry h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.source-entry p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 2px;
  line-height: 1.6;
}

.source-entry a {
  font-size: 13px;
  word-break: break-all;
}

/* ===== SIDE-BY-SIDE ===== */
.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0;
}

.side-by-side .side-col h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

.side-col--benefit h3 { color: #166534; border-color: #16a34a; }
.side-col--concern h3 { color: #991b1b; border-color: #dc2626; }

.side-col--benefit {
  background: #f0fdf4;
  border-radius: 12px;
  padding: 24px;
}

.side-col--concern {
  background: #fef2f2;
  border-radius: 12px;
  padding: 24px;
}

.side-by-side p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
  color: #334155;
}

.side-by-side p:last-child { margin-bottom: 0; }

.side-by-side strong { color: #0f172a; }

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

/* ===== FOOTER ===== */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  margin-top: 48px;
}

.footer a { color: #93c5fd; }
.footer p { margin-bottom: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 280px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar-close { display: block; }
  #sidebar-toggle { display: block; }
  .page-content { margin-left: 0; }
  .hero { padding: 48px 20px; padding-top: 60px; }
  .page-header { padding: 40px 20px; padding-top: 60px; }
}

@media (max-width: 768px) {
  .content-section { padding: 36px 20px; }
  .compare { grid-template-columns: 1fr; gap: 12px; }
  .compare-vs { padding: 8px 0; }
  .bar-label { width: 120px; min-width: 120px; font-size: 12px; }
  .stat-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

/* Smooth scrolling for anchor links */
html { scroll-behavior: smooth; }
