/* The Tribune's clothes for the Navajo County live results board (election/navajo/index.html).
   Loaded after the page's own stylesheet, so these rules win. Everything here is the site's
   own palette (assets/css/desert-v4.css): warm white, paper, canyon, terracotta, ochre,
   turquoise, sage. Party colours stay a clear red and blue so a reader never has to guess.
   The page's markup, ids and script are untouched. */
@import url("/wp-content/themes/painted-desert-tribune-theme/assets/css/fonts.css");

:root {
  color-scheme: light;
  --bg: #fbf0d6;            /* warm white, the site's canvas */
  --panel: #fff9ea;         /* paper: cards and tables */
  --fg: #1c1712;            /* ink */
  --muted: #5b5148;
  --line: rgba(82, 50, 32, .22);
  --grid: #e9cf9f;          /* sandstone: the empty part of a bar */
  --rep: #b9281e;           /* the site's live red */
  --dem: #2b5f93;
  --oth: #d59a28;           /* ochre for independents and write-ins */
  --ok: #68765b;            /* sage */
  --bad: #9a1f17;
  --sans: 'Libre Franklin', system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: 'Noto Serif', Georgia, "Times New Roman", serif;
  --terracotta: #ad5330; --terracotta-light: #d77a4e; --canyon: #742b1d; --ochre: #d59a28; --ochre-light: #efbd48;
  --turquoise: #147f79; --turquoise-dark: #0e5e59; --sage: #68765b; --sandstone: #e9cf9f; --sandstone-light: #fff4dc; --night: #17110d;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #fbf0d6; --panel: #fff9ea; --fg: #1c1712; --muted: #5b5148; --line: rgba(82, 50, 32, .22); --grid: #e9cf9f; --rep: #b9281e; --dem: #2b5f93; --oth: #d59a28; --ok: #68765b; --bad: #9a1f17; }
}
html, body { font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { background: var(--bg); }
.wrap { max-width: 1180px; padding-top: 0; }

/* ── masthead: a canyon band bleeding to the edges ── */
header {
  background: var(--canyon); color: var(--sandstone-light);
  box-shadow: 0 0 0 100vmax var(--canyon); clip-path: inset(0 -100vmax);
  padding: 22px 0 18px; margin: 0 0 18px; border-bottom: 5px solid var(--ochre);
}
.kicker { color: var(--ochre-light); font-weight: 600; letter-spacing: .14em; }
h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; font-size: 2.2rem; color: #fff7e7; }
.pulse { background: var(--sandstone-light); color: var(--canyon); font-weight: 600; letter-spacing: .02em; padding: 5px 12px; border-radius: 999px; }
.pulse i { background: var(--ok); box-shadow: 0 0 0 3px rgba(104, 118, 91, .25); }
.pulse.err i { background: var(--rep); box-shadow: 0 0 0 3px rgba(185, 40, 30, .2); }
.pulse.wait i { background: var(--ochre); box-shadow: 0 0 0 3px rgba(213, 154, 40, .3); }   /* before the county's first count */
.lede { font-family: 'Libre Baskerville', Georgia, serif; font-size: .97rem; line-height: 1.55; color: var(--fg); }

/* ── status tiles, each in one of the paper's colours ── */
.tile { border: 0; border-radius: 6px; border-left: 6px solid var(--terracotta); background: #f9e3cf; box-shadow: 0 1px 2px rgba(58, 37, 24, .12); }
.tile .lbl { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .68rem; color: var(--canyon); }
.tile .big { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; color: var(--canyon); }
.tile .big.sm { font-family: var(--sans); font-weight: 600; }
.tile .sub { color: var(--muted); }
.tile:nth-child(2) { border-left-color: var(--turquoise); background: #dfeeea; }
.tile:nth-child(2) .lbl, .tile:nth-child(2) .big { color: var(--turquoise-dark); }
.tile:nth-child(3) { border-left-color: var(--ochre); background: #f8e9bf; }
.tile:nth-child(3) .lbl, .tile:nth-child(3) .big { color: #7a5410; }


/* ── section heads, like the paper's ── */
h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.015em; font-size: 1.5rem; color: var(--canyon); margin-top: 30px; padding-bottom: 6px; position: relative; }
h2::after { content: ""; display: block; width: 56px; height: 4px; background: var(--terracotta); margin-top: 8px; border-radius: 2px; }
h3 { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; color: var(--night); }
.note, .bench, .foot, footer { font-family: var(--sans); }

/* ── race cards ── */
.card { border: 1px solid var(--line); border-top: 5px solid var(--terracotta); border-radius: 6px; box-shadow: 0 1px 3px rgba(58, 37, 24, .1); }
#tribal .card { border-top-color: var(--turquoise); }
.card.wide { border-top-color: var(--ochre); }
.row { font-size: .9rem; border-bottom-color: rgba(28, 23, 18, .09); }
.name { font-family: var(--sans); }
div.row:first-of-type .name { font-weight: 700; }
.card.preview { border-top-color: var(--ochre); }
.card.preview .foot { color: var(--terracotta); font-weight: 600; }
.chip { letter-spacing: .06em; text-transform: uppercase; font-size: .62rem; border-radius: 3px; padding: .15em .45em; font-weight: 700; }
.chip.R { background: var(--rep); color: #fff7e7; border-color: var(--rep); }
.chip.D { background: var(--dem); color: #fff7e7; border-color: var(--dem); }
.chip:not(.R):not(.D) { background: var(--sandstone); color: var(--canyon); border-color: var(--sandstone); }
.bar { height: 16px; border-radius: 3px; background: var(--grid); }
.fill { border-radius: 3px; }
/* Navajo Nation races are non-partisan: leader in terracotta, the rest in ochre, live or primary */
#tribal .fill, #tribal .fill.D { background: var(--ochre); }
#tribal div.row:first-of-type .fill { background: var(--terracotta); }
.val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fg); }
.bench b { color: var(--canyon); }
.bench .up { color: var(--dem); font-weight: 600; } .bench .down { color: var(--rep); font-weight: 600; }
.foot { color: var(--muted); }

/* ── tables ── */
.tablebox { border-radius: 6px; max-width: 100%; }
th { font-family: var(--sans); }
.tablebox th { background: var(--canyon); color: var(--sandstone-light); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; border-bottom: 0; }
td { border-bottom-color: rgba(28, 23, 18, .09); }
.tablebox tbody tr:nth-child(even) td { background: rgba(233, 207, 159, .22); }
.tablebox tbody tr:hover td { background: rgba(233, 207, 159, .5); }
td.R { color: var(--rep); } td.D { color: var(--dem); }
summary { color: var(--canyon); }

/* ── "How to read the county": the whole record, not a clipped window ── */
.ctx { align-items: start; }
.ctx .card { border-top-color: var(--sage); grid-column: 1 / -1; }   /* full width: one line per race, twenty-four races without a scrollbar */
.ctx .tablebox { max-height: none !important; }
.mini th { position: static; background: transparent; white-space: normal; font-size: .8rem; font-weight: 600; color: var(--canyon); letter-spacing: 0; text-transform: none; width: 38%; }
.mini td { font-variant-numeric: tabular-nums; }
.mini tr:nth-child(even) th, .mini tr:nth-child(even) td { background: rgba(233, 207, 159, .22); }

footer { border-top: 1px solid var(--line); padding-top: 12px; }
footer a, .note a { color: var(--canyon); text-decoration-color: var(--ochre); }

/* ── nothing may push a phone wider than its screen ── */
html, body { overflow-x: hidden; }
.wrap, .card, .tile, .ctx > * { min-width: 0; max-width: 100%; }
.mini { table-layout: fixed; }
@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  .tablebox th { letter-spacing: .05em; }
}

/* ── share-of-vote meter and measure details (Tribune additions to the markup) ── */
.tile.share { border-left-color: var(--canyon); background: #f3dcd0; }
.tile.share .lbl, .tile.share .big { color: var(--canyon); }
.meter { height: 10px; background: rgba(116, 43, 29, .15); border-radius: 5px; overflow: hidden; margin: 6px 0 2px; }
.meter-fill { height: 100%; width: 0; background: var(--terracotta); border-radius: 5px; transition: width .5s ease-out; }
#prop-info { margin-top: 12px; }
.m-head { margin: 0 0 6px; }
details.measure { border-top: 1px solid var(--line); padding: 8px 0; }
details.measure summary { cursor: pointer; font-weight: 600; color: var(--canyon); list-style: none; display: flex; gap: 8px; align-items: baseline; }
details.measure summary::-webkit-details-marker { display: none; }
details.measure summary::before { content: "+"; font-family: var(--serif); font-size: 1.1rem; color: var(--terracotta); width: 1em; flex: none; }
details.measure[open] summary::before { content: "–"; }
details.measure summary b { color: var(--terracotta); white-space: nowrap; }
details.measure p { font-size: .88rem; margin: 6px 0 0 1.5em; }
details.measure .m-yn b { color: var(--fg); }
details.measure blockquote.m-text { margin: 10px 0 0 1.5em; padding: 10px 14px; border-left: 4px solid var(--ochre); background: rgba(233, 207, 159, .25); font-family: 'Libre Baskerville', Georgia, serif; font-size: .86rem; line-height: 1.55; }
details.measure blockquote.m-text p { margin: 0 0 .7em; }
details.measure .m-src { font-size: .78rem; color: var(--muted); }
details.measure .m-src a { color: var(--canyon); }

/* ── precinct map (Tribune addition) ── */
.map-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px 22px; align-items: start; }
.map-col { position: relative; }
.pmap { width: 100%; height: auto; max-height: 1000px; display: block; margin: 0 auto; overflow: visible; }
.pmap path.pm { stroke: #fff9ea; stroke-width: 1.6; stroke-linejoin: round; fill: #efe3c8; cursor: pointer; transition: fill .4s ease-out; }
.pmap path.pm:hover { stroke: var(--night); stroke-width: 2.2; }
.pmap .pm-label { font-family: var(--sans); font-size: 24px; font-weight: 700; fill: var(--night); text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: rgba(255, 249, 234, .8); stroke-width: 3px; pointer-events: none; }
.map-tip { position: absolute; z-index: 2; background: var(--night); color: var(--sandstone-light); font-size: .78rem; line-height: 1.4; padding: 7px 10px; border-radius: 4px; width: 170px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); pointer-events: none; }
.map-tip b { display: block; color: var(--ochre-light); margin-bottom: 2px; }
.map-ctl { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.map-ctl button { font: 600 .78rem var(--sans); letter-spacing: .03em; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--canyon); background: transparent; color: var(--canyon); cursor: pointer; }
.map-ctl button.on { background: var(--canyon); color: var(--sandstone-light); }
.map-legend { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; font-size: .74rem; color: var(--muted); margin-bottom: 10px; max-width: 420px; }
.lg-bar { height: 10px; border-radius: 5px; }
.lg-cap { grid-column: 1 / -1; margin: 0; }
.map-col, .map-side { min-width: 0; }
@media (max-width: 720px) {
  .map-grid { grid-template-columns: minmax(0, 1fr); }
  .pmap { height: 760px; max-height: none; }
}
.pmap .pm-place circle { fill: var(--night); stroke: #fff9ea; stroke-width: 1.5; pointer-events: none; }
.pmap .pm-place text { font-family: var(--sans); font-size: 17px; font-weight: 600; fill: var(--night); paint-order: stroke; stroke: rgba(255, 249, 234, .9); stroke-width: 3px; pointer-events: none; }
#precincts .sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; border: 1px solid rgba(28, 23, 18, .15); }
.card.town { border-top-color: var(--turquoise-dark); }
.fill.M { background: var(--turquoise); }
td.res { white-space: normal; min-width: 22rem; }
td.res .r { display: inline-block; margin-right: 14px; white-space: nowrap; color: var(--muted); }
td.res .r b { font-weight: 500; color: var(--fg); }
td.res .r.lead b { font-weight: 700; }
td.res .r.lead { color: var(--fg); }
td.res .r .chip { margin: 0 4px 0 4px; }
td.res .r.muted { font-style: italic; }
td.num.lead { font-weight: 700; color: var(--fg); }
.card.wide .tablebox { max-height: none !important; }   /* whole tables, no inner scrollbars */
#rest-info { margin-top: 12px; }
.card.town details.measure { margin-top: 8px; }

/* ── compact (the home-page takeover): masthead, tiles, six key races, a link to the rest ── */
.compact .wrap { padding-bottom: 12px; }
.compact .lede, .compact .wrap > p.note, .compact .wrap > .card, .compact .wrap > h2, .compact #towns, .compact .ctx, .compact #tribal, .compact footer { display: none; }
.compact .wrap > h2:first-of-type { display: block; margin-top: 18px; }
.compact #key .card:nth-child(n+7) { display: none; }
.compact header { padding: 14px 0 12px; }
.compact h1 { font-size: 1.7rem; }
.compact-more { margin: 14px 0 0; font-family: var(--sans); font-weight: 600; }
.compact-more a { color: var(--canyon); text-decoration-color: var(--ochre); }
