/* Shared navbar and resource banner for the reference pages. */
.reference-header {
  --header-gutter: 24px;
  --header-bg: #101416;
  --header-orange: #bb3900;
  --header-current: #ff5800;
  --header-rule: #85888a;
  --ink: #ffffff;
  --accent: #ffffff;
  position: relative;
  z-index: 2;
  background: var(--header-bg);
  color: var(--ink);
  line-height: 1.2;
  border-bottom: 1px solid rgb(255 255 255 / 15%);

  & .resource-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 27px;
    background: var(--header-orange);
    color: var(--ink);
    padding: 4px 16px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 800;
  }

  & .resource-banner:focus-visible {
    outline-offset: -3px;
  }

  & .nav-bar {
    width: min(100% - var(--header-gutter) * 2, 1152px);
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 42px;
  }

  & .home-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    text-decoration: none;
  }

  & .home-link .logo {
    gap: 3px;
  }

  & .home-link .mark {
    width: 38px;
    height: 31px;
  }

  & .home-link .word {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.045em;
  }

  & .desktop-nav {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: clamp(17px, 3vw, 35px);
  }

  & :is(.desktop-nav a, .mobile-nav a, .service-menu summary) {
    color: inherit;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    text-transform: capitalize;
  }

  & :is(.desktop-nav a[aria-current="page"], .mobile-nav a[aria-current="page"], .service-menu:has(a[aria-current="page"]) > summary) {
    text-decoration: underline;
    text-decoration-color: var(--header-current);
    text-decoration-thickness: 3px;
    text-underline-offset: 7px;
  }

  & .service-menu summary {
    display: flex;
    gap: 3px;
    width: fit-content;
    cursor: pointer;
    list-style: none;
  }

  & .service-menu summary::-webkit-details-marker {
    display: none;
  }

  & .service-menu[open] > summary .reference-icon {
    transform: rotate(180deg);
  }

  & .service-menu-links {
    list-style: none;
    padding: 4px 0;
    margin: 0;
  }

  & .desktop-nav .service-menu {
    position: relative;
  }

  & .desktop-nav .service-menu-links {
    position: absolute;
    inset: 100% auto auto 0;
    min-width: max-content;
    padding-inline: 12px;
    border: 1px solid var(--header-rule);
    border-radius: 6px;
    background: var(--header-bg);
  }

  & .service-menu-links a {
    display: flex;
    padding-inline: 8px;
    text-transform: none;
  }

  & .nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    padding: 6px 18px;
    min-height: 28px;
    border-radius: 999px;
    color: var(--ink);
    background-color: var(--header-orange);
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    text-transform: capitalize;
  }

  & :is(.resource-banner, .nav-cta, .home-link, .desktop-nav a, .mobile-nav a, .service-menu summary):hover {
    text-decoration: underline;
  }

  & .mobile-nav {
    display: none;
  }
}

@media (640px < width <= 760px) {
  .reference-header {
    --header-gutter: 16px;

    & .nav-bar {
      gap: 10px;
    }
    & .home-link .mark {
      width: 32px;
    }
    & .home-link .word {
      font-size: 19px;
    }
    & .desktop-nav {
      gap: clamp(8px, 1.3vw, 12px);
    }
    & :is(.desktop-nav > a, .service-menu summary, .nav-cta) {
      font-size: 11px;
      white-space: nowrap;
    }
    & .nav-cta {
      padding-inline: 9px;
    }
  }
}

@media (max-width: 640px) {
  .reference-header {
    --header-gutter: 16px;

    & .resource-banner {
      min-height: 44px;
      font-size: 11px;
    }
    & .nav-bar {
      justify-content: space-between;
      min-height: 54px;
    }
    & :is(.desktop-nav, .nav-cta) {
      display: none;
    }
    & .mobile-nav {
      display: block;
    }
    & .mobile-nav > summary {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 4px;
      min-height: 44px;
      min-width: 54px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 750;
    }
    & .mobile-nav nav {
      position: absolute;
      inset: 100% 0 auto;
      display: grid;
      background: var(--header-bg);
      border-block: 1px solid var(--header-rule);
      padding: 5px 16px;
      max-height: calc(100dvh - 100px);
      overflow-y: auto;
    }
    & :is(.mobile-nav a, .service-menu summary) {
      min-height: 44px;
      font-size: 14px;
    }
    & .mobile-nav .service-menu-links {
      margin-inline-start: 8px;
      border-inline-start: 1px solid var(--header-rule);
    }
  }
}
