/*
 * MuslimPoll — design system
 * Palette is mirrored in viz_style.py (blog-portfolio/02-baby-bust-fertility),
 * so the charts and the page read as one visual language.
 */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --paper: #F7F3EC;
  --paper-raised: #FFFFFF;
  --ink: #171B19;
  --grey: #9B958C;
  --grey-dark: #6E6A63;
  --grey-light: #DDD6C9;
  --accent: #0E6E6B;
  --accent-deep: #0A514F;
  --accent-soft: #E2EDEB;
  --amber: #D97E36;
  --serif: "Newsreader", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* MuslimPoll uses a single canonical warm-beige scheme (no dark-mode override). */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

/* ---------- layout ---------- */

.column {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--grey-light);
  padding: 16px 0;
}

.masthead .column {
  max-width: 1080px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.brand em { color: var(--accent); font-style: normal; }

.masthead .tagline {
  font-size: 11px;
  font-weight: 500;
  color: var(--grey-dark);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- hero ---------- */

.hero { padding: 88px 0 44px; }

.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kicker::after {
  content: "";
  flex: 0 0 56px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}

.kicker a, .hero a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: none;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 64px;
  line-height: 1.04;
  margin: 0 0 26px;
  letter-spacing: -0.02em;
}

.standfirst {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.5;
  color: var(--grey-dark);
  margin: 0 0 32px;
}

.byline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--grey-dark);
  border-top: 1px solid var(--grey-light);
  border-bottom: 1px solid var(--grey-light);
  padding: 13px 0;
  text-transform: uppercase;
}

.byline .dot { color: var(--grey-light); }

/* ---------- article body ---------- */

article { padding: 28px 0 90px; }

article p { margin: 0 0 28px; }

article p.lede::first-letter {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 84px;
  line-height: 0.8;
  float: left;
  padding: 10px 14px 0 0;
  color: var(--accent);
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 84px 0 22px;
}

h2 .no {
  color: var(--accent);
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

h2 .no::after {
  content: "";
  flex: 0 0 40px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}

strong { font-weight: 600; }

.accent { color: var(--accent-deep); font-weight: 600; }

/* ---------- figures ---------- */

figure {
  margin: 56px 0;
  padding: 34px 26px 20px;
  background: #FDFCF9;   /* chart text is baked dark — keep panels light in all modes */
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--grey-light);
  border-radius: 0;
}

figure img, figure svg {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--grey-light);
  font-size: 13px;
  line-height: 1.6;
  color: var(--grey-dark);
}

figcaption b { color: #171B19; font-weight: 600; }

/* ---------- stat callouts ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 48px 0;
}

.stat {
  border-top: 3px solid var(--accent);
  padding: 18px 4px 6px;
}

.stat .num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
  margin-bottom: 10px;
}

.stat .lbl {
  font-size: 13px;
  line-height: 1.5;
  color: var(--grey-dark);
}

/* ---------- pull quote ---------- */

.pullquote {
  margin: 64px 0;
  padding: 0 0 0 28px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 29px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---------- caveat box ---------- */

.fineprint {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 30px 32px;
  margin: 56px 0;
  font-size: 15px;
  line-height: 1.7;
}

.fineprint h3 {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.fineprint ul { margin: 0; padding-left: 18px; }
.fineprint li { margin-bottom: 12px; }
.fineprint li:last-child { margin-bottom: 0; }
.fineprint b { font-weight: 600; }

/* ---------- country chips ---------- */

.chips { margin: 8px 0 30px; }

.chips span {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--grey-light);
  border-radius: 999px;
  padding: 5px 15px;
  margin: 0 6px 8px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--grey-dark);
}

.chips span.hot {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* ---------- links ---------- */

article a, footer a {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--grey-light);
}

article a:hover, footer a:hover { border-bottom-color: var(--accent); }

/* ---------- footer ---------- */

footer {
  background: #121614;
  color: #B7B1A6;
  padding: 64px 0 80px;
  font-size: 14px;
}

footer h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #EDE8DE;
  margin: 34px 0 12px;
}

footer h3:first-child { margin-top: 0; }

footer p { margin: 0 0 14px; line-height: 1.7; }

footer a { color: #6FC7C1; border-bottom-color: #2E3533; }
footer a:hover { border-bottom-color: #6FC7C1; }

footer code { color: #D8D3C9; font-size: 13px; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  h1 { font-size: 42px; }
  h2 { font-size: 28px; margin-top: 64px; }
  .standfirst { font-size: 19.5px; }
  .pullquote { font-size: 23px; }
  .stats { grid-template-columns: 1fr; gap: 8px; }
  .masthead .tagline { display: none; }
  .hero { padding: 56px 0 32px; }
  figure { padding: 24px 14px 16px; }
}

/* ---------- print ---------- */

@media print {
  body { background: #fff; }
  .masthead { position: static; }
  figure, .stat, .fineprint { break-inside: avoid; }
  footer { background: #fff; color: #444; }
}
