/* Tuotu Astro-projektista: src/styles/mobile/header.css (bin/sync-astro.py). */
/* Mobile round (Tapio, 2026-09-25): The header row on phones and tablets (<=1199 px): booking button, search beside the menu button.
   Loaded after wp.css (src/layouts/Site.astro). Phone and tablet rules only: desktop stays as it is. */

/* Phones and tablets (the menu button shows up to 1199 px). The row ends in
   [Ajanvaraus/Book] [search] [menu], one small gap between them, all 2.25rem tall and
   centred on the row. The languages move into the menu panel at every width here. */
@media (max-width: 1199px) {
  /* One gap: logo to tools (tools keep margin-left: auto) and search to menu button. */
  body.product-home .product-header-inner {
    column-gap: 0.5rem;
  }

  body.product-home .product-tools {
    gap: 0.5rem;
  }

  /* The booking button stays in the row (global.css hid it up to 560 px) and comes first. */
  body.product-home .product-tools .product-signup {
    display: inline-flex;
    align-items: center;
    order: -1;
    flex: none;
    height: 2.25rem;
    padding: 0 0.75rem;
    line-height: 1;
  }

  /* The globe leaves the row; the panel lists the languages instead (below). */
  body.product-home .product-tools .product-lang {
    display: none;
  }

  /* Search button: the menu button's 2.25rem square. */
  body.product-home .product-search {
    height: 2.25rem;
  }

  body.product-home .product-search.is-collapsible {
    width: 2.25rem;
    flex: 0 0 2.25rem;
  }

  body.product-home .product-search.is-collapsible:not(.is-open) .product-search-submit {
    width: 2.25rem;
    height: 2.25rem;
  }

  body.product-home .product-search input {
    height: 2.25rem;
  }

  /* The suggestion box starts under the (now 2.25rem) field; wp.css has calc(2rem - 2px). */
  body.product-home .product-search .search-suggest {
    padding-top: calc(2.25rem - 2px);
  }

  /* Menu button: never squeezed (it shrank to 26 px wide at 320 px), and the search
     button's border so the two squares match. */
  body.product-home .product-menu-toggle {
    flex: none;
    border-color: color-mix(in srgb, var(--gh-border) 85%, var(--gh-text));
  }

  /* Panel's bottom row: only the languages; the booking button is in the row above. */
  body.product-home .product-nav-account {
    display: block;
  }

  body.product-home .product-nav-account .product-signup {
    display: none;
  }

  body.product-home .product-languages {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body.product-home .product-nav-account .product-languages a {
    display: inline-flex;
    align-items: center;
    height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    color: var(--gh-subtle);
    font-size: 0.94rem;
  }

  body.product-home .product-nav-account .product-languages a[aria-current] {
    border-color: color-mix(in srgb, var(--gh-border) 85%, var(--gh-text));
    color: var(--gh-text);
    font-weight: 600;
  }
}

@media (max-width: 1199px) and (hover: hover) {
  body.product-home .product-menu-toggle:hover {
    border-color: var(--gh-muted);
  }
}

/* Phones: the opened search still covers the whole logo row (global.css "Opened search
   covers the whole logo row"); the 2.25rem slot above must not hold it. */
@media (max-width: 860px) {
  body.product-home .product-search.is-collapsible.is-open {
    width: auto;
    flex: none;
  }
}

/* 641–860 px: the hello bar kept 2.4rem each side for a close button that no longer
   exists; the Finnish line broke in two at 641–690 px. */
@media (min-width: 641px) and (max-width: 860px) {
  body.product-home .hello-bar-inner {
    padding-inline: 0;
  }
}

/* Phones: a smaller name and button so the row fits. Where it still doesn't (Finnish
   below ~390 px, English below ~345 px) the name breaks onto two lines, "Tapio" over
   "Kauranen", the height of the portrait. */
@media (max-width: 640px) {
  body.product-home .product-logo {
    flex: 0 1 auto;
    gap: 0.5rem;
    margin-right: 0.25rem;
    font-size: 1.125rem;
    line-height: 1;
  }

  /* The portrait never shrinks (img max-width: 100% lets flex squash it). */
  body.product-home .product-logo-icon {
    flex: none;
  }

  body.product-home .product-tools .product-signup {
    padding: 0 0.625rem;
    font-size: 0.8125rem;
  }
}

/* The smallest phones (320–359 px). */
@media (max-width: 359px) {
  body.product-home .product-header-inner,
  body.product-home .product-tools {
    column-gap: 0.375rem;
  }

  body.product-home .product-logo {
    gap: 0.375rem;
    font-size: 1rem;
  }

  body.product-home .product-logo-icon img {
    width: 2rem;
    height: 2rem;
  }

  body.product-home .product-tools .product-signup {
    padding: 0 0.5rem;
    font-size: 0.75rem;
  }
}
