/*
 * burger-nav.css - Two-column full-viewport overlay (Korowa-style)
 * Opening choreography: brand-colour wash, curved left panel, then delayed
 * staggered information reveal.
 */

:root {
  --bn-blue: var(--blue);
  --bn-blue-deep: var(--blue-dark);
  --bn-aqua: var(--aqua);
  --bn-panel: var(--white);
  --bn-ink: var(--ink);
  --bn-white: var(--white);
  --bn-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* CLOSED BAR BUTTONS */

.site-header {
  min-height: 96px;
  padding-top: 11px;
  padding-bottom: 11px;
}

.button-contact {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: unset;
  height: 74px;
  padding: 0 34px;
  margin-right: 12px;
  border: none;
  border-radius: 10px;
  background: var(--blue);
  color: var(--bn-white);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 180ms ease;
}

.button-contact::before {
  display: block;
  width: 23px;
  height: 23px;
  margin-right: 14px;
  background: currentColor;
  content: "";
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3v3M17 3v3M4.5 9h15M6.5 5h11a2 2 0 0 1 2 2v11.5a2 2 0 0 1-2 2h-11a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.button-contact:hover { background: #1419b0; transform: none; box-shadow: none; }
.button-contact:focus-visible { outline: 3px solid var(--bn-aqua); outline-offset: 3px; }

.menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: var(--bn-blue);
  color: var(--bn-white);
  border: 3px solid var(--bn-ink);
  border-radius: 10px;
  font-size: 0;
  transition:
    color 280ms ease,
    border-color 360ms ease,
    transform 360ms var(--bn-ease-out);
}

.menu-toggle::before {
  position: absolute;
  inset: 0;
  background: var(--orange);
  content: "";
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 720ms cubic-bezier(0.33, 0, 0.2, 1);
}

.menu-toggle:hover {
  color: var(--bn-ink);
}

.menu-toggle:hover::before,
.menu-toggle[aria-expanded="true"]::before {
  transform: scaleY(1);
}

.menu-toggle[aria-expanded="true"] {
  position: fixed;
  top: 11px;
  right: 20px;
  z-index: 250;
  color: var(--bn-ink);
}

.site-header.is-menu-open {
  z-index: 240;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.site-header.is-menu-open .brand,
.site-header.is-menu-open .button-contact {
  visibility: hidden;
}

.site-header.is-menu-open .menu-toggle {
  visibility: visible;
  pointer-events: auto;
}

.menu-toggle[aria-expanded="true"]:hover {
  color: var(--bn-ink);
}

.menu-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 36px;
  height: 30px;
  font-size: 0;
  line-height: 0;
}

.menu-icon::before,
.menu-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 21px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  border: 0 solid currentColor;
  box-sizing: border-box;
  content: "";
  transform-origin: 50% 50%;
  transition:
    transform 740ms cubic-bezier(0.33, 0, 0.2, 1),
    width 740ms cubic-bezier(0.33, 0, 0.2, 1),
    background-color 220ms ease;
}

.menu-icon::before {
  transform: translate(-50%, -50%) translate(5px, -7px) rotate(0deg);
}

.menu-icon::after {
  transform: translate(-50%, -50%) translate(-5px, 7px) rotate(0deg);
}

.menu-toggle:hover:not([aria-expanded="true"]) .menu-icon::before {
  transform: translate(-50%, -50%) translate(2px, -4px) rotate(0deg);
}

.menu-toggle:hover:not([aria-expanded="true"]) .menu-icon::after {
  transform: translate(-50%, -50%) translate(-2px, 4px) rotate(0deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon::before {
  width: 24px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon::after {
  width: 24px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.menu-toggle.is-opening .menu-icon::before {
  animation: bn-burger-top-open 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.menu-toggle.is-opening .menu-icon::after {
  animation: bn-burger-bottom-open 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.menu-toggle.is-closing .menu-icon::before {
  animation: bn-burger-top-close 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.menu-toggle.is-closing .menu-icon::after {
  animation: bn-burger-bottom-close 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes bn-burger-top-open {
  0%   { width: 21px; transform: translate(-50%, -50%) translate(5px, -7px) rotate(0deg); }
  45%  { width: 23px; transform: translate(-50%, -50%) translate(0, 0) rotate(0deg); }
  100% { width: 24px; transform: translate(-50%, -50%) rotate(45deg); }
}

@keyframes bn-burger-bottom-open {
  0%   { width: 21px; transform: translate(-50%, -50%) translate(-5px, 7px) rotate(0deg); }
  45%  { width: 23px; transform: translate(-50%, -50%) translate(0, 0) rotate(0deg); }
  100% { width: 24px; transform: translate(-50%, -50%) rotate(-45deg); }
}

@keyframes bn-burger-top-close {
  0%   { width: 24px; transform: translate(-50%, -50%) rotate(45deg); }
  55%  { width: 23px; transform: translate(-50%, -50%) translate(0, 0) rotate(0deg); }
  100% { width: 21px; transform: translate(-50%, -50%) translate(5px, -7px) rotate(0deg); }
}

@keyframes bn-burger-bottom-close {
  0%   { width: 24px; transform: translate(-50%, -50%) rotate(-45deg); }
  55%  { width: 23px; transform: translate(-50%, -50%) translate(0, 0) rotate(0deg); }
  100% { width: 21px; transform: translate(-50%, -50%) translate(-5px, 7px) rotate(0deg); }
}

@media (min-width: 1100px) {
  .menu-toggle[aria-expanded="true"] {
    right: 50px;
  }

  .bn-nav-link {
    font-size: 2.75rem;
  }

  .bn-quick-link {
    font-size: 2.1rem;
  }
}

/* OVERLAY CONTAINER
   Single-column full-screen accordion menu. This overlay only ever
   appears below 768px (phones) — the desktop dropdown nav takes over
   at 768px and up, and .menu-toggle is hidden — so one fluid design
   covers every case where it's actually seen; there's no tablet variant.
   Closing is handled entirely by .menu-toggle morphing into an orange X
   (fixed top-right, see the CLOSED BAR BUTTONS rules above); there's no
   second close control inside the overlay.
*/

.bn-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bn-blue-deep);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease, visibility 0s linear 320ms;
}

.bn-overlay.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 320ms ease;
}

.bn-head {
  flex-shrink: 0;
  padding: clamp(20px, 4vw, 32px) clamp(20px, 5vw, 48px) 0;
}

.bn-brand {
  display: block;
  width: clamp(46px, 7vw, 60px);
  aspect-ratio: 1985 / 2083;
  background-image: url("/assets/brand/lbhsc-primary.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* ACCORDION */

.bn-accordion {
  flex: 1;
  padding: clamp(24px, 5vw, 44px) clamp(20px, 5vw, 48px) 8px;
}

.bn-acc-item {
  border-top: 1px solid color-mix(in srgb, var(--bn-white) 14%, transparent);
}

.bn-acc-item:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--bn-white) 14%, transparent);
}

.bn-acc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: clamp(16px, 3.2vw, 22px) 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.bn-acc-title {
  color: var(--bn-white);
  font-family: var(--font-body);
  font-size: clamp(1.4rem, 5.2vw, 2rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  opacity: 0.82;
  transition: color 180ms ease, opacity 180ms ease;
}

.bn-acc-toggle[aria-expanded="true"] .bn-acc-title {
  color: var(--bn-aqua);
  opacity: 1;
}

.bn-acc-toggle:hover .bn-acc-title,
.bn-acc-toggle:focus-visible .bn-acc-title {
  opacity: 1;
}

.bn-acc-icon {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--orange);
}

.bn-acc-icon::before,
.bn-acc-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--bn-white);
  content: "";
  transform: translate(-50%, -50%);
  transition: transform 220ms ease, opacity 220ms ease;
}

.bn-acc-icon::before { width: 14px; height: 2px; }
.bn-acc-icon::after  { width: 2px; height: 14px; }

.bn-acc-toggle[aria-expanded="true"] .bn-acc-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.bn-acc-toggle:focus-visible {
  outline: 3px solid var(--bn-aqua);
  outline-offset: 3px;
  border-radius: 6px;
}

.bn-acc-panel[hidden] {
  display: none;
}

.bn-acc-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  padding: 2px 0 clamp(18px, 3vw, 26px);
}

.bn-acc-links a {
  display: block;
  padding: 8px 0;
  color: color-mix(in srgb, var(--bn-white) 78%, transparent);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  transition: color 150ms ease;
}

.bn-acc-links a:hover,
.bn-acc-links a:focus-visible {
  color: var(--bn-aqua);
}

@media (min-width: 480px) {
  .bn-acc-links {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* FOOTER */

.bn-foot {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 3vw, 24px) clamp(20px, 5vw, 48px) clamp(24px, 5vw, 40px);
  border-top: 1px solid color-mix(in srgb, var(--bn-white) 14%, transparent);
}

.bn-foot address {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-style: normal;
  color: color-mix(in srgb, var(--bn-white) 58%, transparent);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bn-foot address strong {
  color: color-mix(in srgb, var(--bn-white) 90%, transparent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.bn-foot address a {
  color: color-mix(in srgb, var(--bn-white) 55%, transparent);
  transition: color 150ms ease;
}

.bn-foot address a:hover { color: var(--bn-white); }

.bn-foot-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.bn-social {
  display: flex;
  gap: 8px;
}

.bn-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--bn-white) 24%, transparent);
  border-radius: 7px;
  color: var(--bn-white);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.bn-social a:hover {
  background: color-mix(in srgb, var(--bn-white) 10%, transparent);
  border-color: color-mix(in srgb, var(--bn-white) 46%, transparent);
}

.bn-cta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  border-radius: 999px;
  background: var(--orange-cta);
  color: var(--bn-white);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 180ms ease, transform 180ms ease;
}

.bn-cta-pill:hover { background: var(--orange-cta-hover); transform: translateY(-1px); }
.bn-cta-pill:focus-visible { outline: 3px solid color-mix(in srgb, var(--bn-white) 70%, transparent); outline-offset: 3px; }

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  .bn-overlay,
  .menu-toggle,
  .bn-acc-title,
  .bn-acc-icon::before,
  .bn-acc-icon::after {
    transition: visibility 0s, opacity 0s, transform 0s !important;
    transition-delay: 0s !important;
    transform: none !important;
  }

  .menu-toggle,
  .menu-icon::before,
  .menu-icon::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── DESKTOP PRIMARY NAV ───────────────────────────────────────────────── */

.site-nav {
  display: none;
}

.site-nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: clamp(14px, 1.8vw, 26px);
}

.site-nav-link {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bn-ink);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: border-color 150ms ease, color 150ms ease;
}

.site-nav-link:hover,
.site-nav-link.is-current {
  border-bottom-color: var(--bn-aqua);
  color: var(--bn-blue-deep);
}

.site-nav-link:focus-visible {
  outline: 3px solid var(--bn-aqua);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Hide the CTA button on phones — header is logo + burger only */
@media (max-width: 767px) {
  .button-contact {
    display: none !important;
  }
}

/* At the narrow end of the desktop-nav range (768-899px) there isn't room
   for brand + 5 nav items + a variable-length CTA button (some pages'
   text, e.g. "Book Time Trial", is much wider than "Contact") — drop the
   CTA here and rely on the "Contact" nav item; it returns at 900px. */
@media (min-width: 768px) and (max-width: 899px) {
  .button-contact {
    display: none !important;
  }
}

/* ── HERO HEADER: transparent + white nav until scrolled ─────────────────── */
body.has-opening-hero .site-header {
  transition: background 280ms ease, box-shadow 280ms ease;
}

body.has-opening-hero .site-header:not(.is-scrolled) {
  background: transparent !important;
  box-shadow: none !important;
}

body.has-opening-hero .site-header:not(.is-scrolled) .brand {
  color: var(--bn-white);
  text-shadow: 0 1px 16px color-mix(in srgb, var(--bn-blue) 36%, transparent);
}

body.has-opening-hero .site-header:not(.is-scrolled) .brand::before {
  background-image: url("/assets/brand/lbhsc-primary-with-slogan.webp");
  filter: none !important;
}

body.has-opening-hero .site-header:not(.is-scrolled) .site-nav-link {
  color: white;
}

body.has-opening-hero .site-header:not(.is-scrolled) .site-nav-link:hover,
body.has-opening-hero .site-header:not(.is-scrolled) .site-nav-link.is-current {
  color: white;
  border-bottom-color: var(--bn-aqua);
}

/* "Find your programme" CTA — swap calendar icon for arrow */
.button-find::before {
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Header CTA overrides — reset sizing from the mobile panel definition. */
.button-contact,
.bn-cta-pill {
  min-height: 46px;
  height: auto;
  padding: 0 18px;
  gap: 12px;
  border: none;
  border-radius: 7px;
  color: var(--bn-white);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 180ms ease, transform 180ms ease;
}

.button-contact {
  background: var(--blue);
  box-shadow: none;
}

.button-contact:hover {
  background: #1419b0;
}

.bn-cta-pill {
  background: var(--orange-cta);
  box-shadow: none;
}

.bn-cta-pill:hover {
  background: var(--orange-cta-hover);
}

.button-contact::before { display: none; }

.button-contact::after,
.bn-cta-pill::after {
  display: inline-block;
  flex: none;
  content: "↗";
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: transform 220ms var(--bn-ease-out);
}

.button-contact:hover,
.bn-cta-pill:hover {
  color: var(--bn-white);
  background: linear-gradient(135deg, #2334c9 0%, #1419b0 100%);
  box-shadow: 0 12px 25px color-mix(in srgb, var(--bn-blue-deep) 30%, transparent);
  filter: none;
  transform: translateY(-2px);
}

.button-contact:hover::after,
.bn-cta-pill:hover::after { transform: translate(2px, -2px); }

@media (prefers-reduced-motion: reduce) {
  .button-contact,
  .bn-cta-pill,
  .button-contact::after,
  .bn-cta-pill::after { transition: none; }
}

@media (min-width: 768px) {
  .site-nav {
    display: block;
  }

  .menu-toggle {
    display: none !important;
  }

  .button-contact {
    height: 52px;
    padding: 0 22px;
    font-size: 12px;
    margin-right: 0;
  }
}

/* ── MOBILE BAR + SUBMENU (everything below the 768px desktop nav) ──────────
   Fix 1 — the bar was see-through while scrolling. Four separate rules were
   feeding page content through it:
     styles.css      .site-header                       rgba(255,255,255,0.98)
     nav-pages.css   .site-header                       transparent until .is-scrolled
                     .site-header.is-scrolled           rgba(255,255,255,0.98)
     inner-pages.css .inner-page .site-header (sticky)  color-mix(--white 96%, transparent)
     burger-nav.css  body.has-opening-hero
                     .site-header:not(.is-scrolled)     transparent !important
   Below 768px the bar is now one flat --bn-blue fill in every state, so the
   scrolled and unscrolled bars are identical and nothing reads through it.
   Fix 2 — the tapped group's sub-links now sit on their own white card, which
   separates them from the blue parent list and lifts them to 16:1 text
   contrast with 48px+ tap targets.
   ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  /* SOLID BAR — no rgba, no colour-mix alpha, no backdrop blur. */
  .site-header:not(.is-menu-open),
  .site-header.is-scrolled:not(.is-menu-open),
  .inner-page .site-header:not(.is-menu-open),
  body.has-opening-hero .site-header:not(.is-menu-open),
  body.has-opening-hero .site-header:not(.is-scrolled):not(.is-menu-open) {
    background: var(--bn-blue) !important;
    box-shadow: 0 1px 0 color-mix(in srgb, var(--bn-blue-deep) 55%, transparent) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    opacity: 1;
  }

  /* The overlay owns the viewport while the menu is open — bar stays clear.
     z-index is forced because .inner-page .site-header (loaded after this
     file) pins the header to 100, which buried the close X under the
     z-index: 200 overlay and left no visible way out of the menu. */
  .site-header.is-menu-open,
  .inner-page .site-header.is-menu-open,
  body.has-opening-hero .site-header.is-menu-open {
    z-index: 240 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Brand lockup: navy on --bn-blue is 1.8:1, white on --bn-blue is 9.3:1. */
  .site-header .brand,
  .site-header.is-scrolled .brand,
  .inner-page .site-header .brand,
  body.has-opening-hero .site-header:not(.is-scrolled) .brand {
    color: var(--bn-white) !important;
    text-shadow: none !important;
  }

  /* Show the actual coloured crest on the blue bar — no filter. */
  .site-header .brand::before,
  .site-header.is-scrolled .brand::before,
  .inner-page .site-header .brand::before,
  body.has-opening-hero .site-header:not(.is-scrolled) .brand::before {
    filter: none !important;
  }

  /* Burger sits on blue now, so the near-black outline goes translucent white. */
  .menu-toggle:not([aria-expanded="true"]) {
    background: transparent;
    border-width: 2px;
    border-color: color-mix(in srgb, var(--bn-white) 46%, transparent);
    color: var(--bn-white);
  }

  .menu-toggle:not([aria-expanded="true"]):hover {
    color: var(--bn-ink);
    border-color: var(--bn-aqua);
  }

  /* Accordion needs no extra tablet-range overrides — the fluid clamp()
     sizing in the ACCORDION block above already covers this range. */
}
