/* ============ Header / Nav ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}

.site-header .logo img { height: 46px; width: auto; flex-shrink: 0; }

.nav-row {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-heading);
  white-space: nowrap;
  justify-content: center;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 4px;
}

.nav-item { position: relative; }

.nav-link {
  position: relative;
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--color-red);
  transition: right 0.2s ease;
}
.nav-link:hover::after { right: 0; }
.nav-link[aria-current="page"]::after { right: 0; }

.nav-caret { font-size: 10px; opacity: 0.6; }
/* A menu heading with no page of its own is a button; it looks like the
   links beside it. */
button.nav-link {
  background: none;
  border: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  transform: translateY(8px);
  background: #fff;
  box-shadow: var(--shadow-dropdown);
  border-radius: var(--radius-dropdown);
  padding: 10px;
  min-width: 230px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 80;
}
.nav-item:hover .nav-dropdown,
.nav-item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}
.nav-dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-heading);
}
.nav-dropdown a:hover { background: var(--tint-rose-hover); color: var(--color-red); }

.utility-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  justify-self: end;
}
.hamburger span { width: 22px; height: 2px; background: var(--color-text); border-radius: 2px; }

.mobile-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.12);
  padding: 8px 32px 20px;
  z-index: 70;
}
/* Menu entries only — the two buttons at the foot keep their own colours. */
.mobile-panel a:not(.btn) {
  padding: 13px 0;
  font-weight: 600;
  font-size: 15px;
  font-family: var(--font-heading);
  border-bottom: 1px solid #f2ecee;
  color: var(--color-red);
}
.mobile-panel.is-open { display: flex; }
.mobile-sub { padding-left: 14px; display: flex; flex-direction: column; }
/* Sub-items stay black and quieter than the red heading above them. The
   selector matches the specificity of the rule above, which the :not()
   raised — otherwise these inherit its size, weight and divider line. */
.mobile-panel .mobile-sub a { font-size: 13.5px; font-weight: 500; color: var(--color-text); padding: 10px 0; border-bottom: none; }
/* A <button> with no colour of its own is drawn in the system accent on iOS,
   which turned these headings blue on an iPhone. They are set explicitly. */
.mobile-toggle { padding: 13px 0; font-weight: 600; font-size: 15px; font-family: var(--font-heading); border-bottom: 1px solid #f2ecee; text-align: left; width: 100%; display: flex; justify-content: space-between; align-items: center; color: var(--color-red); background: none; border-left: 0; border-right: 0; border-top: 0; -webkit-appearance: none; appearance: none; }

.mobile-panel-ctas { display: none; }

@media (max-width: 980px) {
  .nav-row { display: none !important; }
  .hamburger { display: flex !important; }
  .site-header { grid-template-columns: auto 1fr auto; }
  .utility-row .btn { display: none; }
  /* The two calls to action close the panel rather than open it, so the rule
     sits above them instead of below. */
  .mobile-panel-ctas {
    display: flex;
    gap: 10px;
    padding: 18px 0 4px;
  }
  .mobile-panel-ctas .btn { flex: 1; }
}

/* ============ Page header (interior pages) ============ */
.page-hero {
  padding: 56px var(--side-padding) 48px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}
.breadcrumb {
  text-align: left;
  font-size: 13px;
  color: var(--color-text-mutest);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--color-text-mutest); }
.breadcrumb a:hover { color: var(--color-red); }
.page-hero h1 {
  font-weight: 700;
  font-size: 40px;
  color: var(--color-red);
  letter-spacing: -1px;
  margin-bottom: 14px;
}
.page-hero p {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 640px;
}

/* ============ Hero (Home) ============ */
.hero {
  position: relative;
  padding: clamp(20px, 6vw, 180px) 0 64px;
  background: #fff;
}
/* The watermark is 900px wide and the outer photo columns bleed 40px past the
   edge on purpose. Containing them here keeps that look without making the
   document wider than the screen, which on a phone leaves the whole page
   zoomed out. */
.hero { overflow: hidden; }

.hero-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  max-width: none;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}
.hero-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2.5vw, 36px);
  width: 100%;
  margin: 0 auto;
  padding: 0;
}
.hero-photos { display: flex; gap: 38px; flex-shrink: 0; }
.hero-photo-col { display: flex; flex-direction: column; gap: 22px; flex-shrink: 0; }
.hero-photo-col img { width: 100%; object-fit: cover; border-radius: 14px; flex-shrink: 0; }

@keyframes cicsFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.float-photo { animation: cicsFloat 4s ease-in-out infinite; box-shadow: var(--shadow-float); }
@media (prefers-reduced-motion: reduce) {
  .float-photo { animation: none; }
}

.hero-text { text-align: center; padding: 0 8px; flex-shrink: 0; width: 380px; }
.hero-text h1 {
  font-weight: 700;
  font-size: 44px;
  line-height: 1.1;
  color: var(--color-red);
  margin: 0 0 18px;
  letter-spacing: -1.5px;
}
.hero-text p {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 auto 26px;
  max-width: 400px;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: nowrap; }

/* The four photo columns are a fixed 860px plus gaps. Below about 1300px they
   no longer fit beside the text and were being sliced down the middle, so the
   hero drops to its text-only arrangement from there rather than at 980px. */
/* Below desktop width only the middle of the 900px watermark shows, and its
   tagline was cut to a fragment ("migrant and Comm", "ntre for Immigrant and
   Community Servi") that read as a mistake. Home and About both use it. */
@media (max-width: 980px) {
  .hero-watermark { display: none; }
}

@media (max-width: 1300px) {
  .hero-photos { display: none !important; }
  .hero-row { justify-content: center !important; }
  .hero-text { width: 100% !important; max-width: 520px !important; }
}

/* ============ Section headers ============ */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2 { font-weight: 700; font-size: 34px; letter-spacing: -1px; }
.section-title { font-weight: 700; font-size: 32px; letter-spacing: -1px; margin: 0 0 16px; }
.section-lede { font-size: 15.5px; color: var(--color-text-muted); line-height: 1.6; margin: 0 0 28px; max-width: 640px; }
/* A lede under a section header sits close to it, not a full gap below. */
.section-head + .section-lede { margin-top: -14px; }

/* ============ Help split (Home) ============ */
.help-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.help-split-left .section-title { margin-bottom: 12px; }
.help-split-left .section-lede { margin-bottom: 26px; }
.help-split-photo { border-radius: 20px; overflow: hidden; }
.help-split-photo img { width: 100%; height: 320px; object-fit: cover; display: block; }

.help-list { display: flex; flex-direction: column; gap: 12px; }
.help-row {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  padding: 18px 44px 18px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.help-row:hover { border-color: var(--color-red); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06); }
.help-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.help-row-body { flex: 1; min-width: 0; }
.help-row-title { font-weight: 700; font-family: var(--font-heading); font-size: 15.5px; padding-top: 9px; }
.help-row-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.3s ease;
}
.help-row:hover .help-row-detail { max-height: 180px; opacity: 1; margin-top: 8px; }
.help-row-detail p { font-size: 13px; color: var(--color-text-muted); line-height: 1.6; margin: 0 0 8px; }
.help-row-list { list-style: none; margin: 0 0 10px; padding: 0; }
.help-row-list li {
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.9;
  padding-left: 14px;
  position: relative;
}
.help-row-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-border-strong);
}
.help-row-cta { display: block; text-align: right; font-weight: 700; font-family: var(--font-heading); font-size: 12.5px; }
.help-row-arrow {
  position: absolute;
  top: 25px;
  right: 20px;
  color: var(--color-text-mutest);
  transition: transform 0.25s ease, color 0.2s ease;
}
.help-row:hover .help-row-arrow {
  color: var(--color-red);
  transform: rotate(90deg);
}

@media (max-width: 980px) {
  .help-split { grid-template-columns: 1fr; gap: 32px; }
  .help-split-photo img { height: 240px; }
}

/* ============ Program / service cards ============ */
/* Cards stretch to the tallest in their row, so a long description does not
   leave its neighbours standing short and the "Learn more" links line up. */
.program-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 28px; align-items: stretch; }
.program-card {
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding-bottom: 22px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}
.program-card:hover { box-shadow: inset 0 -6px 0 0 var(--color-red); }
/* The badge hangs 26px below this band, so the band always reserves its
   height — otherwise a card with no picture lets the badge ride up into
   the section heading above it. */
.program-card-media { position: relative; min-height: 120px; background: var(--tint-rose); border-radius: 16px 16px 0 0; }
.program-card-media img { width: 100%; height: 120px; object-fit: cover; border-radius: 16px 16px 0 0; }
.program-card-badge {
  position: absolute;
  left: 24px;
  bottom: -26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-red);
  /* The icon is drawn in currentColor, so the badge sets it: white on red. */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-badge);
}
.program-card-body { padding: 38px 24px 24px; flex: 1; display: flex; flex-direction: column; }

/* Inline-icon variant: no photo, no icon band — the icon sits in the title row
   so the card stays compact and the eye lands on the service name. */
.program-card-inline .program-card-body { padding: 26px 24px 24px; }
.program-card-inline h3 { display: flex; align-items: center; gap: 12px; }
.program-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tint-rose);
  color: var(--color-red);
}
.program-card-body h3 { font-weight: 700; font-size: 17px; line-height: 1.3; min-height: 2.6em; margin: 0; }
/* Descriptions stay visible: hover-to-reveal hid them from touch users entirely,
   and with the photos replaced by icon panels the cards read as empty without them. */
.program-card-detail { margin-top: 12px; flex: 1; display: flex; flex-direction: column; }
.program-card-body p { font-size: 13px; color: var(--color-text-muted); line-height: 1.6; margin: 0 0 14px; }
/* Pushed to the foot of the card, so every row of links sits on one line. */
.program-card-link { text-align: right; margin-top: auto; }
.program-card-link a { font-size: 13px; }

@media (max-width: 980px) { .program-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .program-grid { grid-template-columns: 1fr; } }

/* Home's nine services. In two columns the ninth card would sit alone with an
   empty cell beside it, so whichever card is left over takes the full row —
   still right if CICS adds or removes a service. */
@media (min-width: 641px) and (max-width: 980px) {
  #explore-programs .program-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* One column on a phone: the 48px row gap and the two-line title reserve
   were sized for a grid read across, and stacked nine deep they made this
   section about 2,700px of scrolling. */
@media (max-width: 640px) {
  #explore-programs .program-grid { gap: 16px; }
  #explore-programs .program-card { padding-bottom: 0; }
  #explore-programs .program-card-body { padding-bottom: 20px; }
  #explore-programs .program-card-body h3 { min-height: 0; }
}

/* ============ Welcome / about split ============ */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
}
.split-photos { position: relative; height: 420px; }
.split-photos img { position: absolute; border-radius: 18px; object-fit: cover; }

@media (max-width: 980px) {
  .split-section { grid-template-columns: 1fr; }
  .split-photos { height: 320px; margin-top: 24px; }
}

/* ============ Impact stats banner ============ */
.stats-banner {
  margin: 40px 0 52px;
  background: var(--color-red);
  color: #fff;
  padding: 52px var(--side-padding);
}
.stats-banner .stats-title { font-weight: 700; font-size: 26px; margin-bottom: 30px; }
.stats-banner .highlight { color: #f4b64a; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-num { font-weight: 700; font-size: 52px; color: #f4b64a; line-height: 1; }
.stat-label { font-size: 14px; color: #f5d2d6; margin-top: 4px; }

@media (max-width: 980px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stats-grid { grid-template-columns: 1fr; } }

/* ============ Story card ============ */
.story-card {
  background: #f4f1ea;
  border-radius: 20px;
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.story-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: repeating-linear-gradient(45deg, #e8e2dc, #e8e2dc 6px, #efe9e3 6px, #efe9e3 12px);
  flex-shrink: 0;
}
.story-quote { font-family: var(--font-heading); font-size: 19px; line-height: 1.5; margin: 0 0 14px; }
@media (max-width: 640px) { .story-card { flex-direction: column; align-items: flex-start; } }

/* ============ Event cards ============ */
.event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.event-card { border-radius: 20px; overflow: hidden; border: 1.5px solid var(--color-border); background: #fff; }
.event-card img { height: 150px; width: 100%; object-fit: cover; }
.event-card-body { padding: 18px; }
.event-tag { font-size: 12px; font-weight: 700; color: var(--color-red); background: var(--tint-rose-hover); padding: 5px 11px; border-radius: 20px; }
.event-card-body h3 { font-weight: 700; font-size: 18px; margin: 11px 0 4px; }
.event-card-body p { font-size: 13px; color: var(--color-text-faint); }

/* Three stays three down to tablet width: the cards are short, and two to a
   row left the third standing alone under the first. */
@media (max-width: 640px) { .event-grid { grid-template-columns: 1fr; } }
@media (min-width: 641px) and (max-width: 980px) {
  .event-grid { gap: 16px; }
  .event-card img { height: 120px; }
  .event-card-body { padding: 14px; }
  .event-card-body h3 { font-size: 16px; }
}

/* The gold button. Three page stylesheets already restyle it for their own
   banner; this is the default everywhere else, so a gold button does not
   depend on which page it happens to sit on. */
.btn-gold { background: #f4b64a; color: var(--color-text); }
.btn-gold:hover { background: #eaa930; }

/* ============ CTA banner ============ */
.cta-banner {
  position: relative;
  margin: 0 24px 52px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #fff;
  padding: 56px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  isolation: isolate;
}
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(139, 13, 21, 0.92) 0%, rgba(181, 18, 27, 0.82) 55%, rgba(181, 18, 27, 0.65) 100%),
    var(--cta-photo, url("../photos/gathering-cy-banner.jpg")) var(--cta-focus, center 30%) / cover no-repeat;
}
.cta-banner h2 { font-weight: 700; font-size: 28px; }
.cta-banner .highlight { color: #f4b64a; }
.cta-banner p { font-size: 14.5px; color: #f6e2df; margin-top: 8px; max-width: 440px; }
.cta-banner p a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.cta-banner-actions { display: flex; flex-wrap: wrap; gap: 12px; flex-shrink: 0; max-width: 100%; } /* lets three buttons wrap on a phone instead of being cut off */

@media (max-width: 640px) {
  .cta-banner { margin: 0 12px 40px; padding: 32px; }
}

/* ============ Footer ============ */
.site-footer { background: var(--color-charcoal); color: #c9c1c2; padding: 48px var(--side-padding) 28px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 34px; }
/* On WordPress the link columns follow the header menu, so there may be
   more cells than the approved four: as many columns as cells, the brand
   wider, until the screen is too narrow (the rules below the media queries
   repeat the narrow layouts for these grids, which this selector outranks). */
.footer-grid:has(> :nth-child(5)) { grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)) 1.1fr; gap: 28px; }
.footer-grid:has(> :nth-child(6)) { grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)) 1.1fr; }
a.footer-col-heading { display: inline-block; }
a.footer-col-heading:hover { text-decoration: underline; }
.footer-grid img { height: 38px; width: auto; filter: brightness(0) invert(1); margin-bottom: 16px; }
.footer-tagline { font-size: 13.5px; color: #fff; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.footer-blurb { font-size: 13px; line-height: 1.6; margin: 0 0 18px; max-width: 260px; }
/* The icons are drawn at 17px, which is too small to hit with a thumb. The
   link is now a 29 x 40px box around each one — the same 29px from icon to
   icon as before — with the row pulled back by the padding it adds, so it
   looks unchanged but every icon has a target a thumb can find. */
.footer-social { display: flex; margin: -11.5px 0 -11.5px -6px; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 40px; }
.footer-social a:hover svg { stroke: #fff; }
.footer-col { font-size: 13px; line-height: 2.1; }
.footer-col-heading { color: #fff; font-weight: 700; margin-bottom: 8px; }
.footer-contact-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; line-height: 1.7; }
.footer-contact-row:last-child { margin-bottom: 0; }
.footer-contact-row svg { flex-shrink: 0; margin-top: 3px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 18px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  color: #8f878b;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: #c9c1c2; }

@media (max-width: 980px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .footer-grid:has(> :nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .footer-grid:has(> :nth-child(5)) { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .footer-grid:has(> :nth-child(5)) { grid-template-columns: 1fr; } }

/* ============ Scroll reveal ============ */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ============ Generic grid helpers ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ============ Fixed header hide-on-scroll ============ */
.site-header.is-hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }

/* ============ Back to top ============ */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s ease;
  z-index: 90;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-red-dark); }

@media (max-width: 640px) {
  .back-to-top { bottom: 18px; right: 18px; width: 42px; height: 42px; }
}

/* ============ Site search ============ */
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #5d5650;
}
.search-toggle:hover { color: var(--color-red); }
.search-toggle svg { pointer-events: none; }

body.search-locked { overflow: hidden; }

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(26, 22, 24, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }

.search-box {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-dropdown);
  padding: 28px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.search-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text-mutest);
  cursor: pointer;
}
.search-close:hover { color: var(--color-red); }

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--color-border-strong);
  padding-bottom: 14px;
  color: var(--color-text-mutest);
}
.search-input {
  flex: 1;
  border: none;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--color-text);
  background: transparent;
}
.search-input::placeholder { color: var(--color-text-faint); }

.search-results { margin-top: 16px; overflow-y: auto; }
.search-hint { font-size: 13.5px; color: var(--color-text-mutest); padding: 8px 2px; }

.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-text);
}
.search-result:hover { background: var(--tint-rose); }
.search-result-title { font-family: var(--font-heading); font-weight: 600; font-size: 15px; }
.search-result-category { font-size: 12px; color: var(--color-text-mutest); flex-shrink: 0; }

@media (max-width: 640px) {
  .search-overlay { padding: 60px 16px; }
  .search-box { padding: 20px; }
}

/* ============ Media card (video or photo beside copy) ============ */
.media-card {
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
}
.media-card-frame {
  position: relative;
  width: 100%;
  min-height: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-charcoal);
}
.media-card-frame iframe,
.media-card-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}
.media-card-body { padding: 30px 32px 32px; }
.media-card-body h3 {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin: 13px 0 12px;
}
.media-card-body p {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 68ch;
}
.media-card-body p + p { margin-top: 12px; }
.media-card-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

@media (max-width: 900px) {
  .media-card { grid-template-columns: 1fr; }
  .media-card-frame { min-height: 0; }
}
@media (max-width: 640px) {
  .media-card-body { padding: 24px 22px 26px; }
  .media-card-body h3 { font-size: 19px; }
}

/* ============ Hand-off panel ============ */
/* Used where a page sends the visitor to a form CICS already hosts elsewhere
   (volunteer intake, facility rental) rather than duplicating it on the site. */
.apply-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 18px;
  padding: 30px 32px;
}
.apply-panel-body { flex: 1; min-width: 260px; }
.apply-panel h3 { font-weight: 700; font-size: 19px; margin: 0 0 8px; }
.apply-panel p { font-size: 14px; color: var(--color-text-muted); line-height: 1.6; margin: 0; }
.apply-panel .btn { flex-shrink: 0; }
/* An email address written into the panel's text becomes a link by itself;
   it takes the red link style the approved panel gave it by hand. A phone
   number stays looking like the rest of the sentence. */
.apply-panel p a[href^="mailto:"] { color: var(--color-red); font-weight: 700; font-family: var(--font-heading); }
.apply-panel p a[href^="tel:"]:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .apply-panel { padding: 26px; }
  .apply-panel .btn { width: 100%; text-align: center; }
}

/* Heading colours an editor may choose, and only these. */
.heading-red { color: var(--color-red); }
.heading-white { color: #fff; }

/* Very narrow screens (a 1280px window zoomed to 400% is 320px wide, WCAG
   1.4.10): side-by-side buttons stack, a long button label wraps, and a long
   email address breaks rather than running off the page. Nothing here
   applies at 375px or wider. */
@media (max-width: 360px) {
  .hero-ctas { flex-wrap: wrap; }
  .btn { white-space: normal; text-align: center; }
}
main a[href^="mailto:"] { overflow-wrap: break-word; }

/* ============ Funder logos ============ */
/* Logos arrive in every shape (IRCC is 14:1, United Way nearly square). A
   grid of equal tiles shrinks the wide ones to unreadable strips, so every
   logo is drawn at the same height in a tile as wide as it needs, and the
   rows are centred. */
.funder-grid { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.funder-grid li { background: #fff; border: 1.5px solid var(--color-border); border-radius: var(--radius-card); height: 104px; padding: 0 32px; display: flex; align-items: center; justify-content: center; max-width: 100%; }
.funder-grid img { display: block; height: 52px; width: auto; max-width: 100%; object-fit: contain; }
/* A near-square mark (United Way) looks small next to wordmarks at the same
   height, so it is drawn taller. */
.funder-grid li.funder-square img { height: 76px; }
.funder-grid a { display: flex; align-items: center; justify-content: center; height: 100%; max-width: 100%; }
@media (max-width: 640px) {
  .funder-grid { gap: 10px; }
  .funder-grid li { height: 84px; padding: 0 18px; }
  .funder-grid img { height: 40px; }
  .funder-grid li.funder-square img { height: 60px; }
}
