/* Tamil Nadu Election 2026 - Synopsis Site
   Clean corporate, Palatino Linotype, white/blue palette */

:root {
  --primary: #1F4E79;
  --secondary: #4472C4;
  --accent: #0091D5;
  --bg-soft: #F4F7FB;
  --divider: #D8E2EE;
  --text: #1F2937;
  --text-muted: #5A6B85;
  --white: #FFFFFF;
  --green: #2E8B57;
  --red: #C0392B;
  /* party colours */
  --tvk: #E72BD9;
  --dmk: #06B561;
  --admk: #A08547;
  --inc: #19AAED;
  --bjp: #FF6B1A;
  --pmk: #5D672B;
  --dmdk: #C9A300;
  --vck: #729E31;
  --cpi: #C20612;
  --cpim: #FF1D15;
  --iuml: #006600;
  --ammk: #911578;
  --ntk: #0B2551;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--text);
  line-height: 1.55;
  background: var(--white);
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero .eyebrow {
  font-size: 0.85rem; letter-spacing: 0.4em; text-transform: uppercase;
  margin: 0 0 1rem; opacity: 0.85;
}
.hero-search {
  display: flex; gap: 0.5rem; max-width: 720px; margin: 0 auto 1rem;
  flex-wrap: wrap; justify-content: center;
}
.hero-search input,
.hero-search select {
  padding: 0.6rem 0.95rem; border: 1px solid rgba(255,255,255,0.35);
  font-family: inherit; font-size: 0.95rem;
  background: white; color: var(--text);
  border-radius: 4px;
}
.hero-search input { flex: 1; min-width: 280px; }
.hero-search select { min-width: 180px; cursor: pointer; }
.section-nav {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem 0.85rem; margin: 0 auto 2.25rem; max-width: 920px;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.section-nav a {
  color: rgba(255,255,255,0.85); text-decoration: none;
  padding: 0.25rem 0.4rem; border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.section-nav a:hover {
  color: white; border-bottom-color: rgba(255,255,255,0.6);
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem); margin: 0; letter-spacing: 0.05em;
  font-weight: 700;
}
.hero h2 {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem); margin: 0.4rem 0 1.5rem;
  font-weight: 500; opacity: 0.9; letter-spacing: 0.04em;
}
.hero .lede {
  font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 720px; margin: 0 auto 2.5rem;
  font-style: italic; opacity: 0.95;
}
.hero-stats {
  display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap;
  margin: 2rem 0 1.5rem;
}
.hero-stat {
  background: rgba(255,255,255,0.08);
  border-left: 4px solid var(--c);
  padding: 1.5rem 2.2rem;
  min-width: 140px;
  border-radius: 4px;
  backdrop-filter: blur(6px);
}
.hero-stat .num {
  display: block; font-size: clamp(2.5rem, 5vw, 3.6rem);
  font-weight: 700; color: var(--c); line-height: 1;
}
.hero-stat .label {
  display: block; font-size: 0.95rem; letter-spacing: 0.25em;
  margin-top: 0.5rem; text-transform: uppercase;
}
.hero-meta {
  font-size: 0.9rem; opacity: 0.85; margin-top: 1.5rem;
  font-style: italic;
}

/* SECTIONS */
.section { padding: 4rem 0; }
.section.alt { background: var(--bg-soft); }
.section-tag {
  font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 0.6rem;
  padding-left: 0.85rem; border-left: 4px solid var(--accent);
}
.section-tag.accent { color: var(--accent); }
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--primary); margin: 0 0 2rem; font-weight: 700;
  line-height: 1.25;
}
.sub-tag {
  font-size: 0.8rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin: 1.75rem 0 0.85rem;
}
.caption {
  color: var(--text-muted); font-size: 0.95rem; font-style: italic;
  margin: 1rem 0;
}
.footnote {
  font-size: 0.85rem; color: var(--text-muted); font-style: italic;
  margin-top: 1.25rem; padding: 0.5rem 0.85rem; background: var(--bg-soft);
  border-radius: 3px;
}

/* CARDS */
.card-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem; margin: 1rem 0;
}
.card {
  background: var(--bg-soft); padding: 1.75rem 1.25rem;
  border: 1px solid var(--divider); position: relative;
  border-top: 4px solid var(--c); text-align: center;
}
.card.outline {
  background: white; border: 2px solid var(--c); border-top: 2px solid var(--c);
}
.card-num {
  font-size: clamp(2.4rem, 4.5vw, 3.4rem); font-weight: 700;
  color: var(--c); line-height: 1; margin-bottom: 0.5rem;
}
.card-label {
  font-size: 1rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--primary); margin: 0.5rem 0;
}
.card-note {
  font-size: 0.9rem; color: var(--text-muted); font-style: italic;
}

/* PILLS */
.pill-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0;
}
.pill {
  background: white; border: 1px solid var(--divider);
  padding: 0.45rem 0.95rem; border-radius: 999px;
  font-size: 0.9rem; color: var(--text-muted);
}
.pill strong { color: var(--primary); margin-right: 0.3rem; }

/* COMPARE TABLE */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table.compare, table.all-ac {
  width: 100%; border-collapse: collapse; font-size: 0.95rem;
}
table.compare thead, table.all-ac thead { background: var(--primary); color: white; }
table.compare th, table.compare td,
table.all-ac th, table.all-ac td {
  padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--divider);
  text-align: left;
}
table.compare th { font-weight: 700; letter-spacing: 0.05em; }
table.compare td:not(:first-child), table.compare th:not(:first-child) { text-align: center; }
table.compare .party { font-weight: 700; }
.party.tvk { color: var(--tvk); }
.party.dmk { color: var(--dmk); }
.party.admk { color: var(--admk); }
.party.inc { color: var(--inc); }
.party.bjp { color: var(--bjp); }
.party.pmk { color: var(--pmk); }
.party.ntk { color: var(--ntk); }
.up { color: var(--green); font-weight: 700; }
.down { color: var(--red); font-weight: 700; }

/* CALLOUT */
.callout {
  background: var(--bg-soft); border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem; margin: 1.5rem 0;
}
.callout-tag {
  font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 0.5rem;
}
.callout-body { margin: 0; color: var(--primary); }

/* GRID-2 */
.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  align-items: start;
}
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.chart-wrap {
  background: white; padding: 1rem; border: 1px solid var(--divider);
  min-height: 360px; position: relative;
}
.chart-wrap canvas { width: 100% !important; height: 360px !important; }

/* INSIGHT */
.insight {
  background: var(--bg-soft); border-left: 4px solid var(--c);
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.insight h4 { margin: 0 0 0.3rem; color: var(--primary); }
.insight p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* DARK PANEL */
.dark-panel {
  background: var(--primary); color: white;
  padding: 1.75rem; border-radius: 4px;
}
.dark-panel .panel-tag {
  font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1rem; font-weight: 700;
}
.dark-panel h4 { margin: 1rem 0 0.3rem; }
.dark-panel p { margin: 0 0 0.5rem; opacity: 0.9; }
.dark-panel .accent { color: #6CC4F0; font-weight: 700; }

/* ARITHMETIC */
.arithmetic {
  background: var(--bg-soft); border-top: 4px solid var(--accent);
  padding: 2rem; text-align: center;
}
.arithmetic .lab {
  font-size: 0.8rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--text-muted); margin: 0; font-weight: 700;
}
.arithmetic .lab.red { color: var(--red); }
.arithmetic .big-num {
  font-size: clamp(3.5rem, 8vw, 5.5rem); font-weight: 700;
  color: var(--primary); line-height: 1; margin: 0.25rem 0 1rem;
}
.arithmetic .big-num.blue { color: var(--secondary); }
.arithmetic .big-num.red { color: var(--red); }
.arithmetic hr {
  border: none; border-top: 1px solid var(--divider);
  margin: 1.25rem auto; max-width: 60%;
}

/* STEPS */
.steps {
  background: var(--bg-soft); padding: 1.5rem; margin-top: 1.5rem;
}
.steps .panel-tag {
  font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase;
  font-weight: 700; margin: 0 0 1rem;
}
.step {
  display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem;
}
.step-num {
  flex: 0 0 auto; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--secondary); color: white; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}

/* OPTION CARDS */
.opt-card {
  background: white; border: 1px solid var(--divider);
  border-top: 4px solid var(--c); padding: 1.5rem 1.25rem 0;
  display: flex; flex-direction: column;
}
.opt-tag {
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin: 0;
}
.opt-card h3 {
  font-size: 1.4rem; color: var(--primary); margin: 0.5rem 0 0.85rem;
}
.opt-num {
  font-size: 3rem; font-weight: 700; color: var(--c);
  margin: 0.5rem 0 0.25rem; line-height: 1;
}
.opt-label {
  font-size: 0.9rem; color: var(--text-muted); font-style: italic;
  margin: 0 0 0.85rem;
}
.opt-card p { font-size: 0.95rem; flex: 1; }
.opt-verdict {
  background: var(--c); color: white; padding: 0.7rem 1rem;
  text-align: center; font-weight: 700; margin: 1rem -1.25rem 0;
  font-size: 0.95rem;
}

/* LOSS-ROW */
.loss-row {
  background: var(--bg-soft); border: 1px solid var(--divider);
  border-left: 4px solid var(--c); padding: 0.85rem 1.1rem;
  margin-bottom: 0.65rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.loss-row strong { color: var(--primary); }
.loss-row em { color: var(--text-muted); font-size: 0.85rem; }
.loss-row .margin {
  font-size: 1.15rem; font-weight: 700; color: var(--red);
  text-align: right; line-height: 1.3;
}

/* HIGHLIGHT BANNER */
.highlight-banner {
  background: var(--primary); color: white;
  padding: 1.75rem; border-left: 6px solid var(--tvk);
  margin: 1.5rem 0 2rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.highlight-banner .hb-tag {
  font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--tvk); font-weight: 700; margin: 0;
}
.highlight-banner h3 {
  margin: 0; font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 600;
  font-style: italic;
}
.highlight-banner .hb-num {
  color: var(--tvk); font-size: 1.5em; font-weight: 700; font-style: normal;
  margin-left: 0.5rem;
}
.highlight-banner .hb-detail {
  margin: 0; opacity: 0.85; font-size: 0.95rem;
}

/* MARGIN ROW */
.margin-row {
  background: var(--bg-soft); border: 1px solid var(--divider);
  padding: 0.65rem 1rem; margin-bottom: 0.5rem;
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 1rem;
}
.margin-row.featured {
  background: #FFF4D6; border: 2px solid #F2A900;
}
.margin-row strong { color: var(--primary); }
.margin-row em { color: var(--text-muted); font-size: 0.8rem; }
.party-tag {
  background: var(--c); color: white; padding: 0.25rem 0.75rem;
  border-radius: 4px; font-weight: 700; font-size: 0.85rem;
  white-space: nowrap;
}
.m-num {
  font-size: 1.15rem; font-weight: 700; color: var(--primary);
  text-align: right; min-width: 80px;
}
.m-num.red { color: var(--red); font-size: 1.5rem; }

/* ALL CONSTITUENCIES TABLE */
.table-controls {
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center;
  margin: 1rem 0;
}
.table-controls input,
.table-controls select {
  padding: 0.55rem 0.85rem; border: 1px solid var(--divider);
  font-family: inherit; font-size: 0.95rem; background: white;
  border-radius: 4px;
}
.table-controls input { flex: 1; min-width: 220px; }
.table-controls select { min-width: 180px; }
table.all-ac {
  background: white; font-size: 0.9rem;
}
table.all-ac th {
  cursor: pointer; user-select: none; position: sticky; top: 0;
}
table.all-ac th:hover { background: var(--secondary); }
table.all-ac th.num, table.all-ac td.num { text-align: right; }
table.all-ac tbody tr:hover { background: var(--bg-soft); }
table.all-ac .party-tag { font-size: 0.78rem; padding: 0.18rem 0.55rem; }

/* VERDICT */
.verdict-section {
  background: var(--primary); color: white;
}
.verdict-section .section-tag.accent { color: #6CC4F0; border-left-color: #6CC4F0; }
.big-quote {
  font-size: clamp(1.3rem, 3vw, 2rem); margin: 1rem 0 2.5rem;
  font-weight: 400; line-height: 1.4;
}
.next-card {
  background: rgba(255,255,255,0.06); padding: 1.5rem;
  border-left: 4px solid var(--accent);
}
.next-card .next-tag {
  font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: #6CC4F0; font-weight: 700; margin: 0 0 0.5rem;
}
.next-card h4 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.next-card p { margin: 0; opacity: 0.9; font-size: 0.95rem; }
.verdict-section .sub-tag { color: #6CC4F0; }

/* SOURCES */
.src-panel {
  background: var(--bg-soft); border-left: 4px solid var(--c);
  padding: 1.5rem; height: 100%;
}
.src-panel .panel-tag {
  font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--c); font-weight: 700; margin: 0 0 1rem;
}
.src-list { list-style: none; padding: 0; margin: 0; }
.src-list li { margin-bottom: 0.85rem; }
.src-list li strong { color: var(--primary); display: block; }
.src-list li a, .src-list li em {
  font-size: 0.85rem; color: var(--text-muted); word-break: break-all;
}
.src-list li a:hover { color: var(--accent); }

/* HUMOR FOOTER */
.poster {
  background: #F4E8D8; padding: 3rem 0 2rem;
  border-top: 6px solid #B22222; border-bottom: 6px solid #B22222;
  text-align: center;
}
.poster h2 {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(2.5rem, 9vw, 6rem); font-weight: 900;
  color: #8B0000; margin: 0; line-height: 1; letter-spacing: 0.05em;
}
.poster h2.lighter { color: #B22222; }
.poster-meta {
  font-family: "Arial Black", Impact, sans-serif; font-weight: 900;
  font-size: clamp(1.2rem, 2.5vw, 2rem); color: #8B0000;
  margin: 1.25rem 0 1rem; letter-spacing: 0.15em;
}
.poster-caption {
  color: #8B0000; font-style: italic; font-size: 0.9rem;
  margin: 0; max-width: 700px; margin: 0 auto;
}

.site-footer {
  background: var(--primary); color: white; padding: 1.25rem 0;
  text-align: center;
}
.site-footer p { margin: 0; font-size: 0.85rem; opacity: 0.85; font-style: italic; }

/* BACK TO TOP - floating pill button (red, high visibility) */
.back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  padding: 0.75rem 1.2rem; border-radius: 999px;
  background: var(--red); color: white; border: none;
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  letter-spacing: 0.06em; line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.45);
  display: inline-flex; align-items: center; gap: 0.5rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.15s, background 0.15s, box-shadow 0.15s;
  z-index: 100;
}
.back-to-top .btt-arrow {
  font-size: 1.1rem; line-height: 1;
  display: inline-block; transform: translateY(-1px);
}
.back-to-top .btt-text { line-height: 1; }
.back-to-top.visible {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.back-to-top:hover {
  background: #A02B1F;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(192, 57, 43, 0.55);
}
@media (max-width: 600px) {
  .back-to-top {
    bottom: 1rem; right: 1rem;
    padding: 0.65rem 1rem; font-size: 0.85rem;
  }
}
