/* Shared responsive navigation for every page using partials/header.html. */
body.menu-open {
  overflow: hidden;
}

@media (max-width: 992px) {
  body .site-header {
    transform: none !important;
    filter: none !important;
    perspective: none !important;
    contain: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body .site-header .mobile-menu-btn {
    position: relative;
    z-index: 1300;
    display: block;
  }

  body.menu-open .site-header .mobile-menu-btn {
    opacity: 0;
    pointer-events: none;
  }

  body .site-header #mainNav {
    position: fixed !important;
    top: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1400 !important;
    box-sizing: border-box;
    width: min(86vw, 360px) !important;
    max-width: calc(100vw - 48px) !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: translateX(-105%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .3s ease, opacity .3s ease, visibility .3s ease;
  }

  @supports (height: 100svh) {
    body .site-header #mainNav {
      height: 100svh !important;
      max-height: 100svh !important;
    }
  }

  body .site-header #mainNav.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body .site-header #mainNav .nav-main,
  body .site-header #mainNav .nav-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  body .site-header #mainNav .nav-main {
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  body .site-header #mainNav .nav-actions {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
  }

  body .site-header #mainNav .nav-main > a,
  body .site-header #mainNav .nav-actions > a {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    font-size: 1rem;
  }

  body .site-header #mainNav .mobile-drawer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #eef1f8;
    color: #172554;
    cursor: pointer;
    font-size: 1.45rem;
  }

  body .site-header #mainNav .mobile-drawer-brand {
    width: min(178px, 68%);
    margin: 8px auto 2px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  body .site-header #mainNav .mobile-drawer-brand img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    filter: none;
  }
}
