/* ORBITECH Blog — Print Styles */

/* ─── Print Styles ─── */
@page { margin: 10mm; }

@media print {
    /* Thème sombre actif : texte foncé quand même, l'impression se fait sur papier blanc */
    [data-theme="dark"] h1,
    [data-theme="dark"] h2,
    [data-theme="dark"] h3,
    [data-theme="dark"] h4,
    [data-theme="dark"] h5,
    [data-theme="dark"] h6 {
        color: #000 !important;
    }
    [data-theme="dark"] p,
    [data-theme="dark"] span {
        color: #222 !important;
    }

    /* Hide non-content elements */
    .reading-progress,
    .back-to-top,
    .article-toolbar,
    .disclaimer-banner,
    .related-container,
    #navbar-placeholder,
    #footer-placeholder,
    .back-to-blog,
    .breadcrumb,
    .heading-anchor,
    .quiz-score-bar,
    .correction-toggle,
    .correction-toggle-all,
    footer,
    .table-of-contents { display: none !important; }

    /* Reset gradient text trick (background-clip: text) */
    * {
        -webkit-text-fill-color: initial !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Body */
    body {
        font-size: 12pt;
        line-height: 1.7;
        color: #1e1e2e !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hero: white background, dark text */
    .article-hero {
        background: #fff !important;
        padding: 10px 0 20px !important;
        min-height: auto !important;
    }
    .article-hero::before { display: none !important; }
    .article-hero .hero-container { background: none !important; }
    .article-meta span { color: #555 !important; }
    .article-title {
        color: #000 !important;
        font-size: 1.6rem !important;
    }
    .article-subtitle {
        color: #333 !important;
        font-size: 1rem !important;
    }

    /* Content area */
    .article-content {
        padding: 0 !important;
        background: #fff !important;
    }
    .article-container {
        padding: 20px !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: #fff !important;
    }
    .article-container p,
    .article-container li {
        color: #222 !important;
        font-size: 11pt !important;
    }

    /* Headings: keep gradient bar as solid color */
    .article-container h2 {
        color: #000 !important;
        font-size: 1.3rem !important;
        border-bottom: 2.5pt solid #6366f1 !important;
        border-image: none !important;
        padding-bottom: 4px;
        page-break-after: avoid;
    }
    .article-container h3 {
        color: #000 !important;
        font-size: 1.1rem !important;
        page-break-after: avoid;
    }

    /* Bold/strong: dark and visible */
    strong, b {
        color: #111 !important;
        font-weight: 700 !important;
    }

    /* Links */
    .article-container a {
        color: #6366f1 !important;
        text-decoration: underline !important;
    }
    a[href]::after { content: none !important; }

    /* Callout boxes: KEEP colors */
    .highlight-box, .theorem-box, .definition-box, .formula-box,
    .example-box, .exercise-box, .warning-box, .proof-box,
    .exercice-box, .correction-box, .step-box,
    .flashcard, .annotation-box, blockquote {
        break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    /* Make sure box text is dark */
    .highlight-box p, .theorem-box p, .definition-box p,
    .example-box p, .exercise-box p, .warning-box p,
    blockquote p, .annotation-box p {
        color: #222 !important;
    }
    /* Make sure ::before labels (EXEMPLE, DÉFINITION...) stay visible */
    .highlight-box::before, .theorem-box::before, .definition-box::before,
    .example-box::before, .exercise-box::before, .warning-box::before,
    .proof-box::before, .annotation-box::before {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        -webkit-text-fill-color: initial !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
    }

    /* Tables: keep structure */
    table { border-collapse: collapse; width: 100%; }
    th, td {
        border: 1pt solid #ccc !important;
        padding: 6px !important;
        color: #222 !important;
    }
    th { background: #f0f0f0 !important; font-weight: 700; }

    /* Code */
    pre, code {
        font-size: 9pt !important;
        color: #222 !important;
    }

    /* Page breaks */
    h2, h3 { page-break-after: avoid; }
    img, table, pre, blockquote { page-break-inside: avoid; }
    p { orphans: 3; widows: 3; }

    /* Images */
    img { max-width: 100% !important; height: auto !important; }

    /* Quiz & flashcard: show answers */
    .correction-box { display: block !important; opacity: 1 !important; }
    .flashcard-answer { display: block !important; opacity: 1 !important; }
}
