/* ==========================================================================
   Header & Footer — exact from Figma symbols 217:2833 / 217:2880
   ========================================================================== */

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: #fff;
}

/* Top utility bar — blue-900, 53px */
.topbar { background: var(--blue-900); color: #fff; }
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 53px; padding-block: 10px;
  font-size: var(--fs-body-sm); line-height: var(--lh-body-sm);
}
.topbar a { color: #fff; text-decoration: none; }
.topbar__phone { color: #fff; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.topbar__phone svg { width: 16px; height: 16px; }
.topbar__utils { display: flex; align-items: center; gap: 28px; color: var(--blue-100); }
.topbar__utils a, .topbar__utils button {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue-100); background: none; border: 0; cursor: pointer;
  font-size: var(--fs-body-sm); text-decoration: none;
}
.topbar__utils a:hover, .topbar__utils button:hover { color: #fff; }
.topbar__utils svg { width: 15px; height: 15px; }

/* Main nav row — white, border-bottom, ~96px side padding, py-22 */
.mainbar { background: #fff; border-bottom: 1px solid var(--border); transition: box-shadow var(--dur-micro) var(--ease-out), padding var(--dur-micro) var(--ease-out); }
.mainbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 22px; gap: 28px;
}
/* Main nav uses ~96px gutter (brief §4) — a touch tighter than content 120 */
@media (min-width: 1200px) { .mainbar__inner { padding-inline: 64px; } }
@media (min-width: 1441px) { .mainbar__inner { padding-inline: 64px; } }

.site-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
/* Logo scaled up from the 40px wireframe value so the brand reads properly.
   48px is the largest that still clears the nav at 1440 — the header gutter is
   64px (below) and the nav gap 20px to make room. Matches Figma 217:2823. */
.site-logo img { height: 48px; width: auto; }
@media (max-width: 767px) { .site-logo img { height: 40px; } }

.primary-nav { display: flex; align-items: center; gap: 28px; }
.primary-nav__list { display: flex; align-items: center; gap: 20px; list-style: none; margin: 0; padding: 0; }
.primary-nav__list > li > a {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-nav); line-height: var(--lh-nav);
  color: var(--ink); text-decoration: none; white-space: nowrap; position: relative; padding-block: 4px;
}
.primary-nav__list > li > a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--green-500); transition: right var(--dur-micro) var(--ease-out);
}
.primary-nav__list > li > a:hover { color: var(--blue-700); }
.primary-nav__list > li > a:hover::after, .primary-nav__list .current-menu-item > a::after { right: 0; }
.primary-nav__list .current-menu-item > a { color: var(--blue-700); }

/* ---- Mega-menu dropdowns ------------------------------------------------- */
.primary-nav__list > li { position: relative; }
.primary-nav__list > li > a { display: inline-flex; align-items: center; gap: 4px; }
.primary-nav__caret { color: var(--muted); transition: transform var(--dur-micro) var(--ease-out); }
.has-mega:hover .primary-nav__caret,
.has-mega:focus-within .primary-nav__caret { transform: rotate(180deg); color: var(--blue-700); }

.mega {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 5;
  min-width: 300px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-raised);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out), visibility var(--dur-micro);
}
/* Hover bridge so the pointer can travel from item to panel */
.mega::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.has-mega:hover > a + .mega,
.has-mega:focus-within > a + .mega { opacity: 1; visibility: visible; transform: translateY(0); }
/* Keep the last items' panels inside the viewport */
.primary-nav__list > li:nth-last-child(-n+2) .mega { left: auto; right: 0; }

.mega__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mega__link { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; text-decoration: none; transition: background-color var(--dur-micro) var(--ease-out); }
.mega__link:hover, .mega__link:focus-visible { background: var(--surface); }
.mega__label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-nav); color: var(--blue-700); }
.mega__arrow { color: var(--muted); opacity: 0; transform: translate(-3px,3px); transition: all var(--dur-micro) var(--ease-out); }
.mega__link:hover .mega__arrow, .mega__link:focus-visible .mega__arrow { opacity: 1; transform: none; color: var(--magenta-700); }
.mega__desc { font-size: var(--fs-body-sm); color: var(--muted); line-height: 1.35; }

@media (prefers-reduced-motion: reduce) {
  .mega { transition: opacity var(--dur-micro) linear, visibility var(--dur-micro); transform: none; }
  .has-mega:hover > a + .mega, .has-mega:focus-within > a + .mega { transform: none; }
}

/* Mobile drawer sub-items */
.nav-drawer__sub { list-style: none; margin: 0 0 8px; padding: 0 0 0 12px; border-left: 2px solid var(--border); }
.nav-drawer__sub a { padding: 10px 8px; font-size: 15px; font-weight: 500; color: var(--secondary); border-bottom: 0; }
.nav-drawer__sub a:hover { color: var(--blue-700); }

/* Sticky condense on scroll (brief §11b) */
.site-header.is-scrolled .mainbar { box-shadow: var(--shadow-card); }
.site-header.is-scrolled .mainbar__inner { padding-block: 14px; }

/* Hamburger (mobile) */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--r-input); background: #fff; color: var(--blue-700); cursor: pointer; }
.nav-toggle svg { width: 24px; height: 24px; }

/* ---- Mobile drawer ------------------------------------------------------- */
.nav-drawer { position: fixed; inset: 0; z-index: var(--z-drawer); visibility: hidden; }
.nav-drawer[hidden] { display: none; }
.nav-drawer__overlay { position: absolute; inset: 0; background: rgba(10,62,82,.5); opacity: 0; transition: opacity var(--dur-micro) var(--ease-out); }
.nav-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(360px, 88vw);
  background: #fff; box-shadow: var(--shadow-raised); padding: 24px;
  transform: translateX(100%); transition: transform 280ms var(--ease-out);
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
}
.nav-drawer.is-open { visibility: visible; }
.nav-drawer.is-open .nav-drawer__overlay { opacity: 1; }
.nav-drawer.is-open .nav-drawer__panel { transform: translateX(0); }
.nav-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.nav-drawer__close { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--r-input); background: #fff; color: var(--blue-700); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.nav-drawer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nav-drawer__list a { display: block; padding: 14px 8px; font-weight: 600; font-size: 17px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--border); }
.nav-drawer__list a:hover { color: var(--blue-700); }
.nav-drawer__cta { margin-top: 16px; }
.nav-drawer__phone { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; color: var(--blue-700); font-weight: 600; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .nav-drawer__panel, .nav-drawer__overlay { transition: none; }
}

/* Laptop widths. The full nav plus the CTA is wider than the bar below 1440, which
   pushed the whole page sideways (a horizontal scrollbar from 1024 to about 1370).
   The longer "Share your experience" label made that worse (client amendment,
   Nov 2026), so the header now tightens in two steps and hands over to the drawer
   below 1200. Nothing changes at 1440 and above. */
@media (min-width: 1320px) and (max-width: 1439px) {
  .mainbar__inner { padding-inline: 32px; gap: 20px; }
  .site-logo img { height: 44px; }
  .primary-nav { gap: 20px; }
  .primary-nav__list { gap: 14px; }
  .primary-nav > .btn { padding-inline: 20px; }
}
@media (min-width: 1200px) and (max-width: 1319px) {
  .mainbar__inner { padding-inline: 24px; gap: 14px; }
  .site-logo img { height: 40px; }
  .primary-nav { gap: 14px; }
  .primary-nav__list { gap: 10px; }
  .primary-nav__list > li > a, .mega__label { font-size: 14px; }
  .primary-nav > .btn { padding-inline: 16px; }
}
@media (max-width: 1199px) {
  /* Whole desktop nav (links + CTA) collapses into the drawer; only the
     hamburger shows next to the logo. (Was 1023px: between 1024 and 1199 the
     desktop nav could not fit and ran off the side of the page.) */
  .primary-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .mainbar__inner { padding-block: 16px; }
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--blue-900); color: var(--blue-100); padding: 80px 0 32px; }
.site-footer__top { display: grid; grid-template-columns: 320px repeat(2, 200px) 1fr; gap: 56px; align-items: start; }
.site-footer__brand { display: flex; flex-direction: column; gap: 16px; max-width: 320px; }
.footer-brand__name { display: flex; flex-direction: column; gap: 1px; }
.footer-brand__name strong { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h4); line-height: var(--lh-h4); color: #fff; }
.footer-brand__name span { font-size: var(--fs-body-sm); color: var(--blue-100); }
.site-footer__tagline { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--blue-100); }
.site-footer__phone { font-size: var(--fs-body); line-height: var(--lh-body); color: #fff; font-weight: 400; text-decoration: none; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--blue-700); color: #fff; text-decoration: none; transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.footer-social a:hover { background: var(--blue-500); transform: translateY(-2px); }
.footer-social svg { width: 16px; height: 16px; }

/* Figma 217:2851 — 13/16 title, 14px gap, 14/21 links on a 14px gap. */
.footer-col__title { font-weight: 600; font-size: var(--fs-eyebrow); line-height: var(--lh-eyebrow); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--blue-100); margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.footer-col li { line-height: var(--lh-body-sm); }
.footer-col a { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--blue-100); text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }

.footer-news { display: flex; flex-direction: column; gap: 12px; max-width: 300px; }
.footer-news p { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--blue-100); margin: 0; }
.footer-news p.footer-col__title { font-size: var(--fs-eyebrow); line-height: var(--lh-eyebrow); margin: 0; }
.footer-news__form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.footer-news input { width: 100%; padding: 14px 16px; border: 1px solid var(--blue-700); border-radius: 8px; background: transparent; color: #fff; font-family: inherit; font-size: var(--fs-body); line-height: var(--lh-body); }
.footer-news input::placeholder { color: var(--blue-100); }
.footer-news button { width: 100%; padding: 14px 24px; border: 0; border-radius: 8px; background: #fff; color: var(--ink); font-family: inherit; font-weight: 600; font-size: var(--fs-button); line-height: var(--lh-button); letter-spacing: var(--ls-button); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.footer-news button:hover { background: var(--blue-100); }

.site-footer__divider { height: 1px; background: var(--blue-700); margin: 40px 0; }
.site-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--blue-100); }
.site-footer__bottom p { margin: 0; }
.footer-legal { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-legal a { color: var(--blue-100); text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }

/* Between 1024 and 1439 the fixed 320/200/200 columns left the newsletter column
   as little as 56px wide, so its heading, text and button broke over many lines.
   Share the row out instead, keeping the newsletter at a usable width (client
   amendment, Nov 2026: longer newsletter heading). Unchanged at 1440 and above. */
@media (min-width: 1024px) and (max-width: 1439px) {
  .site-footer__top { grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 0.8fr)) minmax(240px, 1.15fr); gap: 40px; }
  .site-footer__brand { max-width: none; }
}
@media (max-width: 1023px) {
  .site-footer__top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .site-footer__brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 639px) {
  .site-footer__top { grid-template-columns: 1fr; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* Phones: keep the freephone number on one line */
@media (max-width: 480px) {
  .topbar__inner { gap: 12px; font-size: 13px; }
  .topbar__phone { white-space: nowrap; gap: 6px; }
  .topbar__utils { gap: 14px; }
  .topbar__utils button svg:last-child { display: none; }
}
@media (max-width: 360px) {
  .topbar__utils span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
