/* =========================================================
   Layout: announcement bar, header (main + focused),
   desktop dropdowns, mobile menu, footer.
   WordPress: header.php / footer.php markup uses these classes.
   ========================================================= */

/* ---------- Announcement bar (Home only, from site.json) ---------- */
.announcement {
  background: var(--c-navy);
  color: var(--c-white);
  font-size: var(--fs-xs);
  text-align: center;
  padding: var(--sp-2) var(--gutter);
}
.announcement a { color: var(--c-white); font-weight: 500; }
.announcement a:hover { color: #D9E6BE; }

/* ---------- Header shell ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: var(--header-top-gap);
  pointer-events: none;            /* only the pill catches clicks */
}
/* Page text scrolling up behind the floating pill: soften the strip above it
   so half-cut lines don't peek out (works on light and dark sections). */
.site-header::before {
  content: ""; position: absolute; inset: 0 0 auto 0;
  height: calc(var(--header-top-gap) + var(--header-h) / 2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: -1;   /* behind the pill */
}
.site-header.is-scrolled::before { opacity: 1; }
.header-pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--sp-4);
  min-height: var(--header-h);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5);
  background: var(--c-white);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
}

/* Brand: PNG logo mark + "blueberry eleven" wordmark in Steiner
   (brand colours #495ac0 / #78a646). If the PNG is missing, a CSS mark shows. */
.brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  text-decoration: none; flex-shrink: 0;
  font-family: var(--font-brand); font-size: 1.3rem; font-weight: 400;
  line-height: 1; letter-spacing: 0;
}
.brand__logo { height: 40px; width: auto; display: block; }
.brand__mark {
  width: 28px; height: 28px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--c-brand-eleven) 0 50%, var(--c-brand-blueberry) 50% 100%);
  border-radius: 6px; transform: rotate(45deg) scale(.82);
}
.brand__word { white-space: nowrap; }
.brand__b1 { color: var(--c-brand-blueberry); }
.brand__b2 { color: var(--c-brand-eleven); }
.brand:hover .brand__b1 { color: var(--c-brand-blueberry); }
.header-pill > * { min-width: 0; }

@media (max-width: 399px) {
  .header-pill { padding-left: var(--sp-4); gap: var(--sp-2); }
  .brand { font-size: 1.05rem; }
  .brand__logo { height: 32px; }
  .brand__mark { width: 22px; height: 22px; }
  .header-pill .back-link { padding-inline: var(--sp-3); }
}
/* Very small phones (e.g. Galaxy Fold, 280px): keep Back + menu buttons full size */
.back-link, .nav-toggle { flex-shrink: 0; }
@media (max-width: 339px) {
  .header-pill { padding-left: var(--sp-3); }
  .brand { font-size: 0.875rem; gap: 6px; }
  .header-pill { gap: var(--sp-2); }
  .back-link { min-width: 0; }
  .brand__logo { height: 28px; }
  .header-pill .back-link { padding-inline: var(--sp-2) var(--sp-3); gap: 4px; }
}

/* Primary nav (desktop) */
.primary-nav { display: none; margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-link {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-heading); font-weight: 500; font-size: var(--fs-sm);
  color: var(--c-navy); text-decoration: none;
  border-radius: var(--radius-sm);
}
.nav-link:hover,
.nav-link[aria-current="page"],
.nav-item.is-current > .nav-link { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; color: var(--c-navy); }

/* Dropdown: section shortcuts, no arrow icon.
   Opens on hover + keyboard focus; .is-dismissed (Esc) forces it closed. */
.submenu {
  position: absolute; top: 100%; left: 0;
  min-width: 220px;
  padding-top: var(--sp-2);         /* hover bridge between link and panel */
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.submenu__panel {
  list-style: none; margin: 0;
  padding: var(--sp-2);
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.submenu a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm); color: var(--c-navy); text-decoration: none;
  border-radius: var(--radius-sm);
}
.submenu a:hover { background: var(--c-navy-050); }
.nav-item:hover > .submenu,
.nav-item:focus-within > .submenu,
.nav-item.is-open > .submenu {
  opacity: 1; visibility: visible; transform: none;
  transition-delay: 0s;
}
.nav-item.is-dismissed > .submenu { opacity: 0; visibility: hidden; transform: translateY(4px); }

/* .header-pill prefix: beats .btn { display:inline-flex } in components.css (loaded later) */
.header-pill .header-cta { display: none; }
.header-cta { border-radius: var(--radius-pill); padding-inline: 1.5rem; min-height: 46px; }

/* Hamburger */
.nav-toggle {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 0; border-radius: var(--radius-pill);
  background: var(--c-navy-050); color: var(--c-navy);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (min-width: 560px) {
  .header-pill .header-cta { display: inline-flex; margin-left: auto; }
  .nav-toggle { margin-left: 0; }
}
/* Desktop: logo | centred menu (Home–FAQs) | Get Started centred in the
   space between the end of FAQs and the right edge of the header */
@media (min-width: 1080px) {
  .header-pill:not(.header-pill--focused) {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    column-gap: 0;                 /* keeps Get Started exactly mid-way */
    padding-inline: var(--sp-4);   /* equal sides so the menu is truly centred */
  }
  .header-pill .brand { justify-self: start; }
  .primary-nav { display: block; margin: 0; justify-self: center; }
  .header-cta { margin: 0; justify-self: center; }
  .nav-toggle { display: none; }
}
@media (min-width: 1080px) and (max-width: 1240px) {
  .nav-link { padding-inline: var(--sp-2); }
}

/* ---------- Focused header (booking, inquiry, job) ---------- */
.header-pill--focused { justify-content: space-between; }
.back-link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-heading); font-weight: 500; font-size: var(--fs-sm);
  color: var(--c-navy); text-decoration: none;
  border: 2px solid var(--c-border); border-radius: var(--radius-pill);
}
.back-link:hover { border-color: var(--c-navy); color: var(--c-navy); }
.back-link svg { width: 18px; height: 18px; }

/* ---------- Mobile menu ----------
   Full-screen navy sheet: logo + close on top, scrollable page list in the
   middle (rows with dividers; chevrons open a page's sections), and the
   Get Started button + quick contact pinned at the bottom. */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  color: var(--c-white);
  background:
    radial-gradient(120% 55% at 100% 0%, rgba(73, 90, 192, .45), transparent 62%),
    radial-gradient(90% 45% at 0% 100%, rgba(120, 166, 70, .16), transparent 65%),
    var(--c-navy-900);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--header-top-gap) var(--gutter) var(--sp-3);
}
.mobile-menu__top .brand {
  background: var(--c-white); border-radius: var(--radius-pill);
  padding: var(--sp-2) var(--sp-4);
}
.mobile-menu__close {
  width: 46px; height: 46px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  color: var(--c-white); border-radius: 50%;
  transition: background-color var(--dur) var(--ease);
}
.mobile-menu__close:hover { background: rgba(255, 255, 255, .14); }
.mobile-menu__close svg { width: 22px; height: 22px; }
.mobile-menu :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-navy-900), 0 0 0 5px #D9E6BE; border-radius: 10px; }

.mobile-menu__body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--sp-2) var(--gutter) var(--sp-5);
}
.mnav { list-style: none; margin: 0; padding: 0; }
.mnav__item { position: relative; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.mnav__row { display: flex; align-items: center; gap: var(--sp-2); }
.mnav__link {
  flex: 1; display: flex; align-items: center; min-height: 60px;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.3125rem; letter-spacing: -.01em;
  color: var(--c-white); text-decoration: none;
}
.mnav__link:hover { color: #D9E6BE; }
/* Current page: green text + a short green bar */
.mnav__item.is-current .mnav__link { color: var(--c-green-light); }
.mnav__item.is-current::before {
  content: ""; position: absolute; left: calc(-1 * var(--gutter)); top: 18px;
  width: 4px; height: 24px; border-radius: 0 4px 4px 0; background: var(--c-green-light);
}
.mnav__toggle {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .07); color: var(--c-white);
  transition: background-color var(--dur) var(--ease);
}
.mnav__toggle:hover { background: rgba(255, 255, 255, .14); }
.mnav__toggle svg { width: 20px; height: 20px; transition: transform .3s var(--ease); }
.mnav__item.is-open .mnav__toggle svg { transform: rotate(180deg); }
/* Sections: smooth open/close; hidden ones can't be tabbed to */
.mnav__sub {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .32s var(--ease), visibility 0s linear .32s;
}
.mnav__item.is-open .mnav__sub { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .32s var(--ease); }
.mnav__children {
  list-style: none; margin: 0; padding: 0 0 0 var(--sp-4);
  min-height: 0; overflow: hidden;
}
.mnav__children li { margin: 0; }
.mnav__children li:last-child { padding-bottom: var(--sp-3); }   /* inside, so closed rows stay the same height */
.mnav__children a {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 48px;
  padding: var(--sp-2) var(--sp-3); margin-left: calc(-1 * var(--sp-3)); border-radius: 12px;
  font-size: 1.0625rem; line-height: 1.35; font-weight: 500;
  color: rgba(255, 255, 255, .8); text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mnav__children a::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, .35);
}
.mnav__children a:hover { background: rgba(255, 255, 255, .07); color: var(--c-white); }
.mnav__children a:hover::before { background: var(--c-green-light); }

/* Pinned bottom: main action + quick contact (safe area for iPhone home bar) */
.mobile-menu__cta {
  padding: var(--sp-4) var(--gutter) calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(8, 18, 79, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mobile-menu__cta .btn { min-height: 52px; font-size: var(--fs-base); }
.mobile-menu__contact { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-3); }
.mobile-menu__contact:empty { display: none; }
.mobile-menu__quick {
  display: flex; align-items: center; gap: var(--sp-2); min-height: 52px; min-width: 0;
  padding: var(--sp-2) var(--sp-3); border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05);
  color: var(--c-white); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); line-height: 1.2;
}
.mobile-menu__quick:hover { background: rgba(255, 255, 255, .1); }
.mobile-menu__quick svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--c-green-light); }
.mobile-menu__quick span { display: grid; min-width: 0; }
.mobile-menu__quick small { font-size: var(--fs-xs); font-weight: 500; color: rgba(255, 255, 255, .62); }

/* Opening: sheet fades in, rows rise one after another */
@media (prefers-reduced-motion: no-preference) {
  .mobile-menu { animation: mmenu-in .22s var(--ease) both; }
  .mnav__item { animation: mmenu-row .42s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(60ms + var(--i, 0) * 35ms); }
  .mobile-menu__cta { animation: mmenu-row .42s cubic-bezier(.2, .7, .2, 1) .18s both; }
}
@keyframes mmenu-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mmenu-row { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 1080px) {
  .mobile-menu { display: none !important; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--c-white);
  border-top: 1px solid var(--c-border);
  padding-block: var(--sp-7) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}
.footer-grid { display: grid; gap: var(--sp-6); }
.footer-col { min-width: 0; }
.footer-title {
  font-size: var(--fs-sm); font-weight: 600; color: var(--c-navy);
  margin: var(--sp-5) 0 var(--sp-3);
}
.footer-col > .footer-title:first-child { margin-top: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: var(--sp-3); }
.site-footer a { color: var(--c-navy); text-decoration: none; overflow-wrap: break-word; word-break: break-word; }
.site-footer a:hover { text-decoration: underline; color: var(--c-green-700); }
.site-footer strong { color: var(--c-navy); font-weight: 600; }
.footer-branches li, .footer-directory li { display: flex; gap: var(--sp-2); align-items: flex-start; }
.footer-branch { display: grid; gap: 2px; }
.footer-branch__map { font-weight: 600; color: var(--c-green) !important; font-size: var(--fs-xs); }
.footer-branch__map::after { content: " ↗"; }
.footer-hours li { margin-bottom: 2px; }
.footer-icon { flex-shrink: 0; color: var(--c-navy); margin-top: 2px; }
.footer-icon svg { width: 16px; height: 16px; }
.footer-links--legal { margin-top: var(--sp-5) !important; }
.footer-socials { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.footer-socials li { margin: 0; }
.social-link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 40px; padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-2);
  border: 1.5px solid var(--c-border); border-radius: var(--radius-pill);
  font-weight: 500;
}
.social-link:hover { border-color: var(--c-navy); text-decoration: none !important; }
.social-link svg { width: 18px; height: 18px; }
.footer-bottom {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
  text-align: center;
}
.footer-copy { margin: 0; font-size: var(--fs-xs); }
.muted { color: var(--c-text-muted); }

/* Footer rhythm: one gap between groups, one gap between items, one
   gap between a label and its value, on every screen size.
   Phone: 1 column. Tablet: 2 x 2 (Branches | Directory, Hours | Connect).
   Desktop: 4 columns; the two text-heavy groups get a little more width. */
.footer-grid { gap: var(--sp-7) var(--sp-7); }
.site-footer .footer-title { margin: 0 0 var(--sp-4); }
.footer-branches > li, .footer-directory > li { margin-bottom: var(--sp-4); }
.footer-branches > li:last-child, .footer-directory > li:last-child { margin-bottom: 0; }
.footer-entry, .footer-branch, .footer-branch-link { display: grid; gap: 2px; }
.footer-hours li { margin-bottom: 2px; }
.footer-links--legal { margin-top: var(--sp-5) !important; display: grid; gap: var(--sp-2); }
.footer-links--legal li { margin: 0; }
.nowrap { white-space: nowrap; }
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .footer-grid { grid-template-columns: 1.25fr 1.25fr 1fr 1fr; gap: var(--sp-7) var(--sp-6); }
}

/* Branch name + address is itself the Google Maps link */
.footer-branch-link { display: grid; gap: 2px; color: inherit !important; text-decoration: none; }
.footer-branch-link strong { color: var(--c-navy); }
.footer-branch-link .footer-branch__addr { color: var(--c-text-muted); }
.footer-branch-link:hover strong, .footer-branch-link:hover .footer-branch__addr { color: var(--c-green-700); text-decoration: underline; }
.footer-branch-link .ext { font-size: .85em; }

/* Mobile menu on small / short phones (iPhone SE, landscape) */
.mobile-menu__quick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) {
  .mobile-menu__quick { padding-inline: var(--sp-2); gap: 6px; font-size: .8125rem; }
  .mobile-menu__quick svg { width: 18px; height: 18px; }
}
@media (max-height: 720px) {
  .mnav__link { min-height: 52px; font-size: 1.1875rem; }
  .mnav__item.is-current::before { top: 14px; }
  .mobile-menu__cta { padding-top: var(--sp-3); }
  .mobile-menu__cta .btn { min-height: 48px; }
  .mobile-menu__quick { min-height: 46px; }
  .mobile-menu__contact { margin-top: var(--sp-2); }
}
@media (max-height: 480px) {          /* phone turned sideways */
  .mobile-menu__contact { display: none; }
}

/* Before the header partial arrives, keep its space so the page doesn't jump
   up ~80 px and back down when it loads */
[data-include^="header"] { display: block; height: calc(var(--header-h) + var(--header-top-gap)); }

/* Home shows the announcement bar: reserve its height from the very first
   paint too (1 line on wider screens, 2 on phones), so the hero never shifts */
body[data-page="home"] { --ann-reserve: 54px; --ann-h: var(--ann-reserve); }
@media (min-width: 768px) { body[data-page="home"] { --ann-reserve: 35px; } }
body[data-page="home"] [data-include^="header"] { height: calc(var(--header-h) + var(--header-top-gap) + var(--ann-reserve)); }
body[data-page="home"] .announcement[hidden] { display: block; visibility: hidden; height: var(--ann-reserve); padding: 0; }
