/* reneuro branding: the parts of the EU-flag theme that bslib variables in
 * _pkgdown.yml cannot express.
 *
 * This file is reneuro-specific ON PURPOSE. The sibling `pkgdown/extra.scss`
 * is byte-identical across reneuro, timescales, geoscales, energyRt and
 * reneuro.dev -- it carries only the shared dark-mode figure fix and no
 * branding. Keep it that way; brand rules belong here.
 *
 * Palette, sampled from man/figures/logo.png:
 *   #003399  EU blue   10.86:1 on white
 *   #FFCC00  EU gold    1.51:1 on white -- a fill, a rule or an underline,
 *                       never text. #003399 on gold is 7.18:1.
 */

/* bslib derives the dark-mode link from `primary`, NOT from `link-color`, and
 * #003399 derives #6685c2 -- 4.19:1 on the dark body, below AA. (The previous
 * #B12A90 derived #d07fbc at 5.47:1, which is why this was not needed before.)
 * #7E9FDA is the same hue lightened to 5.77:1. */
:root[data-bs-theme="dark"] {
  --bs-link-color: #7E9FDA;
  --bs-link-color-rgb: 126, 159, 218;
  --bs-link-hover-color: #A6B8DB;
  --bs-link-hover-color-rgb: 166, 184, 219;
}

/* DARK-MODE PAGE BACKGROUND. bslib's default is the neutral #212529; these
 * make the page a dark blue of the logo's family without approaching the
 * logo's own #0A1840, which stays reserved for the navbar.
 *
 * CHOICE B is active. Measured: white 13.45:1, the dark link #7E9FDA 5.03:1,
 * and -- the deciding number -- 1.28:1 against the navbar, where the current
 * neutral body gives 1.12:1. B separates from the bar by SATURATION (27.5%
 * against the bar's 73%) as well as luminance, so the bar keeps an edge.
 *
 * ALTERNATIVE E is kept commented in place rather than deleted. It is the
 * richer, darker blue (white 15.97:1) and it reads well -- but it shares the
 * navbar's hue (222 against 224) at nearly the same lightness, so the bar
 * DISAPPEARS into it (1.08:1 with no hue separation left). E is therefore a
 * PAIRED change: switching it on also requires the darker navbar below, or
 * the header stops reading as a header. */
:root[data-bs-theme="dark"] {

  --bs-body-bg: #252F41;                  /* B  slate navy */
  --bs-body-bg-rgb: 37, 47, 65;
  --bs-secondary-bg: #1D2432;             /* cards, table stripes */
  --bs-tertiary-bg: #1D2432;              /* code blocks */
  --bs-border-color: #334159;

  /* --- alternative E: midnight (needs the paired navbar below) ---
  --bs-body-bg: #16213B;
  --bs-body-bg-rgb: 22, 33, 59;
  --bs-secondary-bg: #10182A;
  --bs-tertiary-bg: #10182A;
  --bs-border-color: #203157;
  */
}

/* Paired navbar for alternative E only. #0A1840 is the dark logo's own field
 * and stays the default; against E it gives 1.08:1 and vanishes, so E needs
 * #05091C (1.24:1, white 19.77:1) instead.
[data-bs-theme="dark"] .navbar {
  background-color: #05091C !important;
}
*/

/* `navbar-bg` paints the bar #003399 in both themes; dark mode is re-painted
 * slate grey below. pkgdown drives navbar FOREGROUND from
 * --bs-emphasis-color, which follows the page theme -- so in light mode the
 * links would come out near-black on navy. Set them explicitly.
 * (The toggler icon is a hard-coded dark-stroke SVG upstream, hence the
 * white-stroke replacement; it only shows at mobile widths.) */
.navbar {
  --bs-navbar-color: rgba(255, 255, 255, .75);
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
  --bs-navbar-brand-color: #fff;
  --bs-navbar-brand-hover-color: #fff;
  --bs-navbar-disabled-color: rgba(255, 255, 255, .45);
  --bs-navbar-toggler-border-color: rgba(255, 255, 255, .3);
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 30 30%27%3e%3cpath stroke=%27rgba%28255,255,255,0.85%29%27 stroke-linecap=%27round%27 stroke-miterlimit=%2710%27 stroke-width=%272%27 d=%27M4 7h22M4 15h22M4 23h22%27/%3e%3c/svg%3e");
}

/* Dark mode: the navy bar reads heavy against the dark body; paint it a
 * shade darker than the body (#212529) instead. White foreground and gold
 * accents keep their contrast.
 *
 * 2026-09-26: recoloured to #0A1840, the DARK LOGO's own field, sampled as
 * 41.9% of the opaque pixels of man/figures/logo-dark.png, so the mark sits
 * on its own background. Measured contrast: white 17.25:1, gold #FFCC00
 * 11.41:1, the logo gold #FFD074 11.93:1, muted white 9.38:1 -- all past AA
 * and marginally better than the #1a1d20 grey it replaces (16.93, 11.20).
 * It separates from the body (#212529) by HUE, not luminance (1.12:1), so
 * the edge nearly vanishes in greyscale; nothing should depend on it. */
[data-bs-theme="dark"] .navbar {
  background-color: #0A1840 !important;
}

/* The development version label renders as `text-danger`; that red is 2.40:1
 * on #003399. Gold is 7.18:1. */
.navbar .nav-text {
  color: #FFCC00;
}

.navbar .nav-link.active,
.navbar .nav-item.active > .nav-link {
  box-shadow: inset 0 -3px 0 0 #FFCC00;
}

blockquote {
  border-left: 4px solid #FFCC00;
  padding-left: 1rem;
}

/* Scoped to <main>: the home sidebar's "Links" / "License" / "Citation" /
 * "Table of contents" are <h2> as well, and an unscoped rule stripes all four
 * down the right column. */
main h1,
main h2 {
  border-bottom: 2px solid #FFCC00;
  padding-bottom: .3rem;
}

/* `secondary: "#FFCC00"` alone would put white text on gold (1.51:1). Gold is
 * a ground here, with blue on top. */
.btn-secondary {
  --bs-btn-bg: #FFCC00;
  --bs-btn-border-color: #FFCC00;
  --bs-btn-color: #003399;
  --bs-btn-hover-bg: #E6B800;
  --bs-btn-hover-border-color: #E6B800;
  --bs-btn-hover-color: #003399;
}

/* Dark-mode logo swap: the light mark stays in light mode; the night-
   lights variant replaces it when the dark theme is active. The path is
   relative to this stylesheet (docs/extra.css), so it resolves from any
   page depth. `content: url()` on <img> is supported in all current
   browsers (Firefox since 113). */
[data-bs-theme="dark"] img[src$="logo.png"] {
  content: url("reference/figures/logo-dark.png");
}
