@import url('https://fonts.googleapis.com/css2?family=Chivo&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

/* ------------------------------------------------------------------ *
 * Palette sampled from the hex logo (the Ensemble Battery):
 *   navy     #0E1A3A  (page / navbar)   body  #15254C   lid  #1B2C57
 *   gold     #E0A526  (band)            bright gold #FFC857 (the gold tree)
 *   slate    #6A7DAB  (trees)           cream #F4F1EA  (lettering)
 *   platinum #D9DCE1  (terminal)
 * Theme-aware variables (SDV shared-CSS fix: never hardcode near-black
 * text colors that vanish on the BS5 dark theme).
 * ------------------------------------------------------------------ */
:root,
[data-bs-theme="light"] {
  --sdv-body-color: #15254C;      /* navy text on white */
  --sdv-heading-color: #0E1A3A;
  --sdv-link-color: #8A6200;      /* darkened gold: AA on white */
  --sdv-link-hover: #B5821A;
  --sdv-code-accent: #15254C;
  --sdv-border-color: #6A7DAB;
}
[data-bs-theme="dark"] {
  --sdv-body-color: #F4F1EA;      /* cream on navy, like the side lettering */
  --sdv-heading-color: #FFFFFF;
  --sdv-link-color: #FFC857;      /* bright gold pops on navy */
  --sdv-link-hover: #D9DCE1;      /* platinum hover, like the terminal */
  --sdv-code-accent: #FFC857;
  --sdv-border-color: #6A7DAB;
}

body {
  font-family: "Lato", system-ui, sans-serif;
  color: var(--sdv-body-color);
  font-size: 18px;
}
/* Dark theme sits on the logo's navy */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .navbar + .container,
[data-bs-theme="dark"] main {
  background-color: #0E1A3A;
}

h1, h2, .h1, .h2 {
  font-family: "Chivo", system-ui, sans-serif;
  letter-spacing: 1px;
  line-height: 2.2rem; /* wrapping headers don't overlap */
  color: var(--sdv-heading-color);
  font-weight: 500;
  font-size: 22px;
}

h3, h4, h5, h6, .h3, .h4 {
  font-family: "Chivo", system-ui, sans-serif;
  letter-spacing: 1px;
  line-height: 1.8rem;
  color: var(--sdv-heading-color);
  font-weight: 500;
  font-size: 18px;
}

pre, code {
  font-family: "Fira Mono", Consolas, Inconsolata, monospace;
}
:not(pre) > code {
  color: var(--sdv-code-accent);
}
/* A gold rule on code blocks, like the battery's band */
pre {
  border-left: 4px solid #E0A526;
}

a {
  color: var(--sdv-link-color);
}
a:hover, a:focus {
  color: var(--sdv-link-hover);
}

hr, .dropdown-divider {
  border-top: 1px solid var(--sdv-border-color);
  opacity: 1;
}

#toc ul.nav li a {
  font-family: "Fira Mono", monospace;
  margin-left: 5px;
  font-size: 14px;
  line-height: 1.65rem;
}
.pkgdown {
  display: none;
}
.pkgdown-footer-right {
  display: none;
}

/* Reference tables of returned columns stay readable in both themes */
table {
  color: var(--sdv-body-color);
}

/* Gold glow on the brand wordmark, tinted to the logo's band */
@keyframes glow {
  from { text-shadow: 0 0 8px #E0A526, 0 0 10px #FFC857; }
  to   { text-shadow: 0 0 10px #E0A526, 0 0 11px #FFC857; }
}
@media (prefers-reduced-motion: reduce) {
  .navbar-brand, .dropdown-header { animation: none !important; }
}

/* ------------------------------------------------------------------ *
 * Navbar: the logo's navy in BOTH color modes, cream text, gold
 * hover/active, a gold underline like the band. BS3-era .navbar-dark
 * selectors are dead in BS5's data-bs-theme markup, so style .navbar
 * directly (SDV shared-CSS fix).
 * ------------------------------------------------------------------ */
.navbar {
  background-color: #0E1A3A !important;
  border-bottom: 2px solid #E0A526;
}

.navbar-brand {
  font-family: "Bungee", system-ui, sans-serif;
  font-size: 16px;
  color: #FFFFFF;
  animation: glow 3s ease-in-out infinite alternate;
}

.navbar-nav,
.navbar-nav .nav-link {
  font-family: "Fira Mono", monospace;
  font-size: small;
}
.navbar-nav .nav-link {
  color: #F4F1EA;
  padding: 0.5rem 1rem;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link:focus,
.navbar-nav .show > .nav-link, .navbar-nav .nav-link.active {
  color: #FFC857;
}
.navbar-nav .active > .nav-link, .navbar-nav .focus > .nav-link {
  background: #1B2C57;
  color: #FFC857;
}
.navbar-nav .nav-item > .nav-link:hover {
  background: rgba(106, 125, 171, 0.3);
  color: #FFC857;
}

/* Version badge legible on the navy navbar (BS5 .text-muted otherwise wins) */
small.nav-text {
  --bs-text-opacity: 1;
  display: inline;
  padding: 0.2em 0.6em 0.3em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #FFFFFF;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25em;
}
small.nav-text.text-muted { color: #D9DCE1 !important; }

/* Dropdowns share the navy */
.dropdown-menu {
  box-shadow: 0 6px 12px rgba(5, 5, 5, 0.18);
  background-color: #0E1A3A;
}
.dropdown-item {
  color: #F4F1EA;
  font-family: "Fira Mono", monospace;
  font-size: small;
}
.dropdown-item:hover, .dropdown-item:focus {
  color: #0E1A3A;
  background-color: #FFC857;
}
.dropdown-header {
  font-family: "Chivo", system-ui, sans-serif;
  letter-spacing: 0.1px;
  line-height: 1.3rem;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 14px;
  animation: glow 2.5s ease-in-out infinite alternate;
}

input[type="search"] {
  border-color: #E0A526;
  background-color: #FFFFFF;
  color: #0E1A3A;
}

[role="button"] {
  color: var(--sdv-link-color);
}
