/* Override Bootstrap's primary color variable — changes what bg-primary resolves to */
/* No !important needed: bg-primary uses var(--bs-primary-rgb), so changing the   */
/* variable at root changes the computed color everywhere.                         */
:root {
  --bs-primary: #5b6f95;
  --bs-primary-rgb: 91, 111, 149;
  --bs-link-color: #5b6f95;
  --bs-link-color-rgb: 91, 111, 149;
  --bs-link-hover-color: #5b6f95;
  --bs-link-hover-color-rgb: 91, 111, 149;
}

/* Navbar link colors — keep these explicit regardless of bg */
/* Navbar background — Cosmo theme has a hardcoded gradient on .bg-primary     */
/* that paints over background-color. We must null it out explicitly.           */
.navbar.fixed-top.bg-primary {
  background-image: none !important;
  background-color: #5b6f95 !important;
  --bs-navbar-color: #ffffff;
  --bs-navbar-hover-color: #ffffff;
  --bs-navbar-active-color: #ffffff;
  --bs-navbar-brand-color: #ffffff;
  --bs-navbar-brand-hover-color: #ffffff;
}

/* Keep top-nav links readable */
.navbar.fixed-top .nav-link,
.navbar.fixed-top .navbar-brand {
  color: #ffffff !important;
}

/* Top-nav interaction states use slate highlight with white text */
.navbar.fixed-top .navbar-nav .nav-link:hover,
.navbar.fixed-top .navbar-nav .nav-link:focus,
.navbar.fixed-top .navbar-nav .nav-link.active,
.navbar.fixed-top .navbar-nav .show > .nav-link,
.navbar.fixed-top .navbar-nav .dropdown-item:hover,
.navbar.fixed-top .navbar-nav .dropdown-item:focus,
.navbar.fixed-top .navbar-nav .dropdown-item.active,
.navbar.fixed-top .navbar-nav .dropdown-item:active {
  background-color: #5b6f95 !important;
  color: #ffffff !important;
}

/* Dropdown menu colors */
.navbar.fixed-top .dropdown-menu {
  --bs-dropdown-link-color: #1e3552;
  --bs-dropdown-link-hover-color: #ffffff;
  --bs-dropdown-link-hover-bg: #5b6f95;
  --bs-dropdown-link-active-color: #ffffff;
  --bs-dropdown-link-active-bg: #5b6f95;
}

/* Sidebar TOC — explicit colors to avoid navbar bleed */
.bs-sidebar .nav > li > a {
  color: #1e3552 !important;
}
.bs-sidebar .nav > li > a:hover,
.bs-sidebar .nav > li > a:focus,
.bs-sidebar .nav > li > a.active {
  color: #2f5f98 !important;
}
