/* ============================================================
   LP MOBILE OVERRIDES — annaparfyonova only.
   page-landing.php is the STOCK template, so it loads the parent's
   shared landing-critical.css / landing.css (tpa-base). Those files
   are used by every client on the stock LP template, so client-specific
   tweaks must NOT go there. This stylesheet is enqueued after both
   (functions.php, priority 30) and only touches this site's mobile
   layout. Same breakpoint as the parent (max-width: 960px) so these
   rules kick in at the same point the parent already collapses to a
   single column — extend, don't duplicate, that condition.
   ============================================================ */
@media (max-width: 960px) {

  /* HERO — move the portrait image up next to the eyebrow/headline
     instead of letting it fall to the very bottom of the stack below
     the CTAs and trust meta. .lp-hero-text becomes display:contents so
     its children can be individually ordered alongside .lp-hero-visual
     as direct items of the (already single-column) .lp-hero-grid. */
  /* .lp-hero-grid's 40px gap (parent, line ~562) was meant to space just
     two items (.lp-hero-text as one block + .lp-hero-visual). Once
     .lp-hero-text goes display:contents below, ALL its children become
     direct grid items too, so that 40px gap now lands between every one
     of them on top of their own margins — eyebrow, h1, tagline, sub,
     visual, ctas, meta each get an extra 40px, stacking way too much
     vertical space. Zero it here; each element's own margin (set in
     landing-critical.css) already spaces it correctly. */
  /* The single mobile column is a bare `1fr` (parent, line ~562), not
     `minmax(0, 1fr)` like the desktop tracks. A bare 1fr track's min
     width defaults to its content's min-content size — the parent's own
     comment above .lp-hero-grid on desktop warns this exact thing
     happens when a hero field has a forced-nowrap span in it, and the
     track (and everything in it) grows past the viewport instead of
     wrapping. With overflow-x:clip on <body> (mobile invariant) that
     overflow doesn't scroll, it just gets silently cut off — headline
     and subheadline text truncated at the right edge. minmax(0, 1fr)
     puts the same explicit 0 floor mobile has needed on desktop, and
     the min-width:0 + white-space:normal below is belt-and-suspenders
     for the actual nowrap span if the content has one. */
  .lp-hero-grid { gap: 0; grid-template-columns: minmax(0, 1fr) !important; }
  .lp-hero-text { display: contents; }
  .lp-hero-text > *, .lp-hero-visual { min-width: 0; max-width: 100%; }
  .lp-hero-text h1,
  .lp-hero-text .lp-eyebrow,
  .lp-hero-text .lp-hero-tagline,
  .lp-hero-text .lp-hero-sub,
  .lp-hero-text .lp-hero-sub * {
    white-space: normal !important;
    overflow-wrap: break-word;
  }
  .lp-hero-text .lp-eyebrow { order: 1; }
  .lp-hero-text h1 { order: 2; }
  .lp-hero-text .lp-hero-tagline { order: 3; }
  .lp-hero-text .lp-hero-sub { order: 4; }
  .lp-hero-text .lp-bilateral { order: 5; }
  .lp-hero-visual { order: 6; margin: 0 0 8px; }
  .lp-hero-text .lp-hero-ctas { order: 7; }
  .lp-hero-text .lp-hero-meta { order: 8; }

  /* HEADER PHONE — .lp-header-inner wraps at this breakpoint (parent,
     line ~566) with brand + phone sharing a row before the hamburger
     drops to its own line below. Neither the phone nor the brand had a
     flex-shrink/white-space guard, so squeezing that row could wrap
     "(747) 285-0462" mid-digits. Keep the number on one line and let
     the brand (logo + tagline) be the one that shrinks instead. */
  .lp-header-phone { white-space: nowrap; flex-shrink: 0; }
  .lp-brand { min-width: 0; }

  /* HERO CTA PHONE — the "(747) 285-0462" number inside the hero's
     phone CTA button (.lp-hero-ctas, next to the primary "Learn How
     EMDR Helps" button) had no nowrap guard either; same wrap risk. */
  .lp-btn-phone { white-space: nowrap; flex-shrink: 0; }
  .lp-btn-phone .lp-num,
  .lp-btn-phone .lp-tag { white-space: nowrap; }

  /* The tag/number stack (column) only came from a touch-only query
     (hover:none/pointer:coarse, parent line ~594) — on this width-based
     breakpoint alone .lp-btn-phone stayed the base rule's flex-direction:
     row, so "(747) 285-0462" sat beside the tag instead of under it and
     ran off the right edge. Make the stack unconditional on width. */
  .lp-btn-phone {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100%;
  }

  /* NAV DRAWER — .lp-mobile-menu (parent, line ~324) assumes an 80px
     header and pads its content down by that much. This site's header
     wraps to two rows at this breakpoint (brand+phone row, then the
     hamburger on its own row below — parent line ~567), so the real
     header is closer to ~136px tall. With only 80px of clearance the
     header block sits on top of (hides) the drawer's first nav link(s).
     Push the drawer content down further to actually clear it. */
  .lp-mobile-menu { padding-top: 160px; }

  /* BADGES — hide the trust-badge row (Secure / State Licensed /
     Psychology Today / HIPAA) right after the hero on mobile. */
  .lp-badges { display: none; }

  /* SOLUTION — move the image after the copy block (headline, body,
     benefits, and the "Begin Your Healing" CTA) instead of before it. */
  .lp-solution-grid { display: flex; flex-direction: column; }
  .lp-solution-copy { order: 1; }
  .lp-solution-visual { order: 2; margin-top: 24px; }

  /* PROCESS — the parent's 2-column mobile grid orphans the 3rd step
     onto its own half-width row with a dangling right border. Go
     straight to a single column at this breakpoint instead. */
  .lp-process-steps { grid-template-columns: 1fr !important; }
  .lp-process-step { border-right: 0 !important; border-bottom: 1px solid var(--lp-line); }
  .lp-process-step:last-child { border-bottom: 0; }

  /* BODY IMAGES — the portrait crops (800x1067 / 800x1000) run very
     tall at full mobile width. Cap them to a shorter landscape ratio
     so they don't dominate the scroll. */
  .lp-problem-visual img,
  .lp-solution-visual img {
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
  }
}

/* Landscape phones (e.g. iPhone landscape ~926px wide, short viewport)
   still need the single-column process fix even though 926 < 960 already
   covers width — this just also catches short-height touch devices that
   a width query alone can miss. */
@media (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .lp-process-steps { grid-template-columns: 1fr !important; }
  .lp-process-step { border-right: 0 !important; border-bottom: 1px solid var(--lp-line); }
  .lp-process-step:last-child { border-bottom: 0; }
}

/* Touch-device text-size / tap-target floors — viewport sweep found these
   under 14px / 44px on every touch profile (not just narrow ones), so this
   is scoped to touch capability rather than max-width, matching the main
   site's client.css pattern. The parent's own .lp-footer-legal a rule
   (landing.css, @media max-width:960px) sets min-height:44px but isn't
   winning on this site — !important here to guarantee it regardless. */
@media (hover: none) and (pointer: coarse) {
  .lp-logo-tag { font-size: 14px !important; }
  .lp-problem-symptoms .lp-sym-label { font-size: 14px !important; }
  .lp-cred-tag { font-size: 14px !important; }
  .lp-secure-text span { font-size: 14px !important; }
  .lp-footer-legal a {
    font-size: 14px !important;
    min-height: 44px !important;
    padding: 12px 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
}
