/* results-archive.css - /results/ pages (prefix ra-). Tokens only; loaded after state-legislatures.css,
   state-courts.css and wi-court.css, whose map, ramp, tooltip and result-bar classes these pages reuse. */

body { --ra-nodata: var(--pc-border-light); }

/* Controls: unit toggle + compact year buttons */
.ra-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ra-years { gap: 4px; }
.ra-years .pc-btn { font-size: 13px; padding: 7px 9px; font-variant-numeric: tabular-nums; }
.ra-years .pc-btn:disabled { opacity: 0.35; cursor: default; }

/* Maps */
.ra-mwrap, .ra-cwrap-nat { max-width: 960px; }
.ra-smap .us-state { stroke: var(--pc-surface); stroke-width: 0.8; }
.ra-smap .ra-lab, .ra-smap .sl-co-label { fill: var(--pc-text); paint-order: stroke; stroke: var(--pc-surface); stroke-width: 3px;
    stroke-opacity: 0.7; }
.ra-smap rect.ra-co { stroke: var(--pc-surface); stroke-width: 0.8; }
.ra-smap .is-focus { stroke: var(--pc-text); stroke-width: 1.8; }
.ra-cnat[hidden] { display: none; }
.wc-map.ra-natc path { stroke: var(--pc-surface); stroke-width: 0.25; }
.wc-map.ra-natc path.is-focus { stroke: var(--pc-text); stroke-width: 1.2; }
.wc-map.ra-ctymap path { vector-effect: non-scaling-stroke; stroke-width: 0.8; }
.wc-map.ra-ctymap path.is-focus { stroke-width: 2; }
.ra-ctymap { max-width: 560px; max-height: 520px; }
.ra-loading { padding: 40px 0; }
.ra-cwrap-nat { min-height: 200px; }
.ra-legend { flex-direction: row; flex-wrap: wrap; gap: 10px 28px; margin-top: 10px; }
.wc-map-side .ra-legend { flex-direction: column; }
.ra-nd { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pc-sans); font-size: 12px;
    color: var(--pc-text-body); align-self: flex-end; }
.wc-map-side .ra-nd { align-self: flex-start; }
.ra-nd i { width: 14px; height: 12px; background: var(--ra-nodata); display: inline-block; }
.ra-cmiss { margin-top: 6px; }

/* Chart */
.ra-chart { height: 340px; }
.ra-last { font-family: var(--pc-sans); font-size: 15px; color: var(--pc-text-body); margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.ra-last b { color: var(--pc-text); margin-right: 6px; }

/* Totals bar */
.ra-v { color: var(--pc-text-meta); font-size: 12px; font-variant-numeric: tabular-nums; }
.ra-pb-note { margin-top: 8px; font-variant-numeric: tabular-nums; }

/* State table */
.ra-tbl td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ra-tbl td.ra-m { font-weight: 700; color: var(--pc-text); box-shadow: inset 3px 0 0 var(--party-color); }
.ra-tbl td.ra-m2 { color: var(--pc-text-secondary); }

/* Link lists */
.ra-yearlinks { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--pc-sans); font-size: 16px; font-weight: 600;
    font-variant-numeric: tabular-nums; }
.ra-statelinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 18px;
    font-family: var(--pc-sans); font-size: 14px; }
.ra-yearlinks a, .ra-statelinks a, .ra-prevnext a { color: var(--pc-text); text-decoration: underline; text-underline-offset: 2px; }
.ra-prevnext { display: flex; gap: 18px; font-size: 14px; }

/* Senate: two bars per round */
.ra-sens { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px 40px; }
.ra-sen { font-family: var(--pc-sans); font-variant-numeric: tabular-nums; }
.ra-sen-y { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--pc-text); }
.ra-sen-t { font-weight: 400; font-size: 12px; color: var(--pc-text-meta); margin-left: 8px; }
.ra-rb-row { grid-template-columns: minmax(0, 170px) 1fr 48px; margin-bottom: 4px; }

/* Swing controls */
.ra-h3 { margin-top: 28px; }
.ra-swing-ctl { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--pc-sans); font-size: 14px; color: var(--pc-text-body);
    margin: 0 0 8px; }
.ra-sel { font: inherit; font-weight: 600; color: var(--pc-text); background: var(--pc-surface); border: 1px solid var(--pc-border);
    padding: 5px 8px; margin-left: 4px; }

/* Electoral vote lead: photos and big numbers, the 538 bar (pc seatbar) with the 270 line, popular vote beneath */
.ra-lead { padding-top: 8px; }
.ra-ev { max-width: 960px; }
.ra-ev-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.ra-ev-c { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ra-ev-l { flex-direction: row-reverse; text-align: right; }
.ra-ev-c .us-pt { flex-shrink: 0; border-radius: 50%; box-shadow: 0 0 0 3px var(--party-color); }
.ra-ev-t { display: flex; flex-direction: column; min-width: 0; }
.ra-ev-name { font-family: var(--pc-sans); font-size: 15px; font-weight: 600; color: var(--pc-text-secondary); }
.ra-ev-n { font-family: var(--pc-sans); font-size: 52px; font-weight: 700; line-height: 1; color: var(--pc-text);
    font-variant-numeric: tabular-nums; }
.ra-ev-track { margin-top: 4px; }
.ra-ev .pc-seatbar.ra-ev-bar { height: 28px; }
.ra-ev-pop { margin: 12px 0 0; font-family: var(--pc-sans); font-size: 14px; color: var(--pc-text-body); font-variant-numeric: tabular-nums; }
.ra-ev-pop a { color: var(--pc-text); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.ra-ev-other { margin: 4px 0 0; font-family: var(--pc-sans); font-size: 13px; color: var(--pc-text-meta); }

/* Election map coloured by electoral vote winner: labels on the party fill */
.ra-evmap .ra-lab, .ra-evmap .sl-co-label { fill: var(--pc-on-party-dark); stroke: none; }
.ra-evmap .ra-lab-ev { font-weight: 400; font-size: 10px; }
.ra-evmap .sl-co-label .ra-lab-ev { font-size: 9.5px; }
.ra-splits { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; }
.ra-split { display: flex; align-items: center; gap: 4px; font-family: var(--pc-sans); font-size: 13px; }
.ra-split-st { font-weight: 700; color: var(--pc-text); margin-right: 4px; }
.ra-chip { background: var(--party-color); color: var(--pc-on-party-dark); font-size: 12px; font-weight: 600; padding: 3px 7px;
    font-variant-numeric: tabular-nums; }
.ra-tip-ev { font-family: var(--pc-sans); font-size: 12px; font-weight: 600; color: var(--pc-text); margin: 2px 0 6px; }

/* State table: electoral votes and who won them */
.ra-sort { margin-bottom: 10px; }
.ra-tbl td.ra-ev-td { font-weight: 700; color: var(--pc-text); }
.ra-evw-c { display: inline-block; min-width: 46px; padding: 2px 6px; text-align: center; font-size: 12px; font-weight: 600;
    color: var(--pc-on-party-dark); }

/* State page: one chip per election */
.ra-evchips { display: flex; flex-wrap: wrap; gap: 3px; margin: 0 0 16px; }
.ra-evchips-k { font-family: var(--pc-sans); font-size: 12px; font-weight: 600; color: var(--pc-text-meta); margin: 0 0 6px; }
.pc-wrap a.ra-evchip { font-family: var(--pc-sans); font-size: 12px; color: var(--pc-on-party-dark); padding: 5px 8px; text-decoration: none;
    font-variant-numeric: tabular-nums; white-space: nowrap; }
.ra-evchip b { font-weight: 700; margin-right: 3px; }
.pc-wrap a.ra-evchip:hover, .pc-wrap a.ra-evchip:focus-visible { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 768px) {
    .ra-ev-n { font-size: 38px; }
    .ra-ev-c { gap: 10px; }
    .ra-ev-c .us-pt { width: 48px !important; height: 48px !important; }
    .ra-ev-name { font-size: 13px; }
    .pc-wrap a.ra-evchip { font-size: 11px; padding: 4px 6px; }
    .ra-chart { height: 280px; }
    .ra-tbl { font-size: 13px; }
    .ra-tbl .ra-sm-hide { display: none; }
    .ra-tbl th { white-space: normal; }
    .ra-years .pc-btn { padding: 7px 7px; font-size: 12px; }
    .ra-sens { grid-template-columns: 1fr; }
    .ra-rb-row { grid-template-columns: minmax(0, 130px) 1fr 44px; }
}
