/* ------------------------------------------------------------------
   Mise en page pour l'impression et l'export PDF.

   Chargée par index.html uniquement en mode impression : elle ne
   modifie jamais l'affichage à l'écran.
------------------------------------------------------------------ */

@page { size: A4 landscape; margin: 8mm; }

@media print {

  /* --- Couleurs ---------------------------------------------------
     Sans cela, Chrome supprime les aplats sombres et les photos. */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    width: auto !important; height: auto !important;
    overflow: visible !important; margin: 0 !important;
  }

  /* --- Animations -------------------------------------------------
     Les blocs apparaissent au défilement : sur papier, il n'y a pas
     de défilement, ils doivent donc tous être visibles d'emblée. */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    visibility: visible !important;
  }

  /* --- Éléments flottants ----------------------------------------
     Un menu fixe se répéterait ou se figerait au milieu du papier. */
  .fixed, .sticky,
  [class*="fixed"], [class*="sticky"],
  .entete, .menu-mobile { position: static !important; }

  /* --- Hauteurs calées sur l'écran -------------------------------
     100vh vaut la hauteur d'une page A4 : sans cela on obtient des
     pages presque vides. */
  [class*="min-h-screen"], [class*="h-screen"] {
    min-height: 0 !important; height: auto !important;
  }

  /* --- Découpe ---------------------------------------------------- */
  section, article, figure, li,
  [class*="rounded-2xl"], [class*="rounded-3xl"],
  [class*="carte-"], [class*="cadre-photo"],
  .heros__badge-verre, .panneau-demo, .zone-texte-formulaire {
    break-inside: avoid; page-break-inside: avoid;
  }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  img { max-width: 100% !important; }

  /* Le défilement horizontal des bandeaux animés n'a pas de sens sur
     papier : on affiche le contenu depuis son début. */
  [class*="whitespace-nowrap"],
  .bandeau-defilant__texte { overflow: hidden !important; }
}

/* ------------------------------------------------------------------
   Habillage de imprimer.html (aperçu à l'écran uniquement)
------------------------------------------------------------------ */
.barre-outils {
  position: sticky; top: 0; z-index: 9999;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 14px 22px; background: #101418; color: #fff;
  font: 400 14px/1.4 Manrope, system-ui, sans-serif;
}
.barre-outils strong { font-weight: 600; }
.barre-outils button {
  background: #f5a9a3; color: #101418; border: 0; border-radius: 999px;
  padding: 9px 20px; font: 600 14px Manrope, sans-serif; cursor: pointer;
}
.barre-outils button:disabled { opacity: .5; cursor: default; }
.barre-outils label { display: flex; align-items: center; gap: 7px; opacity: .8; }
.barre-outils .etat { margin-left: auto; opacity: .65; font-size: 13px; }

.consignes {
  background: #f6f2ea; color: #3d3936; border-bottom: 1px solid #e8ebee;
  padding: 12px 22px; font: 400 13px/1.55 Manrope, system-ui, sans-serif;
}
.consignes strong { color: #101418; font-weight: 600; }

.intitule-page {
  font: 500 11px/1 "JetBrains Mono", monospace;
  letter-spacing: .22em; text-transform: uppercase;
  color: #6b7378; padding: 10px 0; border-bottom: 1px solid #e8ebee;
  margin-bottom: 8px;
}
body.sans-intitules .intitule-page { display: none; }

@media screen {
  .page-imprimee {
    background: #fff; margin: 24px auto; width: 1400px; max-width: 96vw;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
  }
}
@media print {
  .barre-outils, .consignes { display: none !important; }
  .page-imprimee { break-after: page; page-break-after: always; }
  .page-imprimee:last-child { break-after: auto; page-break-after: auto; }
}
