/* IMPRESSION OPTIMISÉE */
@media print {
    @page {
        margin: 2cm;
        size: A4;
    }

    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        max-width: 100%;
        padding: 0;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    h1 {
        font-size: 24pt;
        margin-top: 0;
    }

    h2 { font-size: 18pt; }
    h3 { font-size: 14pt; }
    h4 { font-size: 12pt; }

    p, blockquote {
        orphans: 3;
        widows: 3;
    }

    blockquote, pre, img, table, figure {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
        page-break-after: avoid;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        font-weight: normal;
    }

    a[href^="#"]:after {
        content: "";
    }

    pre {
        white-space: pre-wrap !important;
        border: 1pt solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }

    table {
        border-collapse: collapse;
    }

    th, td {
        border: 1pt solid #000;
    }

    #TOC, nav#TOC {
    page-break-after: always;
    }

    .footnotes {
        page-break-before: always;
        margin-top: 2cm;
        padding-top: 1cm;
        border-top: 1pt solid #000;
    }

    /* Numérotation des pages */
    @page {
        @bottom-right {
            content: counter(page) " / " counter(pages);
        }
    }
}
