/* Header and navigation styles */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 3px solid var(--primary-blue);
  padding: 1rem clamp(1rem, 3vw, 2.25rem);
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 71, 171, 0.06);
  gap: 1rem;
}

.site-header__logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

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

.site-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2vw, 2.5rem);
}

.site-header__nav a {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  text-decoration: none;
  position: relative;
  padding: 0.5rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s var(--ease-standard);
}

/* Animated underline on hover/focus */
.site-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--primary-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease-out);
  border-radius: 2px;
}

.site-header__nav a:hover {
  color: var(--primary-blue);
}

.site-header__nav a:hover::after,
.site-header__nav a:focus-visible::after {
  transform: scaleX(1);
}

.site-header__nav a:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-header__nav a.is-active {
  color: var(--primary-blue);
}

.site-header__nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cta-accent);
  border-radius: 2px;
  transform: scaleX(1);
}

.site-header__cta {
  background: var(--primary-blue);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.site-header__cta:hover {
  background: #00337a;
  transform: translateY(-1px);
}

.site-header__cta:focus-visible {
  outline: 3px solid var(--cta-accent);
  outline-offset: 3px;
}

/* Hamburger button — hidden on desktop */
.site-header__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}

.site-header__toggle span {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 3px;
  margin-left: -13px;
  background: var(--primary-blue);
  border-radius: 2px;
  transition: transform 0.22s var(--ease-in-out), opacity 0.22s var(--ease-in-out);
}

.site-header__toggle span:nth-child(1) { transform: translateY(-9px); }
.site-header__toggle span:nth-child(2) { transform: translateY(0); }
.site-header__toggle span:nth-child(3) { transform: translateY(9px); }

/* Animate to X when open */
.site-header__toggle.is-open span:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}

.site-header__toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.site-header__toggle.is-open span:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

/* ── Tablet & Mobile: hamburger menu ──
   Breakpoint raised to 1024px — with 7 nav items + logo + CTA,
   the full nav overflows below ~1100px. */
@media (max-width: 1024px) {
  .site-header {
    flex-wrap: wrap;
    padding: 0.875rem 1.25rem;
  }

  .site-header__toggle {
    display: block;
    order: 3;
    margin-left: auto;
  }

  .site-header__nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    order: 4;
    width: 100%;
    border-top: 1px solid rgba(0, 71, 171, 0.12);
    padding-top: 0;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding-top 0.35s ease, margin-top 0.35s ease;
  }

  .site-header__nav.is-open {
    max-height: 600px;
    padding-top: 0.5rem;
    margin-top: 0.875rem;
  }

  .site-header__nav a {
    padding: 0.85rem 0;
    min-height: 48px;
    border-bottom: 1px solid rgba(0, 71, 171, 0.08);
    font-size: 1rem;
  }

  .site-header__nav a.is-active::after {
    display: none;
  }

  .site-header__nav a.is-active {
    color: var(--cta-accent);
  }

  .site-header__cta {
    order: 5;
    width: 100%;
    text-align: center;
    padding: 0.85rem 1.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.35s ease, margin-top 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
    padding-top: 0;
    padding-bottom: 0;
  }

  .site-header__cta.is-open {
    max-height: 60px;
    margin-top: 0.75rem;
    opacity: 1;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.75rem 1rem;
  }

  .site-header__logo-img {
    height: 34px;
  }
}
