/* Navigation reliability patch: keeps links above decorative layers and aligns the mobile breakpoint with the site CSS. */
header {
  isolation: isolate;
}

header .nav-row,
header .brand,
header nav.top-inline,
header nav.top-inline a,
header .menu-btn {
  position: relative;
  pointer-events: auto;
}

header .nav-row { z-index: 1002; }
header .brand,
header nav.top-inline,
header nav.top-inline a,
header .menu-btn { z-index: 1003; }

header .menu-btn {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

header nav a {
  text-decoration: none !important;
}

@media (max-width: 950px) {
  header nav.top-inline {
    display: none !important;
  }

  header nav#dropdownNav {
    z-index: 1001 !important;
    pointer-events: none !important;
  }

  header nav#dropdownNav.open:not([hidden]) {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  header nav#dropdownNav a {
    pointer-events: auto !important;
    touch-action: manipulation;
  }
}

@media (min-width: 951px) {
  header .menu-btn {
    display: none !important;
  }

  header nav#dropdownNav {
    display: none !important;
  }
}

/* Keep the scripted menu out of layout before JavaScript initializes.
   No-JS visitors still receive the mobile links. */
#dropdownNav[hidden] { display: none !important; }

/* Preserve the fallback menu only when scripting is genuinely disabled.
   This avoids rendering it before deferred JavaScript initializes, which
   previously collapsed the header after first paint on every mobile page. */
@media (scripting: none) and (max-width: 950px) {
  header .menu-btn { display: none !important; }
  header nav#dropdownNav[hidden] {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    position: static !important;
    pointer-events: auto !important;
  }
}
