/* ============================================================
   MDO — Responsive Breakpoint System
   Tested for Desktop (1440x900), Laptop (1280x800),
   Tablet (768x1024), and Mobile (390x844).
   ============================================================ */

/* ---------- ≤ 1200px : Navbar collapse ---------- */
@media (max-width: 1200px) {
  .nav__list {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .footer-main {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

/* ---------- ≤ 1024px : Grid & Split Reflow ---------- */
@media (max-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .split>*:first-child,
  .split>*:last-child,
  .split--flip>*:first-child,
  .split--flip>*:last-child {
    grid-column: span 12;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .pillars-duo {
    grid-template-columns: 1fr;
  }

  .credibility-box {
    grid-template-columns: 1fr;
  }

  .story-slide {
    grid-template-columns: 1fr;
  }
}

/* ---------- ≤ 768px : Tablet & Mobile Composition ---------- */
@media (max-width: 768px) {
  :root {
    --header-h: 80px;
  }

  body {
    font-size: 16.5px;
    line-height: 1.68;
  }

  .section {
    padding-block: clamp(3.5rem, 8vw, 5rem);
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .page-head {
    padding-top: calc(var(--header-h) + 2rem);
  }

  .page-head__title {
    font-size: clamp(2.2rem, 8vw, 3.2rem);
  }

  .home-hero h1 {
    font-size: clamp(2.4rem, 9vw, 3.6rem);
  }

  .home-hero__p {
    font-size: 16px;
  }

  .home-hero__meta {
    gap: 16px 28px;
  }

  .home-hero__eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
    padding: 6px 14px;
    gap: 8px;
  }

  .impact-band,
  .counter-band {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cta-banner {
    padding: 32px 24px;
  }

  .cta-banner .cta-row .btn {
    width: 100%;
  }

  .logo-marquee__track {
    animation-duration: 20s;
    gap: 32px;
  }

  .logo-marquee__item {
    padding: 12px 20px;
  }

  .logo-marquee__item img {
    height: 75px !important;
    max-width: 170px !important;
  }

  /* Direct donation badges: stack badge above its text, full-width on mobile */
  .direct-badge-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .direct-badge {
    width: 100%;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.1em;
    padding: 9px 14px;
  }
  .direct-badge-text {
    font-size: 13.5px;
    text-align: center;
  }

  /* Center key home elements & balance side margins on mobile */
  .split > *,
  .split--flip > * {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
  }
  .home-cta .btn { margin-inline: auto; }
  .leadership-quote { margin-inline: 0; }
  .direct-badges { width: 100%; }

  /* Every button full-width on mobile (keep fixed header controls usable) */
  .btn { width: 100%; justify-content: center; }
  .header-donate-btn,
  .burger,
  .header-search-btn { width: auto; }

  /* Contain any stray overflow so nothing pushes past the viewport edge */
  * { max-width: 100%; }

  /* Keep the header from overflowing on mobile: drop the nav capsule + phone box */
  .nav-capsule, .call-box { display: none; }
}

/* ---------- ≤ 520px : Small Mobile Devices ---------- */
@media (max-width: 520px) {
  .container {
    width: 92%;
  }

  .brand__logo {
    height: 44px;
    max-width: 140px;
  }

  .brand__name {
    font-size: 18px;
  }

  .brand__sub {
    font-size: 8.5px;
    letter-spacing: 0.18em;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .nav__cta {
    width: auto;
  }

  .impact-band,
  .counter-band {
    grid-template-columns: 1fr;
  }

  .amounts {
    grid-template-columns: 1fr 1fr;
  }

  .credibility-cert img {
    aspect-ratio: 16/10;
  }

  .header-search-btn { display: none; }

  .home-hero__eyebrow {
    font-size: 9.5px;
    letter-spacing: 0.05em;
    padding: 5px 12px;
    gap: 6px;
    white-space: nowrap;
  }
}

/* ---------- Overflow Control ---------- */
.hero,
.page-head,
.home-hero,
.logo-marquee-section {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ---------- Mobile overflow & long-string guards ---------- */
@media (max-width: 768px) {
  body {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .split>*,
  .grid>* {
    min-width: 0;
  }

  /* Donate: IBAN + WhatsApp receipt box stack cleanly */
  #ibanText {
    overflow-wrap: anywhere;
    word-break: break-all;
    font-size: 1rem;
    letter-spacing: 0.2px;
  }

  [data-reveal="up"]>div {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  [data-reveal="up"]>div>div,
  [data-reveal="up"]>div>a {
    flex: 0 0 auto !important;
    width: 100% !important;
  }
}

@media (max-width: 520px) {
  [data-reveal="up"]>div {
    padding: 1.4rem 1.2rem !important;
  }

  [data-reveal="up"]>div>a {
    justify-content: center;
  }
}

/* ---------- Donation intro: centered on all viewports (left line only) ---------- */
.donate-intro { text-align: center; }

/* ---------- Desktop: full-width donation intro band ---------- */
@media (min-width: 1025px) {
  .split.split--flip > .donate-intro {
    grid-column: 1 / 13;
  }
  .donate-intro .section__lede { max-width: 760px; margin-inline: auto; }
  .direct-badges {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    max-width: 760px;
    margin-inline: auto;
  }
  .direct-badge-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 22px 18px;
    gap: 10px;
  }
}