/* ==========================================================================
   TY Centre — theme styles
   Tokens transcribed from Figma "TY Centre Website Redesign"
   ========================================================================== */

:root {
  /* Brand palette */
  --c-orange:        #c8560c;
  --c-orange-ink:    #f7f3ed;
  --c-teal:          #457086;
  --c-teal-deep:     #294653;
  --c-cream:         #f8f5ee;
  --c-mist:          #e8eff1;
  --c-mist-rule:     #dceaf0; /* Figma "Visit Us" divider */
  --c-field-rule:    #bfc6c8; /* Figma "Contact Us" form field border */
  --c-devotion-soft: #faefe7; /* Figma "Devotion Wing - Secondary" */
  /* Service, Ladies, Young Adults: 10% of the accent on white, matching the
     Devotion and Education tints. Not yet checked against Figma's own styles. */
  --c-service-soft:      #f0efe4; /* Figma "Service Wing - Secondary" */
  --c-ladies-soft:       #f6e9e7; /* Figma "Ladies Wing - Secondary" */
  --c-young-adults-soft: #faf1e5; /* Figma "Young Adults - Secondary" */
  --c-steel:         #829ca8;

  /* Ink */
  --c-ink:           #312822;
  --c-ink-warm:      #342b26;
  --c-ink-soft:      #342f2b;
  --c-muted:         #746f69;
  --c-white:         #ffffff;

  /* Wing accents */
  --c-wing-devotion:     #c8560c;
  --c-wing-education:    #457086;
  --c-wing-service:      #828a5c;
  --c-wing-ladies:       #b46860;
  --c-wing-young-adults: #d59a36;

  /* Type */
  --font-display: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  /* The Community Impact figures are set in Cormorant Infant in the design. */
  --font-display-alt: "Cormorant Infant", "Cormorant Garamond", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Scale — Figma text styles */
  --fs-h1: 64px;   --lh-h1: 1.1;
  --fs-h2: 40px;   --lh-h2: 1.15;
  --fs-h3: 28px;   --lh-h3: 1.2;
  --fs-h4: 20px;   --lh-h4: 1.3;
  --fs-quote: 32px; --lh-quote: 1.4;
  --fs-body: 16px; --lh-body: 1.7;
  --fs-small: 14px; --lh-small: 1.6;
  --fs-nav: 16px;  --lh-nav: 1.4;

  /* Layout */
  --container: 1180px;
  --gutter: 24px;
  --nav-h: 93px;

  /* Radii */
  --r-btn: 8px;
  --r-chip: 12px;
  --r-card: 16px;

  /* Spacing rhythm */
  --sp-8: 8px;   --sp-16: 16px; --sp-24: 24px; --sp-32: 32px;
  --sp-48: 48px; --sp-96: 96px;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
img { height: auto; }

a { color: var(--c-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); color: var(--c-ink); }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 24px; }

:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 2px; border-radius: 2px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--c-orange); color: #fff; padding: 12px 24px; border-radius: 0 0 var(--r-btn) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: min(var(--container), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.section { padding-block: var(--sp-96); }
.section--tight { padding-block: 64px; }
/* Landing V4: consecutive white sections share one 96px gap, not two. */
.section--flush-bottom { padding-bottom: 0; }
.section--calendar { padding-top: var(--sp-48); }
.section--band { background: var(--c-cream); }
.section--mist { background: var(--c-mist); }

/* Eyebrow — Figma "H4 Card" in accent */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: 600;
  color: var(--c-orange);
  margin: 0;
}
.eyebrow--teal { color: var(--c-teal); }

.h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 500; }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 500; }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }

.quote {
  font-family: var(--font-display);
  font-size: var(--fs-quote);
  line-height: var(--lh-quote);
  font-weight: 500;
  font-style: italic;
  color: var(--c-ink-warm);
}

.lede { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--c-ink); }
.text-justify { text-align: justify; }

/* Arrow link — "Learn More →" */
.arrow-link {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  color: var(--c-orange);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .18s ease;
}
.arrow-link:hover { text-decoration: none; gap: 12px; }
.arrow-link::after { content: "\2192"; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: 12px 24px;
  border-radius: var(--r-btn);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--c-orange); color: var(--c-orange-ink); }
.btn--primary:hover { background: #a8480a; }
.btn--outline { background: transparent; color: var(--c-orange); border-color: var(--c-orange); }
.btn--outline:hover { background: var(--c-orange); color: var(--c-orange-ink); }
.btn__icon { width: 23px; height: 16px; flex: none; }

/* --------------------------------------------------------------------------
   Site header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-white);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
}
.site-header__inner {
  width: min(1344px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
}
.site-brand { flex: none; }
.site-brand img { width: 184px; height: auto; }

.nav-primary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 56px;
}
.nav-primary a {
  font-size: var(--fs-nav);
  line-height: var(--lh-nav);
  font-weight: 500;
  color: var(--c-ink-warm);
  white-space: nowrap;
}
.nav-primary a:hover,
.nav-primary .current-menu-item > a { color: var(--c-orange); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background: var(--c-ink-warm);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--c-cream);
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0 0 0 auto;
  width: 56.25%; /* 810 / 1440 */
  z-index: 0;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__inner { position: relative; z-index: 1; }
.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-32);
  max-width: 427px;
  padding-block: var(--sp-96);
}
.hero__title { color: var(--c-ink-warm); }

/* Home hero — Figma "Landing Page V5 Hero Idea 1": a full-width panorama
   (1440x524, bottom edge kept) over a cream panel with everything centred. */
.home-hero__media { display: block; }
.home-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 524;
  object-fit: cover;
  object-position: center bottom;
}
.home-hero__panel { background: var(--c-cream); padding-block: var(--sp-48); }
.home-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home-hero__kicker {
  font-size: calc(var(--fs-h4) + 1px); /* review feedback: 1px over the H4 size */
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--c-muted);
}
.home-hero__title { margin-top: 12px; color: var(--c-ink-warm); }
.home-hero__actions {
  margin-top: var(--sp-24);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-24);
}
.home-hero__actions .btn { flex: none; white-space: nowrap; }

/* Wing hero variant — solid accent panel, light type */
.hero--wing { background: var(--c-teal); }
.hero--wing .hero__media { width: 49.31%; } /* left edge at 50.69% */
.hero--wing .hero__content { max-width: 580px; gap: var(--sp-16); }
.hero--wing .hero__title,
.hero--wing .hero__quote { color: var(--c-white); }
.hero__badge { width: 48px; height: auto; }
.hero__badge img { width: 48px; }
.hero--wing .hero__quote { margin-top: 0; }

/* --------------------------------------------------------------------------
   Visit Us / Upcoming Events
   -------------------------------------------------------------------------- */
.visit {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 40px var(--gutter);
  align-items: start;
}
.visit__col { display: flex; flex-direction: column; gap: var(--sp-24); }
.visit__block { display: flex; flex-direction: column; gap: var(--sp-16); }
.visit__block h2 { color: var(--c-ink); }
.visit__block p { color: var(--c-ink); }
.visit__block .eyebrow--teal { color: var(--c-teal); } /* "Get in touch"; the rule above was winning */
.visit .contact-list { margin-top: 0; } /* home only: the block's 16px gap is the whole space */

/* A 280px divider sits 32px under Location, with "Get in touch" 16px below it. */
.contact-block { position: relative; margin-top: var(--sp-8); padding-top: var(--sp-16); }
.contact-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(280px, 100%);
  border-top: 1px solid var(--c-mist-rule);
}
.contact-list { list-style: none; margin: var(--sp-16) 0 0; padding: 0; }
.contact-list li { display: flex; align-items: center; gap: var(--sp-16); }
.contact-list a { color: var(--c-ink-soft); }
.contact-list a:hover { color: var(--c-orange); }
.contact-list__icon { width: 17px; height: 17px; flex: none; color: var(--c-steel); }

.events { display: flex; flex-direction: column; gap: var(--sp-24); }
.events__viewport { overflow: hidden; border-radius: var(--r-card); }
.events__track {
  display: flex;
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}
.events__slide { flex: 0 0 100%; }
.events__slide img,
.events__placeholder {
  width: 100%;
  aspect-ratio: 680 / 388;
  object-fit: cover;
  border-radius: var(--r-card);
  background: var(--c-mist);
}
.events__caption {
  margin-top: var(--sp-16);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
}
.events__arrows { display: flex; gap: 12px; justify-content: center; }
.events__arrow {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 1.5px solid rgba(49, 40, 34, .25); border-radius: 50%;
  background: transparent; color: var(--c-ink); cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.events__arrow:hover { background: var(--c-orange); border-color: var(--c-orange); color: #fff; }

/* --------------------------------------------------------------------------
   Centre Wings cards
   -------------------------------------------------------------------------- */
.wings__head { display: flex; flex-direction: column; gap: var(--sp-24); margin-bottom: var(--sp-32); }
.wings__grid {
  display: grid;
  /* The last tile (Young Adults) is 9px wider so its title stays on one line. */
  grid-template-columns: repeat(4, minmax(0, 211fr)) minmax(0, 220fr);
  gap: 29px;
}
.wing-card {
  background: var(--c-cream);
  border-radius: var(--r-card);
  padding: var(--sp-24) var(--sp-32);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-24);
  text-align: center;
  /* Fill the grid track so every card is the same height. */
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease;
}
.wing-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(49, 40, 34, .1); }
.wing-card__icon { width: 100px; height: 100px; flex: none; }
.wing-card__icon img { width: 100px; height: 100px; }
.wing-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
  width: 100%;
  /* Take up the leftover height so the link can sit against the bottom. */
  flex: 1;
}
.wing-card__title { color: var(--c-ink); }
.wing-card__text { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--c-ink); }
.wing-card .arrow-link {
  color: var(--wing-accent, var(--c-orange));
  justify-content: center;
  /* Pin to the bottom, so the links line up across cards of unequal copy. */
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Split (About Us / New Members / How to Get Involved)
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 120px;
  align-items: center;
}
.split--reverse { grid-template-columns: 480px 1fr; }
.split--reverse .split__media { order: -1; }
.split__body { display: flex; flex-direction: column; gap: var(--sp-24); align-items: flex-start; }
.split__media img,
.split__placeholder {
  width: 100%;
  aspect-ratio: 480 / 283;
  object-fit: cover;
  border-radius: var(--r-card);
  background: var(--c-mist);
}
.split--tall .split__media img,
.split--tall .split__placeholder { aspect-ratio: 480 / 617; }
.split--square .split__media img,
.split--square .split__placeholder { aspect-ratio: 1 / 1; }
/* About Us: text and a taller photo share a top edge. */
.split--about { align-items: start; }
.split--about .split__media img,
.split--about .split__placeholder { aspect-ratio: 480 / 447; border-radius: var(--r-chip); }
.split--members .split__media img,
.split--members .split__placeholder { aspect-ratio: 480 / 295; }
.about__text { color: var(--c-ink); }
.about__text p + p { margin-top: 1.7em; } /* one blank line, as in the design */

/* --------------------------------------------------------------------------
   Stay Connected
   -------------------------------------------------------------------------- */
.connect__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: var(--sp-24);
}
.connect-card {
  background: var(--c-mist);
  border-radius: var(--r-card);
  padding: 42px 52px;
  display: flex;
  gap: var(--sp-32);
  align-items: flex-start;
}
.connect-card__icon { flex: none; }
.connect-card__icon img { width: 64px; height: auto; }
.connect-card__body { display: flex; flex-direction: column; gap: var(--sp-24); }
.connect-card__title { color: var(--c-ink-warm); }
.connect-card .arrow-link { color: var(--c-teal); }

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */
.calendar__head { display: flex; flex-direction: column; gap: var(--sp-24); margin-bottom: var(--sp-32); }
.calendar__frame { border-radius: var(--r-card); overflow: hidden; }
.calendar__frame img { width: 100%; }
.calendar__frame iframe { width: 100%; min-height: 700px; border: 0; display: block; }

/* --------------------------------------------------------------------------
   Wing page — quote band, role cards, aims, technique chips
   -------------------------------------------------------------------------- */
.quote-band { background: var(--c-mist); padding-block: 110px; }
.quote-band p { margin: 0; }

.roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: var(--sp-48);
}
.role-card {
  background: var(--c-teal);
  color: var(--c-white);
  border-radius: var(--r-card);
  padding: var(--sp-32) var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}
.role-card__title { color: var(--c-white); }
.role-card__title u { text-decoration: underline; text-underline-position: from-font; }
.role-card ul { margin: 0; padding-left: var(--sp-24); }
.role-card li + li { margin-top: var(--sp-8); }

.aims {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 122px;
  row-gap: var(--sp-32);
  margin-top: var(--sp-24);
  list-style: none;
  padding: 0;
  counter-reset: aim;
}
.aims li {
  counter-increment: aim;
  display: grid;
  grid-template-columns: 43px 1fr;
  align-items: start;
}
.aims li::before {
  content: counter(aim) ".";
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
  color: var(--c-muted);
}

.techniques {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-32);
  margin-block: var(--sp-48);
}
.technique {
  background: var(--c-teal);
  color: var(--c-white);
  border-radius: var(--r-chip);
  min-height: 134px;
  padding: var(--sp-16) var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
}

.programs { display: flex; flex-direction: column; gap: var(--sp-32); margin-top: var(--sp-24); }
.program { display: flex; flex-direction: column; gap: var(--sp-16); }
.program h3 { color: var(--c-ink-warm); }

/* Event and post images (single.php) are often flyers with text to the edge, so they are
   shown whole: uncropped (the full size, not the ty-hero crop), centred, no wider than the
   container and no taller than most of the screen. */
.banner-image { margin-block: var(--sp-96); display: flex; justify-content: center; }
.banner-image img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 85vh;
  border-radius: var(--r-card);
}
.banner-image .split__placeholder {
  width: 100%;
  aspect-ratio: 1180 / 480;
  object-fit: cover;
  border-radius: var(--r-card);
}

.prose { display: flex; flex-direction: column; gap: var(--sp-24); color: var(--c-ink-warm); }
.prose p { margin: 0; }
.prose strong { font-weight: 700; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--c-teal-deep);
  color: var(--c-white);
  padding-block: 68px 32px;
}
.site-footer a { color: var(--c-white); }
.site-footer a:hover { color: var(--c-white); text-decoration: underline; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1.1fr;
  gap: 40px var(--gutter);
}
.footer__title { font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1; color: var(--c-white); }
.footer__col { display: flex; flex-direction: column; gap: var(--sp-16); }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-8); }
.footer__col li, .footer__col p { font-size: var(--fs-small); line-height: var(--lh-small); }
.footer__brand { font-size: 16px; font-weight: 600; line-height: var(--lh-small); max-width: 194px; }
.footer__stack { display: flex; flex-direction: column; gap: 32px; }
.social { display: flex; gap: var(--sp-8); align-items: center; }
.social a { display: block; width: 24px; height: 24px; }
.social img { width: 24px; height: 24px; }
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .25);
  margin-top: 48px;
  padding-top: var(--sp-24);
  text-align: center;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

/* --------------------------------------------------------------------------
   Editor / fallback content
   -------------------------------------------------------------------------- */
.entry-content { display: flex; flex-direction: column; gap: var(--sp-24); }
.entry-content h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 500; }
.entry-content h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
.entry-content img { border-radius: var(--r-card); }
.post-list { display: grid; gap: var(--sp-32); list-style: none; padding: 0; margin: 0; }
.post-card { display: flex; flex-direction: column; gap: var(--sp-8); }
.post-card__meta { font-size: var(--fs-small); color: var(--c-muted); }
.pagination { display: flex; gap: var(--sp-8); margin-top: var(--sp-48); }
.pagination .page-numbers {
  padding: 8px 14px; border-radius: var(--r-btn);
  background: var(--c-cream); color: var(--c-ink);
}
.pagination .page-numbers.current { background: var(--c-orange); color: #fff; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  :root { --fs-h1: 52px; --fs-h2: 34px; --fs-quote: 26px; --sp-96: 64px; }
  .wings__grid { grid-template-columns: repeat(3, 1fr); }
  .techniques { grid-template-columns: repeat(3, 1fr); }
  .split, .split--reverse { grid-template-columns: 1fr; gap: var(--sp-48); }
  .split--reverse .split__media { order: 0; }
  .visit { grid-template-columns: 1fr; }
  .aims { column-gap: var(--sp-48); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  :root { --fs-h1: 40px; --fs-h2: 30px; --fs-h3: 24px; --fs-quote: 22px; --fs-h4: 18px; }

  .nav-toggle { display: flex; }
  .site-header__inner { flex-wrap: wrap; }
  .nav-primary {
    display: none;
    flex-basis: 100%;
    order: 3;
    padding-bottom: var(--sp-24);
  }
  .nav-primary.is-open { display: block; }
  .nav-primary ul { flex-direction: column; align-items: flex-start; gap: var(--sp-16); }
  .header-cta { display: none; }
  .nav-primary.is-open + .header-cta,
  .site-header__inner .nav-primary.is-open ~ .header-cta { display: inline-flex; }

  /* The panorama would be a sliver at phone width; give it some height. */
  .home-hero__media img { min-height: 220px; }
  /* The media leaves the absolute flow here, so the hero must stack. */
  .hero { min-height: 0; flex-direction: column; align-items: stretch; }
  .hero__media { position: static; width: 100%; height: 260px; order: -1; }
  .hero__media img { width: 100%; height: 260px; }
  .hero--wing .hero__media { width: 100%; }
  .hero__content { max-width: none; padding-block: var(--sp-48); }

  .wings__grid { grid-template-columns: repeat(2, 1fr); }
  .connect__grid { grid-template-columns: 1fr; }
  .connect-card { padding: var(--sp-32) var(--sp-24); flex-direction: column; }
  .roles { grid-template-columns: 1fr; }
  .techniques { grid-template-columns: repeat(2, 1fr); }
  .aims { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .quote-band { padding-block: var(--sp-48); }
  .text-justify { text-align: left; }
}

@media (max-width: 520px) {
  .wings__grid { grid-template-columns: 1fr; }
  .techniques { grid-template-columns: 1fr; }
  /* Review feedback: the two buttons stack, full width and equal. */
  .home-hero__actions { flex-direction: column; align-self: stretch; }
  .home-hero__actions .btn { width: 100%; }
}

/* Tablet and phone hero crops (ty_hero_image_sources) are shown whole, at
   their own shape, so the statues at either end stay in. Same breakpoints as
   the <source> media queries. */
@media (max-width: 1023px) {
  .home-hero__media--tablet img { aspect-ratio: auto; height: auto; min-height: 0; }
}
@media (max-width: 600px) {
  .home-hero__media--mobile img { aspect-ratio: auto; height: auto; min-height: 0; }
}

/* --------------------------------------------------------------------------
   Back to Top (footer.php, main.js): no Figma for it. A circle in the footer's
   colours (teal-deep, white line work), so it reads as part of the footer and
   blends into it at the bottom of the page. It fades in once the first screen
   has scrolled away, sits at 70% until hovered or focused, then shows its label.
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: var(--sp-24);
  bottom: var(--sp-48);
  z-index: 90; /* under the header (100) and its menu */
  color: var(--c-white);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.back-to-top:hover { text-decoration: none; }
.back-to-top.is-visible { opacity: .7; visibility: visible; transition: opacity .3s ease; }
.back-to-top.is-visible:is(:hover, :focus-visible) { opacity: 1; }
.back-to-top:focus-visible { outline: none; }
.back-to-top__circle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--c-teal-deep);
}
.back-to-top:focus-visible .back-to-top__circle { outline: 3px solid var(--c-orange); outline-offset: 2px; }
/* The label hangs below the circle, so it never moves the button. It stays in the
   accessibility tree (it is the link's name) and is only hidden visually. */
.back-to-top__label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  translate: -50% 0;
  padding: 2px var(--sp-8);
  border-radius: var(--r-btn);
  background: var(--c-teal-deep);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .18s ease;
}
.back-to-top:is(:hover, :focus-visible) .back-to-top__label { opacity: 1; }
@media (max-width: 600px) {
  .back-to-top { right: var(--sp-16); bottom: var(--sp-32); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   Imported page-builder content (see inc/shortcodes.php)
   -------------------------------------------------------------------------- */
.vc-row { display: flex; flex-direction: column; gap: var(--sp-24); }
.vc-row--inner { gap: var(--sp-16); }
.vc-row--cols-2, .vc-row--cols-3, .vc-row--cols-4 { display: grid; gap: var(--sp-32); }
.vc-row--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vc-row--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vc-row--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vc-col { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-16); }

.vc-text > :is(p, ul, ol, blockquote, h1, h2, h3, h4) { margin: 0 0 var(--sp-16); }
.vc-text > :last-child { margin-bottom: 0; }
.vc-text h1, .vc-text h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 500; }
.vc-text h3, .vc-text h4 { font-family: var(--font-display); font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
.vc-text ul, .vc-text ol { padding-left: var(--sp-24); }
.vc-text li + li { margin-top: var(--sp-8); }
.vc-text blockquote {
  margin: 0; padding: var(--sp-24) var(--sp-32);
  background: var(--c-mist); border-radius: var(--r-card);
  font-family: var(--font-display); font-size: var(--fs-quote);
  line-height: var(--lh-quote); font-style: italic; color: var(--c-ink-warm);
}
.vc-text blockquote :is(h1,h2,h3,h4,p) { font: inherit; margin: 0; }
.vc-text img { border-radius: var(--r-card); }
.vc-text a { color: var(--c-teal); }

.vc-title { color: var(--c-ink-warm); }

.vc-sep { height: var(--sp-24); }
.vc-sep--small { height: var(--sp-16); }
.vc-sep--large { height: var(--sp-48); }
.vc-sep--huge { height: var(--sp-96); }
.vc-sep--line { height: 0; border-top: 1px solid rgba(49, 40, 34, .15); margin-block: var(--sp-24); }

.vc-figure { margin: 0; }
.vc-figure img { border-radius: var(--r-card); width: 100%; }

.vc-note {
  background: var(--c-cream); border-left: 4px solid var(--c-orange);
  border-radius: var(--r-btn); padding: var(--sp-24);
}

.vc-cta {
  background: var(--c-mist); border-radius: var(--r-card);
  padding: var(--sp-32); display: flex; flex-direction: column; gap: var(--sp-16);
}

.vc-iconbox {
  background: var(--c-cream); border-radius: var(--r-card);
  padding: var(--sp-32) var(--sp-24);
  display: flex; flex-direction: column; gap: var(--sp-16);
  height: 100%;
}
.vc-iconbox__icon img { width: 100%; max-width: 96px; height: auto; border-radius: 0; }
.vc-iconbox h3 { color: var(--c-ink-warm); }
.vc-iconbox h3 a { color: inherit; }
.vc-iconbox__body > :last-child { margin-bottom: 0; }

.vc-embed { border-radius: var(--r-card); overflow: hidden; }
.vc-embed iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; display: block; }

.vc-tabs { display: flex; flex-direction: column; gap: var(--sp-8); }
.vc-panel { background: var(--c-cream); border-radius: var(--r-btn); padding: var(--sp-16) var(--sp-24); }
.vc-panel summary {
  cursor: pointer; font-family: var(--font-display);
  font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600;
}
.vc-panel__body { padding-top: var(--sp-16); }

.vc-counter { display: flex; flex-direction: column; gap: var(--sp-8); }
.vc-counter__value { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1; font-weight: 600; color: var(--c-orange); }
.vc-counter__label { font-size: var(--fs-small); color: var(--c-muted); }

.vc-prog { display: flex; flex-direction: column; gap: var(--sp-8); }
.vc-prog__track { display: block; height: 8px; border-radius: 4px; background: var(--c-cream); overflow: hidden; }
.vc-prog__fill { display: block; height: 100%; background: var(--c-orange); }

@media (max-width: 860px) {
  .vc-row--cols-2, .vc-row--cols-3, .vc-row--cols-4 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Navigation dropdowns (imported menu has two sub-menus)
   -------------------------------------------------------------------------- */
.nav-primary li { position: relative; }
/* main.js turns a parent without an address into a button (.submenu-toggle). */
.nav-primary .submenu-toggle {
  font: inherit;
  font-size: var(--fs-nav);
  line-height: var(--lh-nav);
  font-weight: 500;
  color: var(--c-ink-warm);
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-primary .submenu-toggle:hover { color: var(--c-orange); }
.nav-primary .submenu-toggle--icon { width: 24px; height: 24px; margin-left: 2px; vertical-align: middle; }
.nav-primary .has-submenu > :is(a:not([href]), .submenu-toggle:not(.submenu-toggle--icon)) { display: inline-flex; align-items: center; gap: 6px; }
.nav-primary .submenu-toggle::after,
.nav-primary .has-submenu > a:not([href])::after {
  content: ""; width: 6px; height: 6px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.nav-primary .sub-menu {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  translate: -50% 0;
  min-width: 230px;
  width: max-content; /* as wide as the longest item, so none wraps */
  background: var(--c-white);
  border-radius: var(--r-card);
  box-shadow: 0 16px 40px rgba(41, 70, 83, .16);
  padding: var(--sp-16);
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 20;
}
/* Hover bridge so the pointer can travel into the panel. */
.nav-primary .has-submenu::after {
  content: ""; position: absolute; inset: 100% 0 auto; height: 20px;
}
.nav-primary .submenu-toggle--icon::after { display: inline-block; }
.nav-primary .submenu-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.nav-primary li:hover > .sub-menu,
.nav-primary li:focus-within > .sub-menu,
.nav-primary li.is-expanded > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-primary .sub-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-btn);
  font-size: 15px;
  white-space: nowrap;
}
.nav-primary .sub-menu a:hover { background: var(--c-cream); color: var(--c-orange); }

@media (max-width: 860px) {
  .nav-primary .sub-menu {
    position: static;
    translate: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--c-cream);
    padding: var(--sp-8);
    margin-top: var(--sp-8);
    min-width: 0;
    width: auto;
    display: none;
  }
  /* Closed until its parent is tapped (main.js); hover and focus don't open it here. */
  .nav-primary li.is-expanded > .sub-menu { display: flex; }
  .nav-primary .sub-menu a { white-space: normal; }
  .nav-primary .has-submenu::after { display: none; }
  .nav-primary > ul > li { width: 100%; }
}

/* Readable measure for imported long-form content. */
.entry-content.prose .vc-text > :is(p, ul, ol) { max-width: 74ch; }
.entry-content.prose .vc-row--cols-2 .vc-text > :is(p, ul, ol),
.entry-content.prose .vc-row--cols-3 .vc-text > :is(p, ul, ol),
.entry-content.prose .vc-row--cols-4 .vc-text > :is(p, ul, ol) { max-width: none; }
.entry-content.prose .vc-text blockquote { max-width: none; }
.entry-content.prose .vc-text h1,
.entry-content.prose .vc-text h2,
.entry-content.prose .vc-text h3,
.entry-content.prose .vc-text h4 { color: var(--c-ink-warm); }

/* Legacy heading levels mapped onto the design's type scale:
   h3 = section heading (accent eyebrow), h4 = sub-heading. */
.entry-content.prose .vc-text h3 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: 600;
  color: var(--c-orange);
  margin-top: var(--sp-16);
}
.entry-content.prose .vc-text h3:first-child { margin-top: 0; }
/* Calendar (page-calendar.php): its "Calendar of Events" eyebrow is the page's h1,
   and the intro line runs the full width (review). */
.page-calendar .entry-content.prose .vc-text h1 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: 600;
  color: var(--c-orange);
  margin: 0 0 var(--sp-16);
}
.page-calendar .entry-content.prose .vc-text > p { max-width: none; }
/* Without the page title, the empty legacy rows above the heading would show as a gap. */
.page-calendar .entry-content.prose .vc-row:has(> .vc-col:only-child:empty),
.page-calendar .entry-content.prose .vc-text > p:empty { display: none; }
.entry-content.prose .vc-text h4 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
  color: var(--c-ink-warm);
}
.entry-content.prose .vc-text blockquote :is(h1, h2, h3, h4) {
  font-family: var(--font-display);
  font-size: var(--fs-quote);
  line-height: var(--lh-quote);
  font-weight: 500;
  font-style: italic;
  color: var(--c-ink-warm);
  margin: 0;
}
/* Collapse the empty wrapper left behind by the stripped legacy hero row. */
.entry-content.prose > p:empty,
.entry-content.prose .vc-col:empty { display: none; }
.entry-content.prose .vc-row:first-child { margin-top: 0; }

/* --------------------------------------------------------------------------
   Imported embeds (Google Calendar, video) and Impreza responsive states
   -------------------------------------------------------------------------- */
/* Own class, deliberately not .vc-embed: that rule forces a 16/9 ratio and
   height:auto, which would collapse a fixed-height calendar to 150px. */
.ty-embed {
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--c-cream);
}
.ty-embed iframe {
  display: block;
  width: 100%;
  border: 0;
  aspect-ratio: auto;
  height: var(--ty-embed-h, 700px);
}

/* The calendar page ships a mobile (agenda) and a desktop (month) variant;
   these mirror the breakpoints the original content was authored against. */
@media (max-width: 767px) {
  .us-hide-mobiles { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .us-hide-tablets { display: none !important; }
}
@media (min-width: 1025px) and (max-width: 1280px) {
  .us-hide-laptops { display: none !important; }
}
@media (min-width: 1281px) {
  .us-hide-default { display: none !important; }
}

/* Front-page calendar section */
.calendar__frame iframe { min-height: 900px; }
@media (max-width: 860px) {
  .calendar__frame iframe { min-height: 620px; }
  .ty-embed iframe { height: min(var(--ty-embed-h, 700px), 620px); }
}

/* --------------------------------------------------------------------------
   Community Impact
   -------------------------------------------------------------------------- */
.impact__head { display: flex; flex-direction: column; gap: var(--sp-24); margin-bottom: var(--sp-32); }

.impact__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.impact-card {
  --impact-accent: var(--c-orange);
  background: var(--c-cream);
  border-radius: var(--r-card);
  padding: 33px var(--sp-32) var(--sp-32);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
}
/* Each card takes its own accent, as in the design: orange, olive, teal. */
.impact-card:nth-child(3n + 2) { --impact-accent: var(--c-wing-service); }
.impact-card:nth-child(3n)     { --impact-accent: var(--c-teal); }

/* The exported SVGs carry their own width/height; the row is fixed so the
   numbers below line up across cards whose icons differ in height. */
.impact-card__icon {
  height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--impact-accent);
}
.impact-card__icon svg { display: block; }
.impact-card__icon img { max-height: 48px; width: auto; }

.impact-card__body { display: flex; flex-direction: column; align-items: center; gap: var(--sp-16); width: 100%; }
.impact-card__stat { display: flex; flex-direction: column; align-items: center; color: var(--impact-accent); }

.impact-card__figure {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  color: var(--impact-accent);
  margin: 0;
}
.impact-card__number {
  font-family: var(--font-display-alt);
  font-size: 84px;
  line-height: 1.15;
  font-weight: 500;
}
.impact-card__unit {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
}
.impact-card__label {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-h4);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--impact-accent);
}
.impact-card__text {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-muted);
  max-width: 280px;
}

@media (max-width: 1100px) {
  .impact__grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-16); }
  .impact-card { padding: var(--sp-32) var(--sp-24); }
  .impact-card__number { font-size: 60px; }
}
@media (max-width: 860px) {
  .impact__grid { grid-template-columns: 1fr; }
  .impact-card { padding: var(--sp-32) var(--sp-24); }
  .impact-card__number { font-size: 64px; }
}

/* --------------------------------------------------------------------------
   Horizontal overflow fixes (pre-existing, found while verifying)
   -------------------------------------------------------------------------- */

/* A grid item defaults to min-width:auto, so the carousel's 3-slide track
   (3 x 100%) was setting the column's min-content width and pushing the page
   wider than the viewport. The viewport clips the track; the column must be
   allowed to shrink. */
.visit__col,
.events,
.events__viewport { min-width: 0; }

/* Between the desktop and mobile breakpoints the nav gap plus the CTA exceeded
   the header width by a few pixels. Tighten the gap before the burger appears. */
@media (max-width: 1200px) {
  .nav-primary ul { gap: 32px; }
}
@media (max-width: 1000px) {
  .nav-primary ul { gap: 20px; }
  .site-header__inner { gap: var(--sp-16); }
}
