/* MEP Support fundraising page — scoped to avoid site chrome overrides */
.mep-support-page {
  --mep-section-pad-y: calc(var(--section-pad-y, 40px) + 16px);
  font-family: Lato, "Helvetica Neue", Arial, sans-serif;
  color: rgb(43, 26, 63);
  background: #fff;
  width: 100%;
  min-width: 320px;
  line-height: 1.5;
}

.mep-support-page *,
.mep-support-page *::before,
.mep-support-page *::after {
  box-sizing: border-box;
}

/* Match site-wide section vertical rhythm (--section-pad-y from design-spacing.css) */
.mep-support-page section {
  padding-top: var(--mep-section-pad-y) !important;
  padding-bottom: var(--mep-section-pad-y) !important;
}

/* Full-bleed hero / banner sections — no extra section padding */
.mep-support-page section[aria-labelledby="hero-title"],
.mep-support-page section[aria-labelledby="legacy-title"],
.mep-support-page section[aria-labelledby="final-title"] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.mep-support-page img {
  max-width: none;
}

.mep-support-page a[href^="#"] {
  color: inherit;
}

.mep-support-page .mep-support-cta--primary {
  color: rgb(255, 255, 255) !important;
}

.mep-support-page .mep-support-cta--outline-light {
  color: rgb(255, 255, 255) !important;
}

.mep-support-page .mep-support-cta--outline-dark {
  color: rgb(43, 26, 63) !important;
}

/* Hero scholarship card overlay (desktop + mobile) */
.mep-support-page .mep-support-hero-media {
  padding: 32px;
  display: flex;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .mep-support-page .mep-support-hero {
    flex-direction: column;
  }

  /* Copy column: tighter padding so headline is not clipped before the photo */
  .mep-support-page .mep-support-hero>div:first-of-type {
    padding: 48px 24px 32px !important;
  }

  .mep-support-page .mep-support-hero-media {
    position: relative !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: min(132vw, 560px) !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    display: block !important;
  }

  .mep-support-page .mep-support-hero-media>img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 25% 35%;
    border-radius: 0;
  }

  /*
   * Card in lower band; flex-start (inline styles use center, which clips the title on short viewports).
   */
  .mep-support-page .mep-support-hero-card {
    position: absolute !important;
    left: 16px !important;
    right: 16px !important;
    top: 40% !important;
    bottom: 20px !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 8px;
  }

  /* Next section: slight overlap + rounded top like the hero card (1st layout) */
  .mep-support-page section#impact {
    position: relative;
    z-index: 2;
    margin-top: -28px;
    border-radius: 20px 20px 0 0;
    padding-top: calc(var(--mep-section-pad-y) + 12px) !important;
  }
}

@media (max-width: 480px) {
  .mep-support-page .mep-support-hero>div:first-of-type {
    padding: 40px 20px 28px !important;
  }

  .mep-support-page .mep-support-hero-media {
    min-height: min(128vw, 520px) !important;
  }

  .mep-support-page .mep-support-hero-card {
    left: 12px !important;
    right: 12px !important;
    top: 42% !important;
    bottom: 16px !important;
    padding: 20px !important;
    justify-content: flex-start !important;
  }

  .mep-support-page section#impact {
    margin-top: -24px;
  }
}

/* iPhone SE / short viewports: more photo above card, title must stay at top of card */
@media (max-width: 390px) {
  .mep-support-page .mep-support-hero-media {
    min-height: 460px !important;
  }

  .mep-support-page .mep-support-hero-card {
    top: 44% !important;
    bottom: 12px !important;
  }
}

html:has(.mep-support-page) {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html:has(.mep-support-page) {
    scroll-behavior: auto;
  }
}