/* The Stylesheet to override the MKDocs theme */
:root {
  /* AHS brand tokens. Keep these as the single source of truth for custom UI. */
  --ahs-black: #000000;
  --ahs-charcoal: #15171a;
  --ahs-gray: #6b6b6b;
  --ahs-gray-light: #dcd8d7;
  --ahs-red: #a2240d;
  --ahs-red-bright: #cf4630;
  --ahs-red-light: #f3e4e1;
  --ahs-surface-muted: #f6f6f6;
  --ahs-white: #ffffff;

  /* Map the brand tokens to Material's variables, including transparency steps. */
  --md-primary-fg-color: var(--ahs-gray) !important;
  --md-primary-fg-color--light: #d87c6b !important;
  --md-primary-fg-color--dark: var(--ahs-black) !important;
  --md-primary-bg-color: var(--ahs-white) !important;
  --md-primary-bg-color--light: rgb(255 255 255 / 70%) !important;
  --md-accent-fg-color: var(--ahs-red-bright) !important;
  --md-accent-fg-color--transparent: rgb(207 70 48 / 12%) !important;

  --md-default-bg-color: var(--ahs-white) !important;
  --md-default-bg-color--light: rgb(255 255 255 / 70%) !important;
  --md-default-bg-color--lighter: rgb(255 255 255 / 30%) !important;
  --md-default-bg-color--lightest: rgb(255 255 255 / 12%) !important;
  --md-default-fg-color: var(--ahs-black) !important;
  --md-default-fg-color--light: var(--ahs-gray) !important;
  --md-default-fg-color--lighter: rgb(0 0 0 / 32%) !important;
  --md-default-fg-color--lightest: rgb(0 0 0 / 10%) !important;

  --md-footer-bg-color: var(--ahs-black) !important;
  --md-footer-fg-color: var(--ahs-gray-light) !important;
}

/* Remove blueprint/grid background */
body,
.md-main,
.md-content,
.md-typeset {
  background: #ffffff !important;
  background-image: none !important;
}

/* Overall page structure: sticky footer */
body {
  min-height: 100vh;
}

.md-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.md-main {
  flex: 1;
}

/* Header */
.md-header {
  background-color: #15171a;
  color: #ffffff;
  box-shadow: none;
}

.md-header__title,
.md-header__button,
.md-header__topic {
  color: #ffffff;
}

/* Make the site logo more prominent without increasing the header height. */
.md-header__button.md-logo {
  padding-bottom: 0.3rem;
  padding-top: 0.3rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.8rem;
}

/* Keep the main pages in the header row on desktop. */
.md-header__tabs {
  display: none;
  flex-shrink: 0;
  height: 2.4rem;
}

.md-tabs__item {
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.md-tabs__link {
  color: #dcd8d7;
  margin-top: 0.3rem;
  padding: 0.45rem 0.75rem;
  border-radius: 1rem;
  transition: background-color 125ms, color 125ms, opacity 125ms;
}

.md-tabs__item:not(.md-tabs__item--active) .md-tabs__link:hover,
.md-tabs__item:not(.md-tabs__item--active) .md-tabs__link:focus-visible {
  background-color: #2c2f33;
  color: #ffffff;
  opacity: 1;
}

.md-tabs__item--active .md-tabs__link {
  background-color: #5b2118;
  color: #ffffff;
  font-weight: 700;
  opacity: 1;
}

@media screen and (min-width: 76.25em) {
  .md-header__tabs {
    display: block;
  }
}

/* Sidebar */
.md-sidebar {
  background-color: #ffffff;
}

.md-nav__title {
  color: #000000;
  font-weight: 700;
}

/* Keep the sticky navigation title from fading the first page highlight. */
.md-sidebar--primary .md-nav--primary>.md-nav__title {
  box-shadow: none;
  font-size: 1rem;
}

.md-nav__link {
  color: #6b6b6b;
}

.md-nav__link:hover,
.md-nav__link--active {
  color: #6b6b6b;
}

/* Give the current page a stronger heading above its integrated TOC. */
.md-sidebar--primary .md-nav--integrated>.md-nav__list>.md-nav__item--active>.md-nav__link {
  box-shadow: none;
  color: #000000;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Remove Material's continuous rule beside the integrated TOC. */
.md-sidebar--primary .md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary {
  border-left: 0;
  border-right: 0;
}

/* Use the original page-link highlight treatment for TOC sections. */
.md-sidebar--primary .md-nav--secondary .md-nav__link {
  isolation: isolate;
  margin-top: 0;
  padding: 0.25rem 0;
  position: relative;
}

.md-sidebar--primary .md-nav--secondary .md-nav__link::before {
  border-left: 4px solid transparent;
  border-radius: 0 0.2rem 0.2rem 0;
  content: "";
  inset: 0 -0.6rem;
  pointer-events: none;
  position: absolute;
  transition: background-color 125ms, border-color 125ms;
  z-index: -1;
}

.md-sidebar--primary .md-nav--secondary .md-nav__link:not(.md-nav__link--active):hover,
.md-sidebar--primary .md-nav--secondary .md-nav__link:not(.md-nav__link--active):focus-visible {
  color: #a2240d;
}

.md-sidebar--primary .md-nav--secondary .md-nav__link:not(.md-nav__link--active):hover::before,
.md-sidebar--primary .md-nav--secondary .md-nav__link:not(.md-nav__link--active):focus-visible::before {
  background-color: #f2f2f2;
  border-left-color: #c7c7c7;
}

.md-sidebar--primary .md-nav--secondary .md-nav__link--active {
  color: #a2240d;
  font-weight: 700;
}

.md-sidebar--primary .md-nav--secondary .md-nav__link--active::before {
  background-color: #f3e4e1;
  border-left-color: #cf4630;
}

/*
 * Material reuses the integrated desktop TOC inside the mobile navigation
 * drawer. Give that version roomier controls and its own visual hierarchy.
 */
@media screen and (max-width: 76.234375em) {
  .md-sidebar--primary,
  .md-sidebar--primary .md-nav {
    background-color: var(--ahs-white);
  }

  .md-sidebar--primary .md-nav--primary>.md-nav__title[for="__drawer"] {
    background-color: var(--ahs-gray);
    color: var(--ahs-white);
  }

  .md-sidebar--primary .md-nav--primary>.md-nav__list>.md-nav__item>.md-nav__link {
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    min-height: 2.5rem;
    padding: 0.65rem 0.8rem;
  }

  .md-sidebar--primary .md-nav--integrated>.md-nav__list>.md-nav__item--active>label.md-nav__link {
    background-color: var(--ahs-red-light);
    border-bottom-color: transparent;
    border-left: 4px solid var(--ahs-red-bright);
    color: var(--ahs-red);
    font-size: 0.8rem;
    margin: 0;
    min-height: 2.8rem;
    padding: 0.65rem 0.8rem;
  }

  .md-sidebar--primary .md-nav--integrated>.md-nav__list>.md-nav__item--active>label.md-nav__link .md-nav__icon {
    background-color: rgb(207 70 48 / 12%);
    border-radius: 50%;
    color: var(--ahs-red);
    height: 1.6rem;
    margin: -0.2rem -0.25rem -0.2rem auto;
    padding: 0.2rem;
    width: 1.6rem;
  }

  .md-sidebar--primary .md-nav--secondary>.md-nav__title {
    background-color: var(--ahs-gray);
    box-shadow: 0 1px 0 rgb(0 0 0 / 12%);
    color: var(--ahs-white);
    font-size: 0.8rem;
    min-height: 3.2rem;
    padding-bottom: 0.9rem;
    padding-top: 0.9rem;
  }

  .md-sidebar--primary .md-nav--secondary>.md-nav__title .md-nav__icon {
    color: var(--ahs-white);
  }

  .md-sidebar--primary .md-nav--secondary>.md-nav__list {
    padding: 0.45rem 0.6rem 1rem;
  }

  .md-sidebar--primary .md-nav--secondary .md-nav__link {
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    color: var(--ahs-gray);
    line-height: 1.35;
    margin: 0;
    min-height: 2.75rem;
    padding: 0.7rem 0.65rem 0.7rem 0.8rem;
  }

  .md-sidebar--primary .md-nav--secondary .md-nav__link::before {
    border-left-width: 3px;
    border-radius: 0.2rem;
    inset: 0.25rem 0;
  }

  .md-sidebar--primary .md-nav--secondary .md-nav__link--active {
    color: var(--ahs-red);
  }
}

/* The header tabs now share one row, so use the single-row header offset. */
@media screen and (min-width: 76.25em) {
  .md-header--lifted~.md-container .md-typeset :target {
    --md-scroll-margin: 3.6rem;
  }
}

/* Main content */
.md-typeset {
  color: #000000;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: #a2240d;
  font-weight: 700;
}

/* Highlight the page heading selected from the table of contents. */
body.toc-target-highlighted .md-typeset :is(h1, h2, h3, h4):target {
  isolation: isolate;
  position: relative;
}

body.toc-target-highlighted .md-typeset :is(h1, h2, h3, h4):target::before {
  background-color: #f3e4e1;
  border-left: 4px solid #cf4630;
  border-radius: 0 0.2rem 0.2rem 0;
  content: "";
  inset: -0.2rem -0.5rem;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.md-typeset a {
  color: #6b6b6b;
}

.md-typeset a:hover {
  color: #6b6b6b;
}

/* Styling to underline the links */
a[href^="mailto:"],
a[href^="tel:"] {
  color: #a2240d;
  text-decoration: underline;
}


/* Code blocks */
.md-typeset code {
  background-color: #dcd8d7;
  color: #000000;
}

.md-typeset pre {
  background-color: #000000;
  color: #dcd8d7;
}

/* Tables */
.md-typeset table:not([class]) th {
  background-color: #6b6b6b;
  color: #ffffff;
}

.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: #dcd8d7;
}

/* Buttons */
.md-button {
  color: #6b6b6b;
  border-color: #6b6b6b;
}

.md-button:hover,
.md-button--primary {
  background-color: #6b6b6b;
  border-color: #6b6b6b;
  color: #dcd8d7;
}

/* Search */
.md-search__form {
  background-color: #ffff;
  border-radius: 1rem;
}

.md-search__icon {
  color: #4c4c4c !important;
}

.md-search__input {
  color: #000000;
}

/* Search box - hover */
.md-search__form:hover {
  background-color: #ffff !important;
}

.md-search__input::placeholder {
  color: #15171a;
}

/* Search result cards */
.md-search-result__item {
  border-bottom: 2px solid #dcd8d7 !important;
  padding: 1.2rem 1rem !important;
}

/* Page/document title */
.md-search-result__article {
  border-left: 5px solid #cf4630;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

/* Section heading inside result */
.md-search-result__title {
  color: #000000 !important;
  font-weight: 700 !important;
}

/* Matching highlighted words */
.md-search-result mark {
  background-color: #dcd8d7 !important;
  color: #000000 !important;
  font-weight: 700;
}

/* Search terms on the page opened from a result. */
.md-typeset mark.search-term-highlight {
  background-color: #f6d9a8;
  border-radius: 0.15rem;
  box-decoration-break: clone;
  color: inherit;
  padding: 0.05em 0.12em;
  -webkit-box-decoration-break: clone;
}

/* Search result text */
.md-search-result__teaser {
  color: #6b6b6b !important;
}

/* Search result icon */
.md-search-result__icon {
  color: #cf4630 !important;
}

/* "Matching documents" bar */
.md-search-result__meta {
  background-color: #dcd8d7 !important;
  color: #6b6b6b !important;
}

/* This hides the "more" button, but then it doesnt show the other results */
/* .md-search-result__more {
  display: none !important;
} */

/* Footer */
.md-footer {
  margin-top: auto;
  background-color: #000000;
  color: #dcd8d7;
}

.md-footer-meta {
  background-color: #000000;
}

.md-footer a {
  color: #e3aca3;
}

.md-footer a:hover {
  color: #d87c6b;
}

/* The homepage has no desktop TOC; keep the mobile navigation drawer intact. */
@media screen and (min-width: 76.25em) {
  .md-header--homepage~.md-container .md-sidebar--primary {
    display: none;
  }
}
