/* Página do projeto Extrema em dados. Usa os tokens do site (static/css/app.css); só acrescenta o que é do projeto.
 * Cores das séries: paleta validada para fundo escuro (azul, laranja, verde-água, amarelo) + a cor do site para Extrema. */
:root {
  --ex-s1: #3987e5; --ex-s2: #d95926; --ex-s3: #199e70; --ex-s4: #c98500;
  --ex-forest: #2f9e44; --ex-neighbor: #4b5a6a; --ex-land: #151c26; --ex-land-2: #1f2935;
  --ex-win: var(--accent); --ex-lose: #2a3644;
}

.ex-ch { display: flex; flex-direction: column; gap: 24px; scroll-margin-top: 84px; }
.ex-head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.ex-head .lead strong, .lead strong { color: var(--text); }
.ex-src { font: 500 12px/1.5 var(--font-mono); color: var(--muted); }
.ex-note { font-size: 14.5px; color: var(--text-2); border-left: 2px solid var(--accent-line); padding-left: 14px; max-width: 70ch; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; }
.ex-ch .card { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; }
.ex-fig-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; }
.ex-fig-head h3 { font-size: 18px; font-weight: 600; }
.ex-fig-head .muted { font-size: 14px; color: var(--muted); }
.ex-chart { width: 100%; height: 320px; }
.ex-chart-tall { height: 400px; }
.ex-chart-short { height: 220px; }
.ex-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font: 500 12px var(--font-mono); color: var(--text-2); }
.ex-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -8px; }
.sw-main { background: var(--accent); } .sw-muted { background: var(--ex-neighbor); }
.sw-1 { background: var(--ex-s1); } .sw-2 { background: var(--ex-s2); } .sw-3 { background: var(--ex-s3); } .sw-4 { background: var(--ex-s4); }

/* Capa */
.ex-cover { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center; }
.ex-cover-text { display: flex; flex-direction: column; gap: 18px; }
.ex-title { font: 700 clamp(44px, 7vw, 84px)/1 var(--font-display); letter-spacing: -0.03em; }
.ex-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-toc a { font: 500 12.5px var(--font-mono); color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 12px; }
.ex-toc a:hover { border-color: var(--accent-line); color: var(--accent); }
.ex-map { position: relative; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-map svg { width: 100%; height: auto; display: block; }
.ex-town { fill: var(--ex-land); stroke: var(--bg); stroke-width: 2; transition: fill .2s; }
.ex-town:hover { fill: var(--ex-land-2); }
.ex-town.is-main { fill: var(--accent); }
.ex-town.is-main:hover { fill: var(--accent-strong); }
.ex-town-label { font: 600 13px var(--font-mono); fill: var(--text-2); text-anchor: middle; pointer-events: none; }
.ex-town-label.is-main { fill: var(--accent-ink); font-size: 15px; }
.ex-town-pop { font: 500 11px var(--font-mono); fill: var(--muted); text-anchor: middle; pointer-events: none; }
.ex-town-pop.is-main { fill: var(--accent-ink); }
.ex-locator { position: absolute; left: 0; top: 0; width: 28%; max-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.ex-locator path { fill: var(--ex-land-2); }
.ex-locator circle { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.ex-locator span { font: 500 11px var(--font-mono); color: var(--muted); }
.ex-kpis { margin-top: 8px; }
@media (max-width: 860px) { .ex-cover { grid-template-columns: 1fr; } }

/* Linha do tempo */
.ex-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); border-top: 2px solid var(--border-strong); }
.ex-timeline li { position: relative; padding: 18px 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.ex-timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.ex-timeline li.is-key::before { background: var(--accent); }
.ex-timeline time { font: 700 22px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ex-timeline p { font-size: 14.5px; color: var(--text-2); line-height: 1.5; }

/* História que rola */
.ex-scrolly { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: start; }
.ex-sticky { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); }
.ex-steps { display: flex; flex-direction: column; gap: 36vh; padding-block: 8vh 30vh; }
.ex-step { opacity: .5; transition: opacity .3s, border-color .3s; }
.ex-step.is-on { opacity: 1; border-color: var(--accent-line); }
.ex-step-year { font: 700 28px/1 var(--font-display); color: var(--accent); }
.ex-step p { color: var(--text-2); }
@media (max-width: 900px) {
  .ex-scrolly { grid-template-columns: 1fr; gap: 0; }
  .ex-sticky { z-index: 2; }
  .ex-sticky .ex-chart-tall { height: 300px; }
  .ex-steps { gap: 60vh; padding-block: 30vh 40vh; position: relative; z-index: 3; }
  .ex-step { opacity: .97; }
}
@media (prefers-reduced-motion: reduce) { .ex-step { transition: none; } }

/* Destaques e números */
.ex-callout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.ex-callout b { font: 700 clamp(44px, 6vw, 64px)/1 var(--font-display); color: var(--accent); letter-spacing: -0.03em; }
.ex-callout span { color: var(--text-2); max-width: 46ch; }
.ex-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 20px; }
.ex-facts div { display: flex; flex-direction: column; gap: 6px; border-top: 2px solid var(--ex-forest); padding-top: 12px; }
.ex-facts b { font: 700 clamp(30px, 3.6vw, 40px)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ex-facts span { font-size: 14.5px; color: var(--text-2); }
.ex-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.ex-seg button { font: 600 12px var(--font-mono); background: transparent; color: var(--text-2); border: 0; padding: 8px 12px; cursor: pointer; }
.ex-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* Comparador de satélite */
.ex-compare { position: relative; width: 100%; max-width: 820px; margin-inline: auto; aspect-ratio: 802 / 770; border-radius: var(--radius-sm); overflow: hidden; background: var(--ex-land); touch-action: pan-y; }
.ex-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.ex-compare-top { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.ex-compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; }
.ex-compare-handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: #07090d; display: grid; place-items: center; font: 600 16px var(--font-mono); box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.ex-compare-lbl { position: absolute; top: 12px; font: 600 12px var(--font-mono); color: #fff; background: rgba(7, 9, 13, .75); padding: 5px 9px; border-radius: 6px; pointer-events: none; }
.ex-compare-lbl.is-left { left: 12px; } .ex-compare-lbl.is-right { right: 12px; }
.ex-compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ex-compare input[type="range"]:focus-visible + .ex-compare-handle::after { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Natureza: programa e água */
.ex-mini-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ex-mini-tl li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 12px; font-size: 14.5px; color: var(--text-2); }
.ex-mini-tl time { font: 700 15px var(--font-display); color: var(--ex-forest); }
.ex-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.ex-flow div { position: relative; background: rgba(57, 135, 229, .1); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.ex-flow b { font: 600 16px var(--font-display); }
.ex-flow span { font-size: 13.5px; color: var(--text-2); }
.ex-flow div:not(:last-child)::after { content: "→"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); font: 700 15px var(--font-mono); color: var(--ex-s1); }
@media (max-width: 720px) { .ex-flow { gap: 18px; } .ex-flow div:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -17px; transform: none; } }

/* Política */
.ex-explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; }
.ex-explain div { border-top: 2px solid var(--border-strong); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ex-explain h3 { font-size: 17px; }
.ex-explain p { color: var(--text-2); font-size: 14.5px; }
.ex-terms { display: flex; flex-direction: column; gap: 10px; }
.ex-term { display: grid; grid-template-columns: 3.4rem 1fr; gap: 4px 12px; align-items: center; }
.ex-term-year { font: 600 13px var(--font-mono); color: var(--muted); }
.ex-term-bar { display: flex; height: 36px; border-radius: 8px; overflow: hidden; background: var(--ex-land); }
.ex-term-bar span { display: flex; align-items: center; padding: 0 10px; font: 600 12px var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ex-term-bar .is-win { background: var(--ex-win); color: var(--accent-ink); }
.ex-term-bar .is-lose { background: var(--ex-lose); color: var(--text-2); border-left: 2px solid var(--bg); }
.ex-term-meta { grid-column: 2; font: 500 12px var(--font-mono); color: var(--muted); }
.ex-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.ex-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
.ex-table th, .ex-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ex-table th { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ex-table td.num, .ex-table th.num { font-family: var(--font-mono); white-space: nowrap; }
.ex-table tr:last-child td { border-bottom: 0; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-chips span { font: 500 12px var(--font-mono); border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 7px; color: var(--text-2); white-space: nowrap; }

/* Fontes */
.ex-source-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); max-width: 80ch; }
.ex-source-list b { color: var(--text); }
