/* Header chrome + off-canvas drawer. Enqueued globally from inc/enqueue.php.
   Geometry measured off the Elementor header (template #30) and the Elementor
   popup that served as the drawer (template #44). */

.bramhall-scouts-header {
  background: var(--bramhall-scouts-bg);
  /* The old header's 5px purple bottom rule. */
  border-bottom: 5px solid var(--bramhall-scouts-purple);
}

.bramhall-scouts-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  /* 10px here + 10px on the logo were what reproduced the old header's 291px
     total. The logo cap above now drives the height instead. */
  padding-block: 10px;
}

/* Logo left, in its own half of the container.
   The old build let it run to 540px wide on a 1440 viewport (its natural size,
   capped by the column) — deliberately smaller here at Dan's request, so it
   reads as a logo rather than a banner. This is the one place the header
   departs from the measured original; see rebuild-spec.json. */
.bramhall-scouts-header__logo {
  display: flex;
  align-items: center;
  flex: 0 1 50%;
  min-width: 0;
  padding: 10px;
  text-decoration: none;
  font-weight: 700;
  color: var(--bramhall-scouts-purple);
}
.bramhall-scouts-header__logo img {
  width: auto;
  max-width: min(100%, 460px);
}

/* Nav right. */
.bramhall-scouts-nav { margin-left: auto; }

.bramhall-scouts-nav__list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.bramhall-scouts-nav__list li { position: relative; }
.bramhall-scouts-nav__list a {
  display: block;
  padding: 13px 20px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  color: var(--bramhall-scouts-prose);
  transition: color .2s var(--bramhall-scouts-ease);
}
.bramhall-scouts-nav__list a:hover { color: var(--bramhall-scouts-purple-dark); }

/* Active item: purple, with the 3px underline the old nav drew. */
.bramhall-scouts-nav__list .current-menu-item > a,
.bramhall-scouts-nav__list .current_page_item > a,
.bramhall-scouts-nav__list .current-menu-ancestor > a { color: var(--bramhall-scouts-purple-dark); }
.bramhall-scouts-nav__list .current-menu-item > a::after,
.bramhall-scouts-nav__list .current_page_item > a::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 10px;
  background: var(--bramhall-scouts-purple-dark);
}

/* Sub-menus — none exist today, but a two-level menu must not break the header. */
.bramhall-scouts-nav__list .sub-menu {
  position: absolute;
  top: 100%; left: 0;
  z-index: 101;
  min-width: 200px;
  margin: 0; padding: 8px 0;
  list-style: none;
  background: var(--bramhall-scouts-card-bg);
  border: 1px solid var(--bramhall-scouts-border);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  opacity: 0; visibility: hidden;
  transition: opacity .18s var(--bramhall-scouts-ease);
}
.bramhall-scouts-nav__list li:hover > .sub-menu,
.bramhall-scouts-nav__list li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
.bramhall-scouts-nav__list .sub-menu a { font-size: 17px; padding: 8px 16px; }
.bramhall-scouts-nav__list .sub-menu a::after { content: none; }

.bramhall-scouts-header__actions { display: flex; align-items: center; margin-left: auto; }

/* Burger — hidden on desktop, matching the old fa-bars icon's weight. */
.bramhall-scouts-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 56px; height: 44px;
  padding: 0 15px;
  background: none;
  border: 0;
  color: var(--bramhall-scouts-prose);
  cursor: pointer;
}
.bramhall-scouts-burger span {
  display: block;
  height: 3px;
  width: 26px;
  background: currentColor;
  transition: transform .25s var(--bramhall-scouts-ease), opacity .25s var(--bramhall-scouts-ease);
}
.bramhall-scouts-burger:hover { color: var(--bramhall-scouts-purple); }

/* ------------------------------------------------------------------ drawer
   Full-height panel sliding in from the right, as the Elementor popup did.
   -------------------------------------------------------------------------- */

.bramhall-scouts-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(390px, 90vw);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: var(--bramhall-scouts-card-bg);
  padding: 24px 15px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s var(--bramhall-scouts-ease);
}
.bramhall-scouts-drawer.is-open { transform: translateX(0); }

.bramhall-scouts-drawer__close {
  align-self: flex-end;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--bramhall-scouts-text);
  cursor: pointer;
}
.bramhall-scouts-drawer__close:hover { color: var(--bramhall-scouts-purple); }

.bramhall-scouts-drawer__logo { display: block; width: 100%; padding: 0 15px 15px; }
.bramhall-scouts-drawer__logo img { width: 100%; max-width: 300px; height: auto; margin-inline: auto; }

.bramhall-scouts-drawer__nav { width: 100%; }
.bramhall-scouts-drawer__list { list-style: none; margin: 0; padding: 0; text-align: center; }
.bramhall-scouts-drawer__list > li { border-bottom: 3px solid var(--bramhall-scouts-purple); }
.bramhall-scouts-drawer__list a {
  display: block;
  padding: 10px 0;
  line-height: 45px;
  font-size: 24px;
  font-weight: 500;
  text-decoration: none;
  color: var(--bramhall-scouts-prose);
}
.bramhall-scouts-drawer__list a:hover,
.bramhall-scouts-drawer__list .current-menu-item > a { color: var(--bramhall-scouts-purple); }
.bramhall-scouts-drawer__list .sub-menu { list-style: none; margin: 0; padding: 0 0 8px; }
.bramhall-scouts-drawer__list .sub-menu a { font-size: 19px; line-height: 34px; }

/* Full-width button, as the old popup's justified Contact button was. */
.bramhall-scouts-drawer__cta { width: calc(100% - 10px); margin: 5px; }

.bramhall-scouts-drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,.6);
  opacity: 0;
  transition: opacity .3s var(--bramhall-scouts-ease);
}
.bramhall-scouts-drawer__backdrop.is-open { opacity: 1; }

/* The old build swapped nav for burger at Elementor's tablet breakpoint
   (viewport_lg 1025), so the burger appeared on tablets too. */
@media (max-width: 1024px) {
  .bramhall-scouts-nav { display: none; }
  .bramhall-scouts-burger { display: flex; }
  .bramhall-scouts-header__logo { flex: 1 1 auto; }
  .bramhall-scouts-header__logo img { max-width: min(100%, 300px); }
}

@media (prefers-reduced-motion: reduce) {
  .bramhall-scouts-drawer,
  .bramhall-scouts-drawer__backdrop,
  .bramhall-scouts-burger span { transition: none; }
}
