/* ====================================================================== */
/* Feuille de style d'impression pour phpBB (Version moderne et optimisée) */
/* Ce code remplace le contenu de styles/votre_style/theme/print.css */
/* ====================================================================== */

@media print {

    /* --- Configuration de base pour le papier --- */
    body {
        font-family: Georgia, serif;
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    html, body, #wrap {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* --- Masquage des éléments inutiles (navigation, interface, etc.) --- */
    #wrap-sub, .headerbar, .navbar, .footer,
    .forabg, .forumbg, .panel, .breadcrumbs,
    .pagination, .rules, .online-list, .topic-actions,
    .author-box, .postprofile, .action-bar,
    .button, .button-icon, .notice, .jumpbox,
    .search-box, .top-link, .phpbb-logo,
    .topic-tools, .signature, .poll,
    .page-body-box {
        display: none !important;
    }

    /* --- Mise en page des messages et du contenu --- */
    .post, .postbody {
        border: none !important;
        padding: 0 !important;
        background: none !important;
        margin-bottom: 25px;
        page-break-inside: avoid;
    }

    .topic-title, .topic-title a {
        font-size: 20pt;
        font-weight: bold;
        color: #000 !important;
        text-decoration: none !important;
        margin-bottom: 20px;
    }
    
    .post-header {
        border-bottom: 1px solid #ddd;
        padding-bottom: 8px;
        margin-bottom: 15px;
    }

    .post-header h3 {
        font-size: 1.5em;
        font-weight: bold;
        color: #000;
    }
    
    .post-meta {
        font-style: italic;
        color: #666;
        font-size: 0.9em;
    }

    /* Révèle les éléments de contenu qui pourraient être masqués */
    .postbody .content, .postbody .content * {
        visibility: visible !important;
        display: block !important;
        background: none !important;
        color: #000 !important;
        width: auto !important;
        max-width: 100% !important;
    }

    /* --- Styles pour les blocs de contenu --- */
    .quotecontent {
        border-left: 4px solid #aaa;
        background: #f9f9f9;
        padding: 15px;
        margin: 20px 0;
        font-style: italic;
    }
    
    blockquote {
        border-left: 4px solid #aaa !important;
        background: #f9f9f9 !important;
        padding: 15px !important;
        margin: 20px 0 !important;
        font-style: italic !important;
    }

    .codebox {
        border: 1px solid #ccc;
        background: #f5f5f5;
        padding: 15px;
        font-family: 'Courier New', monospace;
        font-size: 10pt;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    /* --- Gestion des images (solution robuste) --- */
    .postbody .content img {
        height: auto !important;
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* Solution pour les Emojis (doit être hors de @media print) */
.content img.emoji, .postbody .content img.emoji {
    display: inline-block !important;
    overflow: hidden !important;
    width: 1.2em !important;
    height: 1.2em !important;
    max-width: 1.2em !important;
    max-height: 1.2em !important;
    vertical-align: middle !important;
}

.content img.emoji img, .postbody .content img.emoji img {
    width: 100% !important;
    height: auto !important;
}

/* Le style pour la balise blockquote est en dehors du @media print */
blockquote {
    position: relative !important;
    border-left: 2px solid #aaa !important; /* La barre fine */
    background: #fff !important;
    padding: 15px !important;
    margin: 20px 0 20px 20px !important; /* Marge gauche pour décaler la citation */
    font-style: italic !important;
}

blockquote::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: -12px !important;
    height: 100% !important;
    width: 6px !important; /* La barre plus large */
    background-color: #000 !important;
}