/* ==========================================================================
   Roti Foundation — mobile refinement layer
   Loaded after style.css + site.css. Every rule here sits inside a phone /
   tablet media query (or a touch-only query), so the desktop design is
   unchanged.

   Goals on phones:
   - one consistent type scale (readable 16px body, calm headings)
   - consistent vertical rhythm between sections
   - comfortable 44px+ tap targets
   - no sticky "hover" lift after tapping a card
   ========================================================================== */

/* ---------- always the real light design: opt out of browser auto-dark modes ---------- */
:root { color-scheme: only light; }

/* ---------- touch devices: no hover lift / tap flash ---------- */
@media (hover: none) {
  html { -webkit-tap-highlight-color: transparent; }
  .btn:hover,
  .mv-card:hover,
  .program-card:hover,
  .story-card:hover,
  .sa-card:hover,
  .feature:hover,
  .feature:hover .feature__icon,
  .social a:hover { transform: none; }
  .program-card:hover { --card-bg: #faf7f2; box-shadow: 0 10px 28px rgba(10, 35, 66, 0.09); }
  .program-card:hover .program-card__media img { transform: none; filter: none; }
  .program-card:hover .program-card__media::before { opacity: 0; }
  .program-card:hover .program-card__overlay { clip-path: circle(0% at 50% 45%); }
  .program-card:hover .program-card__icon { animation: none; background: var(--white); color: var(--gold-500); box-shadow: 0 0 0 5px var(--card-bg), 0 8px 20px rgba(10, 35, 66, 0.12); }
  .program-card:hover .program-card__title { transform: none; color: var(--navy-text); letter-spacing: normal; }
  .program-card:hover .program-card__text { transform: none; }
  .program-card:hover .program-card__arrow { transform: none; }
  .program-card:hover .program-card__arrow i { animation: none; }
  .mv-card:hover .mv-card__icon,
  .story-card:hover .story-card__quote,
  .stat:hover .stat__icon { animation: none; }
  .mv-card:hover h3 { transform: none; color: var(--navy-text); }
}

/* ==========================================================================
   Tablets and phones (≤ 991px)
   ========================================================================== */
@media (max-width: 991px) {
  h1, h2, h3,
  .section-title,
  .hero__title,
  .page-hero__title { text-wrap: balance; }
  p { text-wrap: pretty; }

  .wd-section { padding: clamp(52px, 9vw, 72px) 0; }
  .section-head--center { margin-bottom: 32px; }
}

/* ==========================================================================
   Phones (≤ 767px)
   ========================================================================== */
@media (max-width: 767px) {
  :root {
    --gutter: 12px;
    --header-h: 66px;
    --m-section: 48px;           /* standard gap between home sections */
  }

  body { font-size: 14px; line-height: 1.55; }

  /* ---------- shared type scale ---------- */
  .eyebrow { font-size: 11px; letter-spacing: 0.15em; }
  .eyebrow--lined { gap: 12px; }
  .eyebrow--lined::before, .eyebrow--lined::after { width: 28px; }

  .section-title,
  .stories__head .section-title,
  .about__content .section-title {
    font-size: clamp(19px, 5.4vw, 22px);
    line-height: 1.18;
    letter-spacing: -0.01em;
  }
  .section-head { margin-bottom: 24px; }
  .section-head__text { font-size: 13.5px; line-height: 1.6; margin-top: 12px; }

  /* ---------- buttons: small buttons still get a 44px tap target ---------- */
  .btn { --btn-pad-y: 12px; --btn-pad-x: 22px; font-size: 13.5px; }
  .btn.btn--sm { --btn-pad-y: 10px; min-height: 42px; font-size: 14px; }

  /* ---------- header ---------- */
  .main-nav { width: min(360px, 88vw); }
  .nav-link { padding: 13px 4px; font-size: 15.5px; }
  .dropdown a { padding: 11px 14px; font-size: 14px; }

  /* ---------- hero (home slider): photo stays bright, text sits on a soft shade at the bottom ---------- */
  .hero-slide { min-height: clamp(520px, 138vw, 620px); }
  .hero-slide::before {
    background: linear-gradient(0deg,
      rgba(2, 31, 56, 0.9) 0%,
      rgba(4, 44, 72, 0.78) 34%,
      rgba(4, 44, 72, 0.4) 56%,
      rgba(4, 44, 72, 0.06) 76%,
      rgba(4, 44, 72, 0) 100%);
  }
  .hero__content { padding-block: 84px 100px; }
  .hero__text { max-width: 440px; }
  .hero__eyebrow { gap: 6px; padding: 5px 11px; margin-bottom: 12px; font-size: 10.5px; letter-spacing: 0.12em; }
  .hero__title {
    font-size: clamp(27px, 8vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin-bottom: 18px;
    text-shadow: 0 2px 18px rgba(2, 31, 56, 0.35);
  }
  .hero__title .line { padding-bottom: 2px; }
  .hero__title .swoosh { bottom: -10px; height: 11px; }
  .hero__lead { font-size: 13.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.86); margin-bottom: 24px; }
  /* buttons: text only, side by side when they fit, wrap when they don't */
  .hero__actions { gap: 10px; }
  .hero__actions .btn { flex: 1 1 auto; width: auto; min-width: 0; --btn-pad-y: 12px; --btn-pad-x: 16px; font-size: 13.5px; white-space: nowrap; }
  .hero__actions .btn i { display: none; }
  /* swipe to change slides; keep only the slim progress bars */
  .hero__nav { display: none; }
  .hero__controls { bottom: 56px; justify-content: flex-start; }
  .hero__pagination .swiper-pagination-bullet { width: 20px; height: 3px; }
  .hero__pagination .swiper-pagination-bullet-active { width: 40px; }

  /* ---------- inner-page banner ---------- */
  .page-hero { min-height: 0; }
  .page-hero__inner { padding-block: 40px 44px; }
  .breadcrumb { font-size: 12px; padding: 6px 12px; gap: 8px; margin-bottom: 16px; }
  .page-hero__title {
    font-size: clamp(26px, 7.6vw, 33px);
    line-height: 1.12;
    margin-bottom: 18px;
  }
  .page-hero__title .swoosh { bottom: -11px; height: 12px; }
  .page-hero__lead { font-size: 13.5px; line-height: 1.6; }

  /* ---------- feature strip ---------- */
  .features { padding-top: 28px; }
  .features__bar { grid-template-columns: 1fr; gap: 12px; }
  .feature { flex-direction: row; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 18px; }
  .feature::after { left: 18px; right: 18px; }
  .feature__icon { width: 50px; height: 50px; font-size: 21px; border-radius: 14px; }
  .feature__title { font-size: 15.5px; margin-bottom: 2px; }
  .feature__text { font-size: 13.5px; line-height: 1.45; }

  /* ---------- real stories (home) ---------- */
  .stories { padding: var(--m-section) 0 28px; }
  .stories__head { gap: 14px; margin-bottom: 22px; }
  .stories__head .btn { margin-bottom: 0; }

  /* ---------- about (home) ---------- */
  .about { padding: 28px 0 36px; }
  .about__grid { gap: 26px; }
  .about__media { padding-bottom: 16px; }
  .about__img { border-radius: 18px; aspect-ratio: 16 / 10; }
  .about__content .eyebrow { margin-bottom: 10px; }
  .about__content .section-title { margin-bottom: 14px; }
  .about__content p { font-size: 13.5px; line-height: 1.6; margin-bottom: 20px; }
  .about__cards { gap: 14px; }
  .mv-card { gap: 16px; padding: 18px 18px 20px; border-radius: 16px; }
  .mv-card__icon { font-size: 26px; width: 30px; text-align: center; }
  .mv-card h3 { font-size: 16.5px; margin-bottom: 4px; }
  .mv-card p { font-size: 14px; line-height: 1.55; }

  /* ---------- programs (home) ---------- */
  .programs { padding: 32px 0 40px; }
  .programs__head { margin-bottom: 22px; }
  .program-card { border-radius: 20px; }
  .program-card__media { height: 200px; }
  .program-card__body { padding: 2px 22px 26px; min-height: 0; }
  .program-card__icon { width: 54px; height: 54px; font-size: 21px; }
  .program-card__title { font-size: 17.5px; white-space: normal; }
  .program-card__text { font-size: 14px; line-height: 1.55; padding-right: 44px; }
  .program-card__arrow { right: 20px; bottom: 24px; width: 36px; height: 36px; }

  /* ---------- impact band ---------- */
  .impact { padding: 8px 0 8px; }
  .impact__band { row-gap: 26px; padding: 30px 16px 28px; border-radius: 20px; }
  .impact__title { font-size: 25px; line-height: 1.12; padding-bottom: 14px; }
  .impact__title br { display: none; }
  .stat { padding: 0 6px; }
  .stat__icon { font-size: 22px; margin-bottom: 6px; }
  .stat__num { font-size: 23px; }
  .stat__label { font-size: 12.5px; line-height: 1.35; margin-top: 4px; }

  /* ---------- testimonials (home) ---------- */
  .ts-spot--home { margin-top: 40px; }
  .ts-spot { padding: 48px 0 52px; }
  .ts-spot__grid { gap: 28px; }
  .ts-spot__title { font-size: clamp(19px, 5.4vw, 22px); line-height: 1.18; margin-bottom: 10px; }
  .ts-spot__text { font-size: 13.5px; line-height: 1.6; margin-bottom: 22px; color: rgba(255, 255, 255, 0.78); }
  .ts-spot__controls { gap: 14px; }
  .ts-arrow { width: 42px; height: 42px; font-size: 14px; }
  .ts-spot__count { font-size: 13px; min-width: 60px; }
  .ts-spot__progress { margin-top: 18px; }
  .ts-spot__more { margin-top: 24px; }

  .ts-quote { padding: 22px 18px 20px; }
  .ts-quote__source { padding: 4px 10px; }
  .ts-quote__source { font-size: 11px; padding: 4px 11px; }
  .ts-quote blockquote {
    margin: 16px 0 18px;
    font-size: 13.5px;
    line-height: 1.65;
    /* very long reviews: show 7 lines, the full text is on /testimonials */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 7;
    line-clamp: 7;
    overflow: hidden;
  }
  .ts-quote__author { gap: 12px; padding-top: 14px; }
  .ts-quote__author b { font-size: 13.5px; }
  .ts-quote__author small { font-size: 12px; }
  .ts-quote__author .ts-stars { font-size: 12.5px; }

  /* ---------- featured blog (home) ---------- */
  .bl-featured--home { padding: var(--m-section) 0 24px; }

  /* ---------- CTA band ---------- */
  .cta { margin-top: 32px; }
  .cta__media { height: clamp(220px, 58vw, 320px); }
  .cta__content { padding: 4px 0 44px; }
  .cta__title { font-size: clamp(23px, 6.8vw, 29px); line-height: 1.15; margin-bottom: 14px; }
  .cta__text { font-size: 13.5px; line-height: 1.6; max-width: none; margin-bottom: 20px; }
  .cta__actions { gap: 12px; }
  .cta__note { font-size: 13px; padding: 11px 13px; margin-top: 18px; }

  /* ---------- footer ---------- */
  .footer-top { padding: 40px 0 20px; row-gap: 32px; column-gap: 20px; }
  .footer-brand .logo { margin-bottom: 14px; }
  .footer-brand .logo__img { height: 64px; }
  .footer-brand p { font-size: 13.5px; line-height: 1.6; max-width: 440px; color: rgba(255, 255, 255, 0.85); }
  .footer-title { font-size: 15.5px; margin-bottom: 12px; position: relative; padding-bottom: 10px; }
  .footer-title::after { /* short gold rule under each heading */
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 32px; height: 2px;
    border-radius: 2px;
    background: var(--gold-grad);
  }
  .footer-links li,
  .footer-links--spaced li { line-height: 1.4; padding: 0; }
  .footer-links a { font-size: 14px; padding: 7px 0; color: rgba(255, 255, 255, 0.88); }
  .footer-contact li { align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
  .footer-contact i { margin-top: 3px; color: var(--gold-300); }
  .social { gap: 12px; margin: 4px 0 18px; }
  .social a { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }
  .footer-bottom { padding: 18px 0 22px; gap: 10px; font-size: 12.5px; line-height: 1.6; }
  .footer-bottom__links { flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
  .footer-bottom__links > span { display: none; } /* "|" separators look messy when wrapped */
  .footer-bottom__links a { padding: 4px 0; }
  .footer-credit { flex-basis: 100%; margin-top: 6px; }

  /* ---------- floating WhatsApp / call buttons ---------- */
  .float-contact { right: 14px; bottom: 74px; gap: 10px; }
  .float-btn__icon { width: 48px; height: 48px; }
  .to-top { right: 18px; bottom: 16px; width: 44px; height: 44px; }
}

/* ==========================================================================
   Small phones (≤ 575px)
   ========================================================================== */
@media (max-width: 575px) {
  .logo__img { height: 44px; }

  /* buttons stack full width: let long labels wrap instead of overflowing */
  .btn { white-space: normal; text-align: center; }
  .header-cta .btn { white-space: nowrap; }
  .stories__head .btn,
  .ts-spot__more { width: 100%; }

  /* footer: quick links in two columns so the footer is not one long list */
  .footer-top { grid-template-columns: 1fr; }
  .footer-links:not(.footer-links--spaced) { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .footer-follow .btn { width: 100%; }
}

/* ==========================================================================
   Very small phones (≤ 374px)
   ========================================================================== */
@media (max-width: 374px) {
  :root { --gutter: 10px; }
  .impact__band { padding-inline: 10px; }
  .stat__num { font-size: 21px; }
  .stat__label { font-size: 12px; }
}

/* ==========================================================================
   Phones (≤ 767px) — site-wide compact type scale
   Every inner page has its own heading / lead classes; this one layer brings
   them all onto the same small, calm phone scale. ":not(#_)" lifts the
   specificity so it wins over page rules without needing !important.
   vw-based clamps shrink further on narrow phones automatically.
   ========================================================================== */
@media (max-width: 767px) {
  main h1:not(#_) { font-size: clamp(22px, 6.4vw, 26px); line-height: 1.12; }
  main .hero__title:not(#_) { font-size: clamp(22px, 6.4vw, 26px); line-height: 1.1; }

  main h2:not(#_):not(.lg-card__title):not(.bd-widget__title):not(.ow-tile__title) { font-size: clamp(19px, 5.4vw, 22px); line-height: 1.2; }
  main .bd-widget__title:not(#_) { font-size: 18px; }
  main .ow-tile__title:not(#_) { font-size: 17px; line-height: 1.2; } /* sits in narrow 2-column tiles */
  main .stat__num:not(#_) { font-size: 23px; }

  main h3:not(#_):not(.dn-bank__kicker):not(.lg-card__title) { font-size: clamp(15px, 4.2vw, 16px); line-height: 1.3; }

  /* leads and body copy used across the inner pages */
  :is(.page-hero__lead, .section-head__text, .cta__text, .story__lead, .faq-cat__text,
      .faq-ask__text p, .wd-lead, .wd-intro__content > p, .wd-why__text, .wd-story__text,
      .vg-featured__text, .vg-library__lead, .vg-subscribe__text p, .vg-modal__desc,
      .ts-spot__text, .bd-callout p, .bd-lead, .tm-intro__content > .tm-intro__lead,
      .lg-intro > p, .lg-body p, .ow-prog__lead, .dn-offline__text, .pg-drives__text,
      .pg-video__text, .help-link__text strong, .aside-photo__caption p):not(#_) {
    font-size: 13.5px;
    line-height: 1.6;
  }
  .faq-cat .faq-a p:not(#_) { font-size: 13.5px; line-height: 1.6; }
  .ts-quote blockquote:not(#_), .tm-modal__quote:not(#_) { font-size: 13.5px; line-height: 1.65; }
  .ts-quote__author b:not(#_) { font-size: 13.5px; }

  /* blog article: a touch larger than the rest, it is long-form reading */
  .bp-body:not(#_) { font-size: 14.5px; line-height: 1.7; }
  .bp-body .bp-lead:not(#_) { font-size: 15.5px; }
  .bp-tip p:not(#_) { font-size: 13.5px; }

  /* form fields stay 16px so iPhone Safari does not zoom in on focus */
  input, select, textarea { font-size: 16px; }
}

/* ==========================================================================
   Phones (≤ 767px) — footer link groups collapse / expand
   site.js adds .is-acc to the footer (no JS = everything stays open).
   ========================================================================== */
@media (max-width: 767px) {
  .footer-top { grid-template-columns: 1fr; row-gap: 0; padding-top: 36px; }
  .footer-brand { margin-bottom: 22px; }
  .footer-acc { border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .footer-acc + .footer-follow { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 22px !important; }

  .footer-acc .footer-title { margin: 0; padding: 0; }
  .footer-acc .footer-title::after { display: none; }
  .footer-acc__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 14px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .footer-acc__btn:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 2px; border-radius: 6px; }
  .footer-acc__btn i {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 11px;
    color: var(--gold-300);
    background: rgba(219, 164, 59, 0.16);
    transition: transform 0.4s var(--ease), background 0.3s, color 0.3s;
  }
  .footer-acc__btn[aria-expanded="true"] { color: var(--gold-300); }
  .footer-acc__btn[aria-expanded="true"] i { transform: rotate(180deg); color: var(--navy-900); background: var(--gold-grad); }

  .footer-acc__panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.4s var(--ease); }
  .footer-acc__inner { min-height: 0; overflow: hidden; }
  .footer-acc__inner > ul { padding-bottom: 16px; }
  .is-acc .footer-acc__panel { grid-template-rows: 0fr; }
  .is-acc .footer-acc.is-open .footer-acc__panel { grid-template-rows: 1fr; }
  /* collapsed links can't be tabbed to */
  .is-acc .footer-acc:not(.is-open) .footer-acc__inner { visibility: hidden; transition: visibility 0s 0.4s; }
  .footer-links a:hover { transform: none; }
}

/* ==========================================================================
   Phones (≤ 767px) — calm, clean banners
   Photo stays bright at the top; the words sit at the bottom on a soft navy
   shade, in a smaller size, with the lead kept to a few lines.
   ========================================================================== */
@media (max-width: 767px) {
  /* soft shade from the bottom only */
  .hero-slide::before,
  .page-hero:not(.lg-hero)::before {
    display: block;
    content: "";
    position: absolute; inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(0deg,
      rgba(2, 31, 56, 0.9) 0%,
      rgba(3, 36, 60, 0.72) 30%,
      rgba(4, 44, 72, 0.32) 58%,
      rgba(4, 44, 72, 0) 80%);
  }
  .page-hero:not(.lg-hero)::before { z-index: -1; }
  /* blog + Support a Life banners keep the brand colour over the whole photo */
  .page-hero.bl-hero::before,
  .page-hero.bp-hero::before,
  .page-hero.sa-hero::before,
  .page-hero.cs-hero::before {
    background:
      radial-gradient(ellipse 70% 45% at 85% 15%, rgba(208, 148, 32, 0.28), transparent 70%),
      linear-gradient(0deg, rgba(2, 31, 56, 0.94) 0%, rgba(3, 36, 60, 0.84) 40%, rgba(4, 44, 72, 0.7) 100%);
  }
  .hero__text,
  .page-hero__content { --hero-text-shadow: 0 1px 10px rgba(2, 20, 36, 0.4); text-shadow: var(--hero-text-shadow); }
  .hero__lead,
  .page-hero__lead { text-shadow: 0 1px 8px rgba(2, 20, 36, 0.45); }

  /* ----- home slider ----- */
  .hero-slide { min-height: clamp(480px, 128vw, 560px); }
  .hero__content { position: relative; z-index: 2; padding-block: 72px 76px; }
  .hero__eyebrow { font-size: 10px; padding: 4px 10px; margin-bottom: 10px; }
  main .hero__title:not(#_) { font-size: clamp(22px, 6.4vw, 26px); line-height: 1.22; margin-bottom: 14px; }
  .hero__title .swoosh { bottom: -8px; height: 9px; }
  .hero__lead:not(#_) {
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  .hero__actions { gap: 8px; }
  .hero__actions .btn { --btn-pad-y: 11px; --btn-pad-x: 14px; font-size: 13.5px; }
  .hero__controls { bottom: 34px; }

  /* ----- inner-page banners ----- */
  .page-hero:not(.lg-hero) { min-height: clamp(300px, 82vw, 360px); align-items: flex-end; }
  .page-hero:not(.lg-hero) .page-hero__inner { padding-block: 64px 30px; }
  .page-hero .breadcrumb { font-size: 11.5px; padding: 5px 11px; gap: 7px; margin-bottom: 12px; }
  main h1.page-hero__title:not(#_) { font-size: clamp(22px, 6.4vw, 26px); line-height: 1.14; margin-bottom: 14px; }
  .page-hero__title .swoosh { bottom: -8px; height: 9px; }
  .page-hero__lead:not(#_) {
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  .page-hero__content .btn { --btn-pad-y: 10px; --btn-pad-x: 16px; font-size: 13.5px; }
}

/* ==========================================================================
   Phones (≤ 767px) — app-style text
   - any body copy not covered above drops to 14px (page-specific classes
     above still win: same ":not(#_)" lift + a class)
   - slim weights: Nunito Sans is a variable font, so the weight axis is
     capped — normal text 400, emphasised text 600 instead of 700–900.
     Non-variable fonts (DM Serif headings, Font Awesome icons) ignore this.
   ========================================================================== */
@media (max-width: 767px) {
  main :is(p, dd, blockquote):not(#_) { font-size: 14px; line-height: 1.55; }

  body { font-variation-settings: "wght" 400; }
  body p { font-variation-settings: "wght" 400; }
  body :is(b, strong, h1, h2, h3, h4, h5, h6, th, dt, label, button, .btn, .nav-link,
           [class*="title"], [class*="name"], [class*="num"], [class*="badge"],
           [class*="eyebrow"], [class*="kicker"], [class*="price"], [class*="amount"]) {
    font-variation-settings: "wght" 600;
  }
}
