/* Back-to-top button (injected by /assets/js/site.js initScrollTop) */
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 2px solid #d9ef7a;
  border-radius: 50%;
  background: #076044;
  color: #fff;
  box-shadow: 0 6px 18px rgba(20, 45, 39, 0.22);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0.2s,
    background-color 0.15s ease,
    color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0s,
    background-color 0.15s ease,
    color 0.15s ease;
}

.scroll-top svg {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.scroll-top:hover,
.scroll-top:focus-visible {
  background: #d9ef7a;
  color: #076044;
}

.scroll-top:focus {
  outline: none;
}

.scroll-top:focus-visible {
  outline: 3px solid #076044;
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .scroll-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top,
  .scroll-top.is-visible {
    transition: none;
    transform: none;
  }
}

/* ------------------------------------------------------------------
   Sticky header + mobile menu
   Header height: 88px + 1px border (desktop), 72px + 1px (<=639px).
   Site breakpoint for the mobile menu is 639px (compiled CSS).
   ------------------------------------------------------------------ */
html {
  scroll-padding-top: 105px;
}

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
}

/* Sticky sidebars/TOCs sit below the sticky header (only sticky >800px). */
@media (min-width: 801px) {
  .document aside {
    top: 114px;
  }

  .entity-contents {
    top: 113px;
    max-height: calc(100vh - 137px);
  }
}

@media (max-width: 639px) {
  html {
    scroll-padding-top: 89px;
  }

  /* No JS: the static toggle does nothing, so hide it and keep the nav
     reachable as a horizontally scrollable row under the logo. */
  .site-header:not(.has-mobile-nav) .menu-toggle {
    display: none;
  }

  .site-header:not(.has-mobile-nav) .header-inner {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    row-gap: 0;
  }

  .site-header:not(.has-mobile-nav) .header-inner nav {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 0 16px;
    padding-bottom: 6px;
    font-size: 13px;
  }

  .site-header:not(.has-mobile-nav) .header-inner nav a {
    padding: 8px 4px;
  }

  /* JS enhanced: collapsible panel. */
  .site-header.has-mobile-nav .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
    color: #076044;
    cursor: pointer;
    transition:
      background-color 0.15s ease,
      color 0.15s ease;
  }

  .site-header.has-mobile-nav .menu-toggle svg {
    display: block;
    pointer-events: none;
  }

  .site-header.has-mobile-nav .menu-toggle:hover,
  .site-header.has-mobile-nav .menu-toggle[aria-expanded="true"] {
    background: #d9ef7a;
  }

  .site-header.has-mobile-nav .menu-toggle:focus {
    outline: none;
  }

  .site-header.has-mobile-nav .menu-toggle:focus-visible {
    outline: 3px solid #076044;
    outline-offset: 2px;
  }

  .site-header.has-mobile-nav .header-inner nav.site-nav {
    display: none !important;
  }

  .site-header.has-mobile-nav .header-inner nav.site-nav.open {
    display: flex !important;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 41;
    box-sizing: border-box;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 73px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 20px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line, #dce5df);
    box-shadow: 0 16px 24px rgba(20, 45, 39, 0.1);
    font-size: 15px;
    animation: site-nav-in 0.16s ease-out;
  }

  .site-header.has-mobile-nav .header-inner nav.site-nav.open a {
    display: flex;
    align-items: center;
    min-height: 48px;
    box-sizing: border-box;
    padding: 12px 10px;
    border-bottom: 0;
    border-top: 1px solid #e9eee9;
    white-space: normal;
  }

  .site-header.has-mobile-nav .header-inner nav.site-nav.open a:first-child {
    border-top: 0;
  }

  .site-header.has-mobile-nav .header-inner nav.site-nav.open a.active,
  .site-header.has-mobile-nav .header-inner nav.site-nav.open a[aria-current="page"] {
    background: #edf5ef;
    border-radius: 7px;
    color: #076044;
    font-weight: 600;
  }

  .site-header.has-mobile-nav .header-inner nav.site-nav.open a:focus-visible {
    outline: 3px solid #076044;
    outline-offset: -3px;
    border-radius: 7px;
  }
}

@keyframes site-nav-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header.has-mobile-nav .header-inner nav.site-nav.open {
    animation: none;
  }

  .site-header.has-mobile-nav .menu-toggle {
    transition: none;
  }
}
