/* ============================================================
   FEUILLE DE STYLE DÉDIÉE À L'IMPRESSION — mathildefeld.fr
   Fichier : print.css (à la racine du thème enfant ou du thème)
   Appel automatique via wp_enqueue (voir le shortcode PHP) OU :
   Ajouter dans functions.php du thème enfant :
   add_action('wp_enqueue_scripts', function() {
       wp_enqueue_style(
           'mathilde-print',
           get_stylesheet_directory_uri() . '/print.css',
           array(),
           null,
           'print'   // <-- ce paramètre limite le CSS à l'impression
       );
   });
   ============================================================ */

@page {
  size: A4;
  margin: 5mm 5mm 10mm;
}

/* Pas besoin de @media print : le fichier est chargé avec media="print".
   Si vous préférez tout garder dans style.css, enveloppez ce bloc
   dans @media print { ... }. */

html, body {
  background: #fff !important;
  color: #000 !important;
  font-size: 10pt;
  line-height: 1.5;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* ---------- Mise en page générale ---------- */
main,
.entry-content,
article {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* ---------- Masquages : bandeau actualités, contact, footer, nav,
              toolbar accessibilité, boutons d'impression eux-mêmes ---------- */
.blocactus,
#main-footer,
.category-buttons,
#top-header,
#bloc-contact,
#et-top-navigation,
.pojo-a11y-toolbar-toggle,
.print-btn,
.noprint,
.et_pb_scroll_top.et-pb-icon {
  display: none !important;
}

/* ---------- Titre de l'article (H1) : 16px ---------- */
h1,
h1.entry-title,
.entry-title {
  font-size: 20px !important;
  line-height: 1.3 !important;
  margin: 0 0 8px !important;
  page-break-after: avoid;
  break-after: avoid;
  text-align: left;
}

/* Métadonnées (date, catégories) compactes */
.entry-meta,
.entry-header .entry-meta {
  font-size: 9px !important;
  margin: 0 0 12px !important;
}

/* ---------- Image à la une réduite ---------- */
.post-thumbnail img,
.wp-post-image,
.attachment-post-thumbnail,
.entry-thumbnail img,
img.featured-image {
  display: none !important;
}

/* Autres images du contenu : tenir dans la page */
.entry-content img,
article img {
  max-width: 100% !important;
  height: auto !important;
  page-break-inside: avoid;
  break-inside: avoid;
}

/* ---------- Contenu ---------- */
h2, h3, h4 {
  page-break-after: avoid;
  break-after: avoid;
}

h2 {
  font-size: 14px;
}

p, ul, ol, blockquote, table, figure {
  page-break-inside: avoid;
  break-inside: avoid;
}

blockquote {
  border-left: 2px solid #000;
  padding-left: 10px;
  margin-left: 0;
}

a {
  color: #000 !important;
  text-decoration: none !important;
}

.focus {
  background-color: #fff;
  padding: 0;
  margin: 0;
  border-radius: 0;
}

/* ---------- Contraste des couleurs ---------- */
* {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}