/* Shared site header — brand left, nav + a11y right; hamburger under 768px */

html,
body {
  overflow-x: clip;
  max-width: 100%;
}

/* A11y chrome stays unscaled; keep range inputs on a stable px box */
#a11y-menu-panel input[type="range"],
#welcome-dialog input[type="range"] {
  height: 1.5rem;
  accent-color: #005ea5;
}

.site-header {
  position: relative;
  z-index: 40;
}

.site-header-inner {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  width: 100%;
}

.site-brand,
.site-header-inner > a:first-child {
  flex: 0 0 auto;
}

.site-brand > span:last-child,
.site-header-inner > a:first-child > span:last-child {
  white-space: nowrap;
}

.site-header-right,
.site-header-inner > div:last-child {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 24px !important;
  margin-left: auto !important;
  min-width: 0;
  flex: 0 1 auto;
}

.site-nav,
.site-header-right > nav,
.site-header-inner nav[aria-label="Primary navigation"] {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 24px !important;
  width: auto !important;
  max-width: none;
  padding: 0 !important;
  border: 0 !important;
  order: unset !important;
  margin: 0 !important;
}

.site-nav > a,
.site-header-right > nav > a,
.site-header-inner nav[aria-label="Primary navigation"] > a {
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  flex-shrink: 0;
}

#a11y-menu-wrapper {
  flex: 0 0 auto;
}

.site-nav-toggle,
#nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 9999px;
  border: 1px solid #c2c7ce;
  background: #fff;
  color: #41484d;
  cursor: pointer;
}

.site-nav-toggle:hover,
#nav-menu-btn:hover {
  color: #00569e;
  border-color: #00569e;
}

.site-nav-toggle .material-symbols-outlined,
#nav-menu-btn .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}

.site-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .site-header-right,
  .site-header-inner > div:last-child,
  .site-nav,
  .site-header-right > nav,
  .site-header-inner nav[aria-label="Primary navigation"] {
    gap: 16px !important;
  }
}

/* Mobile: hamburger + dropdown nav */
@media (max-width: 768px) {
  .site-header-right,
  .site-header-inner > div:last-child {
    gap: 10px !important;
  }

  .site-nav-toggle,
  #nav-menu-btn {
    display: inline-flex !important;
  }

  .site-nav,
  .site-header-right > nav,
  .site-header-inner nav[aria-label="Primary navigation"] {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 16px 12px !important;
    background: #fff;
    border-bottom: 1px solid #c2c7ce;
    box-shadow: 0 8px 20px rgba(10, 26, 43, 0.12);
    overflow: visible !important;
  }

  .site-nav.is-open,
  .site-header-right > nav.is-open,
  .site-header-inner nav[aria-label="Primary navigation"].is-open {
    display: flex !important;
  }

  .site-nav > a,
  .site-header-right > nav > a,
  .site-header-inner nav[aria-label="Primary navigation"] > a {
    width: 100%;
    padding: 12px 4px !important;
    border-bottom: 1px solid #e7ebf0;
  }

  .site-nav > a:last-child,
  .site-header-right > nav > a:last-child {
    border-bottom: 0;
  }
}

/*
  Text-size slider scales html font-size, but Tailwind tokens use fixed px
  line-heights — so at 200% glyphs stack on each other. Use unitless ratios
  (same look at 100%, room to breathe when enlarged).
*/
.text-display-lg { line-height: 1.2 !important; }
.text-display-lg-mobile { line-height: 1.2 !important; }
.text-headline-lg { line-height: 1.3 !important; }
.text-headline-lg-mobile { line-height: 1.3 !important; }
.text-headline-md { line-height: 1.35 !important; }
.text-title-lg { line-height: 1.4 !important; }
.text-title-md { line-height: 1.4 !important; }
.text-body-lg { line-height: 1.65 !important; }
.text-body-md { line-height: 1.7 !important; }
.text-body-sm { line-height: 1.65 !important; }
.text-label-lg { line-height: 1.45 !important; }
.text-label-md { line-height: 1.45 !important; }
.text-label-sm { line-height: 1.5 !important; }
.text-mono-sm { line-height: 1.45 !important; }

/* Extra air + keep the floating section tracker off the copy when text is large */
html[data-large-text] .text-body-lg,
html[data-large-text] .text-body-md,
html[data-large-text] .text-body-sm {
  line-height: 1.8 !important;
}

html[data-large-text] #floating-toc .toc-link > span:not(.toc-dot) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-large-text] #floating-toc {
  right: 0.75rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
}

html[data-xlarge-text] #floating-toc {
  display: none !important;
}
