/* ==========================================================================
   PAGES: layouts specific to each page.
   Order: shared (bento, page head, CTA), home, about, programmes,
          projects, project detail, get involved, contact, partners, 404.
   ========================================================================== */

/* ---------- Shared: bento grid ----------
   Tiles may sit inside a display:contents hook (JS-rendered), so the span
   rules target descendants, not only direct children. */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
}
.bento > *, .bento > .contents > * { grid-column: span 12; }
@media (min-width: 40em) { .bento .col-3 { grid-column: span 6; } }
@media (min-width: 64em) {
  .bento .col-3 { grid-column: span 3; }
  .bento .col-4 { grid-column: span 4; }
  .bento .col-5 { grid-column: span 5; }
  .bento .col-6 { grid-column: span 6; }
  .bento .col-7 { grid-column: span 7; }
  .bento .col-8 { grid-column: span 8; }
}
.bento .col-12 { grid-column: span 12; }
.bento .tile { min-height: 18rem; }

/* ---------- Shared: dark page head (all inner pages) ---------- */
.page-head {
  padding: calc(var(--header-h) + var(--space-8)) 0 var(--space-8);
  background: var(--teal-800);
  color: var(--white);
}
.page-head .container { display: flex; flex-direction: column; gap: var(--space-5); }
.page-head .lead { color: var(--white); }
.page-head__back { display: inline-flex; align-items: center; align-self: flex-start; min-height: var(--touch); color: var(--gold); font-weight: 700; text-decoration: none; }

/* ---------- Shared: closing call to action ---------- */
.cta { background: var(--gold); color: var(--ink); padding-block: var(--space-8); }
.cta__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5) var(--space-7); }
.cta__title { max-width: 16ch; font-size: var(--fs-h1); font-weight: 800; line-height: 0.95; letter-spacing: var(--tracking-display); }

.main-pad { padding-block: var(--space-6) var(--section); }

/* ---------- Home: photo hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(34rem, 100svh, 60rem);
  color: var(--white);
  background: var(--teal-900);
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__media img, .hero__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hero__media.gl img { visibility: hidden; }   /* the WebGL canvas takes over */
.hero__media--weave { background: var(--weave-band) var(--teal-700); }
.hero__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(3 47 51 / 0.6) 0%, rgb(3 47 51 / 0.35) 30%, rgb(3 47 51 / 0.93) 85%); }
.hero__content { display: flex; flex-direction: column; gap: var(--space-5); padding-block: calc(var(--header-h) + var(--space-7)) var(--space-8); }
.hero__title { max-width: 14ch; }
.hero__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Home: centre tile, documented work strip ---------- */
.centre-tile { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-6); }
.centre-tile__rings { flex: 0 0 auto; width: min(14rem, 100%); }
.centre-tile__text { flex: 1 1 16rem; display: flex; flex-direction: column; gap: var(--space-3); }

.work { background: var(--teal-800); color: var(--white); padding-block: var(--section); }
.work__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.work__more { display: inline-flex; align-items: center; min-height: var(--touch); color: var(--gold); font-weight: 700; }
.strip {
  display: flex;
  gap: var(--space-5);
  padding: 0 var(--gutter) var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--gold) transparent;
}
.strip__card { flex: 0 0 min(32rem, 82vw); display: flex; flex-direction: column; gap: var(--space-3); text-decoration: none; scroll-snap-align: start; }
.strip__media { width: 100%; height: clamp(18rem, 32vw, 26rem); object-fit: cover; }
.strip__meta { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.strip__title { font-size: var(--fs-h3); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.strip .placeholder { height: clamp(18rem, 32vw, 26rem); color: var(--white); background: transparent; border-color: var(--white); }

/* ---------- About ---------- */
.leader { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.leader__photo { height: 100%; min-height: 24rem; max-height: 40rem; object-position: center 20%; }
.leader__name { font-size: var(--fs-h1); font-weight: 800; }
.leader__role { font-size: var(--fs-lead); font-weight: 600; color: var(--gold); }
@media (min-width: 64em) { .leader { grid-template-columns: 5fr 7fr; } }

/* ---------- Programmes ---------- */
.programmes { display: flex; flex-direction: column; gap: clamp(0.75rem, 1.6vw, 1.25rem); }
.programme { display: grid; gap: inherit; }
.programme__media { min-height: 18rem; border-radius: var(--radius-lg); overflow: hidden; background-size: 60px 60px; }
.programme__media img { width: 100%; height: 100%; min-height: 18rem; object-fit: cover; }
.programme__title { font-size: var(--fs-h2); font-weight: 800; line-height: 1; letter-spacing: var(--tracking-display); color: var(--heading); }
.programme__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: auto; }
.programme__links-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--heading); }
@media (min-width: 64em) {
  .programme { grid-template-columns: 5fr 7fr; }
  .programme:nth-child(even) { grid-template-columns: 7fr 5fr; }
  .programme:nth-child(even) .programme__media { order: 2; }
}

/* ---------- Projects list ---------- */
.project-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.75rem, 1.6vw, 1.25rem); margin-top: var(--space-5); }
.project { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); background: var(--white); border-radius: var(--radius-lg); text-decoration: none; transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.project__media { width: 100%; height: clamp(16rem, 28vw, 26rem); object-fit: cover; border-radius: var(--radius-md); }
.project .placeholder { height: clamp(16rem, 28vw, 26rem); }
.project__body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-4); }
.project__meta { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-700); }
.project__title { font-size: var(--fs-h3); color: var(--heading); }
.project__where { font-size: var(--fs-sm); font-weight: 600; }
.project--feature { grid-column: 1 / -1; }
.project-empty { grid-column: 1 / -1; padding: var(--space-6); text-align: center; }
@media (max-width: 63.99em) { .project-list { grid-template-columns: 1fr; } }
@media (min-width: 64em) {
  .project--feature { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .project--feature .project__media { height: 100%; min-height: 26rem; }
  .project--feature .project__title { font-size: var(--fs-h2); line-height: 1; letter-spacing: var(--tracking-display); }
  .project--feature:nth-child(even) .project__media { order: 2; }
}

/* ---------- Project detail ---------- */
.detail-hero { min-height: clamp(30rem, 78svh, 48rem); }
.detail-hero .hero__title { max-width: 22ch; font-size: clamp(2.2rem, 1rem + 4.4vw, 5rem); }
.facts { display: flex; flex-direction: column; gap: var(--space-5); }
.fact__label { display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-700); }
.fact__value { font-size: 1.35rem; font-weight: 600; line-height: 1.3; }
.gallery-title { margin-block: var(--space-7) var(--space-5); }
.gallery { columns: 3 17rem; column-gap: var(--space-4); }
.gallery__btn { display: block; width: 100%; margin: 0 0 var(--space-4); padding: 0; background: none; border: 0; break-inside: avoid; border-radius: var(--radius-md); overflow: hidden; }
.gallery__btn img { width: 100%; transition: transform 0.5s var(--ease); }
.gallery__btn:hover img { transform: scale(1.04); }
.next-project { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-7); padding: var(--space-6); text-decoration: none; background: var(--teal-800); color: var(--white); border-radius: var(--radius-lg); }
.next-project__title { font-size: var(--fs-h2); font-weight: 800; letter-spacing: var(--tracking-heading); }

/* ---------- Get involved ---------- */
.ways { display: grid; gap: clamp(0.75rem, 1.6vw, 1.25rem); }
.way .tile__body { justify-content: space-between; min-height: 15rem; }
.way__title { font-size: var(--fs-h2); font-weight: 800; line-height: 1; letter-spacing: var(--tracking-display); color: var(--heading); }
.way__action { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.newsletter { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5) var(--space-7); margin-top: var(--space-5); }
.newsletter__copy { flex: 1 1 22rem; display: flex; flex-direction: column; gap: var(--space-2); }
.newsletter__form { flex: 1 1 26rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.newsletter__form .field { flex: 1 1 14rem; }
@media (min-width: 48em) { .ways { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Contact ---------- */
.contact { display: grid; gap: clamp(0.75rem, 1.6vw, 1.25rem); align-items: start; }
.contact__form { display: flex; flex-direction: column; gap: var(--space-4); }
.contact__row { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.contact__side { display: flex; flex-direction: column; gap: clamp(0.75rem, 1.6vw, 1.25rem); }
.contact__item { display: flex; flex-direction: column; gap: var(--space-1); }
.contact__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.contact__value { display: inline-flex; align-items: center; min-height: var(--touch); font-size: clamp(0.95rem, 4.2vw, 1.35rem); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact__socials { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (min-width: 48em) { .contact__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .contact { grid-template-columns: 7fr 5fr; } }

/* ---------- Partners ---------- */
.partners { display: grid; gap: clamp(0.75rem, 1.6vw, 1.25rem); }
.partner__logo { width: 12.5rem; height: 5rem; padding: var(--space-2); font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.partner__logo-img { width: 12.5rem; height: 5rem; object-fit: contain; object-position: left; }
.partner__name { font-size: var(--fs-h3); line-height: 1.1; color: var(--heading); }
@media (min-width: 48em) { .partners { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 404 ---------- */
.not-found { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-5); }

/* ---------- Small shared layout utilities ---------- */
.statement--heading { color: var(--heading); }
.section-intro { display: flex; flex-direction: column; gap: var(--space-3); padding-block: var(--space-8) var(--space-5); }
.section-gap { margin-top: clamp(0.75rem, 1.6vw, 1.25rem); }
.become-partner { margin-top: clamp(0.75rem, 1.6vw, 1.25rem); gap: var(--space-5); }
.become-partner .display { max-width: 24ch; }
