/* ─────────────────────────────────────────────────────────────────────────
   Mobile responsive overrides for the desktop-only builder export.

   The exported pages use inline styles with no breakpoints, so this is a
   retrofit layer: it targets the specific inline grid/heading patterns via
   [style*="…"] attribute selectors and wins over the inline styles with
   !important. It is linked from each page <head>.

   NOTE: re-add the <link rel="stylesheet" href="responsive.css"> to every
   page <head> after a builder re-export (see README post-export checklist).
   The auto-fit grids (repeat(auto-fit,minmax(...))) are already responsive
   and are intentionally left untouched.
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {

  /* Collapse every grid to a single column. Matches both the source style
     string ("display:grid") and the runtime's re-serialized form
     ("display: grid"). auto-fit grids already collapse to 1 col here too. */
  [style*="display:grid"],
  [style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Grid columns default to min-width:auto, so a child with a large intrinsic
     width (the embedded _ds demo widgets) blows the column — and the headings
     beside it — past the viewport. Let columns shrink to the container. */
  [style*="display:grid"] > *,
  [style*="display: grid"] > * { min-width: 0 !important; }

  /* Scale oversized headings so long words don't clip off the right edge */
  h1 { font-size: clamp(26px, 7.2vw, 40px) !important; line-height: 1.1 !important; }
  h2 { font-size: clamp(23px, 5.8vw, 34px) !important; }

  /* Tighten the large desktop side padding */
  section { padding-left: 18px !important; padding-right: 18px !important; }
  nav { padding-left: 16px !important; padding-right: 16px !important; }

  /* Collapse the nav: hide the centered links + "Sign in", keep logo + Book a demo.
     (Full navigation is still reachable from the footer + in-page CTAs.) */
  nav > div[style*="position:absolute"],
  nav > div[style*="position: absolute"] { display: none !important; }
  nav a[href*="beta.askmotometrics.com"] { display: none !important; }
}
