/* ========== Header ========== */

.athena-header {
  position: sticky;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  height: var(--athena-header-height);
  background: var(--athena-header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--athena-header-border);
  box-shadow: var(--athena-shadow-card);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.site-content {
  padding-top: 0;
}

/* Offset sticky header under WP admin bar when logged in */
body.admin-bar .athena-header {
  top: 46px;
}

@media (min-width: 783px) {
  body.admin-bar .athena-header {
    top: 32px;
  }
}

.athena-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  width: 100%;
  min-width: 0;
  padding: 0 0.75rem;
}

/* Logo */

.athena-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

.athena-logo__img {
  height: 2rem;
  width: auto;
  max-width: min(132px, 46vw);
  object-fit: contain;
}

html.athena-dark .athena-logo__img {
  filter: brightness(0) invert(1);
}

/* Backdrop (mobile / tablet drawer) */

.athena-nav-backdrop {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 100vh;
  background: var(--bg-ink-90);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.athena-nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Primary nav — drawer below header until desktop */

.athena-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.5rem 0.75rem 1.25rem;
  max-height: min(70vh, calc(100dvh - var(--athena-header-height)));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--athena-surface);
  border-bottom: 1px solid var(--athena-divider);
  transform: translateY(-0.75rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 12px 30px var(--bg-slate-70);
  z-index: 2;
}

.athena-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.athena-nav__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.athena-nav__list li,
.athena-nav__item {
  margin: 0;
  padding: 0;
  width: 100%;
  border-bottom: 1px solid var(--athena-divider);
}

.athena-nav__list a,
.athena-nav__link {
  display: inline-block;
  width: auto;
  padding: 0.9rem 0.25rem;
  border-bottom: 2px solid transparent;
  font-family: var(--font-heading);
  font-size: var(--fs-head-12);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  line-height: var(--lh-head-12);
  text-transform: uppercase;
  color: var(--athena-header-text);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.athena-nav__list a:hover,
.athena-nav__list a:focus-visible,
.athena-nav__link:hover,
.athena-nav__link:focus-visible {
  color: var(--athena-accent);
}

.athena-nav__list .current-menu-item > a,
.athena-nav__list .current_page_item > a,
.athena-nav__list .current-menu-parent > a,
.athena-nav__list .current_page_parent > a,
.athena-nav__list a[aria-current="page"] {
  color: var(--athena-accent);
  border-bottom-color: var(--athena-accent);
}

.athena-nav__panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.25rem;
}

.athena-nav__panel-actions .athena-phone {
  display: inline-flex;
}

/* Actions */

.athena-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.athena-header__divider {
  display: none;
  width: 1px;
  height: 28px;
  background: var(--athena-header-border);
  margin-right: 0.15rem;
}

.athena-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--athena-header-text);
  transition: background 0.2s ease, color 0.2s ease;
}

.athena-icon-btn:hover,
.athena-icon-btn:focus-visible {
  background: var(--athena-icon-hover-bg);
  color: var(--athena-accent);
}

.athena-theme-toggle,
.athena-menu-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9999px;
  color: var(--athena-header-text);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.athena-theme-toggle:hover,
.athena-theme-toggle:focus-visible,
.athena-menu-toggle:hover,
.athena-menu-toggle:focus-visible {
  background: var(--muted);
  color: var(--athena-accent);
}

.athena-theme-toggle svg,
.athena-menu-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
  flex-shrink: 0;
}

.athena-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.athena-menu__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 14.5rem;
  padding: 1.15rem 1.25rem;
  gap: 0.15rem;
  border-radius: 1rem;
  background: var(--c-navy);
  border: 1px solid var(--bd-white-10);
  box-shadow: 0 16px 40px var(--tx-void-50);
  z-index: 60;
}

html.athena-dark .athena-menu__dropdown {
  background: var(--athena-header-bg);
}

.athena-menu__dropdown.is-open {
  display: flex;
  flex-direction: column;
}

.athena-menu__dropdown a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.35rem;
  border-radius: 0.5rem;
  font-family: var(--font-heading);
  font-size: var(--fs-head-14);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
  line-height: var(--lh-head-14);
  text-transform: none;
  color: var(--c-cream);
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.athena-menu__dropdown svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.athena-menu__dropdown a:hover,
.athena-menu__dropdown a:focus-visible {
  color: var(--secondary);
  background: var(--bg-white-05);
}

.athena-icon {
  display: block;
}

.athena-theme-toggle .athena-icon--sun,
.athena-menu-toggle .athena-icon--close,
html.athena-dark .athena-theme-toggle .athena-icon--moon {
  display: none;
}

html.athena-dark .athena-theme-toggle .athena-icon--sun {
  display: block;
}

.athena-menu-toggle.is-open .athena-icon--menu {
  display: none;
}

.athena-menu-toggle.is-open .athena-icon--close {
  display: block;
}

.athena-phone {
  display: none;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-body);
  font-size: var(--fs-body-12);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-body-12);
  color: var(--athena-header-text);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.athena-phone svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.athena-phone:hover,
.athena-phone:focus-visible {
  color: var(--athena-accent);
}

.athena-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  background: var(--athena-login-bg);
  color: var(--athena-login-text);
  font-family: var(--font-body);
  font-size: var(--fs-body-11);
  font-weight: var(--fw-bold);
  line-height: var(--lh-body-11);
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  box-shadow: var(--athena-shadow-amber);
  transition: all 0.3s ease;
}

.athena-login:hover,
.athena-login:focus-visible {
  box-shadow: var(--athena-shadow-amber-hover);
}

body.athena-nav-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .athena-nav,
  .athena-nav-backdrop {
    transition: none;
  }
}

/* Extra-narrow phones — keep bar on one line */
@media (max-width: 359px) {
  .athena-login {
    padding: 0.35rem 0.65rem;
  }

  .athena-theme-toggle,
  .athena-menu-toggle,
  .athena-icon-btn {
    width: 36px;
    height: 36px;
  }
}

/* Small phones */
@media (min-width: 380px) {
  .athena-header__inner {
    gap: 0.65rem;
    padding: 0 1rem;
  }

  .athena-header__actions {
    gap: 0.45rem;
  }

  .athena-logo__img {
    height: 2.25rem;
    max-width: 146px;
  }
}

/* Large phones / small tablets */
@media (min-width: 480px) {
  .athena-header__inner {
    gap: 1rem;
    padding: 0 1.25rem;
  }

  .athena-header__actions {
    gap: 0.65rem;
  }

  .athena-logo__img {
    height: 2.5rem;
    max-width: 164px;
  }

  .athena-nav {
    padding: 0.75rem 1.25rem 1.35rem;
  }

  .athena-login {
    padding: 0.5rem 1rem;
  }
}

/* Tablets */
@media (min-width: 768px) {
  .athena-header__inner {
    gap: 1.25rem;
  }

  .athena-header__actions {
    gap: 0.85rem;
  }

  .athena-theme-toggle,
  .athena-menu-toggle,
  .athena-icon-btn {
    width: 36px;
    height: 36px;
  }

  .athena-theme-toggle svg,
  .athena-menu-toggle svg {
    width: 1rem;
    height: 1rem;
  }
}

/* Desktop — inline nav, hide hamburger and utility dropdown */
@media (min-width: 1024px) {
  .athena-header {
    position: fixed;
  }

  .site-content {
    padding-top: var(--athena-header-height);
  }

  .athena-header__inner {
    padding: 0 1.75rem;
    gap: 1.25rem;
  }

  .athena-header__actions {
    gap: 1rem;
    margin-left: 0;
  }

  .athena-header__divider {
    display: block;
  }

  .athena-nav-backdrop,
  .athena-nav__panel-actions,
  .athena-menu {
    display: none;
  }

  .athena-nav {
    position: static;
    inset: auto;
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
    margin: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    z-index: auto;
    transition: none;
  }

  .athena-nav.is-open {
    transform: none;
  }

  .athena-nav__list {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1.1rem;
  }

  .athena-nav__list li,
  .athena-nav__item {
    width: auto;
    border-bottom: 0;
  }

  .athena-nav__list a,
  .athena-nav__link {
    display: inline-block;
    width: auto;
    padding: 0.25rem 0;
  }

  .athena-login {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    font-size: var(--fs-body-12);
    line-height: var(--lh-body-12);
  }
}

/* Wide desktop */
@media (min-width: 1280px) {
  .athena-header__inner {
    gap: 1.5rem;
  }

  .athena-nav__list {
    gap: 1.65rem;
  }

  .athena-phone--bar {
    display: inline-flex;
  }
}

@media (min-width: 1400px) {
  .athena-header__inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
