/* WordPress integration and mobile navigation containment. */
/*
 * Keep horizontal overflow at the viewport root. `clip` does not create a
 * scrolling box, so descendants using position: sticky remain attached to
 * the viewport. In particular, do not put overflow-x:hidden on body: CSS
 * computes the other axis to auto and turns body into a vertical scroller.
 */
html {
  overflow-x: clip;
}

body.mdm-homepage-active {
  margin: 0;
  overflow-x: clip;
  overflow-y: visible;
}

/* Override the exported global main{overflow:clip} rule only for this page. */
body.mdm-homepage-active main.mdm-homepage-root {
  overflow: visible;
}

/* The old theme can inject a full-screen preloader through wp_body_open().
 * This standalone homepage has its own eager fallback, so those overlays are
 * unnecessary and can briefly cover the first frame in Chromium. */
body.mdm-homepage-active #preloader,
body.mdm-homepage-active .preloader,
body.mdm-homepage-active #page-loader,
body.mdm-homepage-active .page-loader,
body.mdm-homepage-active .site-loader,
body.mdm-homepage-active .loader-wrapper {
  display: none !important;
}

body.mdm-homepage-active.mdm-menu-open {
  overflow: hidden;
}

@media (max-width: 680px) {
  body.mdm-homepage-active .hero h1 {
    font-size: clamp(43px, 12vw, 50px);
  }

  body.mdm-homepage-active .site-header {
    left: 8px;
    transform: none;
  }

  body.mdm-homepage-active .site-header .nav {
    width: 100vw;
    height: 100dvh;
    left: -8px;
    right: auto;
    top: -8px;
    bottom: auto;
  }
}

body.admin-bar.mdm-homepage-active .site-header {
  top: 46px;
}

@media (min-width: 783px) {
  body.admin-bar.mdm-homepage-active .site-header {
    top: 46px;
  }
}
