/* ==========================================================================
   M28-08 · Mobile 390px Footer Clean Layout & Zero Overlap with 52px FAB
   --------------------------------------------------------------------------
   Adapted from the M28 reference package to the REAL baked DOM (verified in
   Chromium at 390x844, 2026-11-30). The package's hypothetical class names
   (.fy-footer / .fy-site-footer / .fy-footer-grid / .fy-footer-col /
   .fy-footer-newsletter / .fy-footer-bottom) DO NOT exist in the shipped
   index.html and are intentionally NOT used here.

   Real DOM:
     footer.site-footer
       > .fy-moonlight-cta
           > .fy-moonlight-cta__text (__eyebrow / __title)
           > .fy-moonlight-cta__actions > a.fy-mf-btn x2
       > .container
           > .site-footer__mark        (display:none — artwork is the ::before sky)
           > .foot-top
               > .foot-col--brand
               > nav.foot-col (PRODUCTS) / nav.foot-col (THE COMPANY)
               > .foot-col--cta > form.foot-sub + a.foot-cta-link
           > .foot-bottom > span x2 + span.foot-legal

   All rules are mobile-only (@media max-width:767px). Desktop 1440 cascade —
   including the top-anchored starfield / golden FY moonlight artwork — is
   untouched. Background-position of ::before is pinned to the footer TOP, so
   adding bottom padding never moves or crops the golden FY mark.
   ========================================================================== */
@media (max-width: 767px) {
  /* 1) Footer box: 92px bottom clearance so the fixed 52px green FAB
        (bottom 22px, total 74px occupied height) never covers the legal row. */
  html body footer.site-footer {
    padding-bottom: 92px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* 2) Pre-footer glass CTA: buttons stay full-width and vertically stacked.
        :where() style is kept out — real classes + !important so this wins
        regardless of whether the link lands before or after the body-level
        footer-mask-fix.css injection. The CTA box height is NOT changed:
        the starfield clearance contract (mark base ~336px, link row ~384px)
        stays exactly as tuned in footer-mask-fix.css. */
  html body footer.site-footer .fy-moonlight-cta__actions {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 10px !important;
  }
  html body footer.site-footer .fy-mf-btn {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 44px !important;
  }

  /* 3) Main link grid: brand full width -> PRODUCTS | THE COMPANY in two
        equal columns -> subscribe full width. minmax(0,1fr) keeps long
        translated link labels from forcing a horizontal scroll. */
  html body footer.site-footer .foot-top {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 16px !important;
    row-gap: 22px !important;
    align-items: start !important;
  }
  html body footer.site-footer .foot-top > .foot-col--brand,
  html body footer.site-footer .foot-top > .foot-col--cta {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
  }
  /* The 80px desktop offset existed to expose the artwork; on mobile the
     artwork window is provided by .container's margin-top, so drop it. */
  html body footer.site-footer .foot-top > .foot-col--cta {
    padding-top: 0 !important;
  }
  html body footer.site-footer .foot-top > nav.foot-col {
    min-width: 0 !important;
  }
  html body footer.site-footer .foot-top nav.foot-col .foot-label {
    margin-bottom: 8px !important;
  }
  html body footer.site-footer .foot-top nav.foot-col a {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    padding: 10px 0 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  /* 4) Subscribe row: genuinely full width, input flexes, arrow stays 44px. */
  html body footer.site-footer .foot-sub,
  html body footer.site-footer .foot-sub__row {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  html body footer.site-footer .foot-sub__input {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }
  html body footer.site-footer .foot-sub__btn {
    flex: 0 0 44px !important;
    width: 44px !important;
  }

  /* 5) Bottom bar: tidy single column. The 84px RIGHT safe area for the FAB
        is no longer needed on phones (the FAB is cleared vertically by the
        92px footer padding), so the copyright can use the full line width
        and wrap evenly instead of breaking into orphan fragments. */
  html body footer.site-footer .foot-bottom {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-top: 26px !important;
    padding-right: 0 !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
  html body footer.site-footer .foot-bottom > span {
    max-width: 100% !important;
    text-wrap: balance !important;
  }
  html body footer.site-footer .foot-bottom .foot-legal {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 18px !important;
    white-space: nowrap !important;
  }
}
