/* ==========================================================================
   Last-loaded utilities
   --------------------------------------------------------------------------
   This file is linked after every other stylesheet, including per-page CSS
   from `{% block extra_css %}`, and is deliberately unlayered. Unlayered
   rules beat every cascade layer, so `.hidden` wins over Oat, the compat
   layers and page CSS without `!important` or specificity games.

   JS toggles visibility with `classList.toggle('hidden', …)` — never
   `element.style.display`. Inline display writes are invisible to the
   cascade and were the reason expandable panels, the progress bar and the
   globe overlays each had their own ad-hoc visibility logic.

   Keep this file tiny: it exists for utilities that must win. Component
   styles belong in base.css / compat*.css.
   ========================================================================== */

.hidden {
  display: none;
}

/* Theme-toggle icon state.
   These live here, unlayered, because Line Awesome is loaded from a CDN and
   is therefore unlayered too: its `.las { display: inline-block }` beats any
   layered `display: none`, which left both sun and moon visible. Once the
   font is self-hosted it can join a `@layer vendor` below `components` and
   these rules can move back to navbar.css. */
.kb-theme-icon-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .kb-theme-icon-light { display: inline-block; }
  .kb-theme-icon-dark { display: none; }
}

html:has(> head > meta[name="color-scheme"][content="dark"]) .kb-theme-icon-light {
  display: inline-block;
}

html:has(> head > meta[name="color-scheme"][content="dark"]) .kb-theme-icon-dark {
  display: none;
}

html:has(> head > meta[name="color-scheme"][content="light"]) .kb-theme-icon-light {
  display: none;
}

html:has(> head > meta[name="color-scheme"][content="light"]) .kb-theme-icon-dark {
  display: inline-block;
}
