/**
 * Styles d'impression - Format A4
 *
 * Ces styles s'appliquent uniquement lors de l'impression.
 * Optimisés pour une page A4 portrait avec présentation professionnelle.
 */

@media print {
  /* Configuration page A4 */
  @page {
    size: A4 portrait;
    margin: 20mm 15mm;
  }

  /* Reset pour impression */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Masquer éléments non imprimables */
  .skip-link,
  .button,
  button,
  input,
  select,
  textarea,
  #list-input-container,
  #draw-controls-container,
  #list-manager-section,
  #error-container,
  .warning-message,
  footer,
  .no-print {
    display: none !important;
  }

  /* Corps du document */
  body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
    margin: 0;
    padding: 0;
  }

  /* En-tête */
  header {
    text-align: center;
    border-bottom: 2pt solid #000;
    padding-bottom: 10mm;
    margin-bottom: 10mm;
  }

  header h1 {
    font-size: 24pt;
    font-weight: bold;
    margin: 0 0 5mm 0;
  }

  header .subtitle {
    font-size: 14pt;
    font-style: italic;
    margin: 0;
  }

  /* Contenu principal */
  main {
    max-width: 170mm;
    margin: 0 auto;
  }

  /* Sections */
  section {
    margin-bottom: 8mm;
    page-break-inside: avoid;
  }

  section h2 {
    font-size: 16pt;
    font-weight: bold;
    margin: 0 0 5mm 0;
    padding-bottom: 2mm;
    border-bottom: 1pt solid #333;
  }

  /* Résultats du tirage (seule section visible) */
  #result-section {
    display: block !important;
  }

  /* Zone de résultats */
  .result-display {
    background: none;
    padding: 0;
  }

  .result-display__title {
    font-size: 18pt;
    text-align: center;
    margin-bottom: 5mm;
  }

  .result-display__meta {
    font-size: 12pt;
    text-align: center;
    margin-bottom: 8mm;
    color: #333;
  }

  /* Liste des gagnants */
  .result-display__winners {
    font-size: 14pt;
  }

  .result-display__winners ol {
    margin: 0;
    padding-left: 10mm;
  }

  .result-display__winners li {
    margin-bottom: 3mm;
    page-break-inside: avoid;
  }

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

  p, li {
    orphans: 3;
    widows: 3;
  }

  /* Pied de page impression */
  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10pt;
    color: #666;
    border-top: 1pt solid #ccc;
    padding-top: 3mm;
  }
}

/**
 * Classes utilitaires pour l'impression
 */
.print-only {
  display: none;
}

@media print {
  .print-only {
    display: block !important;
  }
}
