/*
 * GWA Modern header styles.
 */

:root {
  --gwa-header-bg: rgba(255, 255, 255, 0.82);
  --gwa-header-border: rgba(91, 104, 132, 0.16);
  --gwa-header-text: #0f172a;
  --gwa-header-muted: #64748b;
  --gwa-header-accent: #4f46e5;
  --gwa-header-accent-2: #7c3aed;
  --gwa-header-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.gwa-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gwa-skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--gwa-header-text);
  box-shadow: var(--gwa-header-shadow);
}

.gwa-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  left: 0;
  right: 0;
  width: 100%;
  padding: 0;
  background: #ffffff;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 10px 24px -18px rgba(109, 40, 217, 0.45);
  transition: box-shadow 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.gwa-header.is-scrolled {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.gwa-header__inner {
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.gwa-header__brand-wrap {
  min-width: 0;
  max-width: 120px;
}

.gwa-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 120px;
  color: var(--gwa-header-text);
  text-decoration: none;
}

.gwa-header__logo img {
  display: block;
  width: 64px;
  height: 18px;
  max-width: 64px;
  max-height: 18px;
  inline-size: auto;
  object-fit: contain;
}

.gwa-header__logo .custom-logo-link {
  display: block;
  align-items: center;
  max-width: 64px;
  line-height: 0;
  overflow: hidden;
}

.gwa-header__logo .custom-logo-link img {
  width: 64px;
  height: 18px;
  max-width: 64px;
  max-height: 18px;
  object-fit: contain;
}

.custom-logo-link {
  display: block;
  line-height: 0;
}

.gwa-header__logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gwa-header-accent), var(--gwa-header-accent-2));
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.gwa-header__brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gwa-header__title {
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--gwa-header-text);
}

.gwa-header__tagline {
  font-size: 0.88rem;
  color: var(--gwa-header-muted);
  line-height: 1.2;
}

.gwa-header__nav {
  min-width: 0;
  justify-self: center;
  width: 100%;
  display: flex;
  justify-content: center;
}

.gwa-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gwa-menu .menu-item {
  position: relative;
}

.gwa-menu > .menu-item > a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 0;
  color: var(--gwa-header-text);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  transition: color 160ms ease, box-shadow 160ms ease;
}

.gwa-menu > .menu-item > a:hover,
.gwa-menu > .menu-item > a:focus-visible,
.gwa-menu > .current-menu-item > a,
.gwa-menu > .current-menu-ancestor > a {
  color: #312e81;
  box-shadow: inset 0 -2px 0 var(--gwa-header-accent);
}

.gwa-menu .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.65;
}

.gwa-menu .sub-menu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 240px;
  margin: 0;
  padding: 14px 10px 10px;
  list-style: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--gwa-header-border);
  border-radius: 0;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  z-index: 20;
}

.gwa-menu .sub-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.gwa-menu .menu-item:hover > .sub-menu,
.gwa-menu .menu-item:focus-within > .sub-menu,
.gwa-menu .menu-item.is-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.gwa-menu .sub-menu .menu-item + .menu-item {
  margin-top: 4px;
}

.gwa-menu .sub-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 0;
  color: var(--gwa-header-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 160ms ease, box-shadow 160ms ease;
}

.gwa-menu .sub-menu a:hover,
.gwa-menu .sub-menu a:focus-visible {
  color: #312e81;
  box-shadow: inset 0 -2px 0 var(--gwa-header-accent);
}

.gwa-menu .sub-menu .sub-menu {
  left: calc(100% + 10px);
  top: 0;
}

.gwa-menu .gwa-menu__submenu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: 2px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--gwa-header-text);
  cursor: pointer;
}

.gwa-menu .gwa-menu__submenu-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.gwa-menu .menu-item.is-open > .gwa-menu__submenu-toggle::before {
  transform: rotate(-135deg);
}

.gwa-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.gwa-header__search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 9px;
  padding: 0 18px;
  border: 1.5px solid rgba(109, 40, 217, 0.48);
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.06);
  color: var(--gwa-header-text);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.gwa-header__search-toggle:hover,
.gwa-header__search-toggle:focus-visible {
  transform: translateY(-1px);
  background: rgba(109, 40, 217, 0.12);
  border-color: rgba(109, 40, 217, 0.72);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.gwa-header__search-icon {
  position: relative;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
  display: inline-block;
  box-sizing: border-box;
}

.gwa-header__search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.gwa-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.gwa-search-overlay[hidden] {
  display: none;
}

.gwa-search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gwa-search-overlay__panel {
  position: relative;
  width: min(760px, 100%);
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  color: var(--gwa-header-text);
}

.gwa-search-overlay__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--gwa-header-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.gwa-search-overlay__eyebrow {
  margin: 0 0 8px;
  color: var(--gwa-header-accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gwa-search-overlay__title {
  margin: 0 0 18px;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.gwa-search-overlay__form {
  display: flex;
  gap: 10px;
}

.gwa-search-overlay__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: var(--gwa-header-text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gwa-search-overlay__input::placeholder {
  color: #94a3b8;
}

.gwa-search-overlay__input:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.38);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.gwa-search-overlay__submit {
  flex: 0 0 auto;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gwa-header-accent), var(--gwa-header-accent-2));
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

body.gwa-search-open {
  overflow: hidden;
}

.gwa-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gwa-header-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--gwa-header-text);
  cursor: pointer;
}

.gwa-header__toggle-icon {
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: background-color 160ms ease;
}

.gwa-header__toggle-icon::before,
.gwa-header__toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: top 160ms ease, transform 160ms ease;
}

.gwa-header__toggle-icon::before {
  top: -7px;
}

.gwa-header__toggle-icon::after {
  top: 7px;
}

.gwa-header.is-open .gwa-header__toggle-icon {
  background: transparent;
}

.gwa-header.is-open .gwa-header__toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.gwa-header.is-open .gwa-header__toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.gwa-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .gwa-header__inner {
    grid-template-columns: auto 1fr auto;
  }

  .gwa-header__actions {
    display: flex;
  }
}

@media (max-width: 959px) {
  .gwa-header {
    padding: 0;
  }

  .gwa-header__inner {
    width: min(1200px, calc(100% - 20px));
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    padding: 6px 0;
  }

  .gwa-header__brand-wrap {
    grid-column: 1;
    grid-row: 1;
  }

  .gwa-header__actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .gwa-header__toggle {
    display: inline-flex;
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .gwa-header__nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    background: #ffffff;
    transition: max-height 260ms ease, opacity 200ms ease, transform 260ms ease;
  }

  .gwa-header.is-open .gwa-header__nav {
    max-height: 80vh;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .gwa-menu {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding-top: 10px;
  }

  .gwa-menu > .menu-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
  }

  .gwa-menu > .menu-item > a {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 0;
    background: transparent;
  }

  .gwa-menu .menu-item-has-children > a::after {
    display: none;
  }

  .gwa-menu > .menu-item > a:hover,
  .gwa-menu > .menu-item > a:focus-visible,
  .gwa-menu > .current-menu-item > a,
  .gwa-menu > .current-menu-ancestor > a {
    background: transparent;
  }

  .gwa-menu .sub-menu {
    background: #ffffff;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .gwa-menu .gwa-menu__submenu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .gwa-menu .sub-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    padding: 8px;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    display: none;
    background: transparent;
    box-shadow: none;
    border: 0;
  }

  .gwa-menu .sub-menu a {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  .gwa-menu .menu-item.is-open > .sub-menu {
    display: block;
  }

  .gwa-menu .sub-menu .sub-menu {
    left: 0;
  }

  .gwa-header__brand {
    min-width: 0;
  }

  .gwa-header__brand-wrap {
    max-width: 96px;
  }

  .gwa-header__logo img,
  .gwa-header__logo .custom-logo-link img {
    width: 72px;
    height: 22px;
    max-width: 72px;
    max-height: 22px;
  }

  .gwa-header__logo .custom-logo-link {
    max-width: 72px;
    overflow: visible;
  }

  .gwa-header__search-toggle {
    min-height: 44px;
    padding: 0 14px;
  }

  .gwa-header__search-label {
    display: none;
  }

  .gwa-search-overlay {
    padding: 12px;
  }

  .gwa-search-overlay__panel {
    padding: 22px 18px 18px;
  }

  .gwa-search-overlay__form {
    flex-direction: column;
  }

  .gwa-search-overlay__submit {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gwa-header,
  .gwa-header__nav,
  .gwa-menu .sub-menu,
  .gwa-header__cta,
  .gwa-header__toggle-icon,
  .gwa-header__toggle-icon::before,
  .gwa-header__toggle-icon::after,
  .gwa-menu__submenu-toggle::before {
    transition: none !important;
  }
}
