.pdf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.pdf-modal-overlay.active {
  display: flex;
}

.pdf-modal {
  background: #ffffff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background:#ffffff ;
  color:  #1e3a8a !important;
  flex-shrink: 0;border-bottom: 4px double #aaaaaa;
}

.pdf-modal-title {
  margin: 0;
  font-size: 1.3rem;font-weight: bolder;
  color:#1e3a8a  !important;
}

.pdf-modal-close {
 position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  background: red;
  border: 1px solid transparent !important;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans);
  font-size: 1.05rem;
  animation: fadeInScale 0.4s ease;
}

.pdf-modal-close:hover,
.pdf-modal-close:focus-visible {
  background: blue;
  color: var(--white);
  border-color:  orangered;;
}

/* Zone scrollable commune au canvas (chapitres) et à l'iframe (présentations) */
.pdf-modal-frame {
  flex: 1;
  width: 100%;
  border: none;
  overflow-y: auto;
}

/* Conteneur des pages canvas (chapitres protégés) */
.pdf-canvas-container {
  background: #ffffff;
  padding: 20px;
  text-align: center;
  user-select: none; /* dissuasion supplémentaire contre la sélection/copie */
}

.pdf-page-canvas {
  max-width: 100%;
  height: auto !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
}

.pdf-loading {
  color: #ffffff;
  font-size: 1rem;
  padding: 60px 20px;
  text-align: center;
}
.open-pdf {
  background-color: #0056b3;
  border-radius: 15px;
  border: 4px double white;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  margin-left: 5px;
  margin-top: 20px;
  padding: 0.5em 1em;
  transition: background-color 0.2s ease;
  width: auto;
}

.open-pdf:hover {
  background-color: #dc8b6f;
  border-radius: 10px;
  border: 4px double white;
  box-shadow: rgba(0, 0, 0, 0.2) 0 6px 12px 0;
  font-weight: bold;
}
/* Petits écrans */
@media (max-width: 600px) {
  .pdf-modal-overlay {
    padding: 8px;
  }
  .pdf-modal {
    max-height: 95vh;
    border-radius: 6px;
  }
  .pdf-modal-header {
    padding: 10px 14px;
  }
  .pdf-modal-title {
    font-size: 1rem;
  }
}

/* =========================================================================
   BLOCAGE IMPRESSION — niveau CSS (couvre tous les déclencheurs)
   -------------------------------------------------------------------------
   Contrairement à l'override JS de window.print() (contournable par le
   clic droit -> Imprimer, le menu du navigateur, etc.), une règle
   @media print est appliquée par le moteur de rendu d'impression lui-même,
   quel que soit ce qui a déclenché l'impression. On masque tout le modal
   (et son contenu) dès qu'il est actif : l'impression retombe alors sur
   la page sous-jacente, jamais sur le PDF protégé.
   ========================================================================= */
@media print {
  .pdf-modal-overlay.active,
  .pdf-modal-overlay.active * {
    display: none !important;
    visibility: hidden !important;
  }
}