/* 181st Castaheany Ongar Scouts. Mobile first.
   Colours come from the group badge: black, red and yellow. */

@font-face {
  font-family: "Libre Franklin";
  src: url("/assets/fonts/libre-franklin-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #16110e; /* badge black (name kept so existing rules still work) */
  --red: #c40018;
  --red-dark: #96000f;
  --yellow: #ffe600;
  --text: #1c1f26;
  --text-soft: #565c68;
  --bg: #fff;
  --tint: #f5f2ec;
  --border: #e4e0d8;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(22, 17, 14, 0.14);
  --wrap: 68rem;
  --measure: 42rem;
  --font: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: #fff; color: var(--navy); padding: 0.75rem 1rem; font-weight: 700; border-radius: 8px; }
.skip-link:focus { top: 0.75rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.97); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.bar { max-width: var(--wrap); margin: 0 auto; padding: 0.5rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--navy); }
.brand img { width: 2.9rem; height: auto; }
.brand-name { font-weight: 800; font-size: 0.9rem; line-height: 1.15; letter-spacing: 0.06em; text-transform: uppercase; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem; }
.site-nav a { display: block; padding: 0.5rem 0.65rem; font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--text); border-radius: 8px; }
.site-nav a:hover { background: var(--tint); color: var(--navy); }
.site-nav a[aria-current="page"] { color: var(--red); box-shadow: inset 0 -3px 0 var(--red); border-radius: 8px 8px 0 0; }

/* ---------- Hero and banners ---------- */
.hero, .banner { position: relative; color: #fff; background: var(--navy); overflow: hidden; display: flex; align-items: flex-end; }
.hero { min-height: 28rem; height: 72svh; max-height: 46rem; }
.banner { min-height: 13rem; }
.hero > picture, .hero > img, .banner > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img, .banner > img { width: 100%; height: 100%; object-fit: cover; }
.hero img { object-position: 68% 62%; }
.banner > img { object-position: 50% 62%; }
.hero::after, .banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14,10,8,0.82) 0%, rgba(14,10,8,0.35) 55%, rgba(14,10,8,0.1) 100%); }
.hero-inner, .banner-inner { position: relative; z-index: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 2rem 1rem; }
.hero h1, .banner h1 { margin: 0; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.hero h1 { font-size: clamp(2.1rem, 7vw, 4rem); font-weight: 800; line-height: 1.05; letter-spacing: 0.01em; max-width: 16ch; }
.hero .tagline { margin: 0.75rem 0 1.5rem; font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 300; }
.banner h1 { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; }

.button { display: inline-block; padding: 0.8rem 1.5rem; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid transparent; transition: background 0.2s, color 0.2s; }
.button-primary { background: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); color: #fff; }
.button-ghost { border-color: #fff; color: #fff; margin-left: 0.5rem; }
.button-ghost:hover { background: #fff; color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.actions .button-ghost { margin-left: 0; }

/* ---------- Layout ---------- */
main { display: block; }
.section { padding: 3.5rem 1rem; }
.section-tint { background: var(--tint); }
.container { max-width: var(--wrap); margin: 0 auto; }
.measure { max-width: var(--measure); }
.eyebrow { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.section-tint .eyebrow, .cta-band .eyebrow { color: var(--red); }

h1, h2, h3 { line-height: 1.2; color: var(--navy); }
h1 { font-size: 2rem; font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; margin: 0 0 1rem; }
h3 { font-size: 1.4rem; font-weight: 800; margin: 0 0 0.5rem; }
p { margin: 0 0 1.1rem; }
.content-page { padding: 3rem 1rem 4rem; }
.content-page .container > * { max-width: var(--measure); }
.content-page .container > .form-embed { max-width: 48rem; }
.content-page .container > .gallery { max-width: none; }

/* ---------- Section cards ---------- */
.cards { display: grid; gap: 1.5rem; margin-top: 2rem; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card .age { align-self: flex-start; margin: 0 0 0.75rem; padding: 0.2rem 0.7rem; background: var(--yellow); color: var(--navy); border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; }
.meeting { margin: auto 0 0; padding: 0.9rem 1rem; background: var(--tint); border-left: 5px solid var(--red); border-radius: 0 10px 10px 0; font-weight: 700; font-size: 0.95rem; }
.meeting p { margin: 0; }
.meeting p + p { margin-top: 0.25rem; color: var(--red-dark); }

/* ---------- Photo strip ---------- */
.strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin: 1.75rem 0; }
.strip a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.strip a:hover img { transform: scale(1.05); }

.cta-band { background: var(--navy); color: #fff; text-align: center; padding: 3.5rem 1rem; }
.cta-band h2 { color: var(--yellow); }
.cta-band p { max-width: 36rem; margin: 0 auto 1.5rem; }

/* ---------- Gallery ---------- */
.gallery { columns: 2; column-gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.gallery li { break-inside: avoid; margin: 0 0 0.6rem; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--tint); cursor: zoom-in; }
.gallery img { width: 100%; height: auto; transition: transform 0.4s, opacity 0.2s; }
.gallery button:hover img { transform: scale(1.04); }

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; color: #fff; }
dialog.lightbox::backdrop { background: rgba(14, 10, 8, 0.94); }
.lb-inner { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 0.5rem 1rem; gap: 0.75rem; }
.lb-inner img { max-width: 100%; max-height: calc(100svh - 9rem); object-fit: contain; border-radius: 6px; }
.lb-caption { max-width: 48rem; text-align: center; font-size: 0.95rem; margin: 0; padding: 0 1rem; }
.lb-btn { position: absolute; background: rgba(255,255,255,0.14); color: #fff; border: 0; width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,0.3); }
.lb-close { top: 0.75rem; right: 0.75rem; }
.lb-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

.form-embed { min-height: 500px; }

/* ---------- Who we are + partner logos ---------- */
.who { display: grid; gap: 2rem; align-items: center; }
.who-logo { width: min(16rem, 70%); height: auto; margin: 0 auto; }
.partners { background: var(--tint); border-top: 1px solid var(--border); padding: 1.75rem 1rem; }
.partners .container { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem 3rem; }
.partners img { height: 4.5rem; width: auto; }
.partners a { display: block; border-radius: 8px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #e3dfd8; padding: 2.5rem 1rem; font-size: 0.9rem; }
.site-footer .container { display: grid; gap: 1rem; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 0.3rem; }
.site-footer .foot-name { font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--yellow); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

@media (min-width: 40em) {
  .who { grid-template-columns: 1fr auto; gap: 4rem; }
  .who-logo { width: 17rem; }
  .gallery { columns: 3; column-gap: 0.75rem; }
  .gallery li { margin-bottom: 0.75rem; }
  .strip { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .site-nav a { font-size: 1rem; padding: 0.6rem 0.9rem; }
  .brand-name { font-size: 1rem; }
  .site-footer .container { grid-template-columns: 1fr auto; align-items: end; }
  .banner { min-height: 16rem; }
}
@media (min-width: 64em) {
  .gallery { columns: 4; }
  .strip { grid-template-columns: repeat(6, 1fr); }
  .section { padding: 5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
