/* Tuotu Astro-projektista: src/styles/mobile/typography.css (bin/sync-astro.py). */
/* Mobile round (Tapio, 2026-09-25): Type on phones: heading sizes, letter spacing, line heights, body text.
   Loaded after wp.css (src/layouts/Site.astro). Phone and tablet rules only: desktop stays as it is. */

/* 1. Phones (<=767 px): the desktop's fixed tracking made relative and nearly neutral.
   global.css 7762/7779 give every heading on the site -2px (h1, h2) or -1px (h3-h6), 8011 the
   feature-row titles -2px and 8729 the eyebrow -1px; ContactBand.astro 111 its paragraph title
   -2px. At the phone sizes that is -0.07 to -0.10em (24 px: -0.083em), twice the desktop's
   -0.033 to -0.045em, and the bold Arial letters touch. The leading `html` adds one type
   selector, so these win over the originals (all !important) whatever order the bundle
   puts the files in. */
@media (max-width: 767px) {
  html body.product-home main :is(h1, h2):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    letter-spacing: -0.01em !important;
  }

  html body.product-home main :is(h3, h4, h5, h6):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    letter-spacing: 0 !important;
  }

  html body.product-home main .feature-row--rails .feature-row-copy .feature-row-title:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    letter-spacing: -0.01em !important;
  }

  html body.product-home main .feature-row--rails .feature-row-copy :is(h3, h4).feature-row-title:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    letter-spacing: 0 !important;
  }

  html body.page-service main p.eyebrow:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    letter-spacing: 0 !important;
  }

  html body.product-home.page-service main .contact-band .section-intro.section-intro--rails p.contact-band-heading:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    letter-spacing: -0.01em !important;
  }

  /* The desktop's 18ch / 20ch caps (global.css 5286, 5814, 7621, 9560) count "0" widths,
     which the looser tracking no longer matches; on a phone they left the heading a
     208-285 px strip of a 358 px column. Headings take the column. */
  html body.page-service.product-home main .feature-row--rails .feature-row-copy .feature-row-title:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)),
  html body.page-service.product-home main .icon-cards--rails .icon-card h3:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)),
  html body.page-service.product-home main .faq-accordion--rails h2:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    max-width: none;
  }

  /* Line heights with room for Finnish umlauts over the line above's descenders
     (bold Arial is 1.12em from descender to ascender). */
  html body.product-home .split-hero--rails h1 {
    line-height: 1.15;
  }

  html body.page-service main .feature-row--rails .feature-row-copy > h2.feature-row-title:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    line-height: 1.2 !important;
  }

  html body.page-service.product-home main :is(h3, h4, .feature-row-title):where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    line-height: 1.25 !important;
  }
}

/* 2. Phones (<=640 px, the phone scale of wp.css 2692): the headings that fell out of it. */
@media (max-width: 640px) {
  /* ContactBand's title as a <p> (beginner's guide) was 32 px; as an h2 it is 24 px. */
  html body.product-home.page-service main .contact-band .section-intro.section-intro--rails p.contact-band-heading:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  /* A text block's h3 was 24 px, as big as the section's h2. */
  html body.page-service main .wp-prose h3:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    font-size: 1.3rem !important;
  }

  /* The FAQ title was 25.6 px, the other section titles 24 px. */
  html body.product-home main .faq-accordion--rails h2:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    font-size: 1.5rem;
  }
}

/* 3. GuideHero: a heading with a word the column beside the 90 px portrait cannot hold
   (screen - 146 px; "Hakukoneoptimointi" is 264 px at 28 px) goes under the portrait.
   GuideHero.astro sets .has-long-word. */
@media (max-width: 419px) {
  .guide-hero.has-long-word .split-hero-copy > h1 {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 1.25rem;
  }

  .guide-hero.has-long-word .guide-hero-text {
    grid-row: 4;
  }
}
