header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: transparent;
  transition: background 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap:20px;
}

header[role="banner"].is-scrolled {
  background: linear-gradient(180deg, #0a2540 0%, #123a63 100%);
}

header[role="banner"] .region {
  display: flex;
  align-items: center;
}

header[role="banner"] .region-primary-menu {
  flex: 1;
  justify-content: center;
}

/* Hover state for nav items without a mega panel — matches the underline
   and sibling-dimming that .is-mega-active / .mega-open give panel items.
   :not(.is-mega-active) keeps panel items on their existing ::after rather
   than drawing a second one. */
.region-primary-menu .menu a:hover:not(.is-mega-active) {
  position: relative;
}

.region-primary-menu .menu a:hover:not(.is-mega-active)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  background: #003346;
}

header.is-scrolled .region-primary-menu .menu a:hover:not(.is-mega-active)::after {
  background: #7ec8e3;
}

/* Dim the siblings, same as .mega-open does for panel items */
.region-primary-menu .menu:has(a:hover) a:not(:hover):not(.is-mega-active) {
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.site-logo-wrap {
  position: relative;
  display: inline-block;
}

.site-logo {
  display: block;
  height: 40px;
  width: auto;
}

.site-logo--scrolled {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.site-logo--default {
  opacity: 1;
  transition: opacity 0.4s ease;
}

header.is-scrolled .site-logo--default {
  opacity: 0;
}

header.is-scrolled .site-logo--scrolled {
  opacity: 1;
}

.region-primary-menu .menu {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.region-primary-menu .menu-item {
  margin: 0;
  padding: 0;
  line-height: normal;
}

.region-primary-menu .menu a {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: #0a2540;
  transition: color 0.4s ease;
}

.region-primary-menu .menu a:hover {
  color: #12385f;
}

header.is-scrolled .region-primary-menu .menu a {
  color: #fff;
}

header.is-scrolled .region-primary-menu .menu a:hover {
  color: #7ec8e3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  display: inline-block;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 999px;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.btn--outline {
  background: transparent;
  color: #0a2540;
  border: 1.5px solid #0a2540;
}

.btn--outline:hover {
  background: #003346;
  color: #fff;
  border-color: #003346;
}

.btn--filled {
  background: #003346;
  color: #fff;
  border: 1.5px solid #003346;
}

.btn--filled:hover {
  background: #00AEEF;
  color: #fff;
  border-color: #00AEEF;
}

header.is-scrolled .btn--outline {
  background: #ffffff;
  color: #005e81;
  border: 1px solid #005e81;
}

header.is-scrolled .btn--outline:hover {
  background: #003346;
  color: #ffffff;
  border-color: #003346;
}

header.is-scrolled .btn--filled {
  background: #003346;
  color: #ffffff;
  border-color: #003346;
}

header.is-scrolled .btn--filled:hover {
  background: #00AEEF;
  color: #ffffff;
  border-color: #00AEEF;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 360px;
  background: #003346;
  color: #fff;
  padding: 28px 32px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  display: none;
  z-index: 999;
  transition: left 0.25s ease;
}

.mega-menu.is-open {
  display: block;
}

.mega-panel {
  display: none;
}

.mega-panel.is-active {
  display: block;
}

.mega-panel__heading {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: #7ec8e3;
  margin-bottom: 20px;
}

.mega-panel__heading a {
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.mega-panel__heading a:hover {
  text-decoration: underline;
}

.mega-panel__links {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.mega-panel__links li {
  margin-bottom: 12px;
}

.mega-panel__links a {
  color: #fff;
  text-decoration: none;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
}

.mega-panel__links a:hover {
  text-decoration: underline;
}

.mega-panel__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 20px 0;
}

.mega-panel__blurb {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.mega-panel__cta a {
  color: #7ec8e3;
  font-weight: 600;
  text-decoration: underline;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
}

/* Active nav item gets an underline indicator matching the panel color */
.region-primary-menu .menu a.is-mega-active {
  color: #0a2540;
  position: relative;
}

.region-primary-menu .menu a.is-mega-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  background: #003346;
}

header.is-scrolled .region-primary-menu .menu a.is-mega-active {
  color: #ffffff;
}

header.is-scrolled .region-primary-menu .menu a.is-mega-active::after {
  background: #7ec8e3;
}

/* Dim sibling nav items while a mega panel is open, to match Figma */
.region-primary-menu .menu.mega-open a:not(.is-mega-active) {
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.mobile-nav-panel {
  display: contents;
}

.mobile-menu-toggle {
  display: none;
}

body.mobile-menu-active {
  overflow: hidden;
}

.mobile-shared-cta {
  display: none;
}

@media (max-width: 1490px) {
  header[role="banner"] {
    flex-wrap: nowrap;
    padding: 14px 20px;
    gap: 12px;
  }

    .region-primary-menu .menu:has(a:hover) a:not(:hover) {
    opacity: 1;
  }

  .region-primary-menu .menu a:hover::after {
    display: none;
  }

  .mega-panel.is-mobile-expanded .mega-panel__heading a,
  .mega-panel.is-mobile-expanded .mega-panel__heading a:hover {
    color: #00AEEF;
  }

  .mega-panel {
    display: none;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .site-logo {
    max-width: 200px;
    height: auto;
    width: auto;
  }

  header[role="banner"].mobile-menu-open .mobile-shared-cta {
    display: block;
  }

  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-menu-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #0a2540;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
  }

  header.is-scrolled .mobile-menu-toggle__bar {
    background: #fff;
  }

    header[role="banner"].mobile-menu-open .mobile-menu-toggle__bar {
      background: #0a2540;
    }

    header[role="banner"].mobile-menu-open .site-logo--default {
      opacity: 1;
    }

    header[role="banner"].mobile-menu-open .site-logo--scrolled {
      opacity: 0;
    }

  header[role="banner"].mobile-menu-open .mobile-menu-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  header[role="banner"].mobile-menu-open .mobile-menu-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  header[role="banner"].mobile-menu-open .mobile-menu-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-nav-panel {
    display: none;
    width: 100%;
  }

    header[role="banner"].mobile-menu-open {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      background: #fff;
      z-index: 1100;
    }

    header[role="banner"].mobile-menu-open .mobile-nav-panel {
      display: flex;
      flex-direction: column;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: #003346;
      border-radius: 0 0 16px 16px;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
      padding: 8px 20px 0;
      max-height: calc(100vh - 70px);
      overflow-y: auto;
    }

  /* Full-width, flush-left menu: the region's desktop justify-content: center
     was centering the shrink-wrapped nav block inside it — override both and
     force the nav block wrapper to full width */
  .region-primary-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .region-primary-menu>* {
    width: 100%;
  }

  .region-primary-menu .menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .region-primary-menu .menu-item {
    width: 100%;
  }

  .region-primary-menu .menu a {
    width: 100%;
    padding: 16px 4px;
    font-size: 15px;
    color: #fff;
  }

    body.mobile-menu-active::after {
      content: '';
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 1050;
    }

  /* Neutralize desktop hover color on touch — sticky :hover after tap was
     making the expanded item's text go dark/ghosted on the navy background */
  .region-primary-menu .menu a:hover {
    color: #fff;
  }

  /* Expanded accordion item: stays white, underlined (matches Figma) */
  .region-primary-menu .menu a.is-mobile-expanded-link {
    text-decoration: underline;
    text-underline-offset: 6px;
  }

  .header-actions {
    width: 100%;
    padding: 20px 4px;
    gap: 12px;
  }

  .header-actions .btn--outline {
    background: #fff;
    color: #0a2540;
    border: none;
  }

  .header-actions .btn--filled {
    background: transparent;
    color: #fff;
    border: none;
    padding: 10px 0;
  }

  .mega-menu {
    display: block;
    position: static;
    width: 100%;
    background: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  .mega-panel {
    display: none;
    width: 100%;
    box-sizing: border-box;
  }

  .mega-panel .mega-panel__heading,
  .mega-panel .mega-panel__links,
  .mega-panel .mega-panel__blurb,
  .mega-panel .mega-panel__cta,
  .mega-panel .mega-panel__divider {
    display: none;
  }

  .mega-panel.is-mobile-expanded {
    display: block;
    padding: 20px 4px;
  }

  .mega-panel.is-mobile-expanded .mega-panel__heading,
  .mega-panel.is-mobile-expanded .mega-panel__links {
    display: block;
    text-align: left;
  }

  .mega-panel.is-mobile-expanded .mega-panel__heading {
    font-size: 13px;
    letter-spacing: 0.04em;
    color: #7ec8e3;
    padding-left: 12px;
    margin-bottom: 14px;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .mega-panel.is-mobile-expanded .mega-panel__links {
    padding-left: 12px;
  }

  .mega-panel.is-mobile-expanded .mega-panel__links a {
    font-size: 15px;
    text-align: left;
    color: #fff;
  }

  /* Safety net: is-mega-active / mega-open are desktop hover states meant
     for a light background. If they ever fire on mobile, keep text legible
     instead of dark navy, rather than relying only on the JS guard below. */
  .region-primary-menu .menu a.is-mega-active,
  .region-primary-menu .menu.mega-open a:not(.is-mega-active) {
    color: #fff;
    opacity: 1;
  }

  .mega-panel__blurb {
    color: rgba(255, 255, 255, 0.8);
  }

  .mobile-shared-cta {
    padding: 4px 4px 28px;
  }

  /* Redundant with the alignment rules above, kept as a defensive belt —
     these were the original fix for the centered-looking items */
  .mobile-nav-panel .region-primary-menu .menu {
    padding-left: 0;
    margin-left: 0;
  }

  .mobile-nav-panel .region-primary-menu .menu-item,
  .mobile-nav-panel .region-primary-menu .menu a {
    padding-left: 4px;
    margin-left: 0;
    text-align: left;
  }
}
