/* ============================================================
   NAV.CSS — All navigation-related styles extracted from style.css
   Cove Parish v5.0
   ============================================================ */

/* ============================================================
   1. SKIP LINK (WCAG 2.4.1)
   ============================================================ */
.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 9999;
  padding: 8px 18px; background: var(--py); color: var(--pb);
  font-family: var(--fb); font-size: .82rem; font-weight: 700;
  border-radius: 0 0 8px 8px; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ============================================================
   2. SAFEGUARDING BAR  (.safeguarding-bar + .sg-bar selectors)
   ============================================================ */

/* Original safeguarding-bar */
.safeguarding-bar { background: rgba(26,122,110,.12); border-bottom: 2px solid #1a7a6e; padding: 10px 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.safeguarding-bar p { font-family: var(--fb); font-size: .75rem; color: #1a7a6e; font-weight: 600; }
.safeguarding-bar a { font-family: var(--fb); font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #1a7a6e; text-decoration: none; border: 1.5px solid #1a7a6e; padding: 5px 14px; border-radius: 100px; white-space: nowrap; transition: all .2s; }
.safeguarding-bar a:hover { background: #1a7a6e; color: var(--wh); }

/* Safeguarding bar (sits below sticky nav — no margin-top needed) */
.sg-bar {
  background: rgba(26,122,110,.08); border-bottom: 2px solid rgba(26,122,110,.35);
  padding: 10px 40px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.sg-bar-inner {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--fb); font-size: .75rem; color: var(--teal-dk); font-weight: 600;
}
.sg-bar-inner svg { flex-shrink: 0; width: 16px; height: 16px; }
.sg-bar p { font-family: var(--fb); font-size: .75rem; color: var(--teal-dk); font-weight: 600; }
.sg-bar a {
  font-family: var(--fb); font-size: .7rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--teal-dk); text-decoration: none;
  border: 1.5px solid var(--teal-dk); padding: 5px 13px; border-radius: 100px;
  white-space: nowrap; transition: all .2s;
}
.sg-bar a:hover { background: var(--teal-dk); color: var(--wh); }

/* ============================================================
   3. MAIN NAV BAR (#site-nav, .nav-logo, .nav-links, etc.)
   ============================================================ */

/* ── Main nav bar ── */
#site-nav {
  position: sticky; top: 0; z-index: 300;
  height: var(--nav-h);
  /* background is already 97% opaque on its own — backdrop-filter used to
     add a barely-visible blur on top of that, but a non-none
     backdrop-filter makes its element the CSS containing block for any
     position:fixed/absolute descendant. That silently broke every menu
     system that has ever rendered its dropdown/mega panel as a child of
     #site-nav: this theme's own mega menu (below), and two different
     WordPress mega-menu plugins tried in between. Dropped entirely —
     restoring it here (even for this theme's own restored mega menu)
     would reintroduce the exact bug that was fixed in 8.50.68. */
  background: rgba(245,240,232,.97);
  border-bottom: 3px solid var(--py);
  box-shadow: var(--sh-sm);
  transition: height .3s var(--ease), box-shadow .3s var(--ease);
  display: flex; align-items: center;
  padding: 0 40px;
  gap: 0;
  /* overflow-x: clip used to guard against the mega menu's 624px panels
     pushing document.scrollWidth and dragging the page sideways — also
     dropped in 8.50.68, the same class of "silently clips a menu panel"
     risk as backdrop-filter above. The mega panel below (.cp-mm-panel) is
     `position: fixed`, nested inside #site-nav via the DOM, and NOT
     separately moved to <body> in JS — with backdrop-filter gone,
     #site-nav is no longer a containing block for it at all, so the
     panel's fixed positioning resolves against the true viewport on its
     own. Re-adding backdrop-filter/overflow-x:clip here would silently
     reintroduce the exact mispositioning/clipping bug fixed in 8.50.68,
     for this menu or any other rendered inside #site-nav. */
}
/* Opt-out: editors can disable the sticky header via
   Customizer → Hero & Nav → "Sticky header" — that strips
   the body class added by cove_header_sticky in functions.php. */
body:not(.cove-header-sticky) #site-nav {
  position: static;
}
#site-nav.scrolled { height: var(--nav-h-scroll); box-shadow: var(--sh-md); }

/* ── Logo ── */
.nav-logo {
  flex-shrink: 0; display: flex; align-items: center;
  margin-right: auto; text-decoration: none;
  padding: 6px 0;
}
.nav-logo img {
  /* Bumped from 68px/180px in v7.55.32 — the logo was blending into
     the cream nav background and getting lost beside the link row.
     New baseline: 80px tall, up to 240px wide (stays inside the 88px
     --nav-h with 4px breathing room). Scrolled state shrinks
     proportionally for the compact-bar look. */
  height: 80px; width: auto; max-width: 240px;
  display: block; object-fit: contain;
  transition: height .3s var(--ease), filter .3s var(--ease);
  filter: drop-shadow(0 3px 8px rgba(30,58,82,.18));
}
.nav-logo:hover img { filter: drop-shadow(0 4px 12px rgba(30,58,82,.28)); }
#site-nav.scrolled .nav-logo img { height: 60px; }
/* Legacy logo class support (kept in sync with .nav-logo above) */
.site-logo { text-decoration: none; display: inline-flex; align-items: center; padding: 6px 0; }
.site-logo img { height: 80px; width: auto; max-width: 240px; object-fit: contain; transition: height .3s var(--ease); }
#site-nav.scrolled .site-logo img { height: 60px; }
.site-logo-text { font-family: var(--ft); font-size: 1.5rem; letter-spacing: 1px; text-transform: uppercase; color: var(--pb); }

/* ── Desktop nav links ── */
.nav-links {
  display: flex; list-style: none; align-items: stretch;
  height: 100%; gap: 0; margin: 0 16px;
}
.nav-links > li {
  position: relative; display: flex; align-items: stretch;
}
.nav-links > li > a {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--fb); font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--pb); text-decoration: none;
  padding: 0 13px; position: relative;
  transition: color .2s; white-space: nowrap;
}
/* Gold underline indicator */
.nav-links > li > a::after {
  content: ''; position: absolute; bottom: -3px; left: 13px; right: 13px;
  height: 3px; background: var(--py); border-radius: 2px 2px 0 0;
  transform: scaleX(0); transform-origin: center;
  transition: transform .25s var(--ease);
}
.nav-links > li > a:hover { color: var(--db); }
.nav-links > li > a:hover::after,
.nav-links > li > a.active::after,
.nav-links > li.current-page > a::after { transform: scaleX(1); }
/* Chevron — unified style for nav dropdowns AND mega-menu triggers
   so every indicator looks the same and animates the same way. */
.nav-chevron,
.cp-mm-chevron {
  display: inline-block;
  width: 12px; height: 12px;
  margin-left: 4px;
  opacity: .65;
  vertical-align: middle;
  transition: transform .25s var(--ease), opacity .15s var(--ease);
}
/* Hover-rotate works for ALL dropdown items (including mega-menu
   triggers), and the cp-mm-trigger keeps its rotated state when
   the panel is actually open via aria-expanded="true". */
.nav-links > li:hover .nav-chevron,
.nav-links > li:hover .cp-mm-chevron,
.cp-mm-trigger[aria-expanded="true"] .cp-mm-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Safeguarding link (teal accent) */
.nav-links > li > a.nav-sg { color: var(--teal); }
.nav-links > li > a.nav-sg::after { background: var(--teal); }
.nav-links > li > a.nav-sg:hover { color: #0f5c52; }
/* Legacy class aliases */
.nav-safeguarding { color: var(--teal) !important; }
.nav-safeguarding:hover { color: #0f5c52 !important; }

/* ── Rich mega-dropdown (v21) ── */
.nav-dropdown {
  position: absolute; top: calc(100% + 3px); left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--wh);
  border-top: 3px solid var(--py);
  border-radius: 0 0 14px 14px;
  box-shadow: var(--sh-lg);
  padding: 22px 24px 20px;
  min-width: 624px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 28px;
  opacity: 0; visibility: hidden;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  pointer-events: none;
  z-index: 300;
}
.nav-links > li:hover .nav-dropdown,
.nav-links > li:focus-within .nav-dropdown,
.nav-links > li.dd-open .nav-dropdown {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
/* Single-column variant */
.nav-dropdown.nav-dd-single { min-width: 288px; grid-template-columns: 1fr; }
/* Short screens (e.g. a MacBook Air with the browser's own bars) can be
   shorter than a long dropdown such as About. Cap it at the space below
   the header and let it scroll inside, so the last items are reachable.
   overscroll-behavior stops the page behind scrolling once it hits the end. */
.nav-dropdown {
  max-height: calc(100vh - var(--nav-h) - 16px);
  max-height: calc(100dvh - var(--nav-h) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* ── Viewport-fit for mega panels ──
   Cap panel width to the viewport, and let clampNavDropdowns() in nav.js
   shift a panel that would open off-screen back inside (it toggles .dd-clamp
   and supplies --dd-left). translateY is kept for the open/close animation;
   the centring translateX is replaced by the computed left. No .dd-clamp is
   applied where the centred panel already fits (≥1280px), so wide layouts
   are unchanged. */
.nav-dropdown { max-width: calc(100vw - 24px); }
.nav-links > li.dd-clamp > .nav-dropdown {
  left: var(--dd-left, 0); right: auto;
  transform: translateY(-8px);
}
.nav-links > li.dd-clamp:hover > .nav-dropdown,
.nav-links > li.dd-clamp:focus-within > .nav-dropdown,
.nav-links > li.dd-clamp.dd-open > .nav-dropdown {
  transform: translateY(0);
}

/* ── Touch mode (.nav-touch on #site-nav, toggled by nav.js) ──
   While a finger is driving the nav, hover must NOT open panels:
   iPadOS simulates hover on taps, which both flashes panels open and
   trips WebKit's content-observation heuristic into cancelling the
   tap's own click event — silently breaking every click-driven
   behaviour on the page (dropdown toggles, the mega menu's
   outside-tap close, cross-menu closing). With hover-open disabled,
   taps deliver clean clicks and .dd-open (set on click by nav.js) is
   the sole open mechanism — the same architecture that makes the
   mega menu reliable on iPads. The ID selector outweighs the
   :hover openers above; .dd-open / :focus-within still win via :not(). */
#site-nav.nav-touch .nav-links > li:hover:not(.dd-open):not(:focus-within) .nav-dropdown {
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
}
#site-nav.nav-touch .nav-links > li.dd-clamp:hover:not(.dd-open):not(:focus-within) > .nav-dropdown {
  transform: translateY(-8px);
}

/* Dropdown section label — cove_dd_item_html() only ever renders
   <span class="dd-label"> as a direct child of .nav-dropdown or
   .cp-mm-tabpanel. Scoped to those containers (rather than a bare
   .dd-label) so a stray "dd-label" CSS class on an unrelated element
   (e.g. a top-level menu item's own <li>, set via the CSS Classes
   field in Appearance → Menus) can never pick up this opacity:.6 —
   which, when that element is an ancestor of the fixed-position mega
   menu panel, made the whole panel render translucent. */
.nav-dropdown .dd-label,
.cp-mm-tabpanel .dd-label {
  font-family: var(--fb); font-size: .6rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--sb); opacity: .6;
  padding: 0 10px 6px;
  grid-column: 1 / -1;
  border-bottom: 1px solid rgba(52,88,124,.07);
  margin-bottom: 4px;
}
.nav-dropdown .dd-label:not(:first-child),
.cp-mm-tabpanel .dd-label:not(:first-child) { margin-top: 10px; }

/* Rich dropdown item */
.dd-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  text-decoration: none; transition: background .18s;
}
.dd-item:hover { background: var(--cr); }
.dd-item-icon {
  font-size: 1rem; flex-shrink: 0; margin-top: 1px;
  width: 28px; height: 28px; display: flex; align-items: center;
  justify-content: center; background: var(--cr); border-radius: 7px;
}
.dd-item:hover .dd-item-icon { background: rgba(228,191,69,.2); }
.dd-item-text { }
.dd-item-title {
  font-family: var(--fb); font-size: .78rem; font-weight: 700;
  color: var(--pb); display: block; margin-bottom: 1px;
}
.dd-item-desc {
  font-family: var(--fb); font-size: .69rem; color: var(--sb);
  line-height: 1.4; display: block;
}

.dd-divider { font-size: .65rem !important; font-weight: 700 !important; letter-spacing: .18em !important; text-transform: uppercase !important; color: var(--sb) !important; background: rgba(52,88,124,.05) !important; padding: 8px 20px 6px !important; cursor: default !important; pointer-events: none; }

/* ============================================================
   7. NAV CTA
   ============================================================ */
.nav-cta {
  flex-shrink: 0;
  font-family: var(--fb); font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--py); color: var(--pb);
  padding: 9px 20px; border-radius: 100px;
  text-decoration: none; transition: all .2s; white-space: nowrap;
  margin-left: 12px;
}
.nav-cta:hover { background: var(--pb); color: var(--py); transform: translateY(-1px); box-shadow: var(--sh-sm); }

/* ============================================================
   4. HAMBURGER (tablet + mobile)
   ============================================================ */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  padding: 4px; margin-left: 10px; flex-shrink: 0;
  border-radius: 8px; transition: background .2s;
}
.nav-hamburger:hover { background: rgba(52,88,124,.08); }
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--pb); border-radius: 2px;
  transition: all .3s var(--ease); transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Legacy hamburger class support */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--pb); border-radius: 2px; transition: all .3s; }

/* ============================================================
   5. MOBILE OVERLAY DRAWER (v21)
   ============================================================ */
#mob-overlay {
  display: none; position: fixed; inset: 0; z-index: 290;
  pointer-events: none;
}
#mob-overlay.open { pointer-events: auto; }
#mob-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(10,20,35,.55);
  opacity: 0; transition: opacity .35s var(--ease);
}
#mob-overlay.open::before { opacity: 1; }

.mob-drawer {
  position: absolute; top: 0; left: 0;
  width: min(320px, 88vw); height: 100%;
  background: var(--wh); box-shadow: var(--sh-lg);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .35s var(--ease);
  overflow-y: auto; overflow-x: hidden;
}
#mob-overlay.open .mob-drawer { transform: translateX(0); }

.mob-drawer-hd {
  background: var(--pb); padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; position: sticky; top: 0; z-index: 1;
}
.mob-drawer-hd img { height: 52px; width: auto; max-width: 140px; object-fit: contain; display: block; }
.mob-drawer-close {
  background: rgba(255,255,255,.12); border: none;
  color: var(--wh); font-size: 1.1rem;
  width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s; flex-shrink: 0;
}
.mob-drawer-close:hover { background: rgba(255,255,255,.25); }
.mob-drawer-body { flex: 1; padding: 0 0 24px; overflow-y: auto; }

/* Drawer sections */
.mob-section { border-bottom: 1px solid rgba(52,88,124,.08); }
.mob-section-label {
  font-family: var(--fb); font-size: .6rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--sb); opacity: .7; padding: 16px 20px 6px; display: block;
}
.mob-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  font-family: var(--fb); font-size: .88rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--pb); text-decoration: none;
  transition: background .15s, color .15s; min-height: 48px;
}
.mob-link:hover { background: var(--cr); color: var(--db); }
.mob-link.mob-active { color: var(--py); background: rgba(228,191,69,.06); }
.mob-link-icon { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.mob-sublink {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 44px;
  font-family: var(--fb); font-size: .8rem; font-weight: 600;
  color: var(--sb); text-decoration: none;
  transition: background .15s, color .15s; min-height: 44px;
}
.mob-sublink:hover { background: var(--cr); color: var(--pb); }
.mob-sublink--l3 { padding-left: 64px; font-size: .76rem; font-weight: 500; opacity: .85; }

/* CTA in drawer */
.mob-cta-wrap { padding: 18px 20px; border-top: 1px solid rgba(52,88,124,.08); }
.mob-cta {
  display: block; text-align: center;
  font-family: var(--fb); font-size: .82rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--py); color: var(--pb);
  padding: 13px 20px; border-radius: 100px;
  text-decoration: none; transition: all .2s;
}
.mob-cta:hover { background: var(--pb); color: var(--py); }

/* Safeguarding in drawer */
.mob-sg-wrap {
  padding: 14px 20px; background: rgba(26,122,110,.06);
  border-top: 2px solid rgba(26,122,110,.2); flex-shrink: 0;
}
.mob-sg-link {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--fb); font-size: .75rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal); text-decoration: none; min-height: 44px;
}
.mob-sg-link:hover { color: #0f5c52; }
.mob-sg-note {
  font-family: var(--fb); font-size: .68rem; color: rgba(26,122,110,.75);
  line-height: 1.5; margin-top: 4px;
}
.mob-safeguarding { color: var(--teal) !important; }

/* ============================================================
   6. LEGACY MOBILE NAV (backward compat)
   ============================================================ */
.mob-nav { display: none; position: fixed; top: 70px; left: 0; right: 0; bottom: 0; background: var(--wh); z-index: 199; padding: 20px 24px 28px; border-bottom: 3px solid var(--py); box-shadow: var(--sh-lg); transform: translateY(-110%); transition: transform .35s var(--ease); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mob-nav.open { transform: translateY(0); display: block; }
.mob-nav ul { list-style: none; }
.mob-nav li { border-bottom: 1px solid rgba(52,88,124,.1); }
.mob-nav a { display: block; padding: 13px 0; font-family: var(--fb); font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--pb); text-decoration: none; }
.mob-nav .mob-sub { padding-left: 14px; font-size: .82rem; opacity: .75; }

/* ============================================================
   8. BREADCRUMB
   ============================================================ */
.breadcrumb { background: var(--wh); padding: 14px 48px; border-bottom: 1px solid rgba(52,88,124,.1); font-family: var(--fb); font-size: .78rem; color: var(--sb); }
.breadcrumb a { color: var(--sb); text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: var(--pb); }
.breadcrumb span { color: rgba(52,88,124,.4); margin: 0 8px; }

/* ============================================================
   9. RESPONSIVE — Nav-related rules from media queries
   ============================================================ */

/* ── <= 1100px ── */
@media (max-width: 1100px) {
  #site-nav { padding: 0 28px; }
  .sg-bar { padding: 10px 28px; }
  .nav-links > li > a { padding: 0 10px; font-size: .7rem; }
  .nav-cta { padding: 8px 16px; font-size: .7rem; margin-left: 8px; }
}

/* ── <= 960px  (tablet — switch to hamburger) ── */
@media (max-width: 960px) {
  .nav-links, .nav-cta-desk { display: none !important; }
  .nav-hamburger { display: flex; }
  #mob-overlay { display: block; }
  #site-nav { padding: 0 20px; }
  .sg-bar { padding: 10px 20px; flex-direction: column; gap: 7px; text-align: center; }
}

/* ── <= 768px  (phone landscape / small tablet) ── */
@media (max-width: 768px) {
  #site-nav { padding: 0 16px; }
  .nav-logo img, .site-logo img { height: 68px; }
  #site-nav.scrolled .nav-logo img, #site-nav.scrolled .site-logo img { height: 52px; }
  .sg-bar { padding: 10px 16px; flex-direction: column; gap: 8px; text-align: center; }
  .breadcrumb, .safeguarding-bar { padding-left: 20px; padding-right: 20px; }
}

/* ── <= 480px ── */
@media (max-width: 480px) {
  #site-nav { padding: 0 16px; }
  .nav-logo img, .site-logo img { height: 58px; }
  #site-nav.scrolled .nav-logo img, #site-nav.scrolled .site-logo img { height: 46px; }
  .sg-bar { padding: 9px 14px; }
  .breadcrumb { padding: 10px 16px; font-size: .72rem; }
}

/* ============================================================
   10. SEARCH BUTTON + OVERLAY
   ============================================================ */

/* ── Icon button in the nav bar ── */
.nav-search-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: none; border: none; cursor: pointer;
  color: var(--pb); flex-shrink: 0;
  margin-left: 6px;
  border-radius: 8px;
  transition: background .2s, color .2s;
}
.nav-search-btn:hover { background: rgba(52,88,124,.08); color: var(--db); }
.nav-search-btn[aria-expanded="true"] { background: rgba(52,88,124,.1); color: var(--db); }

/* ── Full-screen overlay backdrop ── */
.search-overlay {
  position: fixed; inset: 0;
  z-index: 299; /* just below nav (300) */
  display: flex; align-items: flex-start;
  background: rgba(10,20,35,.55);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
  pointer-events: none;
}
.search-overlay.open {
  opacity: 1; visibility: visible;
  pointer-events: auto;
}

/* ── White panel that drops in below the nav bar ── */
.search-overlay-panel {
  width: 100%;
  background: var(--wh);
  padding: 24px 40px;
  display: flex; align-items: center; gap: 16px;
  margin-top: var(--nav-h);
  border-top: 3px solid var(--py);
  box-shadow: var(--sh-lg);
  transform: translateY(-12px);
  transition: transform .25s var(--ease);
}
.search-overlay.open .search-overlay-panel { transform: translateY(0); }

/* Form inside overlay */
.search-overlay-form {
  flex: 1; display: flex; align-items: center; gap: 12px;
  max-width: 860px; margin: 0 auto;
}
.sov-icon { color: var(--sb); flex-shrink: 0; }
.search-overlay-input {
  flex: 1; border: none; outline: none; background: none;
  font-family: var(--fb); font-size: 1.35rem; font-weight: 600;
  color: var(--db); padding: 8px 0; min-width: 0;
}
.search-overlay-input:focus-visible { outline: 2px solid var(--pb); outline-offset: 2px; border-radius: 2px; }
.search-overlay-input::placeholder { color: rgba(74,115,153,.4); }
.search-overlay-submit {
  font-family: var(--fb); font-size: .7rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--py); color: var(--pb);
  border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 100px;
  transition: all .2s; flex-shrink: 0; white-space: nowrap;
}
.search-overlay-submit:hover { background: var(--pb); color: var(--py); }

/* Close button */
.search-overlay-close {
  background: none; border: 1.5px solid rgba(52,88,124,.2);
  color: var(--sb); cursor: pointer; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: background .2s, color .2s, border-color .2s;
}
.search-overlay-close:hover { background: var(--cr); color: var(--pb); border-color: var(--pb); }

/* Scrolled nav — adjust panel top margin */
#site-nav.scrolled ~ .search-overlay .search-overlay-panel { margin-top: var(--nav-h-scroll); }

/* ── WordPress admin bar offset corrections ───────────────────────
   When the admin bar is visible it adds 32px (desktop) or 46px
   (≤782px) to html via margin-top. The sticky nav ends up 32px
   lower in the viewport, so the search panel margin-top must grow
   to match. Without this the top of the panel hides behind the nav.
─────────────────────────────────────────────────────────────────── */
.admin-bar #site-nav {
  top: 32px; /* stick below the admin bar, not under it */
}
.admin-bar .search-overlay-panel {
  margin-top: calc(var(--nav-h) + 32px);
}
.admin-bar #site-nav.scrolled ~ .search-overlay .search-overlay-panel {
  margin-top: calc(var(--nav-h-scroll) + 32px);
}
@media screen and (max-width: 782px) {
  /* Admin bar is 46px tall on smaller screens */
  .admin-bar #site-nav {
    top: 46px;
  }
  .admin-bar .search-overlay-panel {
    margin-top: calc(var(--nav-h) + 46px);
  }
  .admin-bar #site-nav.scrolled ~ .search-overlay .search-overlay-panel {
    margin-top: calc(var(--nav-h-scroll) + 46px);
  }
}

/* ── Mobile drawer: inline search field ── */
.mob-search-wrap {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(52,88,124,.08);
}
.mob-search-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--cr); border-radius: 10px;
  padding: 10px 14px;
  border: 1.5px solid rgba(52,88,124,.12);
  transition: border-color .2s;
}
.mob-search-field:focus-within { border-color: var(--pb); }
.mob-search-field svg { color: var(--sb); flex-shrink: 0; }
.mob-search-field input[type="search"] {
  border: none; outline: none; background: none; flex: 1; min-width: 0;
  font-family: var(--fb); font-size: .85rem; color: var(--db);
}
.mob-search-field input[type="search"]::placeholder { color: rgba(74,115,153,.5); }

/* ── Responsive tweaks ── */
@media (max-width: 960px) {
  /* Hide overlay button on tablet/mobile — drawer search handles it */
  .nav-search-btn { display: none; }
}
@media (max-width: 480px) {
  .search-overlay-panel { padding: 16px 16px; }
}

/* ============================================================
   PER-ITEM ICON on top-level nav links (v7.55.15)
   ============================================================
   When the editor sets an "Icon" on a top-level menu item via
   Appearance → Menus, the icon SVG is emitted inside the link
   markup. Render it 14×14 inline before the label, picking up
   the surrounding currentColor.
   ============================================================ */
.nav-links > li > a > .nav-link-icon {
  display: inline-flex;
  width: 14px; height: 14px;
  flex: 0 0 14px;
  margin-right: 6px;
  vertical-align: -2px;
  color: var(--py);
  transition: color .15s ease;
}
.nav-links > li > a:hover > .nav-link-icon,
.nav-links > li.current-page > a > .nav-link-icon {
  color: currentColor;
}
