/*
 * Mobile & tablet refinements.
 * Every rule below lives inside a max-width media query (or only affects
 * elements that never appear in the desktop layout), so the desktop design
 * above 900px is left untouched.
 * `html:root:root` prefixes raise specificity to match the scoped component styles.
 */

/* Embeds always scale to fit their container (no embeds overflow on any size) */
iframe,
video,
embed,
object {
  max-width: 100%;
}
video {
  height: auto;
}

@media (max-width: 900px) {
  /* ---------- No sideways scrolling ---------- */
  /* Decorative elements (tilted marquee, offset stickers, glows) are clipped
     instead of widening the page. `clip` keeps sticky elements working. */
  main,
  footer {
    overflow-x: clip;
  }
  html:root:root .h-display,
  html:root:root .h1,
  html:root:root .h2,
  html:root:root .h3 {
    overflow-wrap: break-word;
  }

  /* ---------- Images scale to fit ---------- */
  html:root:root .hero__img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: 100% 50%;
  }

  /* ---------- Readable text: body copy at least 16px ---------- */
  html:root:root .btn,
  html:root:root .hdr__word,
  html:root:root .pc__body p,
  html:root:root .ftr__hours,
  html:root:root .ftr__bottom,
  html:root:root .rmap__txt span,
  html:root:root .rmap__route,
  html:root:root .list small,
  html:root:root .conds__note,
  html:root:root .ff__field > span,
  html:root:root .pill span,
  html:root:root .ff__check,
  html:root:root .ff__note,
  html:root:root .ff__err,
  html:root:root .leaflet-popup-content {
    font-size: 1rem;
  }
  html:root:root .ff__field > span {
    letter-spacing: 0.08em;
  }
  html:root:root .leaflet-control-attribution {
    font-size: 0.875rem;
  }

  /* ---------- Tap targets at least 44 x 44px ---------- */
  /* Footer links */
  html:root:root .ftr__list {
    gap: 0.1rem;
  }
  html:root:root .ftr__list a,
  html:root:root .ftr__bottom a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  /* Inline social / delivery links */
  html:root:root .deliv__social a,
  html:root:root .info a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  /* "Itinéraire" links in the restaurant list */
  html:root:root .rmap__route {
    min-height: 44px;
    margin-bottom: 0.4rem;
  }
  /* Map controls */
  html:root:root .leaflet-bar a,
  html:root:root .leaflet-touch .leaflet-bar a {
    width: 44px;
    height: 44px;
    line-height: 44px;
    font-size: 22px;
  }
  html:root:root .leaflet-control-attribution a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  html:root:root .leaflet-container a.leaflet-popup-close-button {
    width: 44px;
    height: 44px;
    font-size: 24px;
    line-height: 44px;
  }
  html:root:root .leaflet-popup-content {
    margin-right: 44px;
  }
  /* Menu page tabs: one swipeable row of 44px-tall pills */
  html:root:root .tabs {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  html:root:root .tabs::-webkit-scrollbar {
    display: none;
  }
  html:root:root .tabs a {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: 44px;
    white-space: nowrap;
  }
  /* Franchise form consent checkbox */
  html:root:root .ff__check {
    min-height: 44px;
  }
  html:root:root .ff__check input {
    width: 24px;
    height: 24px;
  }
  /* The mouse-shaped "scroll down" cue is meaningless on touch screens
     and too small to tap; the content right below is reachable by swiping. */
  html:root:root .hero__scroll {
    display: none;
  }

  /* ---------- Collapsed navigation menu ---------- */
  /* Hide the closed menu from keyboard and screen-reader users too */
  html:root:root .mnav {
    visibility: hidden;
    transition:
      clip-path 0.7s var(--ease),
      visibility 0s linear 0.7s;
  }
  html:root:root .hdr.is-open .mnav {
    visibility: visible;
    transition:
      clip-path 0.7s var(--ease),
      visibility 0s;
  }
  html:root:root .mnav nav {
    gap: 0.4rem;
  }
  html:root:root .mnav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding-inline: 1rem;
  }
}

@media (max-width: 560px) {
  /* Long single words in big section titles (e.g. "Investissement")
     must fit a 320px-wide phone */
  html:root:root .h1 {
    font-size: clamp(2rem, 10.5vw, 2.8rem);
  }
}
