/* ================================================================
   SITE HEADER
   Desktop: teal utility bar (collapses on scroll) + white main nav
   Mobile:  icon logo · William circle · Book pill · hamburger drawer
   ================================================================ */


/* ── Wrapper ────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
}

/* Sit below the WP admin bar when logged in (32px desktop, 46px ≤782px) */
.admin-bar .site-header { top: 32px; }

@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}


/* ── Utility bar (teal) ─────────────────────────────────────────── */

.site-header__utility {
  background: var(--color-teal, #4fbebe);
  max-height: 60px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.site-header__utility-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  padding: 13px 80px;
  max-width: 1440px;
  margin: 0 auto;
}

.site-header__utility-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body, 'Rubik', sans-serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-text, #1e153d);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.site-header__utility-item img { flex-shrink: 0; }
.site-header__utility-item:hover { opacity: 0.75; }

/* Live chat item is a <button>, not an <a> — reset default button chrome
   to match the anchor-based utility items (same pattern as button.ask-william-btn) */
button.site-header__utility-item {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}


/* ── Main nav ───────────────────────────────────────────────────── */

.site-header__main {
  background: #fff;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.10);
}

.site-header__main-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 12px var(--site-px);
  max-width: 1440px;
  margin: 0 auto;
}


/* ── Logo ───────────────────────────────────────────────────────── */

.site-header__logo {
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

.site-header__logo-full {
  display: block;
  height: 32px;
  width: auto;
}

/* Icon-only logo: hidden on desktop, shown on mobile */
.site-header__logo-icon {
  display: none;
  height: 45px;
  width: auto;
}


/* ── Primary nav (desktop) ──────────────────────────────────────── */

.site-header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.site-header__nav-list {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-body, 'Rubik', sans-serif);
 font-size: var(--fs-action);
    font-weight: var(--fw-action);
    line-height: var(--lh-action);
    letter-spacing: var(--ls-action);
  white-space: nowrap;
}

.site-header__nav-list a {
  color: var(--color-primary, #071d49);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

/* Current page highlight */
.site-header__nav-list .current-menu-item > a,
.site-header__nav-list .current-page-ancestor > a { opacity: 0.65; }


/* ── Primary nav — mega-menu dropdowns (desktop) ──────────────────
   Figma desktop: node 3320:4266
   ─────────────────────────────────────────────────────────────── */

.site-header__nav-item {
  position: relative;
}

.site-header__nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: var(--color-primary, #071d49);
  transition: opacity 0.2s ease;
}

.site-header__nav-trigger:hover { opacity: 0.65; }

.site-header__nav-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.site-header__nav-item.is-open .site-header__nav-trigger { opacity: 0.65; }
.site-header__nav-item.is-open .site-header__nav-chevron { transform: rotate(180deg); }

/* Dropdown panel
   --dd-shift-x is set by header.js after measuring the panel against the
   viewport, nudging it back on-screen on narrower desktop widths without
   disturbing the vertical fade-in transform below. */
.site-header__dropdown {
  --dd-shift-x: 0px;
  position: absolute;
  top: calc(100% + 22px);
  left: 50%;
  transform: translate(calc(-50% + var(--dd-shift-x)), -8px);
  background: var(--color-stroke, #e8edf6);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 500;
  /* Reset the nowrap inherited from .site-header__nav-list — dropdown copy wraps normally */
  white-space: normal;
}

.site-header__nav-item.is-open .site-header__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--dd-shift-x)), 0);
}

.site-header__dropdown-inner {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.site-header__dropdown-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 260px;
}

/* List item — every item shares the same treatment: tinted background +
   blurb reveal on hover/focus (About items just won't have a blurb). */
.site-header__dd-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 -12px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.site-header__dd-link:hover,
.site-header__dd-link:focus,
.site-header__dd-link:focus-within {
  background: #ccd6e8;
}

.site-header__dd-link-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.site-header__dd-link-title {
  font-family: var(--font-body, 'Rubik', sans-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--color-text, #1e153d);
}

/* Hidden until the item is hovered/focused — revealed with a max-height
   transition and wraps onto multiple lines within the column. */
.site-header__dd-link-desc {
  display: block;
  font-family: var(--font-body, 'Rubik', sans-serif);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-text, #1e153d);
  white-space: normal;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.site-header__dd-link:hover .site-header__dd-link-desc,
.site-header__dd-link:focus .site-header__dd-link-desc,
.site-header__dd-link:focus-within .site-header__dd-link-desc {
  max-height: 60px;
  opacity: 1;
  margin-top: 4px;
}

.site-header__dd-arrow { 
  flex-shrink: 0; 
  color: var(--color-text, #1e153d); 
  rotate: -45deg;
  width: 12px;
  height: 12px;
}

/* "Ask William" navy CTA card */
.site-header__dropdown-cta {
  background: var(--color-primary, #071d49);
  border-radius: 16px;
  padding: 20px;
  width: 237px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.site-header__dropdown-cta-heading {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: #fff;
  margin: 0;
}

.site-header__dropdown-cta-body {
  font-family: var(--font-body, 'Rubik', sans-serif);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-stroke, #e8edf6);
  margin: 0;
}

.site-header__dropdown-cta .ask-william-btn { width: 100%; }
.site-header__dropdown-cta .gradient-outline-pill { width: 100%; justify-content: center; }


/* ── Actions ────────────────────────────────────────────────────── */

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}


/* Book an Appointment button */
.site-header__btn-book {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--color-primary, #071d49);
  color: #fff;
  font-family: var(--font-body, 'Rubik', sans-serif);
  font-size: var(--fs-action);
  font-weight: var(--fw-action);
  line-height: var(--lh-action);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.site-header__btn-book:hover { opacity: 0.85; color: #fff; }
.site-header__btn-book svg   { flex-shrink: 0; }

/* "Book an Appointment" on desktop; "Book" on mobile */
.site-header__btn-book-short { display: none; }


/* Ask William (desktop pill — uses global gradient-outline-pill) */
.site-header__btn-william { flex-shrink: 0; }

/* Ask William (mobile icon circle) */
.site-header__btn-william-icon {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.site-header__william-circle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.01);
  border: 2px solid var(--color-teal, #4fbebe);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -4px 0 10px 0 rgba(79, 190, 190, 0.5), 4px 0 10px 0 rgba(77, 78, 185, 0.5);
}

.site-header__william-circle::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--color-teal, #4fbebe);
  opacity: 0.3;
  box-shadow: -6px 0 15px 0 var(--color-teal, #4fbebe), 6px 0 15px 0 #4d4eb9;
}


/* Hamburger (mobile only) */
.site-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.site-header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary, #071d49);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Hamburger → X when active */
.site-header__hamburger.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.site-header__hamburger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.site-header__hamburger.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }



/* ── Mobile menu drawer ─────────────────────────────────────────── */

.site-header__mobile-menu {
  display: none;      /* switched to block at mobile breakpoint */
  position: fixed;
  top: var(--fosters-header-h, 90px);
  right: 0;
  width: 350px;
  max-width: 100vw;
  height: calc(100dvh - var(--fosters-header-h, 90px));
  background: #fff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  overflow-x: hidden;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s ease;
}

.site-header__mobile-menu.is-open {
  transform: translateX(0);
}

.site-header__mobile-inner {
  box-sizing: border-box;
  max-width: 100%;
  padding: 24px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--color-stroke);
  height: 100dvh;
}

/* Nav list */
.site-header__mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.site-header__mobile-nav-list li {
  border-bottom: 1px solid var(--color-stroke, #e8edf6);
}

.site-header__mobile-nav-list a {
  display: block;
  padding: 16px 0;
  font-family: var(--font-body, 'Rubik', sans-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-primary, #071d49);
  text-decoration: none;
}


/* ── Mobile accordion dropdowns ────────────────────────────────────
   Figma mobile: node 3337:7450
   ─────────────────────────────────────────────────────────────── */

.site-header__mobile-nav-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 12px 0;
  background: none;
  border: none;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: var(--fs-h4);
  font-weight: var(--fw-h4);
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: var(--color-text, #1e153d);
  text-align: left;
  gap: 16px;
}

.site-header__mobile-nav-trigger .site-header__nav-chevron { flex-shrink: 0; color: var(--color-text, #1e153d); }

.site-header__mobile-nav-item.is-open .site-header__mobile-nav-trigger .site-header__nav-chevron {
  transform: rotate(180deg);
}

/* Fallback plain link (theme with no service pages yet) */
.site-header__mobile-nav-list .site-header__mobile-nav-link {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: var(--fs-h4-mob, 18px);
  font-weight: var(--fw-h4, 700);
  letter-spacing: 0.03em;
}

/* Collapsible panel */
.site-header__mobile-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.site-header__mobile-nav-item.is-open .site-header__mobile-dropdown {
  max-height: 1200px;
}

/* Reset the generic <a> styling inherited from .site-header__mobile-nav-list a */
.site-header__mobile-nav-list .site-header__mobile-dropdown a {
  display: flex;
  padding: 0;
  max-width: 100%;
  font-family: var(--font-body, 'Rubik', sans-serif);
  font-size: var(--fs-action);
  font-weight: var(--fw-action);
  letter-spacing: var(--ls-action);
  color: var(--color-text, #1e153d);
  white-space: normal;
}

/* Label text — flexes to fill the row and wraps instead of pushing the
   arrow icon (or the whole row) past the edge of the screen. */
.site-header__mobile-dd-link-text {
  min-width: 0;
  overflow-wrap: break-word;
}

.site-header__mobile-nav-list .site-header__mobile-dropdown .site-header__mobile-viewall {
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.01em;
  padding-bottom: 16px;
}

.site-header__mobile-dd-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  padding-left: 16px;
}

.site-header__mobile-nav-list .site-header__mobile-dropdown .site-header__mobile-dd-link {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Mobile CTAs */
.site-header__mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-header__mobile-actions .ask-william-btn {
  width: 100%;
}

.site-header__btn-book--mobile {
  justify-content: center;
  width: 100%;
}

.site-header__btn-william--mobile { width: 100%; }

.site-header__btn-william--mobile .gradient-outline-pill {
  width: 100%;
  justify-content: center;
  background: #fff;
}

/* Mobile utility links */
.site-header__mobile-utility {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-header__mobile-utility .site-header__utility-item {
  color: var(--color-text, #1e153d);
  font-size: 15px;
}


/* ── Breakpoints ────────────────────────────────────────────────── */

/* Laptop — tighten padding before desktop nav disappears */
@media (max-width: 1280px) {
  .site-header__utility-inner { gap: 48px; padding: 13px 40px; }

  .site-header__nav-list      { gap: 24px; font-size: 15px; }
}

/* Laptop (narrower) — swap Ask William to the compact icon button so the
   nav + actions row stops crowding/cutting off before the nav itself
   switches to the hamburger drawer at 1024px. */
@media (max-width: 1200px) {
  .site-header__btn-william      { display: none !important; }
  .site-header__btn-william-icon { display: flex; }
}

/* Tablet + Mobile — switch to hamburger/drawer layout */
@media (max-width: 1024px) {
  /* Utility bar hidden (shown in drawer instead) */
  .site-header__utility { display: none; }



 

  /* Hide desktop nav */
  .site-header__nav { display: none; }



  /* Show hamburger */
  .site-header__hamburger { display: flex; }

  /* Activate mobile drawer */
  .site-header__mobile-menu { display: block; }

  /* Contact/Ask William now live only in the mobile flyout menu
     (.site-header__btn-book--mobile / .site-header__btn-william--mobile) —
     hidden here so the header bar only shows the hamburger. Desktop (above
     1024px) is untouched. */
  .site-header__actions .site-header__btn-book,
  .site-header__actions .ask-william-btn {
    display: none !important;
  }
}

@media (max-width: 767px) {
 /* Swap logo variants */
  .site-header__logo-full { display: none; }
  .site-header__logo-icon { display: block; }

    /* Swap Book button text */
  .site-header__btn-book-full  { display: none; }
  .site-header__btn-book-short { display: inline; }

  .site-header__mobile-menu{
    width: 100%;
  }

  .site-header__mobile-nav-trigger {
    font-size: var(--fs-h3);
  }


}