/* Mobile and iPhone polish. Linked last, after every other stylesheet, so it only corrects what the
   earlier sheets get wrong on touch screens and notched phones. Desktop values are unchanged: every
   env() below is 0 without a notch, and every pointer or width query is scoped to touch or phone sizes. */

/* ---------------------------------------------------------------- text and taps */

/* iOS Safari inflates text after a rotation or a font change unless it is pinned to 100%. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* No grey flash on tap, and no 300ms double-tap delay on controls. */
body {
  -webkit-tap-highlight-color: transparent;
}
a, button, [role="button"], label, summary {
  touch-action: manipulation;
}

/* iOS zooms the page when a field under 16px is focused, then leaves it zoomed. Form controls are
   set to at least 16px on phones. The two search and verify fields set 14px on their own class, which
   beats a bare element selector, so they are listed explicitly. */
@media (max-width: 860px) {
  input, select, textarea { font-size: max(16px, 1em); }
  .cat-search input,
  .verify-form__row input { font-size: 16px; }
}

/* ---------------------------------------------------------------- notch and home-indicator safe areas */

/* The viewport uses viewport-fit=cover, so a notched phone (and an installed web app, which runs
   full screen) draws under the status bar and the side curves. The fixed header takes the top inset
   and the side insets. --nav gains the top inset too, so every offset that reads --nav (hero padding,
   anchor scroll margins, the sheet's top) clears the status bar as well.
   No double offset: .nav is border-box with height var(--nav), so its padding-top (the inset) comes out of
   that height. The content box left is core + util, and .nav__bar (100% - util) is exactly the core. */
:root {
  --nav: calc(var(--nav-core) + var(--util-h) + env(safe-area-inset-top, 0px));
}
.nav {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* The inset strip takes the utility bar's colour, so the status bar of an installed app (black-translucent,
   white text) never sits on the light header. It is 0px tall without a notch. A pseudo-element, not a background: later sheets reset the nav's background shorthand when it scrolls. */
.nav::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px);
  background: #0b0d24; pointer-events: none;
}

/* The open menu sheet is full width, so its side padding keeps the gutter and clears the curves. */
@media (max-width: 1023px) {
  .nav.is-open .nav__links {
    padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gut), env(safe-area-inset-right, 0px));
  }
  .nav.is-open .nav__actions {
    padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gut), env(safe-area-inset-right, 0px));
  }
}

/* The footer's last line (legal links) sits above the home indicator. The home page has a larger
   bottom padding for the WhatsApp button, so it keeps that value and takes the larger of the two. */
footer.closing {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: max(clamp(28px, 3.5vw, 48px), env(safe-area-inset-bottom, 0px)) !important;
}
html[data-page="/"] footer.closing {
  padding-bottom: max(calc(clamp(28px, 3.5vw, 48px) + 56px), env(safe-area-inset-bottom, 0px)) !important;
}

/* ---------------------------------------------------------------- 100svh fallback */

/* Heroes use 100svh (the small viewport, so the page does not jump as the browser bar moves). Browsers
   without svh get the 100vh height instead of an auto height that collapses the hero. */
@supports not (height: 100svh) {
  .hero.hero--cinema,
  .hero-sticky { height: 100vh; }
  main > .photo-band--hero:first-child { height: 100vh; min-height: 0; }
}

/* ---------------------------------------------------------------- tap targets on touch screens */

/* Utility bar (phone and tablet): the phone, email and WhatsApp icons are 28px and 22px. Their
   visible size stays; the tappable area grows to 44px with a pseudo-element, so the bar keeps its height. */
@media (pointer: coarse) and (max-width: 859px) {
  .util__link, .util__wa { position: relative; }
  .util__link::before { content: ""; position: absolute; inset: -8px -4px; }
  .util__wa::before { content: ""; position: absolute; inset: -11px -4px; }
}

/* Footer legal links and office links are small inline text. Make them 44px tall on touch screens
   (the footer list links already get this in site-chrome.css). */
@media (pointer: coarse) {
  .footer__legal a, .office__links a, .office a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ---------------------------------------------------------------- horizontal scroll */

/* A stray wide element must not create a sideways scroll on a phone. overflow-x: clip does not make the
   body a scroll container, so position: sticky (the hero and section intros) keeps working. The menu's
   body overflow lock is unaffected: body.nav-locked sets overflow: hidden and has the higher specificity.
   (kit/system.css already sets this on body; it is repeated here so this sheet stands alone. Images, video
   and svg already get max-width: 100% from the kit, so no extra media rule is added: a height: auto on
   svg would override the height attribute of icons that have no CSS size.) */
body {
  overflow-x: clip;
}
