/* MessageFlow home page - fixes for short and scaled screens (Windows 150% = 1280x580 viewport).
 * Ready to ship now, independent of the animation rework.
 * Checked in Chrome (2026-11-16): header at 1280x580 (PL and EN) and 1366x620 - no overflow,
 * top bar and nav bar share the 24 px side padding; whole page at 1280x580, 1470x830,
 * 1536x730, tablets and phones.
 *  1. Full navigation from 1280 px instead of 1440 px (laptop variant).
 *     "Załóż konto" moves from the nav bar to the top bar, as a text link after
 *     "Zaloguj się", same look but no dropdown.
 *  2. Mega menu panel scrolls when it is taller than the screen.
 *  3. Section padding 80 -> 56/64 px on screens up to 760 px tall.
 * Not included on purpose: hero and animation stages (being redesigned this week).
 *
 * MARKUP NEEDED (top bar template, right after the secondary_header_navigation menu
 * that prints "Zaloguj się"). Label, URL and target = the same ACF option the nav bar
 * button already uses (first_button_in_header, see nav-buttons.php), so no new field
 * and translations keep working per language:
 *
 *   <ul class="navbar-nav flex-row align-items-center position-relative fz-14 fw-medium mf-topbar__signup">
 *     <li class="menu-item">
 *       <a class="nav-link" href="{url}" target="{target}" rel="noopener">{label}</a>
 *     </li>
 *   </ul>
 *
 * The classes are the ones the "Zaloguj się" list already has, so the link gets
 * the top bar font (14 px / 500), colour, hover and focus ring from existing CSS.
 * Keep the visually hidden "opens in a new tab" text the nav bar button has
 * (the EN button prints "Link opens in a new tab" in a hidden span).
 */

/* ---------- NAVIGATION (fix 2) ---------- */
/* Live: links only from 90rem (1440 px), hamburger below - so Windows 150% (1280)
   and every 1366 laptop got the drawer. Laptop range 1280-1439 now shows the full
   bar. Space at 1280 (row 1217 px): logo 142 (Figma size, live uses 170) + links
   798 (PL, gap 8 -> 4) + primary CTA 226 = 1166, so 51 px stays for the gaps.
   "Załóż konto" leaves the bar and becomes a top bar link after "Zaloguj się"
   (29.07 decision) - see the markup note at the top of this file. */
@media (min-width: 80rem) and (max-width: 89.999rem) {
  .main-header .navbar .container {
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
  }
  .mf-header-desktop { display: flex !important; }
  .mf-header-compact { display: none !important; }
  .mf-header-actions--desktop { display: flex !important; }
  .mf-header-actions--desktop .crunch-button-wrapper:first-child { display: none !important; }
  /* live sets .mf-gap-inline { gap: 8px !important } and the brand at 10.625rem */
  /* only Polish needs the tighter gap (links 823 px); English links are ~130 px
     shorter and keep the live 8 px */
  html:lang(pl) .mf-header-desktop .navbar-nav.mf-menu.mf-gap-inline { gap: 4px !important; }
  /* height scaled with the width (live box 170 x 26), otherwise the logo sits at the
     top of a 26 px box and ends up ~2 px above the menu links */
  .main-header .navbar .navbar-brand.js-navbar-brand { width: 142px; height: calc(1.625rem * 142 / 170); }
  .main-header .navbar .navbar-brand.js-navbar-brand img { width: 142px; height: auto; }
  .mf-header-actions--desktop .crunch-button { white-space: nowrap; }
  /* live reserves 12.375rem (170 logo + 28 gap) for the brand column */
  .main-header .main-header__nav-wrapper { width: calc(100% - 142px - 24px); }
  /* top bar on the same full-width grid as the nav bar (live: 1160 px container) */
  .main-header .mf-topbar > .container {
    max-width: none !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* "Załóż konto" in the top bar exists only in the laptop range */
.mf-topbar__signup { display: none !important; }
@media (min-width: 80rem) and (max-width: 89.999rem) {
  .mf-topbar .mf-topbar__signup { display: flex !important; }
}

/* Mega menu panel is 493 px tall and fixed under the header: on a 580 px screen
   its last row was cut off with no way to scroll. */
@media (min-width: 80rem) {
  .main-header .mf-mega {
    max-height: calc(100svh - 116px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ---------- SECTION RHYTHM (fix 3) ---------- */
/* 80 px section padding on a 580 px screen eats a third of the view between
   two sections. 56 / 64 px = the values the blocks already use on phones. */
@media (min-width: 768px) and (max-height: 760px) {
  .mf-journey--default-top, .mf-platform--default-top, .mf-channels--top,
  .mf-industries--top, .mf-api--top, .mf-partners--top, .mf-cases--top,
  .mf-security--top { padding-top: 56px; }
  .mf-journey--default-bottom, .mf-platform--default-bottom, .mf-channels--bottom,
  .mf-industries--bottom, .mf-api--bottom, .mf-partners--bottom, .mf-cases--bottom,
  .mf-security--bottom { padding-bottom: 64px; }
}
