/* ===================== Brand tokens ===================== */
:root {
  --ink: #1b1f24;
  --ring: 0 0 0 2px color-mix(in srgb, var(--brand) 45%, transparent);
  /* floating pill */
  --pill-max: 1300px;
  --pill-inset: 14px;
  --pill-radius: 18px;
  --pill-bg: rgba(255, 255, 255, 0.82);
  --pill-bg-scrolled: rgba(255, 255, 255, 0.92);
  --pill-border: 1px solid rgba(0, 0, 0, 0.08);
  --pill-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --pill-shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.08);
  --pill-min-h: 72px;
  --comp-gap: 24px;
  --menu-gap: clamp(28px, 4vw, 48px);
  --btn-h: 44px;
  --edge-pad: 14px;
}

/* ===================== Floating header ===================== */
.site-header.header-full.floating-header {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 2000;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

body.admin-bar .site-header.floating-header {
  top: calc(12px + 32px);
}
@media (max-width: 782px) {
  body.admin-bar .site-header.floating-header {
    top: calc(12px + 46px);
  }
}

/* kill theme header constraints/backgrounds */
.site-header,
.site-header .header-inner,
.site-header:not(.dynamic-header),
.header-full.header-bar {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.site-header {
  padding-block: 0 !important;
}

/* spacer prevents layout jump (set height via JS) */
#header-spacer {
  height: 0;
}

/* ===================== Pill container ===================== */
.nav-pill {
  width: min(var(--pill-max), calc(100% - var(--pill-inset) * 2));
  margin: 0 auto;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-tr) 28%, #ffffff) 0%,
    #ffffff 95%
  );
  border: var(--pill-border);
  border-radius: var(--pill-radius);
  box-shadow: var(--pill-shadow-soft);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);

  display: grid;
  grid-template-columns: max-content 1fr max-content; /* left | center | right */
  align-items: center;
  column-gap: var(--comp-gap);
  min-height: var(--pill-min-h);
  padding: 10px var(--edge-pad);
  overflow: visible; /* allow dropdowns above the pill */
}
body.header-scrolled .nav-pill {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-tr) 18%, #ffffff) 0%,
    #ffffff 55%
  );
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--pill-shadow);
}

/* ===================== Compartments ===================== */
.nav-left,
.nav-center {
  align-self: stretch;
  display: flex;
  align-items: center;
}
.nav-left {
  padding-right: 22px;
  padding-left: 12px; /* nudge logo right */
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.nav-center {
  padding-inline: 18px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  justify-content: center;
  width: 100%;
}
.nav-right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: calc(-1 * var(--edge-pad)); /* visually flush to right edge */
  padding-right: 20px;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.custom-logo {
  display: block;
  max-height: 48px;
  height: auto;
  width: auto;
}
.logo-text {
  font: 800 28px/1.2 Inter, system-ui, sans-serif;
  color: var(--ink);
}
.logo,
.custom-logo-link {
  margin: 0 !important;
}

/* ===================== Desktop menu ===================== */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--menu-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links > li {
  position: relative;
}

/* parent hover bridge to avoid flicker */
.nav-links > li.menu-item-has-children {
  --submenu-gap: 12px;
}
.nav-links > li.menu-item-has-children::after {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: 100%;
  height: var(--submenu-gap);
}

.nav-links > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  z-index: 0;
  font: 700 15px/1.2 Inter, system-ui, sans-serif;
  color: #233029;
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.nav-links > li > a:hover,
.nav-links > li > a:focus-visible {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-ink);
  outline: none;
}

/* underline */
.nav-links > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.nav-links > li > a:hover::after,
.nav-links .current-menu-item > a::after,
.nav-links .current-menu-ancestor > a::after {
  transform: scaleX(1);
}

/* caret */
.nav-links > li.menu-item-has-children > a {
  padding-right: 18px;
}
.nav-links > li.menu-item-has-children > a::before {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  translate: 0 -50%;
  width: 10px;
  height: 10px;
  opacity: 0.7;
  transition: transform 0.18s ease, opacity 0.18s ease;
  background: no-repeat center/10px 10px
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 20 20' fill='none' stroke='%230d3c2a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='4,7 10,13 16,7'/></svg>");
}
.nav-links > li.menu-item-has-children:hover > a::before,
.nav-links > li.menu-item-has-children:focus-within > a::before {
  transform: rotate(180deg);
  opacity: 0.95;
}
/* When the menu is hovered, hide the current item’s underline unless it’s the hovered one */
.nav-links:hover .current-menu-item > a::after,
.nav-links:hover .current-menu-ancestor > a::after {
  transform: scaleX(0);
}
.nav-links > li:hover > a::after {
  transform: scaleX(1);
}

/* ===== Dropdown (opaque to avoid white strip at the top) ===== */
.nav-links li .sub-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + var(--submenu-gap));
  transform: translateX(-50%) translateY(10px);
  min-width: 200px;
  max-width: 260px;

  background: #fff; /* fully opaque surface */
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);

  padding: 10px;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 3000;
}
/* center the little tooth arrow */
.nav-links li .sub-menu::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-top-left-radius: 3px;
}
.nav-links > li:hover > .sub-menu,
.nav-links > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-links li .sub-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font: 600 14px/1.25 Inter, system-ui, sans-serif;
  color: #1f2623;
  text-decoration: none;
}
.nav-links li .sub-menu a:hover,
.nav-links li .sub-menu a:focus-visible {
  background: color-mix(in srgb, var(--brand) 10%, #fff);
  color: var(--brand-ink);
  outline: none;
}

/* ===================== Burger visibility & behavior ===================== */
@media (max-width: 1441px) {
  .nav-toggle {
    display: inline-block !important;
    width: 42px;
    height: 42px;
    border: 2px solid var(--brand);
    border-radius: 10px;
    background: transparent; /* closed = transparent pill */
    color: var(--brand); /* bars use currentColor */
    position: relative;
    cursor: pointer;
    outline: none;
    box-shadow: none;
  }
  .nav-toggle__bar {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: currentColor;
    transition: transform 0.25s, opacity 0.25s, top 0.25s;
  }
  .nav-toggle__bar:nth-child(1) {
    top: 12px;
  }
  .nav-toggle__bar:nth-child(2) {
    top: 20px;
  }
  .nav-toggle__bar:nth-child(3) {
    top: 28px;
  }

  .nav-toggle:hover,
  .nav-toggle:focus {
    background: color-mix(in srgb, var(--brand) 12%, transparent);
  }

  /* OPEN: white fill + green “X” */
  .mobile-open .nav-toggle {
    background: #fff !important;
    color: var(--brand) !important;
    border-color: var(--brand) !important;
  }
  .mobile-open .nav-toggle__bar:nth-child(1) {
    top: 20px;
    transform: rotate(45deg);
  }
  .mobile-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .mobile-open .nav-toggle__bar:nth-child(3) {
    top: 20px;
    transform: rotate(-45deg);
  }
}
@media (min-width: 1441px) {
  .nav-toggle {
    display: none !important;
  }
  .desktop-only {
    display: inline-flex !important;
    gap: 12px;
  }
}

/* 701–1440px: collapse center menu behind burger */
@media (max-width: 1441px) and (min-width: 701px) {
  .nav-center {
    display: none !important;
  }
  .desktop-only {
    display: inline-flex;
    gap: 10px;
  }
  .custom-logo {
    max-height: 44px;
  }
}

/* ≤700px: compact mobile (buttons move to drawer) */
@media (max-width: 700px) {
  .desktop-only {
    display: none !important;
  }
  .nav-center {
    display: none !important;
  }
  .custom-logo {
    max-height: 40px;
  }
}

/* ===================== Mobile drawer ===================== */
.mobile-drawer[hidden] {
  display: none;
}
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  grid-template-columns: 1fr;
  pointer-events: none;
}
.mobile-drawer__backdrop {
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: auto;
}
.mobile-drawer__panel {
  position: fixed;
  inset: 0 0 0 22%;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) 16px 20px;

  /* drawer polish */
  overflow: auto;
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.18);
}
@media (max-width: 1024px) {
  .mobile-drawer__panel {
    inset: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
.mobile-open #mobile-drawer .mobile-drawer__backdrop {
  opacity: 1;
}
.mobile-open #mobile-drawer .mobile-drawer__panel {
  transform: translateX(0);
}

/* sticky header inside drawer */
.mobile-drawer__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.mobile-logo img,
.mobile-drawer .custom-logo {
  max-height: 64px;
  height: auto;
  width: auto;
}

/* close button (white fill + green X) */
.drawer-close {
  position: relative;
  width: 42px;
  height: 42px;
  border: 2px solid var(--brand);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.drawer-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 2px;
  background: var(--brand);
  transform-origin: center;
}
.drawer-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}
.drawer-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.drawer-close:hover,
.drawer-close:focus {
  box-shadow: var(--ring);
}

/* Drawer account buttons: only visible on ≤700px */
.mobile-accounts {
  display: none;
}
@media (max-width: 1441px) {
  .mobile-accounts {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
}

/* ===================== Drawer menu + accordion ===================== */
.mobile-nav {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Row label is a real link; reserve space on right for the toggle button */
.mobile-nav > li > a {
  position: relative;
  display: block;
  padding: 16px 64px 16px 16px; /* space for chevron button */
  border-radius: 12px;
  font: 800 18px/1.2 Inter, system-ui, sans-serif;
  color: #111;
  text-decoration: none;
  background: color-mix(in srgb, var(--brand) 70%, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.mobile-nav > li > a:active {
  transform: scale(0.98);
}

/* clearer hover/focus */
.mobile-nav > li > a:hover,
.mobile-nav > li > a:focus-visible {
  background: color-mix(in srgb, var(--brand) 8%, var(--brand));
  outline: none;
  box-shadow: 0 0 0 2px #fff,
    0 0 0 4px color-mix(in srgb, var(--brand) 55%, transparent);
}

/* current page highlight */
.mobile-nav > li.current-menu-item > a,
.mobile-nav > li.current-menu-ancestor > a {
  background: color-mix(in srgb, var(--brand) 70%, #ffffff);
  border-color: color-mix(in srgb, var(--brand) 28%, rgba(0, 0, 0, 0.06));
}

.mobile-nav .menu-item-has-children {
  position: relative;
  border-radius: 12px;
}

/* Toggle lives INSIDE the <a> so it stays vertically centered */
.mobile-nav .menu-item-has-children > a .sub-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}
.mobile-nav .menu-item-has-children > a .sub-toggle:hover {
  background: color-mix(in srgb, var(--brand) 6%, var(--brand));
}
.mobile-nav .menu-item-has-children > a .sub-toggle .chev {
  width: 20px;
  height: 20px;
  background: no-repeat center/20px 20px
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%230d3c2a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='4,7 10,13 16,7'/></svg>");
  transition: transform 0.2s ease;
}
.mobile-nav .menu-item-has-children.is-open > a .sub-toggle .chev {
  transform: rotate(180deg);
}

/* Smooth accordion */
.mobile-nav .sub-menu {
  display: block;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  transition: max-height 0.22s ease, padding 0.22s ease;
}
.mobile-nav .menu-item-has-children.is-open > .sub-menu {
  max-height: 600px;
  padding: 6px 0 10px 0;
}

/* Submenu links */
.mobile-nav .sub-menu > li > a {
  display: block;
  margin: 6px 0 0 10px;
  padding: 12px;
  border-radius: 10px;
  font: 700 16px/1.2 Inter, system-ui, sans-serif;
  color: #222;
  text-decoration: none;
  background: color-mix(in srgb, var(--brand) 15%, #ffffff);
}

/* ===================== Reset overrides (stop the purple) ===================== */
.site-header button:hover,
.site-header button:focus,
.mobile-drawer button:hover,
.mobile-drawer button:focus {
  background-color: transparent !important;
  text-decoration: none !important;
}

/* Keep burger bars green when closed (bars use currentColor) */
button.nav-toggle,
button.nav-toggle:hover,
button.nav-toggle:focus {
  color: var(--brand) !important;
  border-color: var(--brand) !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ===================== CTA buttons (header & drawer, unified) ===================== */
.site-header .nav-right .btn,
.mobile-accounts .btn {
  --cta-h: 42px;
  height: var(--cta-h);
  min-width: 100px;
  padding: 0 24px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;

  border-radius: 999px; /* pill */
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;

  color: #fff;
  background: var(--brand); /* flatter, modern green */
  border: 1px solid rgba(0, 0, 0, 0.08);

  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease, box-shadow 0.18s ease,
    background-color 0.15s ease;
}

.site-header .nav-right .btn:hover,
.mobile-accounts .btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16);
}

.site-header .nav-right .btn:active,
.mobile-accounts .btn:active {
  background: var(--brand-dark);
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.site-header .nav-right .btn:focus-visible,
.mobile-accounts .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-dark);
}

/* ===================== Misc ===================== */
html,
body {
  overflow-x: hidden;
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .mobile-drawer__panel,
  .mobile-nav .sub-menu,
  .site-header .nav-right .btn,
  .mobile-accounts .btn {
    transition: none !important;
  }
}
/* ===== One scroll container + sticky footer (works with your fixed header) ===== */
html {
  overflow-y: auto;
  height: auto;
}
body {
  margin: 0;
  height: auto;
  min-height: 0;
  overflow: visible; /* body never scrolls */
}

/* Outer wrapper is the ONLY flex column that fills the viewport */
.wp-site-blocks,
.site,
#page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* Main content grows; footer sits at the bottom */
main,
.site-content,
#content,
.wp-block-post-content,
.elementor-location-content {
  flex: 1 0 auto;
  min-height: 0; /* stop nested scrollbars */
  overflow: visible;
}
.site-footer {
  margin-top: auto;
  flex-shrink: 0;
}

/* Kill plugin/builder scroll areas that create the second scrollbar */
#tribe-events-pg-template,
.tribe-events-pg-template,
.woocommerce,
.um,
.um-page-wrapper,
.business-directory-list,
.wpbdp-page,
#wpbdp-page-main_page,
#wpbdp-main-box,
.elementor,
.elementor-section-wrap,
.elementor-container,
.elementor-widget-wrap {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Ensure the mobile drawer can't add a second scrollbar when closed */
.mobile-drawer[hidden] {
  display: none !important;
}

/* keep X-centering during the open animation */
.nav-links > li:hover > .sub-menu,
.nav-links > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0); /* keep the -50% */
}
.mobile-open .site-header {
  pointer-events: none;
}
html.mobile-open,
body.mobile-open {
  overflow: hidden;
  height: 100%;
}
.mobile-open .site-header {
  pointer-events: none; /* important */
  filter: blur(1px) brightness(0.9); /* soft mute */
  visibility: hidden; /* hides without layout shift (header is fixed) */
}
