/* Schémas des documents longs de /ressources/ (17/10/2026, refonte de la page AI Act).
   Va avec /ressources/assets/js/schemas.js, qui dessine les schémas Mermaid (copie locale de la version 11.4.1,
   /ressources/assets/js/mermaid-11.4.1.min.js) et ouvre la visionneuse plein écran.
   Charte V4 : fond blanc, bleu du logo, pas d'orange dans un schéma ; angles droits pour les cadres, 6 px pour les boutons.

   Balisage attendu :
     <figure class="schema" data-titre="Titre court">
       <div class="schema-cadre"><div class="mermaid">…code Mermaid…</div></div>
       <figcaption>…</figcaption>
     </figure> */

.schema { position: relative; min-width: 0; max-width: 100%; margin: 28px 0; padding: 0; background: var(--ngage-blanc, #fff); border: 1px solid var(--ngage-brume, #E4ECF3); border-radius: 0; }
.schema-cadre { padding: 20px 20px 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.schema .mermaid { display: block; min-height: 80px; color: transparent; }
/* Centré par ses marges, pas par flex : plus large que son cadre, un schéma centré en flex débordait à GAUCHE, hors de
   portée du défilement ; avec margin auto, il part du bord gauche et défile normalement. */ /* le code brut ne s'affiche pas pendant le dessin */
.schema .mermaid svg { display: block; height: auto; margin: 0 auto; }
.schema.pret .schema-cadre { cursor: zoom-in; }
.schema figcaption { margin: 0; padding: 14px 20px 16px; border-top: 1px solid var(--ngage-brume, #E4ECF3); background: var(--ngage-citation, #F3F7FA); font-size: .92rem; line-height: 1.5; color: var(--ngage-texte, #34465A); }
.schema figcaption strong { color: var(--ngage-encre, #0F1E2C); }

/* Barre d'outils du schéma (posée par schemas.js une fois le schéma dessiné) : indication de défilement à gauche,
   bouton « Cliquer pour agrandir » à droite. En flux normal : rien ne se chevauche, même sur un téléphone. */
.schema-outils { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 10px 0; }
.schema-glisser { display: none; margin: 0 auto 0 6px; font-size: .85rem; line-height: 1.3; color: var(--ngage-ia, #4F5F70); }
.schema.schema-deborde .schema-glisser { display: block; }
.schema-loupe { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px;
  font: 700 .85rem/1.2 var(--ngage-police, "Source Sans 3", Arial, sans-serif); color: var(--ngage-bleu, #265170); background: var(--ngage-blanc, #fff);
  border: 1.5px solid var(--ngage-ciel, #C4DAEB); border-radius: 6px; cursor: pointer; }
.schema-loupe:hover { border-color: var(--ngage-bleu, #265170); background: var(--ngage-voile, #EAF0F6); }
.schema-loupe:focus-visible { outline: 2px solid var(--ngage-bleu, #265170); outline-offset: 2px; }
.schema-loupe svg { width: 16px; height: 16px; flex: none; }
.schema-loupe .tactile { display: none; }
@media (hover: none) { .schema-loupe .souris { display: none; } .schema-loupe .tactile { display: inline; } }
.schema.pret .schema-cadre { padding-top: 12px; }

/* Téléphone : le schéma garde une taille lisible (largeur minimale posée par schemas.js) et défile dans son cadre ;
   la page, elle, ne défile pas en largeur */
@media (max-width: 760px) {
  .schema-cadre { padding: 12px 12px 14px; }
  .schema figcaption { padding: 12px 14px 14px; }
}

/* ===== Visionneuse plein écran (élément <dialog>, ouvert par showModal) ===== */
.visionneuse { width: min(96vw, 1680px); height: min(92vh, 1100px); max-width: none; max-height: none; margin: auto; padding: 0; border: 0; border-radius: 0; background: var(--ngage-blanc, #fff); color: var(--ngage-texte, #34465A); overflow: hidden; }
.visionneuse[open] { display: flex; flex-direction: column; }
.visionneuse::backdrop { background: rgba(15, 30, 44, .72); }
.visionneuse-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--ngage-brume, #E4ECF3); }
.visionneuse-titre { margin: 0; font: 700 1.05rem/1.3 var(--ngage-police, "Source Sans 3", Arial, sans-serif); color: var(--ngage-encre, #0F1E2C); }
.visionneuse-actions { display: flex; align-items: center; gap: 8px; }
.visionneuse-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 12px;
  font: 700 .95rem/1 var(--ngage-police, "Source Sans 3", Arial, sans-serif); color: var(--ngage-bleu, #265170); background: var(--ngage-blanc, #fff);
  border: 1.5px solid var(--ngage-ciel, #C4DAEB); border-radius: 6px; cursor: pointer; }
.visionneuse-actions button:hover { border-color: var(--ngage-bleu, #265170); background: var(--ngage-voile, #EAF0F6); }
.visionneuse-actions button:disabled { opacity: .45; cursor: default; }
.visionneuse-actions .visionneuse-fermer { color: var(--ngage-blanc, #fff); background: var(--ngage-bleu, #265170); border-color: var(--ngage-bleu, #265170); }
.visionneuse-actions .visionneuse-fermer:hover { background: var(--ngage-encre, #0F1E2C); border-color: var(--ngage-encre, #0F1E2C); }
.visionneuse-actions button:focus-visible { outline: 2px solid var(--ngage-bleu, #265170); outline-offset: 2px; }
.visionneuse-actions svg { width: 16px; height: 16px; }
.visionneuse-niveau { min-width: 7.5em; text-align: center; font-size: .9rem; color: var(--ngage-ia, #4F5F70); }
.visionneuse-zone { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; padding: 20px; background: var(--ngage-blanc, #fff); -webkit-overflow-scrolling: touch; }
.visionneuse-zone:focus-visible { outline: 2px solid var(--ngage-bleu, #265170); outline-offset: -4px; }
.visionneuse-zone > svg { display: block; margin: auto; flex: none; max-width: none !important; }
.visionneuse-aide { margin: 0; padding: 8px 20px 10px; font-size: .85rem; color: var(--ngage-ia, #4F5F70); border-top: 1px solid var(--ngage-brume, #E4ECF3); }
@media (max-width: 600px) {
  .visionneuse { width: 100vw; height: 100dvh; border-radius: 0; }
  .visionneuse-barre { padding: 8px 10px 8px 14px; }
  .visionneuse-titre { font-size: .95rem; flex: 1 1 100%; }
  .visionneuse-actions { width: 100%; justify-content: flex-end; }
  .visionneuse-zone { padding: 12px; }
}
@media print { .schema-outils { display: none !important; } .schema { break-inside: avoid; } }
