/* Page scaffolding: header, footer, containers, sections */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--sp-6); }
}

.section { padding-block: var(--sp-7); }
.section--tight { padding-block: var(--sp-6); }
.section + .section { border-top: 1px solid var(--c-border); }

.section__lead { max-width: 60ch; color: var(--c-text-muted); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

/* ---- Site header ---- */
/* The header is pinned to the top of the viewport on every public page. It is
   `position: fixed` (not `sticky`) because the previous sticky setup had nothing
   to stick within — its wrapper was only as tall as the header itself, so it
   scrolled away as soon as the hero passed. The `#site-header` wrapper now
   reserves the header's height as an in-flow spacer so fixed positioning doesn't
   hide the first content; the home page opts out of that spacer because its
   transparent header is meant to overlay the hero (see .hero__inner padding). */
#site-header { min-height: var(--header-h); }
body.has-transparent-header #site-header { min-height: 0; }

.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 100;
  background: var(--c-bone);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-1);
  /* colour-only change on the transparent->solid swap; base.css zeroes this
     under prefers-reduced-motion, leaving an instant (non-animated) swap */
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5em; /* scales with the wordmark font-size */
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-700); /* mobile: clearly the largest thing in the header, no wrap */
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--c-hill-green);
  text-decoration: none;
  white-space: nowrap;
}
/* Beehive-house logo mark. Sized off the wordmark font-size (cap-height-to-
   ascender), so it tracks the responsive .wordmark steps. Inherits `color`. */
.wordmark__mark {
  flex: none;
  width: auto;
  height: 1.1em;
}
/* Public site header: step the wordmark up once there's room for it (nav appears
   at 900px and the bar is taller). Footer + admin sidebar keep the smaller step. */
@media (min-width: 900px) {
  .site-header__inner .wordmark { font-size: var(--fs-800); }
}
.site-nav { display: none; }
.site-nav ul { display: flex; gap: var(--sp-5); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--c-charcoal);
  text-decoration: none;
  font-weight: 500;
  padding-block: var(--sp-2);
}
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--c-clay); }

.site-header__actions { display: flex; align-items: center; gap: var(--sp-3); }
/* design-spec §1: desktop shows a compact "Check dates" clay button; mobile is
   just the hamburger. Hiding the CTA also gives the enlarged wordmark room. */
.site-header__actions .site-header__cta { display: none; }
@media (min-width: 900px) { .site-header__actions .site-header__cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font: inherit;
  color: var(--c-charcoal);
  cursor: pointer;
}

/* Transparent-over-hero variant (design-spec P1 §1): position is unchanged
   (already fixed above) — only the paint switches, so there is no layout shift. */
.site-header--transparent {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}
.site-header--transparent .wordmark,
.site-header--transparent .site-nav a { color: var(--c-white); }
.site-header--transparent .nav-toggle { color: var(--c-white); border-color: rgba(255,255,255,0.6); }

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--c-border);
  background: var(--c-bone);
  /* the header is fixed, so a long open drawer must scroll within the viewport
     rather than run off the bottom of the screen */
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer ul { list-style: none; margin: 0; padding: var(--sp-3) 0; }
.mobile-drawer a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  color: var(--c-charcoal);
  text-decoration: none;
  font-weight: 500;
}
.mobile-drawer a[aria-current="page"] { background: var(--c-surface-sunk); }

@media (min-width: 900px) {
  .site-nav { display: block; }
  .nav-toggle { display: none; }
  .mobile-drawer { display: none !important; }
}

/* ---- Footer ---- */
.site-footer {
  background: var(--c-hill-green);
  color: var(--c-white);
  padding-block: var(--sp-7);
  margin-top: var(--sp-8);
}
.site-footer a { color: var(--c-white); }
.site-footer h2 { color: var(--c-white); font-size: var(--fs-500); }
.footer-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: var(--sp-2); }
.footer-meta { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid rgba(255,255,255,0.25); font-size: var(--fs-300); opacity: 0.9; }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

/* ---- Generic responsive two-column ---- */
.split {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; align-items: start; }
  .split--rail { grid-template-columns: 1fr 360px; }
  .split--text-first { grid-template-columns: 1.2fr 1fr; }
}

.page-hero { padding-block: var(--sp-7) var(--sp-6); }
.page-hero p { max-width: 60ch; color: var(--c-text-muted); font-size: var(--fs-500); }

/* Main content offset target for skip link */
main:focus { outline: none; }
