/* Dan the Democrat: the brand layer of OK Politics HQ. One file, linked last in every page (the builders add the link), so it wins
   over each page's own colours. Colours come from the Dan the Democrat logo: indigo #0B0DB1, sky #30B0E8, cyan #48E8F8.
   Type matches danthedemocrat.com: Archivo for heads, Inter Tight for text (both served from this site, in fonts/).
   Party colours on maps and charts are data and do not change here: Democrat blue, Republican red, independent green, Libertarian gold.
   Source: OK_Politics_HQ/brand/dtd.css. build_explorer_page.py copies brand/ into site/. Do not edit the copy in site/. */
@font-face{font-family:"Archivo";src:url(fonts/archivo.woff2) format("woff2");font-weight:400 900;font-style:normal;font-display:swap}
@font-face{font-family:"Inter Tight";src:url(fonts/intertight.woff2) format("woff2");font-weight:400 800;font-style:normal;font-display:swap}

:root{--brand:#0B0DB1;--sky:#30B0E8;--cyan:#48E8F8;
  --ink:#0A0B38;--mut:#4A5682;--line:#C5D8EA;--bg:#EFF6FC;--card:#FFFFFF;--field:#E3F1FA;--soft:#CFE5F5;
  --link:#0B0DB1;--pressed:#0B0DB1;--onpressed:#FFFFFF;--band:#0B0DB1;--mapbg:#DFECF5;--panelT:rgba(255,255,255,.96)}
html[data-theme="dark"]{--ink:#EEF3FF;--mut:#A9B5E0;--line:#2B3284;--bg:#070929;--card:#0F1345;--field:#191E5E;--soft:#242A76;
  --link:#73D2F8;--pressed:#30B0E8;--onpressed:#05072B;--band:#0B0DB1;--mapbg:#05071F;--panelT:rgba(15,19,69,.95)}

body{font-family:"Inter Tight",-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
h1,h2.dn,.card h2,#hqtabs b,#legend h3,.pop h4,.big{font-family:"Archivo","Inter Tight",-apple-system,"Segoe UI",Arial,sans-serif}

/* ---- the page head: an indigo band with the logo */
#hqtabs{background:var(--band);border:none;border-radius:12px;padding:8px 12px;margin:0 0 10px;gap:6px}
#hqtabs b{color:#fff;font-weight:800;font-size:var(--fs6,21px);letter-spacing:.01em;display:inline-flex;align-items:center;margin-right:10px}
#hqtabs b::before,header h1::before{content:"";display:inline-block;width:62px;height:34px;margin-right:8px;flex:0 0 auto;
  background:#fff url(dtd-logo.png) center/88% auto no-repeat;border-radius:8px;vertical-align:middle}
#hqtabs a{background:transparent;border:1px solid rgba(255,255,255,.28);color:#E4F4FD;border-radius:999px;padding:4px 13px}
#hqtabs a:hover{color:#fff;border-color:#fff}
#hqtabs a.on{background:#fff;color:var(--brand);border-color:#fff}
#hqtabs button,header #themeBtn,header #moreBtn{background:transparent;border:1px solid rgba(255,255,255,.4);color:#fff;border-radius:999px}
#hqtabs button:hover,header #themeBtn:hover,header #moreBtn:hover{background:rgba(255,255,255,.14)}
#hqsub{margin:0 2px 14px;gap:4px 18px;font-size:var(--fs3,17px)}
#hqsub a.on{border-bottom-color:var(--sky)}

h1{font-weight:800;font-size:var(--fs7,23px);letter-spacing:-.005em;line-height:1.2}
.lede{font-size:var(--fs3,17px)}

/* ---- cards: a sky rule on top, heads in sentence case */
.card{border-radius:12px;border:1px solid var(--line);border-top:3px solid var(--sky)}
.card h2{font-size:var(--fs5,19px);font-weight:700;text-transform:none;letter-spacing:0;color:var(--ink);margin-bottom:9px}
h2.dn{font-weight:800;font-size:var(--fs8,26px)}
.card a,.foot a,a.more,#toc a,.pick a,a.cty,.lede a{color:var(--link)}
/* ---- text contrast (launch audit of 14 Nov 2026, finding 6): colored TEXT that was under 4.5 to 1. Fills of maps and charts stay. */
header .st,header .st span{color:#E4F4FD}      /* the status line of the election-night record stands on the indigo band */
html[data-theme="dark"] #sPills .pill.d,html[data-theme="dark"] #sPills .pill.r{color:#05072B}      /* the seat pills of the Analysis page: dark ink on the lighter party fills of dark mode */
html[data-theme="dark"] b[style*="#2457B8"]{color:#6E9BF0!important}      /* a party name that a page script colors with the light-mode blue */
html[data-theme="dark"] b[style*="#B8352E"]{color:#E8776B!important}      /* and with the light-mode red */
html[data-theme="dark"] b[style*="#1f7a4d"]{color:#5cc48a!important}      /* the independents' green as text on a dark page */
html:not([data-theme="dark"]) b[style*="#b08a2e"]{color:#7A5C0E!important}      /* the Libertarians' gold as text on a light page */
html[data-theme="dark"] #big b[style*="#7b3fa0"]{color:#B48AE0!important}      /* Ballot fatigue: the large figure for judges, on a dark page */
html:not([data-theme="dark"]) #big b[style*="#e07b1a"]{color:#C96A10!important}      /* and the large orange figure, on a light page */
html:not([data-theme="dark"]) table.t tr.st td{color:#0B6B78}      /* the teal row of the whole state on its pale band (Early vote, Compared with who voted): 5.4 to 1 */
.big{font-weight:800}
th{letter-spacing:.03em}

/* ---- controls */
select,input[type=text],button{border-radius:8px}
.seg{border-radius:999px}
.seg button[aria-pressed="true"]{background:var(--pressed);color:var(--onpressed)}
select:focus,button:focus-visible,input[type=text]:focus{outline:2px solid var(--sky);outline-offset:1px}
.chips a{border-radius:999px}
.tag,.pill{border-radius:999px}

/* ---- the explorer: the same band over its controls */
header{background:var(--band);border-bottom:none;color:#fff}
header h1{color:#fff;font-size:var(--fs6,21px);font-weight:800;display:flex;align-items:center;flex-wrap:wrap;gap:0 6px}
header h1 span{color:#CDEAFA;font-family:"Inter Tight",-apple-system,"Segoe UI",Arial,sans-serif;font-weight:500;font-size:var(--fs3,17px)}
header .sub{color:#CDEAFA}
header .lab{color:#BEE3F8}
header label.ck{color:#E2F3FC}
header #links a{color:#E4F4FD}
header #links a.tab{background:transparent !important;border:1px solid rgba(255,255,255,.28) !important;color:#E4F4FD !important;border-radius:999px !important}
header #links a.tab.on,header #links a.tab[aria-current]{background:#fff !important;color:var(--brand) !important;border-color:#fff !important}
header #links .cr,header #links .cr a{color:#CDEAFA}
header select,header input[type=text],header .bar button{border-color:rgba(255,255,255,.35)}
#legend,#top>div{border-radius:10px}
#legend h3{font-weight:700;font-size:var(--fs3,17px)}
.chip.ok{color:#1E8E5A;border-color:#1E8E5A}
html[data-theme="dark"] .chip.ok{color:#5FD79A;border-color:#5FD79A}
.leaflet-popup-content-wrapper{border-radius:10px}

@media (max-width:640px){#hqtabs{border-radius:10px;padding:7px 9px}#hqtabs b{font-size:var(--fs5,19px);flex:1 1 100%}#hqtabs b::before,header h1::before{width:52px;height:28px}
  #hqtabs a{padding:3px 10px}h1{font-size:var(--fs7,23px)}header h1{font-size:var(--fs5,19px)}}

/* ---- the small maps (county and district precincts, People, money by ZIP code, the start page, Records): from the audit of
   11 Nov 2026. On the dark card the darkest map colors and "no figure" sank into the card. Each small map now sits on one
   neutral panel in both themes, with pale hairlines between the areas and a gray of its own for "no figure", so one color rule
   holds on every map: paler is lower, and the legend under the map gives the ranges. */
:root{--panel:#D9E1EB;--hair:#FFFFFF;--nodata:#B9C2CF}
html[data-theme="dark"]{--panel:#8C95AA;--hair:rgba(255,255,255,.72);--nodata:#69728A}
/* the flat SVG maps only: a map of the map engine (hqmap.js, class hqmap) draws Leaflet's own svg and paths, which these rules must not touch */
.card .pm svg:not(.hqmap svg),.card .zm svg:not(.hqmap svg),.card .mp svg:not(.hqmap svg),.card #map svg:not(.hqmap svg){background:var(--panel);border-radius:8px;padding:8px;box-sizing:border-box}
.card .pm path:not(.hqmap path),.card .zm path:not(.hqmap path),.card .mp path:not(.hqmap path),#overview #map path:not(.hqmap path){stroke:var(--hair)}
.card .pm path:hover:not(.hqmap path),.card .pm path.on:not(.hqmap path),.card .zm path:hover:not(.hqmap path),.card .zm path.on:not(.hqmap path),.card .mp path:hover:not(.hqmap path),.card .mp path.on:not(.hqmap path),.card .mp path:focus:not(.hqmap path),#overview #map path:hover:not(.hqmap path),#overview #map path:focus:not(.hqmap path){stroke:#101322}
.pmLg span i,.zmLg span i,.lg span i{box-shadow:0 0 0 1px rgba(255,255,255,.28)}

/* wide screens (Dan, 14 Nov 2026: "it feels like there is a lot of wasted space"): the page column goes from 980 px to 1,280 px, so the maps,
   the tables and the charts use the width; running text keeps a width that reads well */
@media (min-width:1200px){.wrap{max-width:min(1280px,calc(100vw - 48px)) !important}.wrap p,.wrap li{max-width:120ch}}

/* ---- the menus (launch audit of 14 Nov 2026, findings 5, 7, 8 and 9; hq_nav.py writes the rows). The "All pages" panel lists every
   section and every page. On a phone (640 px or less) the brand and two buttons share the first line, the nine tabs are one line that
   scrolls sideways inside its own box (an arrow shows while more tabs follow; the pressed tab is scrolled into view), the second row
   does the same, and every entry is 36 px tall. A page built before this change (no .hqrow) keeps the wrapped rows, at 36 px. */
#hqtabs .hqrow{display:contents}#hqtabs #hqAll{display:none}
#hqpanel{position:absolute;left:0;right:0;top:100%;margin-top:6px;z-index:3000;max-height:calc(100vh - 110px);max-height:calc(100dvh - 110px);overflow:auto;background:var(--card);color:var(--ink);
  border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.35);padding:8px 14px 10px;font-size:var(--fs4,18px);font-weight:400;text-align:left;letter-spacing:0}
#hqpanel[hidden]{display:none !important}
#hqtabs #hqpanel a,#hqpanel a{display:flex;align-items:center;min-height:36px;color:var(--ink);text-decoration:none;border:none;background:none;padding:0;border-radius:0;font-weight:600;white-space:normal}
#hqtabs #hqpanel a.pb,#hqpanel a.pb{min-height:42px;font-weight:800;color:var(--link);border-bottom:1px solid var(--line)}
#hqpanel section{padding:4px 0;border-bottom:1px solid var(--line)}#hqpanel section:last-child{border-bottom:none}
#hqpanel h2{margin:0;font:inherit;font-size:var(--fs4,18px);letter-spacing:0;text-transform:none}#hqtabs #hqpanel h2 a,#hqpanel h2 a{font-weight:800}
#hqpanel ul{list-style:none;margin:0;padding:0 0 0 14px}#hqtabs #hqpanel li a,#hqpanel li a{color:var(--mut)}
#hqtabs #hqpanel a[aria-current],#hqpanel a[aria-current]{color:var(--ink);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:4px;text-decoration-color:var(--sky)}
#hqtabs #hqpanel a:hover,#hqpanel a:hover{color:var(--link)}
@media (max-width:640px){
  #hqtabs a,#hqsub a{min-height:36px;display:inline-flex;align-items:center;box-sizing:border-box}
  #hqtabs button{min-height:36px}
  #hqtabs:has(.hqrow){gap:6px;padding:7px 9px;position:relative}
  #hqtabs:has(.hqrow) b{flex:1 1 0;min-width:0;order:0;font-size:var(--fs5,19px);line-height:1.15;text-wrap:balance}#hqtabs b .dtdn{display:none}
  #hqtabs:has(.hqrow) #themeBtn{order:1;margin-left:0}
  #hqtabs #hqAll{display:inline-flex;align-items:center;order:2;margin-left:0}
  #hqtabs button{display:inline-flex;align-items:center;padding:4px 11px;font-size:var(--fs2,16px);font-weight:650}
  #hqtabs .hqrow{order:3;flex:1 1 100%;min-width:0;display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;position:relative}
  #hqtabs .hqrow a{flex:0 0 auto;white-space:nowrap;padding:4px 13px}
  #hqsub{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;position:relative;gap:0 18px;margin:0 2px 10px}
  #hqsub a{flex:0 0 auto;white-space:nowrap}
  #hqtabs .hqrow::-webkit-scrollbar,#hqsub::-webkit-scrollbar{display:none}
  #hqtabs .hqrow::after,#hqsub::after{content:"\203A";position:sticky;right:0;flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;width:36px;min-width:36px;margin-left:-36px;
    padding-right:3px;box-sizing:border-box;font-size:var(--fs8,26px);font-weight:700;line-height:1;pointer-events:none;visibility:hidden}
  #hqtabs .hqrow::after{color:#fff;background:linear-gradient(to right,rgba(11,13,177,0),var(--band) 58%)}
  #hqsub::after{color:var(--ink);background:linear-gradient(to right,rgba(0,0,0,0),var(--bg) 58%)}
  #hqtabs .hqrow.mr::after,#hqsub.mr::after{visibility:visible}
  #hqtabs .hqrow.ml,#hqsub.ml{-webkit-mask-image:linear-gradient(to right,transparent 0,#000 30px);mask-image:linear-gradient(to right,transparent 0,#000 30px)}
  #hqtabs #hqpanel{left:0;right:0}

  /* tap targets of 36 px in the first screen of every page (finding 7): the pill buttons, the pickers, the "On this page" links, the
     decade buttons of State questions, the map's zoom buttons; the seat dots of The Legislature get a larger hit area (the page also
     lists all 149 seats in a table) */
  .seg button,.osel button,.pick button,.pick select,.pillrow button,.pickrow button,.chips button,.ctl button,.okmap-home{min-height:36px}
  .pick a{display:inline-flex;align-items:center;min-height:36px}
  select,input[type=text],input[type=search]{min-height:36px}
  #toc{row-gap:0}#toc a{display:inline-flex;align-items:center;min-height:36px}
  .dec{row-gap:0}.dec button{display:flex;align-items:center;min-height:36px}
  .dots a::before{content:"";position:absolute;inset:-3px;border-radius:50%}
  html .leaflet-touch .leaflet-bar a{width:36px;height:36px;line-height:36px}
}
header #hqAll{background:transparent;border:1px solid rgba(255,255,255,.4);color:#fff;border-radius:999px}header #hqAll:hover{background:rgba(255,255,255,.14)}

/* ==== 16 Nov 2026: the site for old, non-technical readers (Dan: "think about someone from Cal's senior citizen class using this").
   ONE text scale for the whole site. Every source writes font-size:var(--fsN,<normal px>); the steps are set here. The "Larger
   text" button of the top row sets html[data-text="large"] (hq_nav.py keeps the choice in the reader's browser).
   step   0     1      2     3      4      5     6     7     8     9
   use    tick  small  note  text   text+  h3    h2    h1    big   bigger
   New code uses a step, never a px size under 34. The test _work/qa/qa_senior.py fails a page with text under 14 px. */
:root{--fs0:14px;--fs1:14.5px;--fs2:16px;--fs3:17px;--fs4:18px;--fs5:19px;--fs6:21px;--fs7:23px;--fs8:26px;--fs9:30px}
html[data-text="large"]{--fs0:16px;--fs1:16.5px;--fs2:18px;--fs3:19.5px;--fs4:20.5px;--fs5:22px;--fs6:24px;--fs7:26px;--fs8:29px;--fs9:33px}

/* things to press are 44 px tall or more on every screen (a link inside a sentence is the one exception) */
button,select,input[type=text],input[type=search],input[type=number],summary{min-height:44px}
input[type=checkbox],input[type=radio]{width:22px;height:22px;flex:0 0 auto}
.seg button,.osel button,.pick button,.pick select,.pillrow button,.pickrow button,.chips button,.ctl button,.okmap-home,.dec button{min-height:44px}
.pick a,#toc a,.chips a{display:inline-flex;align-items:center;min-height:44px}
html .leaflet-bar a,html .leaflet-touch .leaflet-bar a{width:44px;height:44px;line-height:44px;font-size:var(--fs8,26px)}

/* the top row: six doors in plain words, then "Larger text", "Print" and "All pages" */
#hqtabs{row-gap:8px}
#hqtabs a,#hqsub a{display:inline-flex;align-items:center;min-height:44px;box-sizing:border-box}
#hqtabs .hqrow a{padding:6px 16px;font-size:var(--fs3,17px)}
#hqtabs .hqtools{margin-left:auto;display:inline-flex;align-items:center;gap:6px;flex:0 0 auto}
#hqtabs button{margin-left:0;display:inline-flex;align-items:center;min-height:44px;padding:6px 14px;font:inherit;font-size:var(--fs2,16px);font-weight:650;cursor:pointer}
#hqtabs #hqAll{display:inline-flex}
#hqtabs #textBtn[aria-pressed="true"]{background:#fff;color:var(--brand);border-color:#fff}
#hqsub{font-size:var(--fs2,16px);gap:0 20px}
#hqtabs #hqpanel a,#hqpanel a{min-height:44px}
#hqpanel .pt{display:flex;flex-wrap:wrap;gap:8px;padding:10px 0 4px}
#hqtabs #hqpanel .pt button,#hqpanel .pt button{background:var(--field);color:var(--ink);border:1px solid var(--line);border-radius:999px}
@media (max-width:640px){
  #hqtabs a,#hqsub a,#hqtabs button{min-height:44px}
  #hqtabs:has(.hqrow) b{font-size:var(--fs4,18px)}
  #hqtabs .hqtools{order:1;margin-left:0}
  #hqtabs .hqtools .hqprint{display:none}      /* on a phone "Print this page" is in the "All pages" panel */
  #hqtabs:has(.hqrow) b{flex:1 1 100%}      /* the name of the site has a line of its own; then the two buttons; then the doors */
  #hqtabs button{padding:6px 12px}
  #hqtabs .hqrow a{padding:6px 15px}
  select,input[type=text],input[type=search]{min-height:44px}
  #toc a,.pick a{min-height:44px}.dec button{min-height:44px}
}

/* print: black text on white paper in both color modes, no menus, no map buttons; the first line names the site */
@media print{
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}      /* bars, strips and color keys print */
  :root,html[data-theme="dark"],html[data-theme="light"]{--ink:#000;--mut:#333;--line:#999;--bg:#fff;--card:#fff;--field:#fff;--soft:#eee;--link:#000;--panel:#fff;--hair:#666;--nodata:#ddd}
  :root,html[data-theme="dark"]{--dem:#2457B8;--rep:#B8352E;--ind:#1f7a4d;--lib:#7A5C0E}      /* party names as text: the colors of a light page */
  html,body{background:#fff !important;color:#000 !important}
  body::before{content:"Dan the Democrat\2019s Oklahoma Politics HQ   \00B7   okhq.danthedemocrat.com";display:block;font-weight:800;font-size:12pt;margin:0 0 8pt;padding-bottom:4pt;border-bottom:1px solid #999}
  #hqtabs,#hqsub,#hqpanel,.leaflet-control-container,.noprint{display:none !important}
  .card{box-shadow:none !important;break-inside:avoid-page}
  h1,h2,h3{break-after:avoid}
  a{color:#000 !important}
  html table.t tr.st td,html:not([data-theme="dark"]) table.t tr.st td{color:#000}      /* the row of the whole state prints in black */
}
