/* Pap'pote, « Piste 27 » : retouches téléphone seulement (la page et la carte sur ordinateur ne changent pas).
   1. Carte : le bouton « Recentrer » reste visible (44 px) ; la fiche d'un pays
      devient une feuille fixée en bas de l'écran, au-dessus de la barre « Embarquer ».
   2. Page : espacements verticaux plus serrés ; listes en balayage horizontal (scroll-snap, sans bibliothèque) pour
      la méthode, les escales et les deux colonnes famille ; tableau des examens défilable ; 
      lignes du tableau des départs plus compactes. Aucun texte supprimé. */

/* Blocs repliables sur téléphone (billet, examens) : le résumé n'apparaît que sur téléphone ; sur ordinateur tout reste déplié. */
details[data-phone-fold] > summary { display: none; }

/* ---------- 1. Carte ---------- */
@media (max-width: 768px), (max-height: 500px) and (hover: none) {
  .carte-outils #c-reset { display: inline-flex; }
  .carte > .carte-fiche {
    position: fixed; z-index: 40; top: auto; left: 0; right: 0; width: auto; max-width: none;
    bottom: 0; max-height: min(56svh, calc(100svh - 96px)); overflow-y: auto; overscroll-behavior: contain;
    margin: 0; border: 1px solid var(--c-silver-a35); border-bottom: 0; border-radius: 14px 14px 0 0;
  }
  .l2-barre-pret .carte > .carte-fiche { bottom: calc(var(--l2-barre-h) + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 2. Page ---------- */
@media (max-width: 768px) {
  .sec { padding: 44px var(--gutter); }
  .sec h2, .destination h2 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .board { margin-top: 24px; padding: 10px; }
  .row { min-height: 0; gap: 2px 10px; padding: 8px 4px; }
  .r-name { font-size: 1rem; }
  .r-hw { font-size: 1rem; }
  .r-book { min-height: 32px; padding: 0 8px; }
  .r-book svg { width: 14px; height: 14px; }
  .r-hw, .r-name { line-height: 1.2; }
  .r-endo, .r-pron { font-size: 0.82rem; }

  /* Méthode : les annonces se balayent, une par écran */
  .announcements {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(80vw, 330px); gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 14px;
  }
  .ann {
    min-height: 0; padding: 20px 16px 20px 26px; border: 1px solid var(--c-metal-300); border-radius: 8px;
    scroll-snap-align: start;
  }
  .ann:last-child { border-bottom: 1px solid var(--c-metal-300); }
  [dir="rtl"] .ann { padding: 20px 26px 20px 16px; }
  .ann h3 { font-size: 1.6rem; }
  .ann p:last-child { margin-top: 8px; font-size: 1rem; }

  /* Billet : un peu plus serré */
  .pass-main { padding: 18px 16px; }
  .pass-route { margin: 12px 0 14px; }
  .pass-fields { gap: 10px 14px; padding-top: 12px; }
  .pass-cta { margin-top: 16px; }

  /* Escales : six étapes à balayer */
  .stops-list {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(74vw, 300px); grid-template-columns: none; gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 14px;
  }
  .stops-list li { padding: 18px 14px; border: 1px solid var(--c-ivory-a20); border-radius: 8px; scroll-snap-align: start; }
  .stops-list li::before { display: none; }
  .exams { gap: 20px; margin-top: 36px; grid-template-columns: minmax(0, 1fr); }
  .exams > *, .manifest-fold { min-width: 0; }
  .exams h3, .schools h3 { font-size: clamp(1.6rem, 7vw, 2rem); }
  .manifest-scroll { min-width: 0; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); overflow-x: auto; overscroll-behavior-x: contain; }
  .manifest-scroll .manifest { min-width: 520px; }

  /* Famille : les deux colonnes se balayent */
  .family-cols {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(80vw, 330px); gap: 12px; grid-template-columns: none;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    margin: 28px calc(-1 * var(--gutter)) 0; padding: 4px var(--gutter) 14px;
  }
  .fam-col { scroll-snap-align: start; padding: 16px; border: 1px solid var(--c-metal-300); border-radius: 8px; }
  .family-inner { gap: 24px; }
  .fam-week { margin-top: 36px; padding-top: 22px; }
  .week-steps {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(74vw, 300px); grid-template-columns: none; gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    margin: 16px calc(-1 * var(--gutter)) 0; padding: 4px var(--gutter) 14px;
  }
  .week-steps li { scroll-snap-align: start; padding: 16px; border: 1px solid var(--c-metal-300); border-radius: 8px; }

  /* Cabines : plan de cabine moins haut (voir plus haut) */
  .pass-stub { padding: 12px 16px; }
  .plane-plan { margin-top: 40px; }

  /* Plan de cabine : moins haut (la logique de cabine.js ne change pas, seule la hauteur de l'illustration) */
  .pcab--v .pcab-plan { width: auto; max-width: 100%; height: 600px; }

  /* Billet et examens repliés : bouton qui déplie le bloc (libellés existants t.kind et x.caption) */
  details[data-phone-fold] > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 14px;
    list-style: none; cursor: pointer; border: 1px solid currentColor; border-radius: 8px; background: transparent; color: inherit;
    font-family: "Barlow Condensed", var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase;
  }
  html[lang="ar"] details[data-phone-fold] > summary { letter-spacing: 0; text-transform: none; font-family: var(--font-text); font-weight: 600; }
  details[data-phone-fold] > summary::-webkit-details-marker { display: none; }
  details[data-phone-fold] > summary::after {
    content: ""; flex: none; width: 9px; height: 9px; margin-inline-start: auto;
    border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s ease;
  }
  details[data-phone-fold][open] > summary::after { transform: rotate(-135deg); }
  details[data-phone-fold] > summary:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
  details[data-phone-fold] { margin: 0; }
  details[data-phone-fold][open] > summary { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  details[data-phone-fold] > summary::after { transition: none; }
}
