/* Feuille aussi utilisée par la page d'accueil, dont le haut de page en garde une copie dans index.html :
   après toute modification, lancer « node tools/css-premier-ecran.mjs » (voir ce fichier). */
/* ═══════════════════════════════════════════════════════════════════
   MPL : finitions téléphone et tablette (12/11/2026)
   Chargée en dernier, sur l'accueil et sur les pages internes.
   - zones sûres de l'iPhone (encoche, barre du bas, paysage)
   - marges régulières (gouttière unique)
   - zones au doigt de 44 px minimum
   - textes lisibles (plus rien sous 10 px)
   - tablette portrait : texte du haut de l'accueil lisible
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --gouttiere: 24px;
  --zs-haut: env(safe-area-inset-top, 0px);
  --zs-bas: env(safe-area-inset-bottom, 0px);
  --zs-gauche: env(safe-area-inset-left, 0px);
  --zs-droite: env(safe-area-inset-right, 0px);
}
@media (max-width: 374px) { :root { --gouttiere: 20px; } }

/* ═══════ 1. ZONES SÛRES ═══════ */
@media (max-width: 980px) {
  /* En-tête : sous l'heure et l'encoche, jamais dessous */
  .hero-nav {
    padding-top: calc(14px + var(--zs-haut)) !important;
    padding-bottom: 14px !important;
    padding-left: max(var(--gouttiere), var(--zs-gauche)) !important;
    padding-right: max(var(--gouttiere), var(--zs-droite)) !important;
  }
  /* Pages internes : le haut de page commence sous l'en-tête fixe */
  .hero:not(.hero--tarmac) { padding-top: calc(118px + var(--zs-haut)) !important; }
  html:not(:has(.hero--tarmac)) { scroll-padding-top: calc(96px + var(--zs-haut)); }
  /* Menu plein écran */
  .mobile-nav-inner {
    padding-top: calc(96px + var(--zs-haut)) !important;
    padding-left: max(28px, var(--zs-gauche)) !important;
    padding-right: max(28px, var(--zs-droite)) !important;
    padding-bottom: calc(28px + var(--zs-bas)) !important;
    /* Sur petit écran (iPhone SE), le bas du menu (langues) doit rester accessible */
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* Bulle du concierge (page conciergerie) */
  .mpl-ai-bubble {
    right: max(18px, var(--zs-droite)) !important;
    bottom: calc(18px + var(--zs-bas)) !important;
  }
  /* Rien ne reste caché sous la bulle en bas de page */
  body:has(.mpl-ai-bubble) .footer { padding-bottom: calc(104px + var(--zs-bas)) !important; }
}

/* ═══════ 2. MARGES RÉGULIÈRES (téléphone) ═══════ */
@media (max-width: 760px) {
  /* Accueil */
  .hero--tarmac .hero-main,
  .mpl-manifesto, .mpl-territory, .mpl-final-cta, .svc-how-inner {
    padding-left: max(var(--gouttiere), var(--zs-gauche)) !important;
    padding-right: max(var(--gouttiere), var(--zs-droite)) !important;
  }
  /* « Réservez votre séjour » avait une double marge (48 px) */
  .services-cols-header { padding-left: 0 !important; padding-right: 0 !important; }
  /* Pages internes */
  .hero:not(.hero--tarmac), .section {
    padding-left: max(var(--gouttiere), var(--zs-gauche)) !important;
    padding-right: max(var(--gouttiere), var(--zs-droite)) !important;
  }
  /* Pied de page */
  .footer {
    padding-left: max(var(--gouttiere), var(--zs-gauche)) !important;
    padding-right: max(var(--gouttiere), var(--zs-droite)) !important;
  }
}

/* ═══════ 3. ZONES AU DOIGT (44 px) ═══════ */
@media (max-width: 1024px) {
  .logo-scm { min-height: 44px; min-width: 44px; align-items: center; }

  /* Pied de page : liens des colonnes */
  .footer-col ul { gap: 0 !important; }
  .footer-col ul li > a:not(:has(.footer-contact-label)) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 !important;
  }
  /* Contact du pied de page (libellé + valeur) */
  .footer-col-contact ul li > a { min-height: 48px; justify-content: center; padding: 4px 0 !important; }
  .footer-col-contact ul { gap: 6px !important; }
  /* Mentions légales, confidentialité, CGV */
  /* Les libellés traduits (russe…) sont plus longs : la rangée passe à la ligne au lieu d'être coupée */
  .footer-legal { flex-wrap: wrap !important; justify-content: center !important; column-gap: 18px !important; row-gap: 0 !important; }
  .footer-legal a, .footer-legal button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
  /* Liens « Pages liées » des pages internes */
  .internal-links a { display: inline-flex; align-items: center; min-height: 44px; }
  /* Réseaux sociaux du pied de page */
  .footer-social a { width: 44px !important; height: 44px !important; }
  /* Accueil : la liste « Nos services » du haut */
  .brands-list { row-gap: 0 !important; }
  .brands-list a { display: inline-flex; align-items: center; min-height: 44px; padding-top: 0 !important; padding-bottom: 0 !important; }
  /* Accueil : WhatsApp direct et Concierge IA du dernier appel */
  .mpl-final-cta-actions .mpl-fcta-wa,
  .mpl-final-cta-actions .mpl-fcta-ai { min-height: 48px; }
}
@media (max-width: 760px) {
  /* Titres repliables du pied de page (Services, Destinations, Contact) */
  .footer-col { padding-top: 4px !important; padding-bottom: 4px !important; }
  .footer-col h4 { min-height: 48px; margin: 0 !important; }
  .footer-col.open ul { padding-top: 0 !important; padding-bottom: 12px; }
  .footer-col-contact { padding-top: 16px !important; }
}

/* ═══════ 4. TEXTES LISIBLES ═══════ */
@media (max-width: 760px) {
  .footer-perk { font-size: 10.5px !important; }
  .footer-contact-label { font-size: 11px !important; }
  .footer-col h4 { font-size: 12px !important; }
  .footer-copy, .footer-legal a, .footer-legal button { font-size: 11px !important; }
  .footer .mpl-wordmark-sub, .footer .mpl-wordmark-amp { font-size: 10px !important; }
  .section-kicker, .eyebrow, .section-eyebrow, .brands-label,
  .svc-how-label, .svc-col-tag, .svc-how-hint, .eyebrow-text,
  .mpl-manifesto-eyebrow, .mpl-territory-eyebrow, .mpl-avis-eyebrow { font-size: 12px !important; }
  .svc-composer-or { font-size: 11px !important; }
  .svc-composer-text-sub { font-size: 13px !important; line-height: 1.45 !important; }
  .svc-col-arrow span { font-size: 11px !important; }
  .btn { font-size: 12px !important; }

  /* Barre « Réserver maintenant » : le É était rogné (hauteur de ligne trop serrée) */
  .mpl-mobile-bar-cta { font-size: 11.5px !important; }
  .mpl-mobile-bar-cta span { line-height: 1.5 !important; padding-top: 1px; }
}

/* ═══════ 5. BARRE DU BAS DE L'ACCUEIL ═══════ */
@media (max-width: 720px) {
  /* Angles nets comme le reste du design prestige */
  .mpl-mobile-bar { border-radius: 0 !important; padding: 6px !important; }
  .mpl-mobile-bar-cta { min-height: 48px !important; }
  .mpl-mobile-bar-ai { width: 48px !important; height: 48px !important; }
}

/* ═══════ 6. MENU PLEIN ÉCRAN DE L'ACCUEIL ═══════ */
/* L'en-tête de l'accueil est à l'encre (fond clair) : menu ouvert, il repasse en clair */
.hero--tarmac:has(.mobile-burger.is-open) .logo-scm .logo-img { filter: none !important; }
.hero--tarmac .mobile-burger.is-open {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}
.hero--tarmac:has(.mobile-burger.is-open) .mobile-lang-toggle-btn {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}
/* Mêmes boutons que sur les pages internes (fins, porcelaine) */
.mobile-nav-overlay .mobile-nav-cta {
  background: var(--porcelaine, #F4F4F1) !important;
  color: var(--nuit, #0E1317) !important;
  font-weight: 400 !important;
  letter-spacing: 0.2em !important;
}
.mobile-nav-overlay .mobile-nav-wa,
.mobile-nav-overlay .mobile-lang-options button { font-weight: 400 !important; letter-spacing: 0.16em !important; }

/* ═══════ 7. TABLETTE PORTRAIT (761 à 1023 px) ═══════ */
/* Le texte passait sur la carrosserie noire : on empile comme sur téléphone */
@media (min-width: 761px) and (max-width: 1023px) {
  .hero--tarmac { min-height: 0 !important; }
  .hero--tarmac .hero-main { flex: none; justify-content: center; padding: 56px 64px 64px !important; }
  .hero--tarmac .hero-content { padding-top: 0 !important; max-width: 620px !important; margin: 0 auto; }
  .hero--tarmac .hero-bg { position: relative !important; inset: auto !important; order: 10; height: auto !important; aspect-ratio: 3 / 2; max-height: 72vh; }
  .hero--tarmac .hero-bg picture { display: block; height: 100%; }
  .hero--tarmac .hero-bg img { height: 100% !important; object-position: 30% 75% !important; transform: none !important; }
  .hero--tarmac .hero-bg::after { background: linear-gradient(180deg, var(--porcelaine, #F4F4F1) 0%, rgba(244, 244, 241, 0) 24%) !important; }
}

/* ═══════ 8. DESTINATIONS DE L'ACCUEIL : pas de case vide ═══════ */
@media (max-width: 640px) {
  .mpl-territory-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mpl-territory-card:last-child:nth-child(odd) .mpl-territory-card-image { aspect-ratio: 16 / 7; }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .mpl-territory-grid { grid-template-columns: repeat(6, 1fr) !important; }
  .mpl-territory-card { grid-column: span 2; }
  .mpl-territory-card:nth-child(4):nth-last-child(2),
  .mpl-territory-card:nth-child(5):last-child { grid-column: span 3; }
  .mpl-territory-card:nth-child(4):nth-last-child(2) .mpl-territory-card-image,
  .mpl-territory-card:nth-child(5):last-child .mpl-territory-card-image { aspect-ratio: 16 / 9; }
}

/* ═══════ 9. ARABE (droite à gauche) ═══════ */
/* Les numéros et adresses restent écrits de gauche à droite (+33… et non 33…+) */
html[dir="rtl"] .footer-contact-value,
html[dir="rtl"] .mobile-nav-phone { unicode-bidi: isolate; direction: ltr; }
/* Textes restés en français ou en anglais dans le pied de page arabe : gardés dans leur ordre
   (sinon « 7 jours sur 7 » devenait « JOURS SUR 7 7 ») */
html[dir="rtl"] .footer p,
html[dir="rtl"] .footer-perk,
html[dir="rtl"] .footer-copy,
html[dir="rtl"] .footer-legal a,
html[dir="rtl"] .footer-contact-value,
html[dir="rtl"] .footer .mpl-wordmark-title,
html[dir="rtl"] .footer .mpl-wordmark-sub,
html[dir="rtl"] .hero-proof span,
html[dir="rtl"] main p,
html[dir="rtl"] main h3,
html[dir="rtl"] main summary,
html[dir="rtl"] .faq-q,
html[dir="rtl"] .internal-links a { unicode-bidi: plaintext; }

/* ═══════ 10. TABLETTE : finitions du pied de page ═══════ */
@media (min-width: 761px) and (max-width: 1024px) {
  .footer-col h4[tabindex], .footer-col h4[role="button"] { min-height: 44px; display: flex; align-items: center; margin-bottom: 0 !important; }
  .footer-perk { font-size: 10.5px !important; }
  .footer-contact-label { font-size: 11px !important; }
  .footer .mpl-wordmark-sub, .footer .mpl-wordmark-amp { font-size: 10px !important; }
}

/* ═══════ 11. MOTS LONGS (russe, allemand) ═══════ */
/* « Политика конфиденциальности » ne tenait pas en largeur à 375 px */
h1, h2, h3 { overflow-wrap: break-word; }
@media (max-width: 420px) {
  html[lang="ru"] .hero h1, html[lang="de"] .hero h1 { font-size: clamp(30px, 9.4vw, 44px) !important; }
  html[lang="ru"] :is(h1, h2, h3), html[lang="de"] :is(h1, h2, h3) { hyphens: auto; -webkit-hyphens: auto; }
}

