/* Feuille de style optimisée pour l'impression */

@media print {
  /* Configuration générale de la page */
  @page {
    margin: 2cm;
    size: A4 portrait;
  }

  /* Réinitialisation des couleurs pour économiser l'encre */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Corps du document */
  body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.6;
    color: black;
    background: white;
  }

  /* Masquer les éléments de navigation et d'interface */
  header,
  nav,
  footer,
  .no-print,
  button,
  input,
  select,
  textarea,
  [role="navigation"],
  [role="banner"],
  [role="contentinfo"] {
    display: none !important;
  }

  /* Afficher uniquement le contenu principal */
  main,
  article {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* Titres */
  h1 {
    font-size: 24pt;
    font-weight: bold;
    margin-bottom: 0.5cm;
    page-break-after: avoid;
    color: black;
  }

  h2 {
    font-size: 18pt;
    font-weight: bold;
    margin-top: 0.8cm;
    margin-bottom: 0.4cm;
    page-break-after: avoid;
    color: black;
  }

  h3 {
    font-size: 14pt;
    font-weight: bold;
    margin-top: 0.6cm;
    margin-bottom: 0.3cm;
    page-break-after: avoid;
    color: black;
  }

  /* Paragraphes */
  p {
    text-align: justify;
    margin-bottom: 0.4cm;
    orphans: 3;
    widows: 3;
  }

  /* Listes */
  ul, ol {
    margin-left: 1cm;
    margin-bottom: 0.4cm;
  }

  li {
    margin-bottom: 0.2cm;
  }

  /* Citations */
  blockquote {
    margin: 0.5cm 1cm;
    padding-left: 0.5cm;
    border-left: 3pt solid #ccc;
    font-style: italic;
    page-break-inside: avoid;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
    page-break-inside: avoid;
    page-break-after: auto;
    display: block;
    margin: 0.5cm auto;
  }

  /* Image de bannière spécifique */
  .aspect-\\[16\\/9\\] img,
  [class*="aspect-"] img {
    max-height: 8cm;
    object-fit: contain;
  }

  /* Tableaux */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5cm;
    page-break-inside: avoid;
  }

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

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

  /* Liens */
  a {
    color: black;
    text-decoration: underline;
  }

  /* Afficher les URLs après les liens */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
    color: #666;
  }

  /* Ne pas afficher les URLs pour les liens internes */
  a[href^="#"]:after,
  a[href^="/"]:after {
    content: "";
  }

  /* Éviter les coupures de page inappropriées */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  p, blockquote, ul, ol, dl, tr, img {
    page-break-inside: avoid;
  }

  /* Métadonnées de l'article */
  .text-slate-500,
  .text-muted-foreground {
    color: #666 !important;
    font-size: 10pt;
  }

  /* Badge de catégorie */
  .text-xs {
    font-size: 10pt;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3cm;
  }

  /* Sous-titre */
  .text-xl {
    font-size: 14pt;
    color: #333 !important;
    margin-bottom: 0.5cm;
  }

  /* Contenu de l'article avec prose */
  .prose,
  [class*="prose-"] {
    max-width: 100%;
  }

  /* Masquer les éléments décoratifs */
  .shadow,
  .shadow-lg,
  .shadow-xl,
  [class*="shadow-"] {
    box-shadow: none !important;
  }

  /* Bordures simples pour l'impression */
  .border,
  [class*="border-"] {
    border-color: #ccc !important;
  }

  /* Espacement des sections */
  section {
    margin-bottom: 1cm;
  }

  /* En-tête de l'article pour l'impression */
  article header {
    display: block !important;
    margin-bottom: 1cm;
    padding-bottom: 0.5cm;
    border-bottom: 2pt solid #000;
  }

  /* Pied de page personnalisé pour l'impression */
  @page {
    @bottom-right {
      content: "Page " counter(page) " sur " counter(pages);
      font-size: 10pt;
      color: #666;
    }
  }

  /* Forcer l'affichage du contenu principal */
  .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Optimisation pour les commentaires (masquer) */
  [class*="comment"],
  #comments,
  .comment-section {
    display: none !important;
  }

  /* Masquer les boutons de partage et actions */
  [class*="share"],
  [class*="social"],
  .action-buttons {
    display: none !important;
  }
}
