/* 1st Radnage Scouts, site styles
   Follows the Scouts brand guidelines v3.3 (August 2026):
   - only the ten palette colours plus black, white and black tints (20/40/60/80%)
   - colour pairings from "What works well": white text on purple, teal, blue, navy and
     forest green; black text on green, orange, yellow and pink; never white on green/orange
   - Nunito Sans: Black for headlines, Extra Bold for the group name in the logo lock-up,
     Bold for calls to action, Regular for body text; no italics or capitalised words */

/* Nunito Sans, the Scouts brand typeface (SIL Open Font Licence, see assets/fonts/OFL.txt) */
@font-face { font-family: "Nunito Sans"; src: url("../assets/fonts/NunitoSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../assets/fonts/NunitoSans-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../assets/fonts/NunitoSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../assets/fonts/NunitoSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../assets/fonts/NunitoSans-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../assets/fonts/NunitoSans-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  /* Scouts palette (brand guidelines pages 22 to 25) */
  --purple: #7413dc;   /* core colour */
  --teal: #088486;     /* core colour */
  --red: #ed3f23;
  --pink: #ffb4e5;
  --green: #25b755;
  --navy: #003982;
  --blue: #006ddf;
  --yellow: #ffe627;
  --orange: #ff912a;
  --forest: #205b41;
  --black: #000000;
  --white: #ffffff;
  --black-80: #333333;
  --black-60: #666666;
  --black-20: #cccccc;

  /* Section colours: Beavers blue, Cubs green, Scouts forest green */
  --beavers: var(--blue);
  --cubs: var(--green);
  --scouts: var(--forest);

  /* Roles */
  --paper: var(--white);
  --text: var(--black-80);
  --heading: var(--black);
  --muted: var(--black-60);
  --line: var(--black-20);
  --hover: var(--navy);

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.375rem;
  --step-4: clamp(2.5rem, 5.5vw, 4.25rem);

  --measure: 66ch;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-lg: 1.5rem;
  --radius-sm: 0.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
}
h1, h2, h3 { color: var(--heading); }
img { max-width: 100%; display: block; }
a { color: var(--purple); text-underline-offset: 0.18em; }
a:hover { color: var(--hover); }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; box-shadow: 0 0 0 5px var(--white); border-radius: 4px; }

h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5em; font-weight: 900; letter-spacing: -0.015em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 800; letter-spacing: 0; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--muted); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--black); color: #fff; padding: 0.75rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Header ---------------------------------------------------------- */
.site-header { background: var(--purple); color: #fff; }
/* Logo lock-up: at least 40mm wide (about 151px) with clear space of one "u" (about 1.1rem) all round */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 6rem; padding-block: 1.1rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; color: #fff; text-decoration: none; font-weight: 900; font-size: 1.25rem; line-height: 1; }
.brand img { height: 3.6rem; width: auto; }

.brand small { display: block; font-weight: 600; font-size: 0.8rem; opacity: 0.85; margin-top: 0.2rem; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; font-weight: 700; padding: 0.5rem 0.75rem; border-radius: 999px; display: block; }
.nav a:hover { background: var(--navy); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--purple); }
.nav-toggle { display: none; background: none; border: 2px solid #fff; color: #fff; font: inherit; font-weight: 800; padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer; }

@media (max-width: 62rem) {
  .nav-toggle { display: block; }
  .nav { display: none; width: 100%; padding-bottom: 1rem; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .site-header .wrap { flex-wrap: wrap; }
}

/* Neckerchief stripe: the group's orange and green */
.stripe { height: 6px; background: linear-gradient(90deg, var(--green) 0 50%, var(--orange) 50% 100%); } /* group neckerchief colours, both from the palette */

/* Buttons --------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font: inherit; font-weight: 800; text-decoration: none; padding: 0.85rem 1.4rem; border-radius: 999px; border: 2px solid transparent; cursor: pointer; background: var(--purple); color: #fff; }
.btn:hover { background: var(--navy); color: #fff; }
.btn.alt { background: #fff; color: var(--purple); border-color: var(--purple); }
.btn.alt:hover { background: var(--purple); color: #fff; }
.btn.on-dark { background: #fff; color: var(--purple); }
.btn.on-dark:hover { background: var(--navy); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Hero ------------------------------------------------------------ */
.hero { background: var(--purple); color: #fff; position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); padding-block: clamp(3rem, 7vw, 5.5rem); align-items: center; position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 13ch; }
.hero .lede { color: #fff; }
.hero-photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--black-20); position: relative; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo figcaption { position: absolute; left: 1rem; bottom: 1rem; background: var(--black); color: #fff; font-size: var(--step--1); font-weight: 700; padding: 0.35rem 0.75rem; border-radius: 999px; }
.contours { position: absolute; inset: 0; z-index: 0; opacity: 0.25; pointer-events: none; }
@media (max-width: 52rem) { .hero .wrap { grid-template-columns: 1fr; } }

/* Page intro (inner pages) */
.page-intro { background: var(--purple); color: #fff; padding-block: clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.page-intro h1, .page-intro h2, .page-intro .lede, .page-intro a:not(.btn) { color: #fff; }
.page-intro .btn.alt { background: transparent; color: #fff; border-color: #fff; }
.page-intro .btn:not(.alt):not(.on-dark) { background: #fff; color: var(--purple); }
.page-intro .btn:not(.alt):not(.on-dark):hover { background: var(--navy); color: #fff; }
.page-intro h1 { font-size: var(--step-4); max-width: 18ch; }
.page-intro.beavers { background: var(--beavers); color: #fff; }
.page-intro.cubs { background: var(--cubs); color: var(--black); }
.page-intro.cubs h1, .page-intro.cubs p, .page-intro.cubs .lede, .page-intro.cubs a:not(.btn) { color: var(--black); }
.page-intro.scouts { background: var(--scouts); color: #fff; }

.page-intro .facts { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 1.5rem 0 0; padding: 0; list-style: none; font-weight: 800; }
.page-intro .facts li > span:first-child { display: block; font-weight: 600; font-size: var(--step--1); opacity: 0.85; }

/* Sections -------------------------------------------------------- */
.block { padding-block: clamp(3rem, 7vw, 5rem); }
.block.tint { background: var(--paper); border-top: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .two-col { grid-template-columns: 1fr; } }

/* "This week at the hut" — live from OSM */
.this-week { background: #fff; color: var(--text); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, 0.5); }
.this-week h2 { font-size: var(--step-1); margin-bottom: 0.25rem; }
.this-week > p { color: var(--muted); font-size: var(--step--1); margin-bottom: 1rem; }
.week-list { list-style: none; margin: 0; padding: 0; }
.week-item { padding: 0.9rem 0; border-top: 1px solid var(--grey-200, #ccc); }
.week-item:first-child { border-top: 0; padding-top: 0.25rem; }
.week-item:last-child { padding-bottom: 0; }
.week-item .sec-logo { display: block; height: 1.35rem; width: auto; margin-bottom: 0.45rem; }
.week-item strong { display: block; font-size: var(--step-0); }
.week-item .when { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
[data-section="beavers"] { --c: var(--beavers); }
[data-section="cubs"] { --c: var(--cubs); }
[data-section="scouts"] { --c: var(--scouts); }

/* Section chooser on the home page */
.sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2rem; }
@media (max-width: 52rem) { .sections { grid-template-columns: 1fr; } }
.section-tile { background: var(--c); color: #fff; border-radius: var(--radius-lg); padding: 1.75rem; text-decoration: none; display: flex; flex-direction: column; min-height: 15rem; }
.section-tile:hover { color: #fff; box-shadow: 0 0 0 4px var(--navy); }
.section-tile[data-section="cubs"], .section-tile[data-section="cubs"]:hover { color: var(--black); }
.section-tile h3 { font-size: var(--step-3); font-weight: 900; margin-bottom: 0.25rem; }
.section-tile .age { font-weight: 800; }
.section-tile p { margin-top: auto; margin-bottom: 0; font-weight: 600; }

/* Programme list (section pages) */
.programme { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 2px solid var(--line); }
.programme li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.programme .date { font-weight: 800; color: var(--black); }
.programme .date span { display: block; font-weight: 600; color: var(--muted); font-size: var(--step--1); }
.programme .title { font-weight: 800; }
.programme .notes { color: var(--muted); margin: 0.25rem 0 0; font-size: var(--step--1); }
.programme li.next { box-shadow: inset 4px 0 0 var(--c, var(--purple)); margin-inline: -1rem; padding-inline: 1rem; }
.programme li.event .title::after { content: "Event"; margin-left: 0.5rem; font-size: 0.75rem; font-weight: 800; background: var(--orange); color: var(--black); padding: 0.1rem 0.5rem; border-radius: 999px; vertical-align: middle; }
@media (max-width: 36rem) { .programme li { grid-template-columns: 1fr; gap: 0.25rem; } }
.status { color: var(--muted); }

/* Fact list */
.facts-list { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; }
.facts-list dt { font-weight: 800; }
.facts-list dd { margin: 0; }

/* Times table */
.times { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.times th, .times td { text-align: left; padding: 0.9rem 0.5rem; border-bottom: 1px solid var(--line); }
.times th { font-weight: 800; }
.times td:first-child { font-weight: 800; box-shadow: inset 4px 0 0 var(--c); padding-left: 1rem; }

.map { border: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); background: var(--black-20); }

.panel { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 2.25rem); }
.panel.purple { background: var(--purple); color: #fff; border-color: var(--purple); }
.panel.purple h2, .panel.purple h3, .panel.purple p { color: #fff; }
.panel.purple a:not(.btn) { color: #fff; }

/* Forms ----------------------------------------------------------- */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
@media (max-width: 36rem) { .choice { grid-template-columns: 1fr; } }
.choice label { display: block; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.25rem; cursor: pointer; font-weight: 800; }
.choice label span { display: block; font-weight: 600; color: var(--muted); font-size: var(--step--1); }
.choice input { position: absolute; opacity: 0; }
.choice input:checked + label { border-color: var(--purple); box-shadow: inset 0 0 0 2px var(--purple); }
.choice input:focus-visible + label { outline: 3px solid var(--black); outline-offset: 3px; }
form .field { margin-bottom: 1.25rem; max-width: 36rem; }
form label.lbl { display: block; font-weight: 800; margin-bottom: 0.35rem; }
form .hint { display: block; font-size: var(--step--1); color: var(--muted); margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; font: inherit; padding: 0.75rem 0.9rem; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); outline: 2px solid var(--purple); outline-offset: 0; }
textarea { min-height: 8rem; resize: vertical; }
.hp { position: absolute; left: -5000px; }
.form-msg { padding: 1rem 1.25rem; border-radius: var(--radius-sm); font-weight: 700; margin-top: 1rem; max-width: 36rem; }
.form-msg.ok { background: var(--paper); color: var(--black); border-left: 6px solid var(--green); }
.form-msg.err { background: var(--paper); color: var(--black); border-left: 6px solid var(--red); }
.consent { display: flex; gap: 0.6rem; align-items: flex-start; }
.consent input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; }

/* Donate ---------------------------------------------------------- */
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.way { border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; }
.way.main { border-color: var(--purple); }
.way p { flex: 1; }
.way .btn { align-self: flex-start; }
.way .pending { font-weight: 700; color: var(--muted); }
.impact { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.75rem; }
.impact li { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; align-items: baseline; }
.impact b { font-size: var(--step-2); font-weight: 900; color: var(--purple); }

/* Team ------------------------------------------------------------ */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.person { display: grid; grid-template-rows: auto 1fr; }

.avatar { width: 7rem; aspect-ratio: 1; border-radius: var(--radius-lg); background: var(--c, var(--purple)); color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 900; overflow: hidden; margin-bottom: 1rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { margin-bottom: 0.1rem; }
.person .person-role { font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.person p { font-size: var(--step--1); color: var(--muted); }
.person[data-section="group"] { --c: var(--purple); }
.person[data-section="trustee"] { --c: var(--navy); }
.person[data-section="cubs"] .avatar { color: var(--black); }
.person[data-section="helpers"] { --c: var(--teal); }
.team-group { margin-top: 2.5rem; }
.team-group .team { margin-top: 1rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.team-heading { font-size: var(--step-1); padding-bottom: 0.4rem; border-bottom: 3px solid var(--c, var(--purple)); display: inline-block; }
.team-group[data-section="group"] { --c: var(--purple); }
.team-group[data-section="helpers"] { --c: var(--teal); }
#team-trustees.team { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }

/* Footer ---------------------------------------------------------- */
.site-footer { background: var(--purple); color: #fff; padding-block: 3rem 2rem; font-size: var(--step--1); }
.site-footer .tag { font-weight: 900; font-size: var(--step-1); margin: 0 0 0.5rem; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
@media (max-width: 52rem) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: var(--step-0); color: #fff; font-weight: 800; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.site-footer .legal { border-top: 1px solid #fff; margin-top: 2rem; padding-top: 1.25rem; }

@media (prefers-reduced-motion: no-preference) {
  .this-week { animation: rise 600ms 150ms cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}

/* Photography ------------------------------------------------------ */
picture.photo { display: block; border-radius: var(--radius-lg); overflow: hidden; background: var(--black-20); }
picture.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-credit { font-size: 0.75rem; color: var(--muted); margin-top: 0.4rem; }

/* Home hero with photo and overlapping programme card */
.hero-media { position: relative; }
.hero-media picture.photo { aspect-ratio: 16 / 10; }
.hero-media .this-week { position: relative; margin: -3rem 2.5rem 0 -2.5rem; }
@media (max-width: 52rem) { .hero-media .this-week { margin: -3rem 1rem 0; } }

/* Section tiles with photos */
.section-tile { padding: 0; overflow: hidden; }
.section-tile picture { aspect-ratio: 3 / 2; display: block; }
.section-tile picture img { width: 100%; height: 100%; object-fit: cover; }
.section-tile .tile-body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; gap: 0.35rem; }
.section-tile .tile-body p { margin-top: auto; }
.section-tile img.logo { height: 2.6rem; width: auto; }

/* Section page intro: logo as heading, photo alongside */
.page-intro .intro-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.page-intro .intro-grid picture.photo { aspect-ratio: 4 / 3; }
.page-intro h1.logo-heading { margin-bottom: 1.25rem; }
.page-intro h1.logo-heading img { height: clamp(4rem, 9vw, 6.5rem); width: auto; }
@media (max-width: 52rem) { .page-intro .intro-grid { grid-template-columns: 1fr; } }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.badges li { width: 5.5rem; text-align: center; font-size: var(--step--1); font-weight: 700; line-height: 1.25; }
.badges img { width: 4.5rem; height: 4.5rem; object-fit: contain; margin: 0 auto 0.4rem; }

/* Donate QR */
.qr { display: grid; grid-template-columns: 9rem 1fr; gap: 1.25rem; align-items: center; margin-top: 1.25rem; }
.qr img { width: 9rem; height: 9rem; border-radius: var(--radius-sm); background: #fff; padding: 0.4rem; border: 2px solid var(--line); }
.qr p { font-size: var(--step--1); margin: 0; }
@media (max-width: 36rem) { .qr { grid-template-columns: 1fr; } }

/* Three-way choice on the contact form */
.choice.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 52rem) { .choice.three { grid-template-columns: 1fr; } }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 36rem; }
.field-row .field { margin-bottom: 1.25rem; }
input[type="date"], input[type="number"] { width: 100%; font: inherit; padding: 0.75rem 0.9rem; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); }

.checklist { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.5rem; }
.checklist li { padding-left: 1.75rem; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--green); box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px var(--green); }

/* Badges and awards block on section pages */
.top-award { display: grid; grid-template-columns: 8rem 1fr; gap: 1.5rem; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; margin: 1.5rem 0 2rem; max-width: 48rem; }
.top-award img { width: 8rem; height: auto; }
.top-award h3 { font-size: var(--step-2); font-weight: 900; }
.top-award p { margin: 0; }
.badge-groups { display: grid; gap: 2rem; }
.badge-groups h3 { margin-bottom: 0.25rem; }
.badge-groups > div > p { color: var(--muted); margin-bottom: 0; }
@media (max-width: 36rem) { .top-award { grid-template-columns: 5rem 1fr; } .top-award img { width: 5rem; } }

.volunteer-strip { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.volunteer-strip p { margin-bottom: 0; color: #fff; }

/* Volunteer page */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2rem; }
.role { border-radius: var(--radius-lg); overflow: hidden; background: #fff; border: 2px solid var(--line); display: flex; flex-direction: column; scroll-margin-top: 1rem; }
.role .role-head { background: var(--c, var(--purple)); color: #fff; padding: 1.25rem 1.5rem; min-height: 6rem; display: flex; flex-direction: column; justify-content: flex-end; }
.role .role-head img { height: 2.4rem; width: auto; align-self: flex-start; margin-bottom: 0.5rem; }
.role .role-head h3 { margin: 0; font-size: var(--step-1); }
.role .role-head > span { font-weight: 600; font-size: var(--step--1); opacity: 0.9; }
.role .role-body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.role .role-body p { font-size: var(--step--1); }
.role .role-body .btn { margin-top: auto; align-self: flex-start; }
.role[data-section="support"] { --c: var(--navy); }
.role[data-section="trustee"] { --c: var(--teal); }
.role[data-section="cubs"] .role-head, .role[data-section="occasional"] .role-head { color: var(--black); }
.role[data-section="occasional"] { --c: var(--orange); }
.role .role-head h3 { color: inherit; }
.role:target { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 1rem; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; align-items: start; }
.steps-list li::before { content: counter(s); width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 900; display: grid; place-items: center; }
.steps-list b { display: block; }

@media (max-width: 62rem) { .roles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 36rem) { .roles { grid-template-columns: 1fr; } }

/* Team cards on small screens: avatar beside the name (kept last so it wins over the base rules) */
@media (max-width: 36rem) {
  .team-group .team, #team-trustees.team { grid-template-columns: 1fr; gap: 1rem; }
  .person { grid-template-columns: 4.5rem 1fr; grid-template-rows: auto; gap: 1rem; align-items: center; }
  .avatar { width: 4.5rem; font-size: 1.4rem; border-radius: 1rem; margin-bottom: 0; }
}

/* Young Leaders and DofE */
.yl-panel { display: grid; grid-template-columns: 6rem 1fr; gap: 1.25rem; align-items: start; }
.yl-panel img { width: 6rem; height: auto; }
.dofe-mark { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; align-items: center; margin-top: 1.25rem; }
.dofe-mark img { width: 5rem; height: auto; }
.dofe-mark p { margin: 0; font-size: var(--step--1); color: var(--muted); }
@media (max-width: 36rem) { .yl-panel { grid-template-columns: 1fr; } .yl-panel img { width: 5rem; } }

/* Photos of our own group: small originals, so shown at roughly their natural size */
.gallery { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.75rem; }
.gallery li, .mosaic li { aspect-ratio: 3 / 4; border-radius: var(--radius-sm); overflow: hidden; background: var(--black-20); }
.gallery img, .mosaic img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 62rem) { .gallery { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 36rem) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.mosaic { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; max-width: 36rem; }
.gallery-block { border-top: 1px solid var(--line); }

/* Parents page */
.jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.jump a { color: #fff; font-weight: 700; text-decoration: none; border: 2px solid #fff; border-radius: 999px; padding: 0.4rem 0.9rem; }
.jump a:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.uniform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
@media (max-width: 52rem) { .uniform-grid { grid-template-columns: 1fr; } }
.uniform-card { border: 2px solid var(--line); border-top: 8px solid var(--c); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.uniform-card .checklist { margin: 0; flex: 1; }
.uniform-logo { height: 3.25rem; width: auto; align-self: flex-start; }
.parents-note { margin-top: 1.5rem; padding-left: 1rem; box-shadow: inset 4px 0 0 var(--purple); }
[id] { scroll-margin-top: 1rem; }
.gallery a.zoom, .gallery picture { display: block; width: 100%; height: 100%; }
.gallery a.zoom:hover img { transform: scale(1.04); }
.gallery img { transition: transform 200ms ease; }
@media (prefers-reduced-motion: reduce) { .gallery img { transition: none; } }
.mosaic picture { display: block; width: 100%; height: 100%; }
.mosaic { max-width: none; }

/* Copy-link buttons next to headings */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.heading-link { position: relative; display: inline-grid; place-items: center; vertical-align: middle; margin-left: 0.4rem; width: 1.9rem; height: 1.9rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: 0.45; cursor: pointer; }
.heading-link:hover, .heading-link:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.08); }
.panel.purple .heading-link:hover, .page-intro .heading-link:hover { background: rgba(255, 255, 255, 0.18); }
@media (hover: hover) { h2:not(:hover):not(:focus-within) > .heading-link, h3:not(:hover):not(:focus-within) > .heading-link { opacity: 0; } }
.heading-link .copied { position: absolute; left: 50%; bottom: calc(100% + 0.35rem); transform: translateX(-50%); white-space: nowrap; font-size: 0.8rem; font-weight: 700; letter-spacing: 0; background: var(--black); color: #fff; padding: 0.2rem 0.55rem; border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: opacity 150ms; }
.heading-link.is-copied { opacity: 1; }
.heading-link .copied { opacity: 0 !important; }
.heading-link.is-copied .copied { opacity: 1 !important; }
:target { scroll-margin-top: 1rem; }
h2:target, h3:target { animation: target-flash 1.6s ease-out; }
@keyframes target-flash { from { background: rgba(255, 145, 42, 0.35); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { h2:target, h3:target { animation: none; } }
/* Balance the three section logos in the "Coming up" card (their shapes differ, so equal heights look uneven). */
.week-item[data-section="beavers"] .sec-logo { height: 1.75rem; }
.week-item[data-section="cubs"] .sec-logo { height: 1.55rem; }
.week-item[data-section="scouts"] .sec-logo { height: 1.15rem; }

/* Photo viewer */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: transparent; color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.94); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 4.5rem 1.5rem; box-sizing: border-box; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); width: auto; height: auto; border-radius: var(--radius); object-fit: contain; }
.lightbox figcaption { margin-top: 0.85rem; text-align: center; max-width: 45rem; font-size: var(--step--1); }
.lightbox .lb-count { color: #ccc; white-space: nowrap; }
.lb-btn { position: absolute; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; width: 3rem; height: 3rem; border-radius: 999px; line-height: 0; cursor: pointer; display: grid; place-items: center; padding: 0; }
.lb-btn:hover { background: var(--purple); }
.lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-close { top: 0.75rem; right: 0.75rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 0.75rem; }
.lb-next { right: 0.75rem; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
@media (max-width: 40rem) {
  .lightbox figure { padding: 3.75rem 0.75rem 1rem; }
  .lb-prev, .lb-next { top: auto; bottom: 0.75rem; transform: none; }
  .lightbox img { max-height: calc(100vh - 10rem); }
  .lightbox figcaption { padding: 0 3.5rem; }
}
.panel.strip { margin-top: 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; flex-wrap: wrap; }
.panel.strip > div { flex: 1 1 28rem; }
.panel.strip p { margin-bottom: 0; }

/* Badges a meeting works towards */
.meeting-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.4rem; margin: 0.45rem 0 0; font-size: var(--step--1); }
.meeting-badges .mb-label { color: var(--muted); font-weight: 600; margin-right: 0.15rem; }
.meeting-badges .mb-chip { background: #f2e9fc; color: #3a0a6e; border-radius: 999px; padding: 0.15rem 0.65rem; font-weight: 700; }


/* OSM waiting list panel on the contact page */
#osm-join { margin-top: 1.5rem; }
#osm-join .btn { margin-top: 0.5rem; }

/* Page not found */
.not-found-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.not-found-links a { display: block; padding: 1rem 1.25rem; border: 2px solid #ccc; border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.not-found-links a:hover, .not-found-links a:focus-visible { border-color: var(--purple); }
