/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE FOUNDATION  ·  site-wide responsive layer — Margaux Beaumont
   Breakpoints established here and used consistently site-wide:
     --bp-lg: 1024px  tablet landscape and below
     --bp-md: 768px   tablet portrait and below
     --bp-sm: 480px   phone
   Rule: every declaration is inside a max-width media query OR is a
   strictly additive property that cannot alter desktop rendering.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Additive base rules (reinforce base.css, no desktop impact) ─────────── */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   TABLET AND BELOW  ·  max-width: 768px  (--bp-md)
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── 1. Type scale ─────────────────────────────────────────────────────── */
  /* Body copy: floor at 1rem, line-height 1.6 */
  body {
    font-size: max(1rem, var(--fs-body));
    line-height: 1.6;
  }

  /* Prose measure: cap at 34ch so lines don't run too long on wide phones */
  .mgx-hero__subline,
  .mgx-lace-split__copy,
  .mgx-about__body,
  .mgx-invitation__letter-copy { max-width: 34ch; }

  /* ── 2. Tap targets — minimum 44 × 44 px (padding, not width/height) ───── */
  .mgx-about__cta,
  .mgx-lace-split__cta,
  .mgx-services__cta,
  .mgx-diary__cta,
  .mgx-collage__cta,
  .mgx-invitation__cta { min-height: 44px; }

  /* Block-level CTAs: use flex so min-height + content centring both work */
  .mgx-about__cta,
  .mgx-services__cta,
  .mgx-invitation__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Inline text CTAs: keep inline-block but ensure hit area via padding */
  .mgx-lace-split__cta,
  .mgx-collage__cta,
  .mgx-diary__cta {
    display: inline-flex;
    align-items: center;
    padding-block: 0.875rem;
  }

  /* ── 3. Navigation — hamburger inherits light colour over hero ─────────── */
  body[data-page="home"]:not(.is-past-hero) .nav__hamburger {
    color: var(--mgx-cream-text);
  }

  /* ── 4. Forms — iOS Safari auto-zoom prevention (font-size ≥ 16px) ─────── */
  .form__input,
  .form__textarea,
  .form__select {
    font-size: 16px;
    min-height: 48px;
    padding: 0.875rem 1rem;
  }
  .form__textarea { min-height: 8rem; }
  .form__submit   { min-height: 48px; }

  /* Ensure radio pills meet 44px tap target too */
  .form__radio-pill span {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ── 5. Motion: strip desktop scroll-linked parallax transform ─────────── */
  .mgx-diary__strip { transform: none !important; }

  /* ── 6. Kind words rail — 82vw card width peeks next card ─────────────── */
  .mgx-kw-card { flex: 0 0 82vw; }

  /* ── 7. Global horizontal page padding — 24px ─────────────────────────── */
  .wrap,
  .mgx-ground-parchment,
  .mgx-ground-oxblood,
  .mgx-ground-oxblood-deep { padding-inline: 24px; }

  /* ── 8. Section vertical padding — reduce ~40% vs desktop clamp ─────────── */
  .mgx-collage,
  .mgx-about,
  .mgx-services,
  .mgx-kind-words { padding-block: var(--space-5); }

  /* Diary pin was already addressed in home.css ≤768px block */
}

/* ── Prefers-reduced-motion overrides (independent of viewport width) ──── */
@media (prefers-reduced-motion: reduce) {
  .mgx-diary__strip { transform: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
   PHONE  ·  max-width: 480px  (--bp-sm)
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* ── 1. Global horizontal page padding — 20px ──────────────────────────── */
  .wrap,
  .mgx-ground-parchment,
  .mgx-ground-oxblood,
  .mgx-ground-oxblood-deep { padding-inline: 20px; }

  /* ── 2. Display & script letter-spacing reduction ─────────────────────── */
  /* Bodoni Moda and Pinyon Script letter-spacing becomes too airy at small sizes */
  .mgx-lockup__caps         { letter-spacing: 0.005em; }
  .mgx-hero__h1             { letter-spacing: 0; }
  .mgx-lockup__script,
  .mgx-hero__script-word,
  .mgx-hero__eyebrow-script { letter-spacing: 0; }
  .mgx-services__display    { letter-spacing: 0.005em; }
  .mgx-diary__heading       { letter-spacing: 0.005em; }

  /* ── 3. Stack form two-column rows ────────────────────────────────────── */
  .form__row { grid-template-columns: 1fr; gap: var(--space-3); }

  /* ── 4. Tighter section padding at smallest breakpoint ────────────────── */
  .mgx-collage,
  .mgx-about,
  .mgx-services,
  .mgx-kind-words { padding-block: var(--space-4); }
}
