/*
 * InspireSphere Theme — Header / Navigation
 *
 * Nav pill: white, border-radius 20px, shadow, fixed at top.
 * Width: 1320px (same as --section-max-width), centered at 1440px viewport.
 * Desktop nav items: Poppins 16px Regular. Active: #034083 with blue bottom border.
 * CTA button in nav: "Contact Us" — blue (#034083).
 */

/* ── Site Header ─────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px var(--section-pad-desktop);
  pointer-events: none;
  /* let clicks pass through the transparent gap */
}

/* ── Nav Pill ────────────────────────────────────────────────────── */
.site-header__pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--section-max-width);
  padding: 0 26px;
  height: 70px;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-nav);
  pointer-events: all;
}

/* ── Logo ────────────────────────────────────────────────────────── */
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo__img {
  height: 50px;
  width: auto;
}

/* ── Primary Navigation ──────────────────────────────────────────── */
.primary-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Nav link — default */
.primary-nav__list a {
  font-family: var(--font-body);
  font-size: var(--font-size-body-md);
  font-weight: var(--font-weight-regular);
  color: var(--color-grey);
  text-decoration: none;
  padding-block: 27px;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s ease;
}

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

/* Nav link — active page (WordPress adds .current-menu-item) */
.primary-nav__list .current-menu-item>a,
.primary-nav__list .current-page-ancestor>a {
  color: var(--color-blue);
  font-weight: var(--font-weight-regular);
}

/* Active underline (blue bottom border) */
.primary-nav__list .current-menu-item>a::after,
.primary-nav__list .current-page-ancestor>a::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

/* ── Desktop CTA ─────────────────────────────────────────────────── */
.site-header__cta {
  flex-shrink: 0;
}

/* ── Mobile-only elements — hidden on desktop ───────────────── */
/* Shown only inside the open mobile drawer */
.primary-nav__mobile-actions,
.primary-nav__drawer-header {
  display: none;
}

/* ── Mobile Toggle — hidden on desktop ───────────────────────────── */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-toggle__icon {
  width: 28px;
  height: 28px;
  display: block;
}

.mobile-toggle__icon--close {
  display: none;
}


/* ── Intermediate (1281px – 1440px) — nav starts to crowd at this width ── */
@media (min-width: 1281px) and (max-width: 1440px) {
  .site-header {
    padding-inline: 32px;
  }

  .primary-nav__list {
    gap: 24px;
  }
}

/* ── Tablet (769px – 1280px) ─────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1280px) {
  .site-header {
    padding-inline: 24px;
  }

  .site-header__pill {
    padding-inline: 16px;
  }

  .primary-nav__list {
    gap: 16px;
  }

  .primary-nav__list a {
    font-size: 14px;
  }
}


/* ── Mobile (≤ 768px) ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-header {
    padding: 16px var(--section-pad-mobile);
  }

  .site-header__pill {
    padding: 0 16px;
    height: 60px;
    border-radius: var(--radius-lg);
  }

  /* Hide desktop nav and CTA */
  .primary-nav,
  .site-header__cta {
    display: none;
  }

  /* Show hamburger */
  .mobile-toggle {
    display: flex;
  }

  /* ── Mobile nav drawer ─────────────────────────────────────── */
  /* ── Nav overlay (dark backdrop) ───────────────────────────── */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.36);
    z-index: 998;
  }

  body.nav-open .nav-overlay {
    display: block;
  }

  /* ── Mobile nav drawer ─────────────────────────────────── */
  .primary-nav--open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 16px;
    left: var(--section-pad-mobile);
    right: var(--section-pad-mobile);
    z-index: 1001;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    gap: 0;
    min-height: 75vh;
    overflow-y: auto;
  }

  /* Drawer top bar: logo + close button */
  .primary-nav--open .primary-nav__drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-light-grey);
    width: 100%;
    flex-shrink: 0;
  }

  .primary-nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
  }

  .primary-nav__logo img {
    height: 44px;
    width: auto;
  }

  .primary-nav__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }

  /* Nav list inside the drawer */
  .primary-nav--open .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 0 20px;
    flex: 1;
  }

  .primary-nav--open .primary-nav__list li {
    width: 100%;
    border-bottom: 1px solid var(--color-light-grey);
  }

  /* Reset old sibling top-border — replaced with border-bottom on each li */
  .primary-nav--open .primary-nav__list li+li {
    border-top: none;
  }

  .primary-nav--open .primary-nav__list a {
    display: block;
    width: 100%;
    padding: 18px 0;
    font-size: var(--font-size-body-md);
    font-weight: 500;
    color: var(--color-grey);
    text-align: left;
  }

  /* Active item: blue text + full-width blue bottom border */
  .primary-nav--open .primary-nav__list .current-menu-item>a::after,
  .primary-nav--open .primary-nav__list .current-page-ancestor>a::after {
    display: none;
  }

  .primary-nav--open .primary-nav__list .current-menu-item,
  .primary-nav--open .primary-nav__list .current-page-ancestor {
    border-bottom: 2px solid var(--color-primary);
  }

  .primary-nav--open .primary-nav__list .current-menu-item>a,
  .primary-nav--open .primary-nav__list .current-page-ancestor>a {
    color: var(--color-blue);
    font-weight: 600;
  }

  /* Mobile CTA pinned to the bottom of the drawer */
  .primary-nav__mobile-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
  }

  .primary-nav__mobile-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Icon swap on the hamburger button */
  .mobile-toggle[aria-expanded="true"] .mobile-toggle__icon--open {
    display: none;
  }

  .mobile-toggle[aria-expanded="true"] .mobile-toggle__icon--close {
    display: block;
  }
}

/* Prevent body scroll when mobile nav is open */
body.nav-open {
  overflow: hidden;
}

/* ── WordPress Admin Bar offsets ─────────────────────────────────── */
/*
 * When a logged-in admin views the site, WordPress injects #wpadminbar:
 *   Desktop (> 782px) : 32px tall
 *   Mobile  (≤ 782px) : 46px tall
 * WordPress also adds `.admin-bar` to <body> automatically.
 */

/* Fixed nav pill — push down by admin bar height */
.admin-bar .site-header {
  top: 32px;
}

/* Mobile nav drawer — base 16px + 32px admin bar */
.admin-bar .primary-nav--open {
  top: 48px;
}

@media (max-width: 782px) {

  /* Fixed nav pill — admin bar is 46px at this breakpoint */
  .admin-bar .site-header {
    top: 46px;
  }

  /* Mobile nav drawer — base 16px + 46px admin bar */
  .admin-bar .primary-nav--open {
    top: 62px;
  }
}