/* ===================================================================
   ELECTION 2027 — Design System
   Concept: "The Gazette" — a modern civic results-desk, not a template.
   Deep navy dossier canvas, tricolor used structurally (not decoratively),
   gold hairlines, serif display type, tabular mono for every figure.
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  /* --- Core palette (named) --- */
  --navy-950:#080d21;      /* page canvas */
  --navy-900:#0c1330;      /* section alt */
  --navy-800:#121a42;      /* raised surface / cards */
  --navy-700:#1b2657;      /* borders on dark */
  --ivory:#f6f2e7;         /* primary text on dark */
  --ivory-dim:#b9c0d9;     /* secondary text on dark */
  --saffron:#ff9933;       /* flag saffron */
  --saffron-deep:#e07f14;
  --india-green:#128807;   /* flag green */
  --india-green-light:#3fae3a;
  --gold:#caa356;          /* hairline / chakra accent */
  --gold-dim:#8a744a;
  --ink:#171308;           /* text on light surfaces */
  --paper:#f7f4ec;         /* light surface (forms, legal pages) */
  --paper-2:#efe9d9;
  --line-on-dark: rgba(246,242,231,0.14);
  --line-on-light: rgba(23,19,8,0.12);

  /* --- Type --- */
  --font-display:'Fraunces', ui-serif, Georgia, serif;
  --font-body:'IBM Plex Sans', -apple-system, Segoe UI, sans-serif;
  --font-mono:'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --container: 1180px;
  --radius-s: 3px;
  --radius-m: 6px;
  --ease: cubic-bezier(.22,.68,0,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; scroll-behavior:auto !important; }
}

body{
  margin:0;
  background:var(--navy-950);
  color:var(--ivory);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

body.light-page{ background:var(--paper); color:var(--ink); }

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{ font-family:var(--font-display); margin:0; font-weight:600; letter-spacing:-0.01em; }
p{ margin:0 0 1em; }
button{ font-family:inherit; cursor:pointer; }

:focus-visible{ outline:2px solid var(--saffron); outline-offset:3px; }

.wrap{ max-width:var(--container); margin:0 auto; padding:0 24px; }
.tricolor-rule{ height:3px; width:64px; background:linear-gradient(90deg,var(--saffron) 0 33%, var(--ivory) 33% 66%, var(--india-green) 66% 100%); border-radius:2px; }
.hairline{ height:1px; background:var(--line-on-dark); border:0; }
.light-page .hairline{ background:var(--line-on-light); }

.eyebrow-num{ font-family:var(--font-mono); font-size:13px; letter-spacing:0.04em; color:var(--gold); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:13px 26px; border-radius:2px; border:1px solid transparent;
  font-family:var(--font-body); font-weight:600; font-size:15px;
  transition:transform .25s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn-primary{ background:var(--saffron); color:#241202; }
.btn-primary:hover{ background:var(--ivory); transform:translateY(-2px); }
.btn-outline{ border-color:var(--line-on-dark); color:var(--ivory); }
.btn-outline:hover{ border-color:var(--saffron); color:var(--saffron); }
.light-page .btn-outline{ border-color:var(--line-on-light); color:var(--ink); }
.light-page .btn-outline:hover{ border-color:var(--saffron-deep); color:var(--saffron-deep); }

/* ---------- Site header ---------- */
.site-header{
  position:sticky; top:0; z-index:200;
  background:rgba(8,13,33,0.88); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line-on-dark);
}
.light-page .site-header{ background:rgba(247,244,236,0.92); border-color:var(--line-on-light); }
.header-inner{ display:flex; align-items:center; justify-content:space-between; height:76px; }
.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{ width:38px; height:38px; flex:none; }
.brand-text{ display:flex; flex-direction:column; line-height:1.15; }
.brand-text b{ font-family:var(--font-display); font-size:19px; font-weight:700; letter-spacing:0.01em; }
.brand-text span{ font-family:var(--font-mono); font-size:10.5px; letter-spacing:0.14em; color:var(--gold); text-transform:uppercase; }

.main-nav{ display:flex; align-items:center; gap:2px; }
.main-nav a{
  position:relative; padding:10px 16px; font-size:14.5px; font-weight:500; color:var(--ivory-dim);
  transition:color .2s;
}
.light-page .main-nav a{ color:#4a4634; }
.main-nav a:hover, .main-nav a.active{ color:var(--ivory); }
.light-page .main-nav a:hover, .light-page .main-nav a.active{ color:var(--ink); }
.main-nav a.active::after{
  content:''; position:absolute; left:16px; right:16px; bottom:4px; height:2px;
  background:linear-gradient(90deg,var(--saffron),var(--india-green));
}
.nav-cta{ margin-left:8px; }

.menu-toggle{ display:none; background:none; border:1px solid var(--line-on-dark); border-radius:3px; width:42px; height:42px; align-items:center; justify-content:center; color:var(--ivory); }
.light-page .menu-toggle{ color:var(--ink); border-color:var(--line-on-light); }

@media (max-width: 960px){
  .main-nav{
    position:fixed; inset:76px 0 0 0; background:var(--navy-950); flex-direction:column; align-items:stretch;
    padding:12px 24px 32px; gap:0; transform:translateY(-8px); opacity:0; pointer-events:none; transition:all .3s var(--ease);
    overflow-y:auto;
  }
  .light-page .main-nav{ background:var(--paper); }
  .main-nav.open{ transform:translateY(0); opacity:1; pointer-events:auto; }
  .main-nav a{ padding:16px 4px; border-bottom:1px solid var(--line-on-dark); font-size:17px; }
  .light-page .main-nav a{ border-color:var(--line-on-light); }
  .nav-cta{ margin:16px 4px 0; }
  .menu-toggle{ display:flex; }
}

/* ---------- Hero ---------- */
.hero{
  position:relative; overflow:hidden;
  padding:96px 0 76px;
  background:
    radial-gradient(ellipse 900px 500px at 82% -10%, rgba(255,153,51,0.16), transparent 60%),
    radial-gradient(ellipse 700px 500px at -10% 110%, rgba(18,136,7,0.18), transparent 60%),
    var(--navy-950);
  border-bottom:1px solid var(--line-on-dark);
}
.chakra-spin{
  position:absolute; right:-140px; top:-140px; width:520px; height:520px; opacity:0.10;
  animation:spin 90s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
.hero-grid{ display:grid; grid-template-columns:1.3fr 1fr; gap:56px; align-items:end; position:relative; }
.hero-kicker{ display:flex; align-items:center; gap:10px; margin-bottom:22px; }
.hero-kicker .dot{ width:7px; height:7px; border-radius:50%; background:var(--saffron); box-shadow:0 0 0 4px rgba(255,153,51,0.18); }
.hero-kicker span{ font-family:var(--font-mono); font-size:12.5px; letter-spacing:0.14em; text-transform:uppercase; color:var(--ivory-dim); }
.hero h1{ font-size:clamp(38px,5.4vw,64px); line-height:1.04; max-width:15ch; }
.hero h1 em{ font-style:italic; color:var(--saffron); }
.hero p.lead{ margin-top:22px; max-width:52ch; color:var(--ivory-dim); font-size:17.5px; }
.hero-actions{ display:flex; gap:14px; margin-top:34px; flex-wrap:wrap; }

.scoreboard{
  border:1px solid var(--line-on-dark); border-radius:4px; background:rgba(255,255,255,0.03);
  padding:26px 26px 20px;
}
.scoreboard-top{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:16px; }
.scoreboard-top span:first-child{ font-family:var(--font-mono); font-size:11.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--gold); }
.countdown{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
.countdown div{ text-align:center; border:1px solid var(--line-on-dark); border-radius:3px; padding:12px 4px; }
.countdown b{ display:block; font-family:var(--font-mono); font-size:26px; font-variant-numeric:tabular-nums; }
.countdown small{ font-size:10.5px; color:var(--ivory-dim); letter-spacing:0.06em; text-transform:uppercase; }
.scoreboard-foot{ display:flex; justify-content:space-between; font-size:13px; color:var(--ivory-dim); padding-top:14px; border-top:1px solid var(--line-on-dark); }
.scoreboard-foot b{ color:var(--ivory); font-family:var(--font-mono); }

/* ---------- Ticker ---------- */
.ticker{ background:var(--navy-900); border-bottom:1px solid var(--line-on-dark); overflow:hidden; padding:13px 0; }
.ticker-track{ display:flex; gap:48px; white-space:nowrap; animation:ticker 38s linear infinite; width:max-content; }
@keyframes ticker{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }
.ticker-track span{ font-family:var(--font-mono); font-size:13px; color:var(--ivory-dim); }
.ticker-track b{ color:var(--saffron); font-weight:500; }

/* ---------- Section scaffolding ---------- */
section{ padding:88px 0; }
.section-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-bottom:44px; flex-wrap:wrap; }
.section-head h2{ font-size:clamp(28px,3.4vw,40px); max-width:16ch; }
.section-head p{ color:var(--ivory-dim); max-width:42ch; margin:10px 0 0; }
.light-page .section-head p, .light-page section p{ color:#5a5540; }
.section-num{ font-family:var(--font-mono); font-size:13px; color:var(--gold); letter-spacing:0.08em; margin-bottom:10px; display:block; }

/* ---------- Dossier rows (states list) ---------- */
.dossier{ border-top:1px solid var(--line-on-dark); }
.dossier-row{
  display:grid; grid-template-columns:44px 1.4fr 0.9fr 0.9fr 1fr 90px; gap:18px; align-items:center;
  padding:22px 18px; border-bottom:1px solid var(--line-on-dark);
  transition:background .25s, border-color .25s; position:relative;
}
.dossier-row:hover{ background:rgba(255,255,255,0.03); }
.dossier-row::before{ content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:transparent; transition:background .25s; }
.dossier-row:hover::before{ background:linear-gradient(var(--saffron),var(--india-green)); }
.dossier-idx{ font-family:var(--font-mono); color:var(--gold-dim); font-size:14px; }
.dossier-name{ font-family:var(--font-display); font-size:21px; font-weight:600; }
.dossier-name small{ display:block; font-family:var(--font-body); font-size:12.5px; color:var(--ivory-dim); font-weight:400; margin-top:2px; }
.dossier-seats{ font-family:var(--font-mono); font-size:15px; }
.dossier-seats small{ display:block; color:var(--ivory-dim); font-size:11px; text-transform:uppercase; letter-spacing:0.06em; }
.dossier-when{ font-size:14px; color:var(--ivory-dim); }
.pill{ display:inline-block; padding:5px 12px; border-radius:20px; font-size:12px; font-weight:600; border:1px solid; }
.pill-bjp{ color:var(--saffron); border-color:rgba(255,153,51,0.4); background:rgba(255,153,51,0.08); }
.pill-inc{ color:#7ea6ff; border-color:rgba(126,166,255,0.4); background:rgba(126,166,255,0.08); }
.pill-aap{ color:#6fd0ff; border-color:rgba(111,208,255,0.4); background:rgba(111,208,255,0.08); }
.dossier-arrow{ text-align:right; font-family:var(--font-mono); font-size:13px; color:var(--gold); }

@media (max-width: 800px){
  .dossier-row{ grid-template-columns:1fr auto; row-gap:8px; }
  .dossier-idx{ display:none; }
  .dossier-seats,.dossier-when{ grid-column:1/2; }
  .dossier-arrow{ grid-column:2/3; grid-row:1/4; align-self:center; }
}

/* ---------- Cards (parties, options) ---------- */
.grid{ display:grid; gap:20px; }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-4{ grid-template-columns:repeat(4,1fr); }
@media (max-width:900px){ .grid-3,.grid-4{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .grid-3,.grid-4{ grid-template-columns:1fr; } }

.party-card{
  border:1px solid var(--line-on-dark); border-radius:4px; padding:26px; background:var(--navy-900);
  transition:transform .25s var(--ease), border-color .25s;
}
.party-card:hover{ transform:translateY(-4px); border-color:var(--gold-dim); }
.party-top{ display:flex; align-items:center; gap:14px; margin-bottom:16px; }
.party-badge{
  width:54px; height:54px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:700; font-size:16px; flex:none; color:#241202;
}
.party-top h3{ font-size:18px; }
.party-top span{ font-family:var(--font-mono); font-size:11.5px; color:var(--gold); }
.party-meta{ display:flex; flex-wrap:wrap; gap:8px 18px; margin:14px 0; font-size:12.5px; color:var(--ivory-dim); }
.party-meta b{ color:var(--ivory); font-weight:600; }
.party-desc{ font-size:14.5px; color:var(--ivory-dim); line-height:1.65; }
.chip{ font-size:11px; padding:3px 9px; border-radius:20px; border:1px solid var(--line-on-dark); color:var(--ivory-dim); }

/* ---------- Poll widget ---------- */
.poll-box{
  border:1px solid var(--line-on-dark); border-radius:6px; background:var(--navy-900); padding:34px;
  max-width:640px;
}
.poll-box h3{ font-size:22px; margin-bottom:6px; }
.poll-box .poll-sub{ color:var(--ivory-dim); font-size:14px; margin-bottom:22px; }
.poll-option{ margin-bottom:12px; }
.poll-btn{
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:rgba(255,255,255,0.03); border:1px solid var(--line-on-dark); border-radius:4px;
  padding:14px 16px; color:var(--ivory); font-size:14.5px; font-weight:500; text-align:left;
  transition:border-color .2s, background .2s;
}
.poll-btn:hover{ border-color:var(--saffron); }
.poll-btn .p-left{ display:flex; align-items:center; gap:12px; }
.poll-dot{ width:12px; height:12px; border-radius:50%; flex:none; }
.poll-options{ display:block; }
.poll-pct{ font-family:var(--font-mono); }
.poll-voted-note{ min-height:1px; }
.poll-result{ display:none; }
.poll-result.show{ display:block; }
.poll-bar-row{ margin-bottom:14px; }
.poll-bar-label{ display:flex; justify-content:space-between; font-size:13.5px; margin-bottom:6px; }
.poll-bar-label b{ font-family:var(--font-mono); }
.poll-bar-track{ height:9px; background:rgba(255,255,255,0.06); border-radius:20px; overflow:hidden; }
.poll-bar-fill{ height:100%; border-radius:20px; transition:width 1s var(--ease); width:0; }
.poll-note{ font-size:12px; color:var(--ivory-dim); margin-top:18px; }
.poll-reset{ font-family:var(--font-mono); font-size:12px; color:var(--gold); margin-top:6px; display:inline-block; }

/* ---------- Layout with sidebar ---------- */
.with-sidebar{ display:grid; grid-template-columns:1fr 300px; gap:56px; align-items:start; }
@media (max-width:900px){ .with-sidebar{ grid-template-columns:1fr; } }
.sidebar{ position:sticky; top:100px; display:flex; flex-direction:column; gap:22px; }
.side-box{ border:1px solid var(--line-on-dark); border-radius:4px; padding:22px; background:var(--navy-900); }
.light-page .side-box{ background:var(--paper-2); border-color:var(--line-on-light); }
.side-box h4{ font-size:14px; text-transform:uppercase; letter-spacing:0.06em; margin-bottom:14px; font-family:var(--font-mono); color:var(--gold); }
.side-list li{ padding:10px 0; border-bottom:1px solid var(--line-on-dark); font-size:14px; display:flex; justify-content:space-between; }
.light-page .side-list li{ border-color:var(--line-on-light); }
.side-list li:last-child{ border-bottom:0; }
.side-list b{ font-family:var(--font-mono); color:var(--saffron); }

/* ---------- State detail page ---------- */
.state-hero{ padding:64px 0 46px; border-bottom:1px solid var(--line-on-dark); }
.state-hero .breadcrumb{ font-size:13px; color:var(--ivory-dim); margin-bottom:22px; font-family:var(--font-mono); }
.state-hero .breadcrumb a:hover{ color:var(--saffron); }
.state-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--line-on-dark); border:1px solid var(--line-on-dark); margin-top:36px; border-radius:4px; overflow:hidden; }
.state-stats div{ background:var(--navy-950); padding:20px; }
.state-stats b{ display:block; font-family:var(--font-mono); font-size:24px; }
.state-stats span{ font-size:11.5px; color:var(--ivory-dim); text-transform:uppercase; letter-spacing:0.05em; }
@media (max-width:700px){ .state-stats{ grid-template-columns:repeat(2,1fr); } }

.const-search{ margin-bottom:26px; }
.const-search input{
  width:100%; padding:14px 18px; background:var(--navy-900); border:1px solid var(--line-on-dark);
  border-radius:4px; color:var(--ivory); font-family:var(--font-body); font-size:15px;
}
.district-group{ margin-bottom:30px; }
.district-group h4{ font-family:var(--font-mono); font-size:13px; color:var(--gold); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:14px; padding-bottom:8px; border-bottom:1px solid var(--line-on-dark); }
.const-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; }
.const-chip{ border:1px solid var(--line-on-dark); border-radius:3px; padding:10px 13px; font-size:13.5px; display:flex; justify-content:space-between; gap:8px; }
.const-chip small{ font-family:var(--font-mono); color:var(--gold-dim); font-size:11px; }
.const-chip.sc, .const-chip.st{ border-left:3px solid var(--saffron); }

/* ---------- Light page (legal / about / contact) ---------- */
.light-page section{ padding:64px 0; }
.prose{ max-width:74ch; }
.prose h2{ font-size:26px; margin:44px 0 14px; }
.prose h2:first-child{ margin-top:0; }
.prose p, .prose li{ color:#4a4634; font-size:15.5px; line-height:1.75; margin-bottom:14px; }
.prose ul{ padding-left:20px; list-style:disc; }
.prose li{ margin-bottom:8px; }
.light-page .site-header{ }
.page-banner{ padding:56px 0 40px; border-bottom:1px solid var(--line-on-light); }
.page-banner .eyebrow-num{ color:var(--saffron-deep); }
.page-banner h1{ font-size:clamp(30px,4vw,44px); color:var(--ink); margin-top:10px; }
.noindex-tag{ display:inline-block; margin-top:14px; font-family:var(--font-mono); font-size:11.5px; color:#8a744a; }

/* ---------- Contact form ---------- */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.form-grid .full{ grid-column:1/3; }
@media (max-width:640px){ .form-grid, .form-grid .full{ grid-template-columns:1fr; grid-column:1; } }
label{ display:block; font-size:13px; font-weight:600; margin-bottom:7px; color:#4a4634; }
input,textarea,select{
  width:100%; padding:12px 14px; border:1px solid var(--line-on-light); border-radius:4px;
  font-family:var(--font-body); font-size:14.5px; background:#fff; color:var(--ink);
}
textarea{ min-height:140px; resize:vertical; }
.form-field{ margin-bottom:18px; }

/* ---------- News ---------- */
.news-empty{ border:1px dashed var(--line-on-dark); border-radius:6px; padding:70px 30px; text-align:center; }
.news-empty h3{ font-size:22px; margin-bottom:10px; }
.news-empty p{ color:var(--ivory-dim); max-width:44ch; margin:0 auto; }
.news-card{ border:1px solid var(--line-on-dark); border-radius:4px; overflow:hidden; background:var(--navy-900); }
.news-card .nc-body{ padding:20px; }
.news-card .nc-tag{ font-family:var(--font-mono); font-size:11px; color:var(--gold); text-transform:uppercase; }
.news-card h3{ font-size:17px; margin:8px 0; }
.news-card p{ font-size:13.5px; color:var(--ivory-dim); }

/* ---------- Footer ---------- */
footer{ background:var(--navy-900); border-top:1px solid var(--line-on-dark); padding:64px 0 0; }
.foot-grid{ display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr; gap:36px; padding-bottom:50px; }
@media (max-width:800px){ .foot-grid{ grid-template-columns:1fr 1fr; } }
.foot-grid h5{ font-family:var(--font-mono); font-size:12px; letter-spacing:0.08em; text-transform:uppercase; color:var(--gold); margin-bottom:16px; }
.foot-grid li{ margin-bottom:10px; font-size:14px; color:var(--ivory-dim); }
.foot-grid li a:hover{ color:var(--ivory); }
.foot-about p{ color:var(--ivory-dim); font-size:14px; max-width:36ch; margin-top:14px; }
.foot-bottom{ border-top:1px solid var(--line-on-dark); padding:22px 0; display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; font-size:12.5px; color:var(--ivory-dim); }
.foot-bottom a:hover{ color:var(--saffron); }
.foot-strip{ height:5px; background:linear-gradient(90deg,var(--saffron),var(--ivory) 50%,var(--india-green)); }

/* ---------- Reveal-on-load ---------- */
.reveal{ opacity:0; transform:translateY(14px); animation:revealIn .7s var(--ease) forwards; }
@keyframes revealIn{ to{ opacity:1; transform:none; } }

/* ---------- Back to top / misc ---------- */
.skip-link{ position:absolute; left:-999px; top:0; background:var(--saffron); color:#241202; padding:10px 16px; z-index:999; }
.skip-link:focus{ left:12px; top:12px; }
