/* Shared navigation: retain the homepage's brand, spacing and control styling. */
.fc-site-navigation {
  --fc-site-header-height: 101px;
  --fc-site-admin-bar-height: 0px;
  width: 100%;
}

.fc-site-navigation--home {
  position: absolute;
  z-index: 20;
  inset: 0 0 auto;
}

.fc-site-navigation--inner {
  position: sticky;
  z-index: 30;
  top: 0;
}

.fc-site-navigation .site-header {
  position: relative;
  min-height: var(--fc-site-header-height);
}

.fc-site-navigation .header-cta {
  min-height: 44px;
  font-style: italic;
}

.fc-site-navigation .desktop-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.fc-site-navigation .desktop-nav a::after {
  bottom: 0;
}

.fc-site-navigation .menu-toggle,
.fc-site-navigation__fallback {
  display: none;
}

.fc-site-navigation .menu-toggle {
  touch-action: manipulation;
}

.fc-site-navigation .menu-icon[hidden],
.fc-site-navigation .mobile-menu[hidden] {
  display: none !important;
}

.fc-site-navigation .mobile-menu {
  z-index: 21;
  top: 100%;
  max-height: calc(100vh - var(--fc-site-header-height) - var(--fc-site-admin-bar-height));
  max-height: calc(100dvh - var(--fc-site-header-height) - var(--fc-site-admin-bar-height));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.fc-site-navigation .mobile-menu.is-open {
  animation: fc-site-navigation-reveal 160ms ease-out;
}

.fc-site-navigation .mobile-menu a,
.fc-site-navigation__fallback a {
  flex-shrink: 0;
  overflow-wrap: anywhere;
}

.fc-site-navigation a:focus-visible,
.fc-site-navigation button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.admin-bar .fc-site-navigation {
  --fc-site-admin-bar-height: 32px;
}

.admin-bar .fc-site-navigation--inner {
  top: 32px;
}

@keyframes fc-site-navigation-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1020px) {
  .fc-site-navigation[data-site-navigation-ready] .menu-toggle {
    display: inline-flex;
  }

  .fc-site-navigation .mobile-menu:not([hidden]),
  .fc-site-navigation__fallback {
    display: flex;
    flex-direction: column;
  }
}

/* The fallback is rendered only within <noscript>; no dead menu button is shown. */
.fc-site-navigation__fallback {
  position: absolute;
  z-index: 21;
  top: 100%;
  left: 28px;
  right: 28px;
  max-height: calc(100vh - var(--fc-site-header-height) - var(--fc-site-admin-bar-height));
  max-height: calc(100dvh - var(--fc-site-header-height) - var(--fc-site-admin-bar-height));
  overflow-y: auto;
  padding: 10px 22px max(22px, env(safe-area-inset-bottom));
  background: rgba(6, 11, 14, 0.98);
  border: 1px solid var(--line);
}

.fc-site-navigation__fallback a {
  display: flex;
  align-items: center;
  min-height: 50px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.fc-site-navigation__fallback .mobile-menu__cta {
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--ink);
  background: var(--cyan);
  border: 0;
}

@media (max-width: 782px) {
  .admin-bar .fc-site-navigation {
    --fc-site-admin-bar-height: 46px;
  }

  .admin-bar .fc-site-navigation--inner {
    top: 46px;
  }
}

@media (max-width: 760px) {
  .fc-site-navigation {
    --fc-site-header-height: 72px;
  }

  .fc-site-navigation .mobile-menu,
  .fc-site-navigation__fallback {
    left: 20px;
    right: 20px;
  }
}

/* WordPress's toolbar scrolls away below 601px instead of staying fixed. */
@media (max-width: 600px) {
  .admin-bar .fc-site-navigation--inner {
    top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc-site-navigation .mobile-menu,
  .fc-site-navigation .desktop-nav a::after {
    animation: none;
    transition: none;
  }
}
