/* Custom site styles — add your overrides here. */

/* Self-hosted Nunito Sans (the Lux body font). Lux normally pulls this from
   Google Fonts at page load, which leaks every visitor's IP/User-Agent to
   Google; that @import is disabled in light-lux.scss / dark-lux.scss
   ($web-font-path: false) and served from here instead. One variable-font
   file (weight axis 100–900) covers every weight Lux asks for. The file is
   the same NunitoSans-VF vendored for the TikZ pipeline, converted to woff2
   and published via `resources` in _quarto.yml. The src reference below is
   relative to this stylesheet (site root), so it holds regardless of page
   depth. Every CSS reference in this file must carry a real path inside the
   parentheses. An empty pair of parentheses after the css url keyword makes
   Quarto's reference scanner resolve the reference to this stylesheet's own
   directory (the project root) and then try to copy the whole repo into _site/
   ("Cannot copy ... to a subdirectory of itself"). Never write that empty form
   anywhere in this file, even in a comment. */
@font-face {
  font-family: "Nunito Sans";
  src: url("_fonts/NunitoSans-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Swap Quarto's default toggle-slider for sun/moon glyphs (Bootstrap Icons font).
   Which glyph shows is keyed on the toggle's state class:
     :not(.alternate) = light mode -> sun
     .alternate       = dark mode  -> moon
   The navbar is always dark (data-bs-theme="dark"), so the icon is light in
   both modes, brightening to white on hover. */
.navbar .quarto-color-scheme-toggle .bi::before {
  background-image: none !important;
  font-family: "bootstrap-icons" !important;
  width: auto !important;
  height: auto !important;
  font-size: 1rem;
  line-height: 1;
  vertical-align: -0.125em;
  color: rgba(255, 255, 255, 0.75);
}
.navbar .quarto-color-scheme-toggle:hover .bi::before {
  color: #fff;
}
.navbar .quarto-color-scheme-toggle:not(.alternate) .bi::before {
  content: "\f5a1" !important;  /* sun-fill — light mode */
}
.navbar .quarto-color-scheme-toggle.alternate .bi::before {
  content: "\f495" !important;  /* moon-stars-fill — dark mode */
}

/* Subtle text-selection highlight (light mode; dark mode overrides this in
   dark-lux.scss). */
::selection {
  background-color: rgba(71, 88, 171, 0.18);
}

/* Collapsible notation primer: a plain toggle that reads as a subordinate line
   under the section heading (no callout box). */
details.nomenclature-primer {
  margin-bottom: 1.25rem;
}
details.nomenclature-primer > summary {
  cursor: pointer;
  list-style: none;          /* drop the default disclosure triangle */
  font-style: italic;
  color: #6c757d;
}
details.nomenclature-primer > summary::-webkit-details-marker {
  display: none;             /* same, for WebKit */
}
details.nomenclature-primer[open] > summary {
  margin-bottom: 0.85rem;    /* breathing room before the body when expanded */
}
details.nomenclature-primer > summary::before {
  content: "\25B8";          /* ▸ caret, rotates to ▾ when open */
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
}
details.nomenclature-primer[open] > summary::before {
  transform: rotate(90deg);
}

/* Theorem-like environments (definitions, propositions, corollaries, examples)
   stand out as a tinted box with a colour-coded accent bar. Only the mode-agnostic
   STRUCTURE lives here; the colours live in light-lux.scss / dark-lux.scss so they
   switch together with the rest of the theme (a body-class scope flipped early). */
.theorem {
  border-left-width: 3px;
  border-left-style: solid;
  border-radius: 4px;
  padding: 0.75rem 1rem 0.4rem;
  margin: 1.25rem 0;
}

/* Remarks are commentary: lighter — no fill, just a subtle bar. */
.proof.remark {
  border-left-width: 3px;
  border-left-style: solid;
  padding-left: 1rem;
  margin: 1.25rem 0;
}

/* Inline TikZ diagrams: black line-art with white-filled nodes on a transparent
   background. Centred here because the extension emits a bare <img> (fig-align
   only applies when a diagram has a caption). */
img.diagram {
  display: block;
  margin-inline: auto;
  max-width: 100%;
  height: auto;
}
/* Dark mode: invert(0.9), NOT invert(1). The CSS invert formula maps
   white -> (1-amount)*255 and black -> amount*255, so 0.9 sends the white node
   fills to ~#191919 — matching the #1a1a1a page background so the node boxes
   disappear — and the black lines/text to ~#e5e5e5 (light, legible). A full
   invert(1) would make the fills pure #000, showing as boxes on #1a1a1a.
   (Safe because the diagrams are monochrome; revisit for a coloured diagram.) */
.quarto-dark img.diagram {
  filter: invert(0.9);
}
