/* ==========================================================================
   IMPRESSION & EXPORT PDF (@media print)
   ========================================================================== */
@media print {
    /* 1. Passer en mode "papier" (fond blanc, texte noir) */
    body {
        background-color: white !important;
        color: black !important;
    }

    /* 2. Cacher l'UI inutile pour le PDF */
    .app-header, .controls {
        display: none !important;
    }

    /* 3. Forcer les sauts de page avant chaque chapitre */
    .chapter {
        page-break-before: always;
        break-before: page;
        border-bottom: none;
    }
    
    /* Éviter que les images soient coupées en deux entre deux pages */
    .visual-container {
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    /* 4. LE SECRET : Cacher le WebGL et forcer l'affichage des images */
    .interactive-container, .screen-only {
        display: none !important;
    }

    .static-container, .print-only {
        display: block !important;
    }

    .static-container img {
        display: block !important;
        opacity: 1 !important;
        width: 100%;
        max-height: 400px; /* Évite qu'une image prenne toute la page */
        object-fit: contain;
    }

    /* Ajustement typo pour l'impression */
    .chapter h2, .chapter h3, .chapter p {
        color: black !important;
    }
    .chapter h2::after {
        background: black !important;
        box-shadow: none !important;
    }
}