/* Site header & primary navigation */

.site-header {
  background: #fff;
  border-bottom: 1px solid rgba(4, 53, 72, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

.site-branding {
  flex-shrink: 0;
}

.site-branding a,
.site-branding .site-logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.site-branding img,
.site-branding .site-logo,
.site-branding .custom-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .site-branding img,
  .site-branding .site-logo,
  .site-branding .custom-logo {
    height: 36px;
    max-width: 180px;
  }
}

.site-branding .site-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #043548;
}

/* Nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #043548;
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #043548;
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Primary nav */
.primary-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.primary-menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
}

.primary-menu > li {
  position: relative;
}

.primary-menu > li > a {
  display: block;
  padding: 20px 15px;
  line-height: 1.3;
  text-decoration: none;
  color: #000;
  font-weight: 400;
}

.primary-menu > li:hover,
.primary-menu > li.current-menu-item,
.primary-menu > li.current-menu-ancestor {
  background-color: #043548;
}

.primary-menu > li:hover > a,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current-menu-ancestor > a {
  color: #fff;
}

.primary-menu > li > a:hover {
  color: #ffcc66;
}

/* Submenu */
.primary-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  background: #fff;
  list-style: none;
  margin: 0;
  padding: 0;
  box-shadow: 0 8px 24px rgba(4, 53, 72, 0.12);
  border: 1px solid rgba(4, 53, 72, 0.08);
  z-index: 100;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
  display: block;
}

.primary-menu .sub-menu li {
  width: 100%;
}

.primary-menu .sub-menu a {
  display: block;
  padding: 9px 12px;
  line-height: 1.4;
  text-decoration: none;
  color: #000;
  width: 100%;
}

.primary-menu .sub-menu a:hover,
.primary-menu .sub-menu .current-menu-item > a {
  background: #043548;
  color: #fff;
}

.primary-menu .sub-menu a .menu-description {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: #333;
  line-height: 1.3;
}

.primary-menu .sub-menu a:hover .menu-description,
.primary-menu .sub-menu .current-menu-item > a .menu-description {
  color: #fff;
}

.current-menu-ancestor .sub-menu a {
  color: #000;
}

.current-menu-ancestor .sub-menu a:hover {
  color: #fff;
}

/* Mobile */
@media (max-width: 1024px) {
  .nav-toggle {
    display: block;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid rgba(4, 53, 72, 0.08);
    display: none;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-menu {
    flex-direction: column;
    width: 100%;
  }

  .primary-menu > li > a {
    padding: 12px 20px;
  }

  .primary-menu .sub-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: #f9fafb;
    min-width: 0;
  }

  .primary-menu .sub-menu.is-open {
    display: block;
  }

  .primary-menu .menu-item-has-children > a::after {
    content: ' ▾';
    font-size: 0.75em;
  }

  .primary-menu a .menu-description {
    display: none !important;
  }
}
