/* Map chrome, layered over the map's own styles: scripts/build.mjs links this file last in the map page's <head>, so it wins.
   It may set only the chrome tokens (npm test checks): --bg --panel --panel-2 --ink --muted --line --chip --chip-ink --chip-on
   --chip-on-ink --shadow --ui --hist --mapbg --label-ink --label-halo. The data colors (water, battle lines including --us and
   --cs, HOLC grades, depth, tracts, trails) stay as upstream set them, so the legends stay true. Selector rules here stay
   cosmetic (font family/weight/style/size, letter-spacing, text-transform, corners, border color/style, box-shadow,
   background and text color from the tokens); the map's layout belongs to the upstream build.
   Mix 2 ("Finding Aid" with the current italic Caslon for the title, era and group heads and map labels): Literata for reading and controls, Courier Prime only for record data (dates, event IDs, readings, legend ticks),
   paper and archival-box tones, square corners, hairline rules, record-ink blue for what is selected; confidence notes in
   italic, as an editor would annotate a record. */
:root{
  --bg:#f3f1ea; --panel:#fbfaf6; --panel-2:#e8ebe4; --ink:#1d211e; --muted:#535a54; --line:#c9cdc3;
  --chip:#e4e8e0; --chip-ink:#1d211e; --chip-on:#2a4775; --chip-on-ink:#fbfaf6;
  --shadow:0 1px 2px rgba(29,33,30,.16);
  --ui:"Literata",Georgia,"Times New Roman",serif;
  --hist:"Libre Caslon Text",Georgia,"Times New Roman",serif;
  --mapbg:#e4e5de; --label-ink:#1d211e; --label-halo:#fbfaf6;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#1a1b17; --panel:#22241f; --panel-2:#2b2e28; --ink:#e6e2d6; --muted:#aba99c; --line:#3c4038;
    --chip:#2f322b; --chip-ink:#e6e2d6; --chip-on:#b3c4de; --chip-on-ink:#1a1b17;
    --shadow:0 1px 2px rgba(0,0,0,.5);
    --mapbg:#1d1f1a; --label-ink:#e6e2d6; --label-halo:#1a1b17;
  }
}
:root[data-theme="dark"]{
  --bg:#1a1b17; --panel:#22241f; --panel-2:#2b2e28; --ink:#e6e2d6; --muted:#aba99c; --line:#3c4038;
  --chip:#2f322b; --chip-ink:#e6e2d6; --chip-on:#b3c4de; --chip-on-ink:#1a1b17;
  --shadow:0 1px 2px rgba(0,0,0,.5);
  --mapbg:#1d1f1a; --label-ink:#e6e2d6; --label-halo:#1a1b17;
}
body,.leaflet-container{font-family:var(--ui)}

/* title: the current italic Caslon; the place in plain words */
.top h1{font-style:italic;font-weight:400;letter-spacing:-.005em}
.top h1 .place{font-family:var(--ui);font-style:normal;font-weight:400;font-size:.66em;letter-spacing:0;text-transform:none;color:var(--muted)}
.edition{font-family:var(--ui);letter-spacing:0;text-transform:none;border-radius:0;border-color:var(--line)}

/* square corners everywhere, hairline borders, almost no shadow */
.modes,.modes button,.ghost,.stage,.search input,.results,.results button,.readout,.readout .more,.views button,.places,.layertag,
.panel,.chips button,.btn,.seg,.ev,.detail,details.rules,.gcard,.tl,.row,.card,.dayctl button,details.fg,.about .card,.toast,
.tourcard,.tourhole,.msg,.askform textarea,.pinchip,.dosdetail .cool,.strip,.strip .fr,.strip .fr span,.swipe .tagL,.swipe .tagR,
.locbtn,.insn,.ys,.vd,.conf,.leaflet-popup-content-wrapper,.leaflet-popup-content .pbtn,.leaflet-bar{border-radius:0}
.leaflet-bar a,.leaflet-touch .leaflet-bar a:first-child,.leaflet-touch .leaflet-bar a:last-child{border-radius:0}
.modes{box-shadow:none;border-color:var(--line)}
.ghost{border-color:var(--line)}
.ghost:hover{background-color:var(--chip)}

/* modes: the selected mode is underlined in record ink, like a filed tab */
.modes button{font-weight:600;letter-spacing:0}
.modes button[aria-pressed="true"]{background-color:var(--chip);color:var(--ink);box-shadow:inset 0 -3px 0 var(--chip-on)}
.tabs button{font-weight:600;letter-spacing:0}
.tabs button[aria-selected="true"]{border-bottom-color:var(--chip-on)}

/* labels in sentence case, no letter-spaced capitals */
.sec h2{font-size:15.5px;font-weight:700;letter-spacing:0;text-transform:none;color:var(--ink)}
.chips .grp,.places h4,.gcard .lbl{font-size:14px;font-weight:600;letter-spacing:0;text-transform:none}
.about h3,.dosdetail h4{font-size:16px;font-weight:700;letter-spacing:0;text-transform:none;color:var(--ink)}
.row .tag,.tl .t em,.dtl .cf,.ys,.vd{letter-spacing:0;text-transform:none}

/* chips: square index tabs; selected ones are inked */
.chips button{border-color:var(--line)}
.chips button[aria-pressed="true"]{border-color:var(--chip-on)}
.views button{border-color:var(--line)}
.views button[aria-pressed="true"]{border-color:var(--chip-on)}
.ev[aria-pressed="true"],.row[aria-current="true"]{border-color:var(--chip-on)}

/* record data is typed */
.ev .id,.tl .d,.detail .when,.card .when,.leaflet-popup-content .when,.daydate,.xrng output,
.swipe .tagL,.swipe .tagR,.strip .fr span,.tourcard .tstep,.lg-ticks,.lg-lab,.ramplab,.insn,a.ref,.leaflet-control-zoom-in,.leaflet-control-zoom-out{font-family:"Courier Prime","Courier New",Courier,monospace}
.tl .d,.detail .when,.card .when,.leaflet-popup-content .when,.daydate{font-weight:700;font-size:13.5px}
/* confidence is an editor's note, not a badge: italic book weight, no box (the hairline takes the card's colour) */
.conf,.tl .t em,.dtl .cf{font-family:var(--ui);font-style:italic;font-weight:400;font-size:13.5px;letter-spacing:0;text-transform:none}
.conf,.conf.D{border-color:var(--panel)}
.tourcard .tstep{font-size:13.5px;letter-spacing:0;text-transform:none}
/* the first-visit tip in the book weight and a size smaller, so it stays narrow (it still sits over the search box on wide screens: its position is upstream layout) */
.toast{font-weight:400;font-size:13.5px}

/* links in record ink, the same blue as the pages' links (the data blue --us stays with the Union lines) */
.about a,.sitebar a,.sitelinks a,.wmall,.linkbtn,.leaflet-popup-content a,.msg a,a.ref{color:var(--chip-on)}


/* ---------- review fixes (cosmetic only) ---------- */
/* placeholders in the muted ink, so the search and Ask prompts pass AA on the new panels */
.search input::placeholder,.askform textarea::placeholder{color:var(--muted);opacity:1}
/* Caslon has no bold italic: its italics stay at their true weight instead of a smeared faux bold */
.eraH,.lbl.river span,.lbl.trail span,.lbl.h64 span{font-weight:400}
/* entry titles follow the pages' italic Caslon onto the map's Watermark card */
.wmcard h3{font-family:var(--hist);font-style:italic;font-weight:400;font-size:19px;letter-spacing:-.005em}
/* list-row facts and tab labels a size smaller, so the wider Literata leaves room for names and more tabs show */
.row .meta{font-size:12px;letter-spacing:-.01em}
.tabs button{font-size:13.5px}
.sitelinks a{white-space:nowrap}
.leaflet-container a.leaflet-popup-close-button{font-family:var(--ui)}
.leaflet-popup-content{font-size:13.5px}
.leaflet-control-scale-line{text-shadow:none}
/* small laptops: the header's mode switch and blurb a size smaller, so the map keeps its height */
@media (min-width:900px) and (max-width:1199px){.modes button{font-size:13px}.top p{font-size:13.5px}.hbtns .ghost{font-size:13px}}
/* narrowest phones: title and header buttons a size smaller, so the place name clears the Guide button */
@media (max-width:359px){.top h1{font-size:21px}.top h1 .place{font-size:.58em}.hbtns .ghost{font-size:13px}}
/* ground badges: dark ink on the pale dark-mode ground colour (white on it is 2:1); the colour itself is untouched */
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .gnum,:root:not([data-theme="light"]) .gmark{color:var(--bg)}}
:root[data-theme="dark"] .gnum,:root[data-theme="dark"] .gmark{color:var(--bg)}
