/* ==========================================================================
   WCAS header
   Homepage (body.has-hero): transparent bar over the hero photo (white logo, glass menu pill, gold Call button).
   Everywhere else, and on the homepage after the hero: white floating bar (blue logo, navy links).
   The bar hides on scroll down and returns on scroll up (assets/js/nav.js).
   Breakpoints: desktop 1055px and up, tablet and phone below.
   ========================================================================== */

[hidden] { display: none !important; }

/* ---- Frame: fixed, side padding lines up with the page content ---- */
.site-header {
  --side: calc(max((100vw - var(--w)) / 2, 24px) + clamp(0px, 2.5vw, 48px));
  position: fixed; z-index: 999; top: 0; left: 0; right: 0;
  padding: 24px var(--side) 0; pointer-events: none;
  transform: translate3d(0, var(--ty, 0px), 0);
}
.site-header.is-bar, .no-hero .site-header { padding: 13px calc(var(--side) - 20px) 0; transition: transform .6s var(--ease); }
.site-header a, .site-header button, .primary-nav .menu, .primary-nav .sub-menu { pointer-events: auto; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header__bar {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 64px;
  animation: nav-fade .9s var(--ease) .35s backwards;
}
.site-header.is-bar .site-header__bar, .no-hero .site-header__bar {
  padding: 0 20px; border-radius: 999px; background: rgba(255, 255, 255, .96); box-shadow: 0 6px 24px rgba(34, 48, 81, .1); animation: none;
}
@keyframes nav-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Logo: white file over the hero, blue file on the white bar ---- */
.site-logo { position: relative; display: block; width: 200px; height: 38px; justify-self: start; }
.site-logo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.site-logo__img--dark { display: none; }
.site-header.is-bar .site-logo__img--light, .no-hero .site-logo__img--light { display: none; }
.site-header.is-bar .site-logo__img--dark, .no-hero .site-logo__img--dark { display: block; }

/* ---- Right side: phone link (secondary) and gold quote button ---- */
.site-header__cta { justify-self: end; display: flex; align-items: center; gap: 18px; }
.call-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #fff; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: color .2s ease;
}
.call-btn:hover, .call-btn:focus-visible { color: #fff; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.call-btn .icon { flex: none; }
.site-header.is-bar .call-btn, .no-hero .call-btn { color: var(--navy); }
.site-header.is-bar .call-btn:hover, .no-hero .call-btn:hover { color: var(--navy); }
.quote-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--gold); color: var(--navy); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color .25s ease, transform .35s var(--ease);
}
.quote-btn:hover, .quote-btn:focus-visible { background: var(--gold-deep); color: var(--navy); transform: translateY(-2px); }
.quote-btn__short { display: none; }

/* ---- Menu button (phone and tablet) ---- */
.nav-toggle { display: none; position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(20, 26, 42, .42); cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { position: absolute; left: 50%; width: 20px; height: 2px; margin-left: -10px; border-radius: 2px; background: #fff; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle__bars { top: 50%; margin-top: -1px; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; left: 0; margin-left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }
.site-header.is-bar .nav-toggle, .no-hero .nav-toggle { background: var(--mist); -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header.is-bar .nav-toggle__bars, .site-header.is-bar .nav-toggle__bars::before, .site-header.is-bar .nav-toggle__bars::after,
.no-hero .nav-toggle__bars, .no-hero .nav-toggle__bars::before, .no-hero .nav-toggle__bars::after { background: var(--navy); }
.site-header.is-bar .nav-toggle[aria-expanded="true"] .nav-toggle__bars, .no-hero .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }

/* ==========================================================================
   Desktop (1055px and up)
   ========================================================================== */
@media (min-width: 1055px) {
  .primary-nav { justify-self: center; }
  .primary-nav .menu {
    display: flex; align-items: center; gap: 4px; margin: 0; padding: 5px; list-style: none; border-radius: 999px;
    background: rgba(20, 26, 42, .42); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .site-header.is-bar .primary-nav .menu, .no-hero .primary-nav .menu { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .primary-nav .menu > li { position: relative; display: flex; align-items: center; margin: 0; }

  /* Top-level links */
  .primary-nav .menu > li > a {
    position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border-radius: 999px;
    color: #fff; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
  }
  .primary-nav .menu > li.menu-item-has-children > a { padding-right: 34px; }
  .primary-nav .menu > li.menu-item-has-children > a::after {
    content: ""; position: absolute; right: 15px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; opacity: .7; transform: rotate(45deg);
  }
  .primary-nav .menu > li > a:hover, .primary-nav .menu > li:hover > a, .primary-nav .menu > li:focus-within > a { background: #fff; color: var(--navy); }
  .primary-nav .menu > li.current-menu-item > a, .primary-nav .menu > li.current-menu-ancestor > a,
  .primary-nav .menu > li.current_page_item > a, .primary-nav .menu > li.current_page_ancestor > a { background: rgba(255, 255, 255, .16); font-weight: 600; }
  .primary-nav .menu > li.current-menu-item > a:hover, .primary-nav .menu > li.current-menu-ancestor:hover > a { background: #fff; }

  /* White bar: navy links, mist hover */
  .site-header.is-bar .primary-nav .menu > li > a, .no-hero .primary-nav .menu > li > a { color: var(--navy); }
  .site-header.is-bar .primary-nav .menu > li > a:hover, .site-header.is-bar .primary-nav .menu > li:hover > a, .site-header.is-bar .primary-nav .menu > li:focus-within > a,
  .no-hero .primary-nav .menu > li > a:hover, .no-hero .primary-nav .menu > li:hover > a, .no-hero .primary-nav .menu > li:focus-within > a { background: var(--mist); }
  .site-header.is-bar .primary-nav .menu > li.current-menu-item > a, .site-header.is-bar .primary-nav .menu > li.current-menu-ancestor > a,
  .site-header.is-bar .primary-nav .menu > li.current_page_item > a, .site-header.is-bar .primary-nav .menu > li.current_page_ancestor > a,
  .no-hero .primary-nav .menu > li.current-menu-item > a, .no-hero .primary-nav .menu > li.current-menu-ancestor > a,
  .no-hero .primary-nav .menu > li.current_page_item > a, .no-hero .primary-nav .menu > li.current_page_ancestor > a { background: var(--mist); }

  /* Drop-down panel: white, opens at once on hover or keyboard focus, no animation */
  .primary-nav .sub-menu {
    position: absolute; z-index: 5; top: 100%; left: 50%; display: none; grid-auto-flow: column; grid-auto-columns: max-content; align-items: start; column-gap: 36px;
    min-width: 220px; max-width: calc(100vw - 32px); margin: 12px 0 0; padding: 22px 24px; list-style: none; text-align: left;
    background: #fff; border-radius: 18px; box-shadow: 0 18px 48px rgba(20, 26, 42, .22); transform: translateX(-50%);
  }
  .primary-nav .menu > li:hover > .sub-menu, .primary-nav .menu > li:focus-within > .sub-menu { display: grid; }
  .primary-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; } /* keeps the panel open while the pointer crosses the gap */
  .primary-nav .sub-menu li { margin: 0; padding: 0; list-style: none; }
  .primary-nav .sub-menu a { display: block; padding: 6px 0; color: var(--navy); font-size: 14px; font-weight: 500; line-height: 1.3; text-decoration: none; transition: color .2s ease; }
  .primary-nav .sub-menu a:hover, .primary-nav .sub-menu a:focus-visible { color: var(--navy-2); background: var(--mist); }
  /* Group headings: the second level items that have their own links */
  .primary-nav .sub-menu > li.menu-item-has-children > a { margin-bottom: 8px; padding: 0; color: var(--slate); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .primary-nav .sub-menu > li.menu-item-has-children > a:hover { color: var(--navy); }
  .primary-nav .sub-menu .sub-menu { position: static; display: block; min-width: 0; margin: 0; padding: 0; background: none; border-radius: 0; box-shadow: none; transform: none; }
  .primary-nav .sub-menu .sub-menu::before { display: none; }
}

/* Laptops and small desktops (1055 to 1315px): tighter */
@media (min-width: 1055px) and (max-width: 1315px) {
  .site-logo { width: 165px; height: 31px; }
  .primary-nav .menu > li > a { padding: 0 11px; font-size: 13px; }
  .primary-nav .menu > li.menu-item-has-children > a { padding-right: 28px; }
  .primary-nav .menu > li.menu-item-has-children > a::after { right: 11px; }
  .quote-btn { padding: 0 18px; font-size: 13px; }
  .site-header__cta { gap: 14px; }
  .call-btn { font-size: 13px; }
}
/* Narrow laptops: the number collapses to an icon so the menu keeps its room */
@media (min-width: 1055px) and (max-width: 1199px) {
  .call-btn { justify-content: center; width: 44px; min-height: 44px; border-radius: 50%; background: rgba(20, 26, 42, .42); }
  .site-header.is-bar .call-btn, .no-hero .call-btn { background: var(--mist); }
  .call-btn__text { display: none; }
  .call-btn:hover { text-decoration: none; }
}

/* ==========================================================================
   Tablet and phone (1054px and down)
   ========================================================================== */
@media (max-width: 1054px) {
  .site-header, .site-header.is-bar, .no-hero .site-header { padding: 8px 12px 0; }
  .site-header__bar { display: flex; gap: 10px; height: 64px; padding: 0 12px 0 8px; }
  .site-header.is-bar .site-header__bar, .no-hero .site-header__bar { padding: 0 10px 0 18px; }
  .site-logo { width: 130px; height: 26px; margin-right: auto; }
  .primary-nav { display: none; }
  .nav-toggle { display: block; flex: none; }
  .call-btn { display: none; }  /* the number is in the menu panel */
  .quote-btn { min-height: 44px; padding: 0 18px; font-size: 13px; }
  .site-header__cta { margin-left: auto; }
}
@media (max-width: 767px) {
  /* Phones: the bar button is a gold round call icon; the quote button stays in the menu panel. */
  .quote-btn { display: none; }
  .call-btn, .site-header.is-bar .call-btn, .no-hero .call-btn { display: inline-flex; justify-content: center; width: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--gold); color: var(--navy); }
  .call-btn:hover, .call-btn:focus-visible, .site-header.is-bar .call-btn:hover, .no-hero .call-btn:hover { background: var(--gold-deep); color: var(--navy); text-decoration: none; }
  .call-btn__text { display: none; }
}

/* ---- Full-screen menu panel ---- */
.mobile-panel { position: fixed; z-index: 998; inset: 0; overflow-y: auto; padding: 104px var(--gutter) 40px; background: var(--navy); color: #fff; overscroll-behavior: contain; }
.admin-bar .mobile-panel { padding-top: 136px; }
body.nav-open { overflow: hidden; }
.mobile-nav .menu { margin: 0; padding: 0; list-style: none; }
.mobile-nav .menu > li { position: relative; margin: 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.mobile-nav .menu > li > a { display: block; padding: 14px 56px 14px 0; color: #fff; font-size: 1.125rem; font-weight: 500; letter-spacing: -.01em; text-decoration: none; }
.mobile-nav a:hover { color: var(--gold); }
.mobile-nav .sub-toggle { position: absolute; top: 6px; right: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.sub-toggle__chev { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -7px 0 0 -5px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .3s var(--ease); }
.mobile-nav li.is-open > .sub-toggle .sub-toggle__chev { transform: rotate(225deg); margin-top: -2px; }
.mobile-nav .menu > li > .sub-menu { display: none; margin: 0; padding: 0 0 16px; list-style: none; }
.mobile-nav li.is-open > .sub-menu { display: block; }
.mobile-nav .sub-menu li { margin: 0; list-style: none; }
.mobile-nav .sub-menu a { display: block; padding: 8px 0; color: rgba(255, 255, 255, .92); font-size: .9375rem; font-weight: 400; text-decoration: none; }
.mobile-nav .sub-menu > li.menu-item-has-children > a { margin-top: 12px; padding-bottom: 4px; color: rgba(255, 255, 255, .6); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mobile-nav .sub-menu .sub-menu { margin: 0; padding: 0 0 0 14px; list-style: none; }
.mobile-panel__cta { display: grid; gap: 12px; max-width: 420px; margin-top: 32px; }
.mobile-panel__cta .button-secondary { background: rgba(255, 255, 255, .14); }
@media (min-width: 1055px) { .mobile-panel { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .site-header__bar { animation: none; }
  .site-header.is-bar, .no-hero .site-header { transition: none; }
}
