/* =====================================================================
   Impression et export PDF (§90)

   Objectif : un document lisible en noir sur blanc, sans navigation ni
   décor, avec des coupures de page maîtrisées. Aucune information n’est
   perdue : les liens utiles voient leur adresse imprimée.
   ===================================================================== */

@media print {
  @page {
    size: A4;
    margin: 16mm 14mm 18mm;
  }

  :root {
    --bg: #fff;
    --bg-elevated: #fff;
    --surface: #fff;
    --surface-2: #fff;
    --surface-3: #fff;
    --border: #c9ced9;
    --border-strong: #99a0b0;
    --text: #000;
    --text-muted: #2b2f38;
    --text-subtle: #4a505c;
    --primary: #1a3fb8;
    --primary-soft: transparent;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-glow: none;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  /* Tout ce qui relève de la navigation ou du décor disparaît. */
  .sidebar,
  .sidebar-toggle,
  .sidebar-overlay,
  .scroll-hint,
  .site-footer,
  .backdrop,
  .hero__scene,
  .loader,
  .cursor-dot,
  .cursor-ring,
  .jury__bar,
  .jury__nav,
  .filters,
  .search-form,
  .no-print,
  [data-print='hide'] {
    display: none !important;
  }

  /* La barre latérale disparaît : le contenu ne doit plus être décalé. */
  .shell { margin-left: 0 !important; padding-top: 0 !important; }

  main { padding: 0 !important; }
  .container, .container--wide { max-width: none; padding: 0; }
  .section { padding-block: 0 6mm; }

  /* Chaque section imprimée s'enchaîne sans la hauteur d'écran ni les fonds
     alternés, qui n'ont de sens qu'à l'écran. */
  .section-block {
    padding-block: 0 6mm;
    min-height: 0;
    background: none !important;
    border-top: 0;
  }

  /* Les cartes deviennent des blocs encadrés sobres. */
  .card,
  .project-card,
  .competency-card,
  .timeline-entry__card,
  .article,
  .document,
  .evidence,
  .difficulty,
  .steps li {
    border: 1px solid #c9ced9 !important;
    background: #fff !important;
    box-shadow: none !important;
    transform: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Coupures de page raisonnées */
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  h2 { margin-top: 8mm; font-size: 14pt; }
  h3 { font-size: 12pt; }
  .case-section { break-inside: avoid-page; }
  .page-break { break-before: page; page-break-before: always; }

  /* Le détail masqué au survol doit être imprimé. */
  .project-card__reveal { display: block !important; max-height: none !important; opacity: 1 !important; }
  .project-card__summary { -webkit-line-clamp: unset; overflow: visible; }

  /* Toutes les diapositives du mode jury s’impriment à la suite. */
  .jury__slide { display: block !important; break-after: page; }
  .jury__slide:last-child { break-after: auto; }

  /* Les états restent distinguables sans couleur (§81). */
  .state { border: 1px solid #99a0b0; background: #fff !important; color: #000 !important; }
  .state--validated::before { background: #000; }
  .state--proposed::before  { background: #fff; box-shadow: inset 0 0 0 1px #000; }
  .state--none::before      { background: #fff; box-shadow: inset 0 0 0 1px #99a0b0; }

  .matrix-cell { border: 1px solid #99a0b0 !important; background: #fff !important; color: #000 !important; }
  .matrix-cell[data-state='non_associee'] { border-color: #dfe3ea !important; }

  /* L’adresse des liens sortants est imprimée, sinon le lien est perdu. */
  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 8.5pt;
    color: #4a505c;
    word-break: break-all;
  }

  a[href^='#']::after,
  a[href^='mailto']::after,
  .button::after { content: ''; }

  .table thead th { background: #f0f2f6 !important; color: #000 !important; }
  .table { font-size: 9.5pt; }

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