/* ---------- Tokens ---------- */
:root {
  --purple: #7413dc;
  --purple-hover: #5c0fb0;
  --purple-tint: #f5f2fb;
  --yellow: #ffe627;
  --yellow-tint: #fdf6d8;
  --border: #e6e2ee;
  --ink: #1a1a1a;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fff;
  color: #333;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3, p, ul { margin: 0; }
img { max-width: 100%; }
a { color: inherit; }

/* ---------- Layout ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.content { max-width: 1140px; margin: 0 auto; padding: 48px 24px 0; }
.content:last-child { padding-bottom: 48px; }

/* ---------- Header ---------- */
.site-header { background: #fff; color: var(--ink); position: relative; border-bottom: 1px solid var(--border); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px 24px;
}
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 32px; height: 32px; background: none; border: none; cursor: pointer; padding: 0; flex: none;
}
.nav-toggle span { display: block; width: 100%; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.site-header__brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); flex: none; }
.site-header__logo { height: 38px; width: auto; display: block; }
.site-header__wordmark { font-weight: 900; font-size: 20px; line-height: 1.1; }
.site-nav { display: flex; gap: 18px; font-weight: 700; font-size: 15px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:not(.pill-btn) { opacity: .8; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.site-nav a:not(.pill-btn):hover { opacity: 1; text-decoration: underline; }
.site-nav a.is-active { opacity: 1; border-bottom-color: var(--purple); }
.pill-btn { background: var(--yellow); color: var(--ink) !important; padding: 8px 16px; border-radius: 6px; text-decoration: none !important; }
.pill-btn:hover { background: #fff3a0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--purple); color: #fff; margin-top: 64px; }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 36px 24px; }
.site-footer__about { display: flex; align-items: center; gap: 18px; }
.site-footer__logo { height: 64px; width: auto; border-radius: 6px; display: block; }
.site-footer__text { font-size: 13px; line-height: 1.6; opacity: .9; }
.site-footer__links { display: flex; gap: 24px; font-weight: 700; font-size: 13.5px; }
.site-footer__links a { color: #fff; text-decoration: none; }
.site-footer__links a:hover { text-decoration: underline; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-block; margin-top: 12px; background: var(--purple); color: #fff !important;
  font-weight: 800; font-size: 14.5px; padding: 10px 20px; border-radius: 6px; text-decoration: none;
}
.btn:hover { background: var(--purple-hover); }
.btn--sm { font-size: 14px; padding: 9px 18px; }
.link-arrow { display: inline-block; margin-top: 12px; color: var(--purple); font-weight: 800; font-size: 14.5px; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Hero (home) ---------- */
.hero { background: #0d6dda; }
.hero__inner { max-width: 1140px; margin: 0 auto; padding: 64px 24px 48px; }
.hero h1 { font-size: 58px; line-height: 1.02; font-weight: 900; color: #fff; letter-spacing: -1px; max-width: 820px; margin-bottom: 18px; }
.hero h1 .accent { color: var(--yellow); }
.hero p { font-size: 19px; line-height: 1.55; color: #fff; max-width: none; }

/* ---------- Page header band (purple, interior pages) ---------- */
.page-header { background: var(--purple); color: #fff; }
.page-header__inner { padding: 56px 24px 48px; min-height: 240px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; }
.page-header h1 { font-weight: 900; font-size: 44px; letter-spacing: -.5px; margin-bottom: 10px; }
.page-header p { font-size: 18px; opacity: .9; max-width: 820px; line-height: 1.55; }
.page-header__subtitle--full { max-width: none; }
.wrap--wide {
  max-width: 1500px;
  margin-left: max(24px, calc((100vw - 1140px) / 2));
  margin-right: auto;
}

/* ---------- Section colour header band (Beavers/Cubs/Scouts) ---------- */
.section-header { color: #fff; background: var(--accent); }
.section-header__inner {
  padding: 56px 24px 48px; min-height: 240px; box-sizing: border-box;
  display: flex; justify-content: space-between;
  align-items: flex-end; gap: 24px; flex-wrap: wrap;
}
.section-header__logo { display: block; width: auto; margin-bottom: 16px; filter: brightness(0) invert(1); }
.section-header h1 { font-weight: 900; font-size: 44px; letter-spacing: -.5px; margin: 0; }
.section-header__pill { font-weight: 800; font-size: 16px; background: rgba(255,255,255,.15); padding: 10px 18px; border-radius: 8px; }

.section-heading { font-weight: 900; font-size: 32px; color: var(--ink); letter-spacing: -.5px; margin-bottom: 20px; }
.section-heading--center { text-align: center; font-size: 40px; margin-bottom: 28px; }

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-grid { grid-template-columns: 1fr 1.2fr; align-items: stretch; }
.grid-2--wide { gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-3--wide { gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.body-copy p.lead { font-size: 16.5px; line-height: 1.65; color: #333; margin-bottom: 18px; }
.body-copy p { font-size: 16.5px; line-height: 1.65; color: #555; margin-bottom: 28px; }
.body-copy h2 { font-weight: 900; font-size: 24px; color: var(--ink); margin-bottom: 14px; }
.body-copy ul { padding: 0 0 0 20px; font-size: 16.5px; line-height: 1.9; color: #444; }

/* ---------- Age-finder cards (home) ---------- */
.age-card {
  position: relative; overflow: hidden; background: #fff; color: var(--ink);
  border-radius: 10px; padding: 30px 16px 24px; min-height: 168px;
  box-shadow: 0 0 9px 2px rgba(0,0,0,.1);
  text-decoration: none; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: box-shadow .2s ease;
}
.age-card::before {
  content: ''; position: absolute; inset: 0; z-index: 0; background: var(--accent);
  opacity: 0; transform: scale(1.06); transition: opacity .3s ease, transform .3s ease;
}
.age-card:hover { box-shadow: 0 0 16px 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.age-card:hover::before { opacity: 1; transform: scale(1); }
.age-card__logo, .age-card__name, .age-card__range { position: relative; z-index: 1; }
.age-card__logo { display: block; height: 54px; width: auto; max-width: 100%; transition: filter .2s ease; }
.age-card:hover .age-card__logo { filter: brightness(0) invert(1); }
.age-card__name { display: block; font-weight: 900; font-size: 28px; transition: color .2s ease; }
.age-card__range { display: block; font-weight: 900; font-size: 15px; letter-spacing: .2px; transition: color .2s ease; }
.age-card:hover .age-card__name, .age-card:hover .age-card__range { color: #fff; }

/* ---------- Tint cards (light purple, and modifiers) ---------- */
.tint-card { background: var(--purple-tint); border-radius: 10px; padding: 24px 26px; }
.tint-card h3 { font-weight: 900; font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.tint-card p { font-size: 15.5px; line-height: 1.6; color: #444; }
.tint-card--flex { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.tint-card--flex .btn { margin-top: 0; flex: none; }
.tint-card--compact { padding: 20px 22px; }
.tint-card--compact h3 { font-size: 16px; color: var(--purple); margin-bottom: 6px; }
.tint-card--compact p { font-size: 14.5px; color: #555; }

/* ---------- Accent-top cards (white, coloured top border) ---------- */
.accent-top-card { border: 1px solid var(--border); border-top: 5px solid var(--accent); border-radius: 10px; padding: 20px 22px; }
.accent-top-card h3 { font-weight: 900; font-size: 19px; color: var(--ink); }
.accent-top-card__body { font-size: 14.5px; color: #555; margin-top: 8px; line-height: 1.7; }
.accent-top-card--thick { border-top-width: 6px; padding: 28px 30px; }
.accent-top-card__eyebrow { font-weight: 900; font-size: 15px; color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase; }
.accent-top-card__title { margin: 6px 0 14px; font-weight: 900; font-size: 30px; color: var(--ink); }
.accent-top-card__text { margin: 0 0 16px; font-size: 16px; line-height: 1.65; color: #555; }

/* ---------- Link cards (Info hub) ---------- */
.link-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 26px 28px;
  text-decoration: none; display: block; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.link-card:hover { border-color: var(--purple); box-shadow: 0 6px 18px rgba(116,19,220,.12); }
.link-card h2 { font-weight: 900; font-size: 22px; color: var(--ink); margin-bottom: 8px; }
.link-card p { font-size: 15px; color: #555; line-height: 1.6; }
.link-card .link-arrow { display: block; }

/* ---------- Step cards (Join) ---------- */
.step-card { border: 1px solid var(--border); border-radius: 10px; padding: 24px 26px; }
.step-card__number {
  width: 38px; height: 38px; border-radius: 50%; background: var(--purple); color: #fff;
  font-weight: 900; font-size: 18px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.step-card h3 { font-weight: 900; font-size: 19px; color: var(--ink); margin-bottom: 8px; }
.step-card p { font-size: 15px; color: #555; line-height: 1.6; }

/* ---------- Callouts & banners ---------- */
.callout { margin-top: 20px; background: var(--yellow-tint); border-radius: 10px; padding: 18px 24px; font-size: 15px; color: #333; }
.callout a { color: var(--purple); font-weight: 800; }
.banner-strip { border-radius: 10px; padding: 18px 24px; font-size: 15px; color: #333; background: var(--tint); }
.banner-strip a { font-weight: 800; color: var(--accent); }
.footnote { margin-top: 24px; background: var(--purple-tint); border-radius: 10px; padding: 14px 20px; font-size: 14.5px; color: #666; line-height: 1.6; }
.footnote a { color: var(--purple); font-weight: 700; }
.section-block { margin-top: 40px; }
.section-block--tight { margin-top: 20px; }

/* ---------- Maps ---------- */
.map { height: 200px; background: #eef0f3; }
.map--tall { height: 360px; }
.map-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.map-card__body { padding: 20px 24px 22px; }
.map-card__title { font-weight: 900; font-size: 21px; color: var(--ink); margin-bottom: 6px; }
.map-card__address { font-size: 14.5px; color: #666; line-height: 1.6; }
.map-card__body .link-arrow { font-size: 14px; }
.map-attribution { max-width: 1140px; margin: 14px auto 0; padding: 0 24px; font-size: 12.5px; color: #999; }
.leaflet-container { font-family: 'Nunito Sans', system-ui, sans-serif; }

/* ---------- Contact form ---------- */
.contact-form-card { display: flex; flex-direction: column; }
.contact-form { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; flex: 1; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.contact-form .label--message { flex: 1; margin-top: 8px; }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--ink);
}
.contact-form textarea { flex: 1; min-height: 160px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--purple); outline-offset: 1px; }
.contact-form button { align-self: flex-start; border: none; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 38px; }
  .page-header h1, .section-header h1 { font-size: 32px; }
  .section-header__inner, .page-header__inner { min-height: 190px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 8px 24px 20px; box-shadow: 0 10px 20px rgba(0,0,0,.12);
    border-bottom: 1px solid var(--border);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.pill-btn) {
    padding: 12px 0; border-bottom: 1px solid var(--border);
  }
  .site-nav a.is-active { border-bottom-color: var(--purple); }
  .site-nav a.pill-btn { margin-top: 14px; text-align: center; }
}
