/*
 * Print Stylesheet - DMO Institutionnel
 * Styles optimisés pour l'impression
 */

/* ========================================
   Configuration de base pour l'impression
   ======================================== */

@media print {

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

    /* Configuration de la page */
    @page {
        margin: 2cm;
        size: A4 portrait;
    }

    /* Typographie optimisée pour l'impression */
    body {
        font-family: Georgia, 'Times New Roman', serif !important;
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }

    /* ========================================
       Masquer les éléments non imprimables
       ======================================== */

    /* Éléments de navigation */
    .wp-block-navigation,
    nav,
    .navigation,
    .nav,
    header nav,
    .menu,
    .site-navigation {
        display: none !important;
    }

    /* Pied de page social et navigation */
    footer .wp-block-navigation,
    footer nav {
        display: none !important;
    }

    /* Éléments interactifs */
    button,
    .wp-block-button,
    .button,
    .btn,
    input[type="submit"],
    input[type="button"],
    .search-form,
    .widget_search,
    .comment-respond,
    .comments-area,
    #respond {
        display: none !important;
    }

    /* Éléments de partage et social */
    .share-buttons,
    .social-links,
    .social-media,
    .addtoany_share,
    .sharedaddy {
        display: none !important;
    }

    /* Sidebar et widgets (généralement) */
    aside,
    .sidebar,
    .widget-area {
        display: none !important;
    }

    /* Vidéos, iframes et éléments multimédia */
    video,
    audio,
    iframe,
    embed,
    object {
        display: none !important;
    }

    /* Éléments d'accessibilité visuelle uniquement */
    .screen-reader-text {
        display: none !important;
    }

    /* ========================================
       Optimisation des titres
       ======================================== */

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        font-weight: bold;
        color: #000;
    }

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

    h2 {
        font-size: 20pt;
        margin-top: 18pt;
        margin-bottom: 12pt;
    }

    h3 {
        font-size: 16pt;
        margin-top: 14pt;
        margin-bottom: 10pt;
    }

    h4 {
        font-size: 14pt;
        margin-top: 12pt;
        margin-bottom: 8pt;
    }

    h5, h6 {
        font-size: 12pt;
        margin-top: 10pt;
        margin-bottom: 6pt;
    }

    /* Titre du site */
    .wp-block-site-title,
    .site-title {
        font-size: 18pt;
        margin-bottom: 12pt;
        page-break-after: avoid;
    }

    /* ========================================
       Optimisation des paragraphes et textes
       ======================================== */

    p {
        orphans: 3;
        widows: 3;
        margin-bottom: 10pt;
    }

    /* Éviter les coupures */
    p, blockquote, pre, ul, ol, dl, figure, table, fieldset {
        page-break-inside: avoid;
    }

    /* ========================================
       Liens
       ======================================== */

    /* Afficher les URLs des liens */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    /* Ne pas afficher les URLs pour certains liens */
    a[href^="#"]:after,
    a[href^="javascript:"]:after,
    a.no-print-url:after,
    .wp-block-navigation a:after,
    .wp-block-site-title a:after {
        content: "";
    }

    a {
        text-decoration: underline;
        color: #000;
    }

    /* ========================================
       Listes
       ======================================== */

    ul, ol {
        margin-left: 20pt;
        margin-bottom: 10pt;
    }

    li {
        margin-bottom: 4pt;
    }

    /* ========================================
       Images
       ======================================== */

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

    /* Figures WordPress */
    .wp-block-image,
    .wp-block-gallery,
    figure {
        page-break-inside: avoid;
        margin: 10pt 0;
    }

    /* Légendes */
    figcaption,
    .wp-caption-text,
    .wp-element-caption {
        font-size: 9pt;
        font-style: italic;
        margin-top: 4pt;
        color: #333;
    }

    /* ========================================
       Blocs WordPress spécifiques
       ======================================== */

    /* Citations */
    .wp-block-quote,
    blockquote {
        border-left: 3px solid #000;
        padding-left: 15pt;
        margin: 15pt 0;
        font-style: italic;
        page-break-inside: avoid;
    }

    .wp-block-pullquote {
        border-top: 2px solid #000;
        border-bottom: 2px solid #000;
        padding: 15pt 0;
        margin: 20pt 0;
        text-align: center;
        page-break-inside: avoid;
    }

    /* Code */
    .wp-block-code,
    code,
    pre {
        font-family: 'Courier New', Courier, monospace;
        font-size: 10pt;
        border: 1px solid #ccc;
        padding: 8pt;
        background: #f5f5f5 !important;
        page-break-inside: avoid;
        overflow: visible;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    code {
        padding: 2pt 4pt;
    }

    /* Tableaux */
    .wp-block-table,
    table {
        border-collapse: collapse;
        width: 100%;
        margin: 15pt 0;
        page-break-inside: avoid;
    }

    th, td {
        border: 1px solid #000;
        padding: 6pt;
        text-align: left;
    }

    th {
        font-weight: bold;
        background: #f0f0f0 !important;
    }

    thead {
        display: table-header-group;
    }

    /* Séparateurs */
    .wp-block-separator,
    hr {
        border: 0;
        border-top: 1px solid #ccc;
        margin: 15pt 0;
        page-break-after: avoid;
    }

    /* ========================================
       Header et Footer pour impression
       ======================================== */

    /* En-tête simplifié */
    header,
    .wp-block-template-part[data-area="header"] {
        margin-bottom: 20pt;
        padding-bottom: 10pt;
        border-bottom: 2px solid #000;
    }

    /* Logo */
    .wp-block-site-logo img {
        max-width: 150px;
        max-height: 60px;
    }

    /* Pied de page simplifié */
    footer,
    .wp-block-template-part[data-area="footer"] {
        margin-top: 30pt;
        padding-top: 15pt;
        border-top: 1px solid #ccc;
        font-size: 9pt;
    }

    /* Informations de contact à garder */
    footer .wp-block-group p {
        margin: 4pt 0;
    }

    /* ========================================
       Contenu principal
       ======================================== */

    main,
    .wp-block-group[role="main"],
    article,
    .entry-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Articles de blog */
    .wp-block-post-template > * {
        page-break-after: always;
    }

    .wp-block-post-template > *:last-child {
        page-break-after: auto;
    }

    /* Métadonnées d'article */
    .wp-block-post-date,
    .post-meta,
    .entry-meta {
        font-size: 9pt;
        color: #666;
        margin-bottom: 10pt;
    }

    /* Titre d'article */
    .wp-block-post-title {
        font-size: 22pt;
        margin-bottom: 8pt;
        page-break-after: avoid;
    }

    /* Extrait */
    .wp-block-post-excerpt {
        font-style: italic;
        margin-bottom: 15pt;
    }

    /* ========================================
       Pagination et éléments de requête
       ======================================== */

    .wp-block-query-pagination,
    .pagination,
    .nav-links {
        display: none !important;
    }

    /* ========================================
       Blocks ACF personnalisés
       ======================================== */

    .acf-block-preview {
        border: none !important;
        padding: 0 !important;
    }

    /* ========================================
       Utilitaires d'impression
       ======================================== */

    /* Classe pour forcer un saut de page */
    .page-break,
    .print-page-break {
        page-break-after: always;
    }

    /* Classe pour empêcher un saut de page */
    .no-page-break,
    .print-no-break {
        page-break-inside: avoid;
    }

    /* Classe pour masquer à l'impression */
    .no-print,
    .print-hidden {
        display: none !important;
    }

    /* Classe pour afficher uniquement à l'impression */
    .print-only {
        display: block !important;
    }

    /* ========================================
       Optimisations finales
       ======================================== */

    /* Supprimer les ombres et effets visuels */
    .wp-block-group,
    .wp-block-cover,
    .has-background {
        box-shadow: none !important;
        background: transparent !important;
    }

    /* Contrastes pour les bordures */
    .has-border-color {
        border-color: #000 !important;
    }

    /* Optimisation des marges globales */
    .wp-block-group {
        margin-top: 0;
        margin-bottom: 15pt;
    }

    /* Largeurs fluides */
    .alignwide,
    .alignfull {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* ========================================
   Fin du fichier print.css
   ======================================== */