/* Phone layout fixes for the pages exported from WordPress (Steve, 2026-11-11: "right across mobile
   experience there is work to do"). Added to every page's <head> by assemble() in src/lib/chrome.ts, after the
   page's own CSS. Pages rebuilt to the page design rules (.gga) size their own
   type, so they're left alone. */

@media (max-width: 767px) {
  /* One type scale on phones. WordPress set headings per page and per module, up to 52px, which put
     six or seven lines of headline on the first screen. */
  h1:not(.gga *):not(header *) { font-size: 36px !important; line-height: 42px !important; letter-spacing: -0.3px; }
  /* H2s and H3s only from the modules that set the big sizes, so smaller card headings keep theirs */
  h2:is(.fl-heading, .uabb-infobox-title, .uabb-infobox-title-prefix, .pp-testimonials-heading, .wp-block-heading, .uabb-heading, :not([class])):not(.gga *):not(header *):not([data-type="footer"] *) { font-size: 28px !important; line-height: 34px !important; }
  h3:is(.fl-heading, .uabb-infobox-title, .wp-block-heading, :not([class])):not(.gga *):not(header *):not([data-type="footer"] *) { font-size: 22px !important; line-height: 28px !important; }
  :is(h1, h2, h3):not(.gga *) :is(.fl-heading-text, span) { font-size: inherit !important; line-height: inherit !important; }
}

@media (max-width: 767px) {
  /* Images never wider than their column. The export lost WordPress's own img{max-width:100%} on
     some pages, so one 3000px upload stretched a whole blog post to 3000px wide on a phone. */
  :is(.fl-post-content, .fl-builder-content, .fl-page) img:not(.gga img):not(header img) { max-width: 100%; }
  :is(.uabb-photo-img, .pp-post-img, .fl-photo-img, .wp-block-image img, .wp-post-image):not(.gga img) { height: auto; }

  /* Section spacing: WordPress gives every section 48px top and bottom on phones, so sections sat 96px
     apart and pages with one section per step (1, 2, 3...) read as mostly gaps. Same selector as
     WordPress's rule, loaded after it. */
  .fl-row[data-node]:where(:not(.gga *)) > .fl-row-content-wrap { padding-top: 32px; padding-bottom: 32px; }

  /* Intro paragraphs set at 28px for desktop (HubSpot, Resources, website landing page): 20px on phones */
  :is(.fl-node-5e5fb5a43b0bd, .fl-node-6d4cjragpsw0, .fl-node-5e59478936e9a, .fl-node-5db18ca616bf7) :is(p, li) { font-size: 20px !important; line-height: 28px !important; }

  /* Buttons and eyebrow labels wrap inside the screen instead of running off it */
  :is(.uabb-button, a.btn, .fl-button):not(.gga *) { max-width: 100%; box-sizing: border-box; white-space: normal; }
  .uabb-infobox-title-prefix:not(.gga *) { white-space: normal; overflow-wrap: anywhere; }
  /* Last line of defence: anything still wider than the screen (carousel tracks, fixed-width boxes)
     is clipped instead of making the whole page scroll sideways. clip, not hidden, so sticky bars still work. */
  html, body { overflow-x: clip; }
}

/* Blog archive cards: the titles are 18px links inside a heading set at 26px, so each line took the
   heading's 35px spacing. The link gets its own lines, at every width. */
h3.fl-post-title:not(.gga *) > a { display: block; line-height: 1.4; }

/* Rebuilt pages: step and tier headings in the SEO and GEO patterns were 30-32px on phones */
@media (max-width: 767px) {
  .gs :is(.gs-stage, .gs-tier, .gq-step) h3 { font-size: 26px; line-height: 32px; }
}

/* Blog archive post images keep their proportions at every width (Steve, 2026-11-11). They kept the
   height WordPress wrote on the <img> while the width scaled, so on /paid-search-and-social/ and
   /sales-enablement/ they were squashed by up to 15% on desktop. */
img.pp-post-img:not(.gga img) { height: auto; }
