/* Tuotu Astro-projektista: src/styles/mobile/hero.css (bin/sync-astro.py). */
/* Mobile round (Tapio, 2026-09-25): Heroes on phones: the text first, the picture after it.
   Loaded after wp.css (src/layouts/Site.astro). Phone and tablet rules only: desktop stays as it is. */

/* One column (<=960 px), where the rails hero stacks (global.css .split-hero--rails
   @media (max-width: 960px)). Every hero's markup has the text first; only the
   booking hero put its photo on top (wp.css .wp-booking .split-hero-card { order: -1 }).
   Tapio 2026-09-25: "The image should be after the text." */
@media (max-width: 960px) {
  /* Booking pages (TextBlock's booking branch): /ilmainen-hakukoneoptimoinnin-tsekkaus/,
     /en/free-seo-checkup/, /ilmainen-wordpress-konsultaatio/. The photo after the text,
     the button and its note (and before a Calendly calendar), at the size of the same
     photo on /hinnasto/ and /tapio-kauranen/. The pricing hero (also .wp-booking) does
     this in src/components/PricingHero.astro. */
  .split-hero.split-hero--rails.wp-booking:not(.pricing-hero) .split-hero-card {
    order: 0;
    padding-top: 1.5rem;
  }

  .split-hero.split-hero--rails.wp-booking:not(.pricing-hero) .split-hero-card img {
    max-height: 16rem;
  }

  /* About pages (/tapio-kauranen/, /en/who-is-tapio-kauranen/): the photo centred under
     the text like the others (margin-inline: auto does nothing on the inline img). */
  .split-hero.split-hero--rails.tk-hero .split-hero-card {
    text-align: center;
  }
}

/* Front page hero on phones (Tapio, 2026-10-19: "korjaa heron mobiilinäkyvyys. Se on nyt
   todella huono"). The desktop hero stays as Tapio likes it. On a phone it kept the desktop's
   gaps: 80 px above the portrait, 40 px a side on both halves (wp.css body.is-front .wp-opener,
   !important), so the text was 278 px wide (heading on three lines, text on eight), and 80 px
   below, which pushed the button under the first screen. Here the hero uses the full width,
   the gaps are small and the button spans the column, still centred on one axis. */
@media (max-width: 640px) {
  body.is-front .split-hero.split-hero--rails.wp-opener .split-hero-copy {
    padding: 2rem 0 0 !important;
  }

  body.is-front .split-hero.split-hero--rails.wp-opener .split-hero-card {
    padding: 1.25rem 0 2.5rem !important;
  }

  body.is-front .split-hero.split-hero--rails.wp-opener .wp-opener-portrait img {
    width: 6rem;
    margin-bottom: 1rem;
  }

  body.is-front .split-hero.split-hero--rails.wp-opener h1 {
    font-size: clamp(1.75rem, 7.5vw, 2.1rem);
    line-height: 1.12;
  }

  body.is-front .split-hero.split-hero--rails.wp-opener .wp-prose {
    margin-top: 0;
  }

  body.is-front .split-hero.split-hero--rails.wp-opener .split-hero-actions {
    width: 100%;
    margin-top: 1.5rem !important;
  }

  body.is-front .split-hero.split-hero--rails.wp-opener .split-hero-actions .btn:where(:not(.tk-sec, .tk-sec *, .tk-results, .tk-results *, .tk-fp-hero, .tk-fp-hero *)) {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
  }
}
