/* ================================================================
   PRINT — règles @media print pour l'export PDF / impression
   ================================================================ */

@media print {
  /* Masquer toute l'interface du site */
  header,
  footer,
  .leaf-drift,
  .theme-toggle,
  .fiche-toc-mobile,
  .print-toolbar { display: none !important; }

  /* Forcer la visibilité des éléments animés (reveal reste opacity:0 avant scroll) */
  .reveal { opacity: 1 !important; transform: none !important; }

  /* Désactiver animations et transitions */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  /* Quand printing-mode est actif : cacher l'app, montrer le modal (portal hors #root) */
  body.printing-mode #root { display: none !important; }
  body.printing-mode .fiche-print-modal { display: block !important; }

  /* Format page A4 sans marges (le padding est géré dans .print-page) */
  @page { size: A4 portrait; margin: 0; }

  html, body {
    background: white !important;
    color: #1c241b !important;
  }

  /* Zone imprimable */
  .print-outer-wrap {
    padding: 0 !important;
    background: none !important;
    display: block !important;
  }
  .print-page {
    width: 210mm !important;
    padding: 14mm 18mm !important;
    margin: 0 !important;
    background: white !important;
    box-shadow: none !important;
  }

  /* Éviter les coupures en milieu de section */
  .print-section { page-break-inside: avoid; }

  /* Photo */
  .print-photo {
    max-height: 90mm;
    width: 100%;
    object-fit: contain;
    display: block;
  }

  /* Barre outils masquée */
  .print-toolbar { display: none !important; }
}
