/* ============================================================
   CHES design system — layer 3: page-specific section layout.
   Sections are appended here by the tasks that build them.
   ============================================================ */

/* ---------- hero carousel ---------- */

.hero { position: relative; }

.hero .carousel__track {
  height: clamp(320px, 46vw, 560px);
}

/* Slide 1 is the organisation's own banner, which has text baked into the image.
   It must never be cropped, so it is contained on white rather than covered. */
.hero__slide--banner { background: var(--white); }
.hero__slide--banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hero__slide--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Neutral black scrim, not blue-tinted — matches the lightbox/popup fix:
   any dark overlay stays neutral so it doesn't wash the photo blue. */
.hero__slide--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.48) 52%,
    rgba(0, 0, 0, 0.12) 100%
  );
}

.hero__caption {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
}
.hero__caption .container { max-width: var(--max-width); }
.hero__caption h1,
.hero__caption p {
  color: var(--white);
  max-width: 20ch;
  /* A light, single shadow as a legibility backstop — the lighter accent
     green now does most of the work, so this stays subtle rather than the
     heavy double-shadow that read as a muddy halo. */
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.hero__caption p { max-width: 46ch; font-size: 1.08rem; margin-bottom: 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

@media (max-width: 620px) {
  .hero .carousel__btn { display: none; }
  .hero__caption h1 { font-size: 1.75rem; }
}

/* ---------- impact strip ---------- */

.impact { padding-block: clamp(2.6rem, 5vw, 4rem); }
.impact__head { text-align: center; margin-bottom: 2.2rem; }
.impact__head .eyebrow { justify-content: center; }
.impact__head h2 { margin-bottom: 0.3rem; }

.impact__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
@media (max-width: 820px) { .impact__grid { grid-template-columns: repeat(2, 1fr); } }

.impact__stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.impact__stat span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.93rem;
  color: color-mix(in srgb, var(--white) 82%, black);
}

/* ---------- our work strip ---------- */

.work__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}
.work__head h2 { margin-bottom: 0.2rem; }
.work__nav { display: flex; gap: 0.5rem; flex: none; }
.work__nav button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.work__nav button:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

@media (max-width: 700px) {
  .work__head { flex-direction: column; align-items: flex-start; }
  .work__nav { display: none; }
}

/* ---------- what we do: icon-led cards, no photography ---------- */
/* Photos were the same nine images repeated across every section of the
   site. This section states the actual services instead, with a hand-drawn
   icon per category rather than a reused photograph. */

.cluster-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.8rem; }
@media (max-width: 1000px) { .cluster-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .cluster-grid { grid-template-columns: 1fr; } }

.wwd-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.wwd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }

.wwd-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy-tint);
  color: var(--navy);
  margin-bottom: 1rem;
}
.wwd-card--featured .wwd-icon { background: var(--green-tint); color: var(--green); }
.wwd-card--featured { border-top: 3px solid var(--green); }

.wwd-card h3 { margin-bottom: 0.4rem; font-size: 1.12rem; }
.wwd-card p { font-size: 0.93rem; margin-bottom: 0.8rem; }

.wwd-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.wwd-list li {
  font-size: 0.87rem;
  color: var(--ink);
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.4rem;
}
.wwd-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.wwd-link { font-weight: 600; font-size: 0.9rem; color: var(--green-ink); }
.wwd-card:hover .wwd-link { color: var(--green-dark); text-decoration: underline; }

/* Reusable curved divider fill — the SVG path lives in the markup. */
.divider--cream svg { fill: var(--cream); }
.divider--white svg { fill: var(--white); }
.divider--navy  svg { fill: var(--navy); }

/* ---------- collage: every documented photo, one clean grid ---------- */

.collage-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.collage-photo img { width: 100%; }

/* ---------- our story ---------- */

.story__split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  margin-top: 3rem;
}
@media (max-width: 880px) { .story__split { grid-template-columns: 1fr; } }

/* Gives the two columns visual weight instead of floating as bare text on
   the page background. The accent variant carries a green top edge so the
   two panels read as distinct, not a repeat of the same block. */
.story__panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.story__panel--accent { border-top: 4px solid var(--green); }

/* Panels turn to face the reader as they enter view — a small rotation on the
   X axis, not a spin. Perspective lives on the parent so both panels share a
   single vanishing point and tilt as a pair rather than independently. */
.story__split { perspective: 1400px; }
.story__panel.reveal {
  opacity: 0;
  transform: perspective(1400px) rotateX(7deg) translateY(26px);
  transform-origin: 50% 0%;
  transition: opacity 0.85s var(--ease-soft), transform 0.85s var(--ease-soft);
}
.story__panel.reveal.is-visible {
  opacity: 1;
  transform: perspective(1400px) rotateX(0) translateY(0);
}
.story__panel--accent.reveal { transition-delay: 0.12s; }

.timeline { position: relative; padding-left: 1.75rem; margin: 0; }
/* The container carries .reveal purely so the observer flips is-visible on it;
   the animation belongs to the entries, so cancel the container's own fade. */
.timeline.reveal { opacity: 1; transform: none; transition: none; }
/* Base rail, drawn faintly the whole height. */
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
/* Green progress rail that grows downward as the entries reveal, so the line
   appears to draw itself between the dots rather than being there already. */
.timeline::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  width: 2px;
  height: 0;
  background: var(--green);
  transition: height 1.9s var(--ease-soft);
}
.timeline.is-visible::after { height: calc(100% - 16px); }

.timeline__item { position: relative; padding-bottom: 1.5rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.55rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--green);
  /* dot pops in slightly after its text, so the eye follows down the rail */
  transform: scale(0);
  transition: transform 0.5s var(--ease-soft);
  transition-delay: inherit;
}
.timeline.is-visible .timeline__item::before { transform: scale(1); }

/* Entries fade up one after another. The stagger is wider than the site
   default so it reads as a sequence being walked down, not a group fade. */
.timeline[data-stagger] > .timeline__item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s var(--ease-soft), transform 0.65s var(--ease-soft);
  transition-delay: calc(var(--i, 0) * 260ms);
}
.timeline.is-visible > .timeline__item { opacity: 1; transform: none; }
.timeline.is-visible > .timeline__item::before {
  transition-delay: calc(var(--i, 0) * 260ms + 120ms);
}

/* The global reduced-motion block resets .reveal, but these animate their own
   children and pseudo-elements, so they need resetting explicitly. */
@media (prefers-reduced-motion: reduce) {
  .story__panel.reveal,
  .story__panel.reveal.is-visible { opacity: 1; transform: none; }
  .timeline > .timeline__item { opacity: 1; transform: none; }
  .timeline__item::before { transform: scale(1); }
  .timeline::after { height: calc(100% - 16px); }
}
.timeline__year {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  font-size: 1.02rem;
}
.timeline__item p { margin: 0.15rem 0 0; font-size: 0.96rem; }

.story__facts { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.story__facts li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.85rem;
  font-size: 0.98rem;
}
.story__facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--green);
}

/* ---------- partner ---------- */

.modes { margin-top: 2.2rem; }
.mode { display: flex; flex-direction: column; height: 100%; }
.mode__num {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--green);
  margin-bottom: 0.5rem;
}
.mode p:last-of-type { margin-bottom: 0; }

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 2.6rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }

.steps li {
  counter-increment: step;
  padding-top: 1.1rem;
  border-top: 3px solid var(--green);
  font-size: 0.97rem;
  color: var(--text-muted);
}
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.partner__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
  margin-top: 3rem;
}
@media (max-width: 880px) { .partner__split { grid-template-columns: 1fr; } }

.compliance-line {
  background: var(--navy-tint);
  border-left: 3px solid var(--green);
  padding: 0.9rem 1.1rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.93rem;
  margin-top: 1.4rem;
}
.compliance-line p { margin: 0; }

/* Fills the empty column beside the contact block with something that does
   work — restating the three registrations a CSR reviewer checks for, rather
   than decorative filler on an otherwise evidence-led page. */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
@media (max-width: 520px) { .trust-badges { grid-template-columns: 1fr; } }

.trust-badge {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: center;
}
.trust-badge__figure {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--navy);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.trust-badge__label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section--alt .trust-badge { background: var(--cream); }

/* Full-width now that it's its own section rather than a split column —
   wider hit area per question, more room to breathe. */
.faq { max-width: 820px; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green-ink); font-size: 1.2rem; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0.7rem 0 0; font-size: 0.95rem; }

/* ---------- enquiry form ---------- */
/* A fully dark card rather than a white box with a dark header band — it
   needs to visually pop as the primary CTA of the section, not blend in
   with the surrounding white/cream page. */

.enquiry {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-90);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 96px;
}
@media (max-width: 880px) { .enquiry { position: static; } }

.enquiry__head { padding: 1.6rem 1.6rem 0.4rem; }
.enquiry__head h3 { color: var(--white); margin-bottom: 0.15rem; font-size: 1.2rem; }
.enquiry__head p {
  margin: 0;
  font-size: 0.88rem;
  color: color-mix(in srgb, var(--white) 76%, var(--navy));
}

.enquiry__body { padding: 1.6rem; }
.enquiry__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 520px) { .enquiry__row { grid-template-columns: 1fr; } }

/* Override the light-background form field styling for this dark card. */
.enquiry .form__group label { color: color-mix(in srgb, var(--white) 88%, var(--navy)); }
.enquiry .form__group input,
.enquiry .form__group select,
.enquiry .form__group textarea {
  background: color-mix(in srgb, var(--white) 12%, var(--navy-90));
  border-color: color-mix(in srgb, var(--white) 22%, var(--navy-90));
  color: var(--white);
}
.enquiry .form__group input::placeholder,
.enquiry .form__group textarea::placeholder { color: color-mix(in srgb, var(--white) 55%, var(--navy-90)); }
.enquiry .form__group select option { color: var(--navy); }
.enquiry .form__status { color: var(--white); }

.enquiry .btn { width: 100%; text-align: center; margin-top: 0.4rem; }
.enquiry__fine {
  font-size: 0.81rem;
  color: color-mix(in srgb, var(--white) 72%, var(--navy-90));
  margin: 0.9rem 0 0;
  line-height: 1.5;
}
.enquiry__fine a { color: color-mix(in srgb, var(--white) 88%, var(--navy-90)); text-decoration: underline; }
.form__status:empty { display: none; }

/* ---------- support / donations ---------- */

.support__inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 4vw, 3.2rem);
  align-items: start;
}
@media (max-width: 880px) { .support__inner { grid-template-columns: 1fr; } }

.support__box {
  background: color-mix(in srgb, var(--white) 8%, var(--navy));
  border: 1px solid color-mix(in srgb, var(--white) 18%, var(--navy));
  border-radius: var(--radius);
  padding: 1.5rem;
}
.support__box h3 { color: var(--white); font-size: 1.05rem; }
.support__box dl { margin: 0; font-size: 0.94rem; }
.support__box dt {
  color: color-mix(in srgb, var(--white) 62%, var(--navy));
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.8rem;
}
.support__box dd { margin: 0.1rem 0 0; color: var(--white); font-weight: 600; }

.support__note {
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--white) 68%, var(--navy));
  margin-top: 1.4rem;
}

/* ---------- subpage header (shared by every subpage) ---------- */

/* --navy-band, matching the utility bar and footer, rather than the heavier
   full-strength --navy. White text on it measures 4.63:1. */
.page-head { background: var(--navy-band); padding-block: clamp(2.6rem, 5vw, 4.2rem); }
.page-head h1 { color: var(--white); max-width: 24ch; }
.page-head p {
  color: color-mix(in srgb, var(--white) 90%, var(--navy-band));
  max-width: 62ch;
  margin-bottom: 0;
  font-size: 1.08rem;
}

.breadcrumb { font-size: 0.85rem; margin-bottom: 1rem; }
.breadcrumb a { color: var(--white); text-decoration: underline; }
.breadcrumb a:hover { color: color-mix(in srgb, var(--white) 80%, var(--navy-band)); }
.breadcrumb span { color: color-mix(in srgb, var(--white) 75%, var(--navy-band)); }

/* ---------- full photo gallery (/our-work) ---------- */

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure { margin: 0; }

/* ---------- programmes reference page (/programmes) ---------- */

/* top was 96px, calculated as if the utility bar stayed pinned above the
   header. It doesn't — it scrolls away, leaving the condensed header at
   ~54px and a 40px transparent gap that page content showed through.
   Pinning directly below the condensed header closes the gap. */
.prog-nav {
  position: sticky;
  top: 54px;
  z-index: 20;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding-block: 0.8rem;
}
.prog-nav .container { display: flex; gap: 1.4rem; overflow-x: auto; scrollbar-width: none; }
.prog-nav .container::-webkit-scrollbar { display: none; }
.prog-nav a {
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.prog-nav a:hover { color: var(--green-ink); border-bottom-color: var(--green); text-decoration: none; }

/* header (54px) + sticky prog-nav (~48px) + a little breathing room */
.prog { padding-block: clamp(2.6rem, 5vw, 4rem); scroll-margin-top: 112px; }
.prog + .prog { border-top: 1px solid var(--border); }

/* The dashed separator is gone — the boxed metadata panel now does the
   dividing work, so a rule as well would be redundant clutter. */
.prog__item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 2.2rem;
  align-items: start;
  padding: 1.5rem 0;
}
@media (max-width: 820px) { .prog__item { grid-template-columns: 1fr; gap: 0.9rem; } }
.prog__item h3 { margin-bottom: 0.4rem; }

/* Boxed panel, matching the .story__panel treatment on the homepage. */
.prog__meta {
  list-style: none;
  margin: 0;
  font-size: 0.93rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.prog__meta li { display: flex; gap: 0.7rem; padding-block: 0.42rem; }
.prog__meta li + li { border-top: 1px solid var(--border); }
.prog__meta li:first-child { padding-top: 0; }
.prog__meta li:last-child { padding-bottom: 0; }
.prog__meta b {
  flex: 0 0 8.5rem;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.15rem;
}
@media (max-width: 480px) {
  .prog__meta li { flex-direction: column; gap: 0.1rem; }
  .prog__meta b { flex: none; }
}
/* On white-backed sections the panel needs the opposite surface to separate. */
.section--alt .prog__meta { background: var(--cream); }

/* ---------- credentials page ---------- */

.cred-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.3rem; }
@media (max-width: 700px) { .cred-list { grid-template-columns: 1fr; } }

.cred {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.3rem 1.5rem;
}
.cred h3 { font-size: 1.08rem; margin-bottom: 0.3rem; }
.cred__value {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}
.cred p:last-child { margin-bottom: 0; font-size: 0.93rem; }

.doc-scan {
  margin-top: 2.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}
.doc-scan img { width: 100%; }
.doc-scan figcaption {
  padding: 0.9rem 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ---------- printable one-pager (/profile) ---------- */

.profile-doc { max-width: 780px; margin-inline: auto; }
.profile-doc h1 { font-size: 1.9rem; }
.profile-doc__row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.6rem 1.4rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.profile-doc__row b {
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.15rem;
}
@media (max-width: 620px) { .profile-doc__row { grid-template-columns: 1fr; gap: 0.1rem; } }

@media print {
  .utility-bar, .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  body { background: var(--white); font-size: 10.5pt; }
  .section { padding-block: 0; }
  .profile-doc { max-width: none; }
  a { color: var(--navy); text-decoration: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  @page { margin: 16mm; }
}
