/* steps follow-up — agent «mobile» (steps 20, 21). Loaded after v3.css on every rea page (ReaPage::cssFiles).
   On the public shell pages this file sits in the cascade layer `rea` and only reaches the chrome (header, menu, footer);
   a page body's own controls are sized in that page's stylesheet. */

/* ================================================================== step 20 — header on phones
   ≤1180px, and wherever the menu row folds into the burger (html.nav-fold, v3.js / site-chrome.js navFit), the header holds
   the logo, one «apply» button and the burger. The language switch, the theme switch, «trainee login» / the account menu
   (and the WhatsApp icon, which the bottom bar carries) live in the menu or the bar. */
.happly__short { display: none; }

@media (max-width: 1180px) {
  .header__right > .hbtn--wa,
  .header__right > #themeToggle,
  .header__right > .langsw,
  .header__right > .hlogin,
  .header__right > .hacct { display: none; }
  html .header__right > .happly { display: inline-flex; --h: 44px; padding-inline: 20px; }
  .happly__long { display: none; }
  .happly__short { display: inline; }
  .header__right { gap: 8px; }
}
html.nav-fold .header__right > .hbtn--wa,
html.nav-fold .header__right > #themeToggle,
html.nav-fold .header__right > .langsw,
html.nav-fold .header__right > .hlogin,
html.nav-fold .header__right > .hacct { display: none; }
html.nav-fold .header__right > .happly { display: inline-flex; --h: 44px; padding-inline: 20px; }
html.nav-fold .happly__long { display: none; }
html.nav-fold .happly__short { display: inline; }
html.nav-fold .header__right { gap: 8px; }

/* the menu's theme switch (a second handle on the header's #themeToggle) */
.mmenu__theme .i-sun { display: none; }
html:not([data-theme="dark"]) .mmenu__theme .i-sun { display: block; }
html:not([data-theme="dark"]) .mmenu__theme .i-moon { display: none; }
.mmenu__theme[aria-pressed="true"] { border-color: var(--c-hi); }

/* ------------------------------------------------------------------ the bottom bar (_mobilebar.blade.php)
   Phones only; shown by the inline script after the first screen. Below the header (80), the menu (120), the course
   sheet (250) and the video modal (260). */
.mbar { display: none; }
@media (max-width: 767px) {
  .mbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 70; display: flex; gap: 10px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--c-bg); /* a browser without color-mix() gets the solid ground, never a see-through bar */
    background: color-mix(in srgb, var(--c-bg) 90%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid var(--c-line);
    transform: translateY(100%); visibility: hidden;
    transition: transform .35s var(--ease), visibility 0s .35s;
  }
  .mbar.is-on { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s; }
  .mbar .btn { --h: 48px; flex: 1 1 0; min-width: 0; padding-inline: 14px; }
  .mbar__apply { flex-grow: 1.7; }
  /* room for the bar under the footer's last links: added the first time the bar shows (on <html>, so it also holds on the shell pages).
     69px = the bar's own height: 10 + 48 (button) + 10 padding + 1 border. */
  html.has-mbar { padding-bottom: calc(69px + env(safe-area-inset-bottom, 0px)); }
  /* toasts sit above the bar */
  html.has-mbar .site-toasts, html.has-mbar .lms-toasts { inset-block-end: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .mbar, .mbar.is-on { transform: none; transition: none; }
}

/* ================================================================== step 21 — touch targets ≥ 44×44px on phones
   Built with padding / min-height so the type and the look stay as they are; inline links inside a sentence get their
   padding cancelled by an equal negative margin so the lines do not move apart. */
@media (max-width: 900px) {
  .logo { min-height: 44px; }

  /* filters, tabs, switches */
  .filter, #programs[data-v="h"] .filter { height: 44px; min-height: 44px; }
  .ftab, .lvl__b, .lab__sw2 button, .aix__c { min-height: 44px; }

  /* "text + arrow" links: the underline stays under the text, the extra room is above it */
  .link-arrow { min-height: 44px; align-items: flex-end; }
  .lab__more::before, .bn__f .link-arrow::before, .bn__strip .link-arrow::before { min-height: 0; }

  /* contact / venue lists (home «our place», the apply side, the footer) */
  .vlink { display: inline-flex; align-items: center; min-height: 44px; }
  .reg__contact p a { display: flex; align-items: center; min-height: 44px; }
  .fhelp__l li a { display: inline-flex; align-items: center; min-height: 44px; }
  .fcontact { gap: 0; }
  .fcontact li { align-items: center; }
  .fcontact li svg { margin-top: 0; }
  .fcontact li a { display: flex; align-items: center; min-height: 44px; }
  .footer .social a, .social a { width: 44px; height: 44px; }

  /* footer link columns and the legal row */
  .footer__links ul { gap: 0; }
  .footer__links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .footer__legal { gap: 0 20px; }
  .footer__legal a { display: flex; align-items: center; min-height: 44px; min-width: 44px; }

  /* breadcrumbs (the apply page) */
  .crumbs a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

  /* the home page's course sheet (v3.js buildSheet): its section pills were 38px, «ask about the price» 40px and
     «the full course page» 25px tall */
  .cs__nav button, .pblock__ask, .cs__page { min-height: 44px; }

  /* a link inside a sentence */
  .sec-sub a, .footer__bottom p > a { display: inline-block; padding-block: 13px; margin-block: -13px; }

  /* the consent checkbox: the real input becomes a 44×44 invisible hit area over the same 22px box, which the label draws */
  .field--check { position: relative; grid-template-columns: 44px minmax(0, 1fr); gap: 0; align-items: start; }
  .field--check input { position: absolute; inset-block-start: 0; inset-inline-start: 0; z-index: 1; width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
  .field--check label { position: relative; grid-column: 2; min-height: 44px; padding-block: 11px; }
  .field--check label::before { content: ""; position: absolute; inset-block-start: 11px; inset-inline-start: -33px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--c-line-2); background: var(--c-field); transition: border-color .25s, background-color .25s; }
  .field--check input:checked + label::before { background: var(--c-acc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.2l3 3 6-6.4' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; border-color: var(--c-acc); }
  html[data-theme="dark"] .field--check input:checked + label::before { background-color: var(--btn); border-color: var(--btn); }
  .field--check input:focus-visible + label::before { outline: 2px solid var(--c-hi); outline-offset: 3px; }
  .field--check.is-invalid label::before { border-color: var(--c-error); }
}
