/* Overrides to force header/top-nav to the brand red */
:root {
  /* Ensure CSS variables fallback if JS didn't set them */
  --md-primary-fg-color: #e5242a !important;
  --md-primary-bg-color: #e5242a !important;
  --md-accent-fg-color: #e5242a !important;
  --md-accent-fg-color--transparent: #e5242a1a !important;
}

/* Header background */
.md-header {
  /* Force the brand colour explicitly to avoid palette/CSS ordering issues */
  background-color: #e5242a !important;
  /* Keep variable for other areas that depend on it */
  --md-primary-fg-color: #e5242a !important;
  color: #ffffff !important;
}

/* Header logo and icons (make them visible on red) */
.md-header .md-logo svg,
.md-header .md-header__button .md-icon svg,
.md-header .md-header__title,
.md-header .md-header__button,
.md-header .md-icon {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* Tabs / header links */
.md-tabs,
.md-header .md-header__title {
  background-color: var(--md-primary-fg-color) !important;
}

/* Force tab link text to white, including hover/active/focus states */
.md-tabs .md-tabs__list .md-tabs__tab a,
.md-header .md-nav__link,
.md-header .md-nav__link:link,
.md-header .md-nav__link:visited {
  color: #ffffff !important;
}

/* Hover and focus states keep high contrast */
.md-tabs .md-tabs__list .md-tabs__tab a:hover,
.md-header .md-nav__link:hover,
.md-header .md-nav__link:focus {
  color: #ffffff !important;
  opacity: 0.95 !important;
}

/* Active tab label ensure white text */
.md-tabs .md-tabs__tab--active a,
.md-header .md-nav__link--active {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Stronger overrides: ensure tab and top-nav text is white in all cases.
   Covers different DOM structures across Material versions (links, buttons, spans).
   Uses high specificity and !important to override theme variables. */
.md-header .md-nav__link,
.md-header .md-nav__link *,
.md-header .md-nav__link:link,
.md-header .md-nav__link:visited,
.md-header .md-nav__link:hover,
.md-header .md-nav__link:focus,
.md-tabs .md-tabs__tab,
.md-tabs .md-tabs__tab a,
.md-tabs .md-tabs__tab button,
.md-tabs .md-tabs__tab .md-nav__link {
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
  text-decoration: none !important;
}

/* Some theme variants wrap text in spans - ensure those are white too */
.md-header .md-nav__link span,
.md-tabs .md-tabs__tab span {
  color: #ffffff !important;
}

/* Keep active link contrast and weight */
.md-header .md-nav__link--active,
.md-tabs .md-tabs__tab--active a,
.md-tabs .md-tabs__tab--active button {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* If any pseudo-elements show text color, force their color too */
.md-header .md-nav__link::before,
.md-header .md-nav__link::after,
.md-tabs .md-tabs__tab::before,
.md-tabs .md-tabs__tab::after {
  color: #ffffff !important;
}

/* Ensure active nav link highlights are contrasting */
.md-nav__link--active,
.md-nav__link--active:hover {
  background-color: rgba(255,255,255,0.06) !important;
}

/* Buttons in header: primary actions should use accent color */
.md-header .md-button--primary {
  background-color: var(--md-accent-fg-color) !important;
  border-color: var(--md-accent-fg-color) !important;
  color: #ffffff !important;
}

/* Target the actual tab link class used in the built HTML */
.md-tabs__link,
.md-tabs__link:link,
.md-tabs__link:visited,
.md-tabs__link:hover,
.md-tabs__link:focus {
  color: #ffffff !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* Remove the small pill-like background that some themes add to tabs */
.md-tabs__item .md-tabs__link,
.md-tabs__item {
  background: transparent !important;
}

/* Ensure active tab text and background remain white/transparent */
.md-tabs__item--active .md-tabs__link,
.md-tabs__item--active .md-tabs__link:hover {
  color: #ffffff !important;
  background: transparent !important;
}

/* Bottom page navigation styles removed — the theme's built-in footer navigation
   is now used (controlled via the `navigation.footer` / `navigation.prev_next`
   feature flags in `mkdocs.yml`). Removing the injected styles avoids
   duplicated/unused CSS while retaining the other header overrides above.
*/
