/* ============================================================
   Genie — shared responsive layer
   Targets the fixed 1280px desktop layouts and reflows them for
   tablet / phone.

   IMPORTANT: the DC renderer RE-SERIALIZES every inline style, so
   `style="padding:0 40px"` becomes `style="padding: 0px 40px"` in the
   live DOM and `repeat(4,1fr)` becomes `repeat(4, 1fr)`. Attribute
   substring selectors below therefore match the *serialized* form
   (space after every colon/comma, bare `0` → `0px`). Class-based rules
   are preferred where a class exists.
   ============================================================ */

/* ---- Tablet & below: tighten gutters ---- */
@media (max-width: 900px) {
  [style*="padding: 0px 40px"] { padding-left: 24px !important; padding-right: 24px !important; }
  [style*="padding: 0px 32px"] { padding-left: 20px !important; padding-right: 20px !important; }

  /* split 2-column cards & hero panels → stack */
  [style*="grid-template-columns: minmax(0px, 1.5fr)"],
  [style*="grid-template-columns: minmax(0px, 1.55fr)"],
  [style*="grid-template-columns: minmax(0px, 1.02fr)"],
  [style*="grid-template-columns: minmax(0px, 1fr) minmax(0px, 1.5fr)"],
  [style*="grid-template-columns: minmax(0px, 1fr) minmax(0px, 1fr)"],
  [style*="grid-template-columns: 1.5fr repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* tools-page hero feature banner → show image above text when stacked */
  .vid-banner1 > div:last-child { order: -1; }
}

/* ---- Phone ---- */
@media (max-width: 760px) {
  .cta-headline { white-space: normal !important; font-size: 26px !important; }
  [style*="padding: 0px 40px"] { padding-left: 18px !important; padding-right: 18px !important; }
  [style*="padding: 0px 32px"] { padding-left: 18px !important; padding-right: 18px !important; }

  /* any fixed 4-up grid → 2-up */
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  /* fixed 3-up grid → 1 */
  [style*="grid-template-columns: repeat(3, 1fr)"] { grid-template-columns: 1fr !important; }
  /* generic 2-col → stack */
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  /* closing CTA / cream panels and any remaining split grids → stack */
  [style*="grid-template-columns: 1.5fr repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }

  /* mobile footer: mirror desktop, stacked into a single column (logo above the
     link column). "Connect with us" stays hidden and the LinkedIn social icon
     stays visible — same as desktop. */
  .ft-grid { grid-template-columns: 1fr !important; gap: 30px !important; }

  /* nowrap display headings → allow wrap on phones */
  h1[style*="white-space: nowrap"], h2[style*="white-space: nowrap"], p[style*="white-space: nowrap"] { white-space: normal !important; }

  /* mono eyebrow pills → allow wrap + tighter tracking so they never clip on narrow screens */
  .hero-eyebrow { white-space: normal !important; letter-spacing: 1px !important; line-height: 1.3 !important; padding-top: 11px !important; padding-bottom: 9px !important; text-align: center !important; }

  /* case-study hero heading → looser leading once it wraps to several lines */
  .bingo-hero-h1 { line-height: 1.14 !important; }

  /* Book-a-demo trust logos → uniform heights + tighter gaps so the row reads cleanly */
  .bd-trust { gap: 20px !important; }
  .bd-trust > div { gap: 20px 24px !important; }
  .bd-trust img { height: 20px !important; }
  .bd-trust img[alt="Whalo"] { height: 42px !important; }

  /* homepage logo cloud → flatten both rows into an even 2-col grid so a logo is never alone on a line */
  .hp-logos { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 26px 16px !important; align-items: center !important; justify-items: center !important; }
  .hp-logo-row { display: contents !important; }
  .hp-logos img { height: 30px !important; }
  .hp-logos img[alt="Whalo"] { height: 60px !important; }
  .hp-logos img[alt="Communix"] { height: 22px !important; }

  /* dark closing-CTA banner headline → comfortable leading/tracking once wrapped */
  [data-theme="dark"] h2 { line-height: 1.12 !important; letter-spacing: -1px !important; }

  /* hero CTA is redundant with the mobile sticky Book-a-demo bar → hide on phones */
  .hero-cta { display: none !important; }

  /* tool-gallery tab row → horizontal scroll instead of overflow */
  #toolTabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  #toolTabs::-webkit-scrollbar { display: none; }

  /* pillar grids (the 4-category rows) → 2-up */
  .pillars-grid { grid-template-columns: 1fr 1fr !important; }

  /* reduce big section vertical padding a touch */
  [style*="padding: 88px 0px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding: 92px 0px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding: 64px 0px"] { padding-top: 48px !important; padding-bottom: 48px !important; }

  /* Pricing hero → trim heavy top padding on mobile; FAQ box → tighter stacked gap */
  .pr-hero { padding-top: 44px !important; }
  .faq-box { gap: 28px !important; }

  /* Bingo case study → trim heavy section bottoms on mobile */
  .cs-quote { padding-bottom: 44px !important; }
  .cs-closing { padding-bottom: 48px !important; }

  /* compare-plans table → horizontal scroll so columns never spill past the card */
  .cmp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cmp-card { min-width: 620px; }
  /* the scroll wrapper becomes a scroll context, so drop the sticky header (it would overlap rows) */
  .cmp-head { position: static !important; top: auto !important; }
}

/* ---- Small phone ---- */
@media (max-width: 480px) {
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr !important; }
  .pillars-grid { grid-template-columns: 1fr !important; }
}
