/* KERR DAYLIGHT 2026-11-29 (Errol, 7:50 to 7:55 AM: "This app has to be used outside in broad daylight, so think super high contrast.
   ... create a daylight theme for everything. I will just leave it locked on. These are all utilities ... you just have to be able to
   read them in broad daylight.")
   One shared light theme for every public page. functions/_middleware.js puts class="k-day" on <html> in the HTML itself (no flash),
   links this file and kerr-theme-day.js at the end of <head>. A small inline boot script at the top of <head> takes the class off for
   a device that picked Dark in the site menu (localStorage kerrTheme = "dark"). /display, Crewtrack, Crew Camera, the AI desk and
   admin pages are not design system pages and stay dark.
   Layers:
   1. TOKENS (this file): the only palette the light theme uses. Lanes write `html.k-day .their-thing{...}` with var(--kd-*).
   2. kerr-theme-day.js: maps every remaining hard coded dark color (stylesheets, inline styles, SVG fill/stroke) onto these tokens at
      load and as nodes arrive. A rule whose selector names k-day is never touched, so hand tuned rules always win.
   3. Hand tuned rules below for shared chrome: nav, weather tab row, NWS banners, Ask Kerr, sheets, toasts, Drive 80 server card.
   NOAA map ramps are not changed: map canvases, tiles and bright saturated swatches keep their colors. No em dashes. */

html.k-day{
  /* grounds */
  --kd-bg:#F6F7F9; --kd-surface:#FFFFFF; --kd-raised:#EEF1F4; --kd-inset:#E6E9EE; --kd-glass:rgba(255,255,255,.96);
  /* type (Errol 8:30 AM: "white background with black text"): primary 15:1+, secondary 12:1+, muted 9:1+ on every ground; no light grey */
  --kd-text:#0B1220; --kd-text2:#1B2330; --kd-text3:#2B3340; --kd-on-dark:#FFFFFF;
  /* lines strong enough for glare */
  --kd-line:#7A8698; --kd-line-soft:#AEB8C5; --kd-line-strong:#4E5A6B;
  /* brand: navy for headers and the nav bar, gold for controls (fill, not thin text) */
  --kd-navy:#1F3864; --kd-navy-2:#2B4A7E; --kd-gold:#E3AF25; --kd-gold-ink:#634500; --kd-gold-line:#9C7210; --kd-on-gold:#0B1220; --kd-gold-tint:#FBF0D2;
  /* call colors (Errol 8:20 AM: vivid): GO, CAUTION, NO-GO fills are vivid with near-black type on them and a dark edge where they meet
     the light ground (--kd-fill-edge); -ink is the dark readable text version, -tint the panel behind dark text.
     NO-GO is hot pink by Errol's call (#FF2E88 for marks with no type, #FF72B4 plate under dark type). Snow and rain fills carry white type. */
  --kd-go:#00E676;      --kd-go-ink:#075A2E;      --kd-go-tint:#DDF7E8;      --kd-go-hot:#19FF7A;
  --kd-caution:#FF9100; --kd-caution-ink:#683F00; --kd-caution-tint:#FFEBD1;
  --kd-nogo:#FF72B4;    --kd-nogo-ink:#931117;    --kd-nogo-tint:#FFE3EF;    --kd-nogo-hot:#FF2E88;
  --kd-on-call:#0B1220; --kd-fill-edge:#0B1220;
  --kd-snow:#1559B0;    --kd-snow-ink:#0D4A94;    --kd-snow-tint:#E2EDFA;
  --kd-rain:#0E7A55;    --kd-rain-ink:#08573D;    --kd-rain-tint:#DFF2EA;
  --kd-orange-ink:#783500; --kd-purple-ink:#5A2CA8;
  --kd-shadow:0 1px 2px rgba(11,18,32,.10),0 2px 8px rgba(11,18,32,.08);
  --kd-focus:#0B1220;
  /* type floor */
  --kd-body:16px; --kd-label:15px;
  /* old page tokens, pointed at the light set so pages that read them flip with no rewrite */
  --k-bg:var(--kd-bg); --k-surface:var(--kd-surface); --k-raised:var(--kd-raised); --k-line:var(--kd-line);
  --k-text:var(--kd-text); --k-text2:var(--kd-text2); --k-text3:var(--kd-text3);
  --k-gold-soft:var(--kd-gold-tint); --k-go:var(--kd-go-ink); --k-caution:var(--kd-caution-ink); --k-nogo:var(--kd-nogo-ink);
  --kerr-nav-bg:var(--kd-navy);
  color-scheme:light;
  background:var(--kd-bg)!important;
}

/* ---- base ---- */
html.k-day body{background:var(--kd-bg)!important;color:var(--kd-text)!important;font-size:var(--kd-body);-webkit-font-smoothing:auto}
html.k-day ::selection{background:var(--kd-gold);color:var(--kd-on-gold)}
html.k-day :focus-visible{outline:3px solid var(--kd-focus)!important;outline-offset:2px!important}
html.k-day hr{border-color:var(--kd-line-soft)!important}
html.k-day main a:not([class]),html.k-day article a:not([class]),html.k-day .post-content a:not([class]){color:var(--kd-snow-ink)!important;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:2px}
html.k-day input,html.k-day select,html.k-day textarea{background:var(--kd-surface)!important;color:var(--kd-text)!important;border:2px solid var(--kd-line)!important}
html.k-day input::placeholder,html.k-day textarea::placeholder{color:var(--kd-text3)!important;opacity:1}

/* ---- site nav: navy bar, gold controls, white type (white on navy 11.5:1, gold on navy 6.3:1) ---- */
html.k-day #kerrNavUnified,html.k-day #kerrNavUnified .knav-bar,html.k-day #kerrNavUnified .knav-bar:hover{background:var(--kd-navy)!important}
html.k-day #kerrNavUnified .knav-bar{box-shadow:0 2px 0 rgba(11,18,32,.25)!important;border-top:3px solid var(--kd-gold)!important}
html.k-day #kerrNavUnified .knav-label{color:#fff!important}
html.k-day #kerrNavUnified .knav-label i,html.k-day #kerrNavUnified .knav-hint{color:var(--kd-gold)!important}
html.k-day #kerrNavUnified .knav-hint{font-size:16px!important;font-weight:700!important}
html.k-day #kerrNavUnified .knav-hamburger span{height:3px!important}
html.k-day #kerrNavUnified .knav-menu{background:var(--kd-navy)!important;border-bottom:3px solid var(--kd-gold)!important;box-shadow:0 12px 30px rgba(11,18,32,.35)!important}
html.k-day #kerrNavUnified .knav-link{color:#fff!important;border-bottom:1px solid rgba(255,255,255,.22)!important;font-size:16px!important}
html.k-day #kerrNavUnified .knav-sub .knav-link{font-size:15px!important}
html.k-day #kerrNavUnified .knav-link svg{opacity:1!important}
html.k-day #kerrNavUnified .knav-link:hover{background:rgba(255,255,255,.1)!important}
html.k-day #kerrNavUnified .knav-link.active,html.k-day #kerrNavUnified .knav-link.contact{color:var(--kd-gold)!important;background:rgba(227,175,37,.14)!important}
html.k-day #kerrNavUnified .knav-subtog{color:#fff!important;border-bottom-color:rgba(255,255,255,.22)!important}
html.k-day #kerrNavUnified .knav-sub{background:rgba(0,0,0,.16)!important}

/* the Day / Dark switch kerr-theme-day.js adds at the foot of the site menu (both themes: it is how a device switches back) */
#kerrNavUnified .kd-theme{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:56px;padding:10px 24px;box-sizing:border-box;background:none;border:0;border-top:1px solid rgba(255,255,255,.18);color:#fff;font:700 16px/1.2 Inter,system-ui,sans-serif;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
#kerrNavUnified .kd-theme small{display:block;font:500 14px/1.3 Inter,system-ui,sans-serif;color:rgba(255,255,255,.82);margin-top:3px}
#kerrNavUnified .kd-theme .kd-sw{flex:0 0 auto;display:inline-flex;border:2px solid #E3AF25;border-radius:999px;overflow:hidden}
#kerrNavUnified .kd-theme .kd-sw b{display:inline-flex;align-items:center;justify-content:center;min-width:58px;height:36px;padding:0 10px;font:800 15px/1 Inter,system-ui,sans-serif;color:#fff}
#kerrNavUnified .kd-theme .kd-sw b[aria-current="true"]{background:#E3AF25;color:#0B1220}
#kerrNavUnified .kd-theme:focus-visible{outline:3px solid #E3AF25;outline-offset:-4px}

/* ---- weather tab row (kerr-nav #kerrWxTabs and /weather #tabBar): solid white strip, dark pills, active pill navy ---- */
html.k-day #kerrWxTabs,html.k-day #tabBar.tab-bar{background:var(--kd-surface)!important;border-top:0!important;border-bottom:2px solid var(--kd-line)!important;box-shadow:0 2px 6px rgba(11,18,32,.08)!important}
html.k-day #kerrWxTabs a,html.k-day #tabBar .tab-btn{background:var(--kd-surface)!important;color:var(--kd-text)!important;border:2px solid var(--kd-line)!important;font-size:15px!important;font-weight:700!important;letter-spacing:0!important;text-transform:none!important}
html.k-day #kerrWxTabs a:hover,html.k-day #tabBar .tab-btn:hover{background:var(--kd-raised)!important}
html.k-day #kerrWxTabs a[aria-current],html.k-day #kerrWxTabs a.active,html.k-day #tabBar .tab-btn.active,html.k-day #tabBar .tab-btn[aria-selected="true"]{background:var(--kd-navy)!important;color:#fff!important;border-color:var(--kd-navy)!important}

/* ---- NWS banners (server copy and kerr-nws.js): solid, bold, readable in sun ---- */
html.k-day .knws details.knws-b,html.k-day .knws .knws-b{background:#FCE5E5!important;border:3px solid var(--kd-nogo-ink)!important;color:var(--kd-text)!important}
html.k-day .knws details.knws-b.s2,html.k-day .knws .knws-b.s2{background:var(--kd-caution-tint)!important;border-color:var(--kd-caution-ink)!important}
html.k-day .knws details.knws-b.s1,html.k-day .knws details.knws-b.s0,html.k-day .knws .knws-b.s1,html.k-day .knws .knws-b.s0{background:var(--kd-snow-tint)!important;border-color:var(--kd-snow)!important}
html.k-day .knws .knws-b>summary,html.k-day .knws .knws-b b{color:var(--kd-text)!important}
html.k-day .knws .knws-b small,html.k-day .knws .knws-b p{color:var(--kd-text2)!important;font-size:15px!important}
html.k-day .knws .knws-x{color:var(--kd-text)!important}
html.k-day .knws-b:focus-visible,html.k-day .knws .knws-b summary:focus-visible{outline:3px solid var(--kd-focus)!important}

/* ---- Drive 80 server card (functions/_middleware.js d80Card writes var(--kdx-*) with the dark values as fallbacks) ---- */
html.k-day{--kdx-card:var(--kd-surface);--kdx-ink:var(--kd-text);--kdx-mute:var(--kd-text3);--kdx-gold:var(--kd-gold-ink);--kdx-line:var(--kd-line);--kdx-go:var(--kd-go-ink);--kdx-caution:var(--kd-caution-ink);--kdx-nogo:var(--kd-nogo-ink)}
/* a vivid call plate: html.k-day .x{background:var(--kd-go);color:var(--kd-on-call);box-shadow:0 0 0 2px var(--kd-fill-edge)} */
html.k-day .kd-call-go{background:var(--kd-go)!important;color:var(--kd-on-call)!important;box-shadow:0 0 0 2px var(--kd-fill-edge)}
html.k-day .kd-call-caution{background:var(--kd-caution)!important;color:var(--kd-on-call)!important;box-shadow:0 0 0 2px var(--kd-fill-edge)}
html.k-day .kd-call-nogo{background:var(--kd-nogo)!important;color:var(--kd-on-call)!important;box-shadow:0 0 0 2px var(--kd-fill-edge)}

/* ---- Ski Day lane's own invert filter (wt/skitrails html.skd-day) must not stack on the shared theme ---- */
html.k-day.skd-day,html.k-day.skd-day img,html.k-day.skd-day video,html.k-day.skd-day iframe,html.k-day.skd-day picture,html.k-day.skd-day .maplibregl-map,html.k-day.skd-day .skg-cam,html.k-day.skd-day .sd-cam{filter:none!important}

/* ---- maps: the map picture keeps its colors; controls on top read dark on white ---- */
html.k-day .maplibregl-ctrl-group,html.k-day .leaflet-bar{background:var(--kd-surface)!important;border:2px solid var(--kd-line-strong)!important;box-shadow:var(--kd-shadow)!important}
html.k-day .maplibregl-ctrl-group button,html.k-day .leaflet-bar a{background-color:var(--kd-surface)!important;color:var(--kd-text)!important}
html.k-day .maplibregl-ctrl-group button+button{border-top:1px solid var(--kd-line)!important}
html.k-day .maplibregl-ctrl-attrib{background:rgba(255,255,255,.9)!important;color:var(--kd-text2)!important}
html.k-day .maplibregl-ctrl-attrib a{color:var(--kd-text2)!important}
html.k-day .maplibregl-popup-content{background:var(--kd-surface)!important;color:var(--kd-text)!important;border:2px solid var(--kd-line-strong)!important}
html.k-day .maplibregl-popup-tip{border-top-color:var(--kd-line-strong)!important;border-bottom-color:var(--kd-line-strong)!important}

/* ---- photo and video plates keep light type: text sitting on a camera image or a video is not a page surface ---- */
html.k-day video,html.k-day img{filter:none}

/* ---- /weather and its tabs: the dark sky photo behind the search and the call card goes; a utility reads on a plain light ground ---- */
html.k-day .wx3-hero .hero-bg,html.k-day .wx3-hero .hero-overlay{display:none!important}
html.k-day .wx3-hero{background:var(--kd-bg)!important}

/* ---- storm cell rows (kerr-nowcast.js): at the 15 px floor the "comes within" line wraps under the cell instead of squeezing it ---- */
html.k-day .knc-cell{grid-template-columns:auto minmax(0,1fr)!important}
html.k-day .knc-cell>.e{grid-column:1/-1;text-align:left!important}
