/* The bar follows the document, so the page keeps its layout as it pins. */
html:has(> body > header[data-md-header]) {
  --md-header-height: 88px;
  scroll-padding-top: calc(var(--md-header-height) + 8px);
}

/* Legacy horizontal clipping must not create a separate scroll container. */
body:has(> header[data-md-header]):not(.ts-is-locked) {
  overflow-x: clip;
}

html body > header[data-md-header] {
  position: sticky !important;
  inset: 0 0 auto !important;
  background: rgb(16 16 16 / .60) !important;
  border-bottom-color: rgb(255 255 255 / .14) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
  transition: background-color .24s ease, border-color .24s ease;
}

html body > header[data-md-header][data-md-header-over-hero] {
  margin-block-end: calc(-1 * var(--md-header-height)) !important;
}

/* Keep visual media under the bar while retaining room for hero text and buttons. */
html body > header[data-md-header-over-hero] ~ main > .mc2-hero > .mc2-hero-copy {
  margin-block-start: var(--md-header-height);
}

html body > header[data-md-header][data-md-header-scrolled] {
  background: rgb(16 16 16 / .82) !important;
  border-bottom-color: #30302d !important;
}

@media (max-width: 760px) {
  html:has(> body > header[data-md-header]) {
    --md-header-height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body > header[data-md-header] {
    transition: none;
  }
}
