/**
 * Styles CSS pour l'impression
 * Utilisé sur toutes les pages du site SNT & Techno
 */

@media print {
    @page {
        size: A4;
        margin: 0;
    }
    
    body { 
        margin: 0;
        padding: 0 1cm;
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        max-width: none;
        /* Police serif pour l'impression : plus lisible sur papier */
        font-family: "Georgia", "Times New Roman", "Liberation Serif", "DejaVu Serif", serif;
        font-size: 11pt;
        line-height: 1.4;
        color: #000;
    }
    
    /* Titres en serif pour l'impression */
    h1, h2, h3, h4, h5, h6 {
        font-family: "Georgia", "Times New Roman", "Liberation Serif", "DejaVu Serif", serif;
        font-weight: 600;
    }
    
    /* Masquer les éléments de navigation */
    .course-menu, 
    nav[aria-label="Fil d'Ariane"], 
    .action, 
    .links-top, 
    .no-print { 
        display: none !important; 
    }
    
    main { 
        display: block; 
        width: 100%; 
    }
    
    /* Gestion des sauts de page */
    .page { 
        page-break-after: always !important; 
        display: block; 
        margin-bottom: 1em; 
    }
    .page:last-child { 
        page-break-after: auto !important; 
    }
    
    /* Encadrement imprimé */
    .content-frame {
        border: 1px solid #000 !important;
        padding: 10mm;
        margin: 0 0 10mm 0;
        page-break-inside: auto;
        box-sizing: border-box;
    }
    
    /* Optimisation des encadrés */
    .info-box, 
    .analogy, 
    details { 
        background: none !important; 
        border: 1px solid #666 !important; 
        color: #000 !important;
        padding: 5px 10px !important;
        margin: 8px 0 !important;
        border-radius: 0 !important;
    }
    .info-box h3, 
    .analogy strong, 
    h1, 
    h2, 
    h3, 
    summary { 
        color: #000 !important; 
    }
    
    /* Titres compacts */
    h1 { 
        font-size: 14pt; 
        margin: 0 0 10px 0; 
        text-align: center; 
        page-break-after: avoid;
    }
    h2 { 
        font-size: 12pt; 
        margin: 15px 0 5px 0; 
        border-bottom: 1px solid #000; 
        page-break-after: avoid;
    }
    h3 { 
        font-size: 11pt; 
        margin: 8px 0 2px 0; 
        page-break-after: avoid;
    }
    h4, h5, h6 {
        page-break-after: avoid;
        margin-top: 4mm !important;
        margin-bottom: 2mm !important;
    }
    
    /* Listes compactes */
    ul, ol { 
        margin: 2px 0 5px 20px; 
        padding-left: 0; 
        page-break-after: avoid;
        margin-top: 1.5mm !important;
        margin-bottom: 1.5mm !important;
    }
    li { 
        margin-bottom: 1px; 
    }
    p { 
        margin: 4px 0; 
        text-align: justify;
        page-break-after: avoid;
        margin-top: 1.5mm !important;
        margin-bottom: 1.5mm !important;
    }
    
    /* Zones à compléter */
    .trou { 
        border-bottom: 1px solid #000 !important; 
        min-width: 3cm; 
    }
    
    /* Détails interactifs */
    details { 
        display: block !important; 
        page-break-inside: avoid; 
    }
    summary { 
        font-weight: bold; 
        text-decoration: underline; 
        font-size: 11pt; 
        margin-bottom: 2px; 
    }
    details > * { 
        display: block !important; 
    }
    
    /* Liens */
    a { 
        text-decoration: none; 
        color: #000; 
    }
    
    /* Empêcher les coupures dans les blocs importants */
    .part-page,
    .info-box,
    .analogy,
    .schema-container,
    .chaine-info,
    .chaine-energie,
    .two-col,
    .two-col .col,
    .object-grid,
    .object-card,
    .component-card,
    table,
    .table-3col,
    .table-3col tr,
    .table-3col td,
    .table-3col th {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Marges internes réduites */
    .info-box,
    .analogy {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        margin-top: 6px !important;
        margin-bottom: 6px !important;
    }
    
    /* Tables compactes */
    .table-3col th,
    .table-3col td {
        padding: 4px 5px !important;
    }
    
    /* Désactiver les sauts automatiques si nécessaire */
    .print-break-before {
        page-break-before: auto;
        break-before: auto;
    }
}

