/* PANNEAUX : le panneau de détail (un seul : tiroir à droite, feuille en bas sur téléphone), son animation d'ouverture, son en-tête,
   les blocs communs des panneaux (.d-grand, .d-phrase, .d-ligne, .d-bloc, .d-vide, .d-pre) et « Pour les curieux ».
   Le contenu propre à une section est dans le fichier de cette section. */
/* ----------------------------------------------------------------------- le panneau de détail (un seul) */
dialog { padding: 0; border: 1px solid var(--trait2); border-radius: 8px; color: var(--texte); overflow: auto; box-shadow: 0 0 40px rgba(169, 146, 250, .22);
  background: linear-gradient(var(--lavande), var(--lavande)) left bottom / 14px 2px no-repeat, linear-gradient(var(--lavande), var(--lavande)) left bottom / 2px 14px no-repeat,
    radial-gradient(120% 40% at 50% 0%, rgba(0, 32, 127, .55), transparent 70%), #060c33; }
dialog::backdrop { background: radial-gradient(80% 80% at 50% 50%, rgba(2, 4, 16, .6), rgba(2, 4, 16, .86)); }
dialog.large { width: min(96vw, 1300px); max-height: 94vh; margin: auto; }
dialog.tiroir { width: min(470px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0 0 0 auto; border-radius: 8px 0 0 8px; border-right: 0; }
html[data-mode="tel"] dialog.tiroir { width: min(430px, 100vw); height: auto; max-height: 82vh; margin: auto auto 0; border-radius: 12px 12px 0 0; border: 1px solid var(--trait2); }
html[data-mode="tel"] dialog.large { width: min(430px, 96vw); }
@media (prefers-reduced-motion: no-preference) {
  dialog.tiroir[open] { animation: tiroir .26s var(--ressort); }
  dialog.large[open] { animation: lever .2s ease-out; }
  html[data-mode="tel"] dialog.tiroir[open] { animation: feuille .26s var(--ressort); }
  dialog[open] .zoom-tete::after { animation: filet .5s var(--ressort) both; }
  dialog[open] .zoom-tete b { display: inline-block; animation: glitch .18s steps(6) 1; }
  dialog[open] .zoom-corps > * { animation: monte .35s var(--ressort) both; }
  dialog[open] .zoom-corps > :nth-child(2) { animation-delay: .04s; }
  dialog[open] .zoom-corps > :nth-child(3) { animation-delay: .08s; }
  dialog[open] .zoom-corps > :nth-child(n+4) { animation-delay: .12s; }
}
@keyframes tiroir { from { transform: translateX(48px); opacity: 0; } }
@keyframes lever { from { transform: scale(.98); opacity: 0; } }
@keyframes feuille { from { transform: translateY(48px); opacity: 0; } }
@keyframes filet { from { transform: scaleX(0); } }
@keyframes monte { from { transform: translateY(8px); opacity: 0; } }
@keyframes glitch {
  0% { transform: translate(0); text-shadow: none; }
  20% { transform: translate(-3px, 1px); text-shadow: 3px 0 var(--rose), -3px 0 var(--jaune); }
  45% { transform: translate(3px, -1px) skewX(-8deg); text-shadow: -3px 0 var(--rose), 3px 0 var(--lavande); }
  70% { transform: translate(-1px, 0); text-shadow: 2px 0 var(--rose); }
  100% { transform: none; text-shadow: none; }
}
.zoom-tete { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: rgba(6, 12, 51, .97); }
.zoom-tete::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; transform-origin: left; background: linear-gradient(90deg, var(--rose), var(--lavande) 60%, transparent); box-shadow: 0 0 10px rgba(234, 85, 177, .6); }
/* Le titre cède la place, le bouton « Fermer » ne cède jamais : un mot long coupe sa ligne au lieu de pousser le bouton hors du cadre (TAB-4). */
.zoom-tete b { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-family: var(--titre); text-transform: uppercase; letter-spacing: .06em; font-size: 1.4rem; }
.zoom-fermer { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font-family: var(--titre); text-transform: uppercase; letter-spacing: .08em; background: transparent; border: 1px solid var(--trait2); border-radius: var(--rayon); cursor: pointer; transition: border-color .15s, color .15s, box-shadow .15s; }
.zoom-fermer:hover { border-color: var(--rose); color: var(--rose); box-shadow: var(--lueur-rose); }
/* En dessous de 390 px (320 à 389), rien ne change à partir de 390 : le titre rétrécit en douceur (17 px à 320, plafond 22,4 px) et serre ses lignes ;
   le bouton garde son mot mais perd 12 px de marges ; un panneau large reprend les 96 % de largeur que son style prévoyait (le navigateur le bridait à
   la page moins 38 px). Résultat : « SKYSCRAPPER » tient sur une ligne sans être coupé, et « Fermer » reste entier. */
@media (max-width: 389px) {
  .zoom-tete { gap: 8px; }
  .zoom-tete b { font-size: clamp(1.0625rem, 5.4vw, 1.4rem); line-height: 1.2; }
  .zoom-fermer { gap: 6px; padding: 0 10px; letter-spacing: .06em; }
  dialog.large { max-width: none; }
}
.zoom-corps { padding: 16px 14px; display: grid; gap: 14px; align-content: start; }
.zoom-corps > img { width: 100%; height: auto; border-radius: 4px; }
.d-grand { display: flex; align-items: center; gap: 14px; }
.d-grand .pastille { flex: none; }
.d-phrase { font-size: 1.3rem; margin: 0; }
.d-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--discret); font-size: .9rem; }
.d-ligne span { display: inline-flex; align-items: center; gap: 6px; }
.d-bloc { position: relative; border: 1px solid var(--trait); border-radius: 6px; padding: 10px 12px 10px 14px; background: rgba(0, 32, 127, .22); }
.d-bloc::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 2px; background: var(--lavande); box-shadow: 0 0 8px var(--lavande); border-radius: 2px; }
.d-bloc h4 { margin: 0 0 4px; font-family: var(--titre); text-transform: uppercase; letter-spacing: .07em; font-size: .875rem; color: var(--lavande); }
.d-bloc p { margin: 0; }
.d-vide { color: var(--discret); font-style: italic; }
.d-pre { white-space: pre-wrap; font-family: Consolas, monospace; font-size: .875rem; margin: 0; }

/* « Pour les curieux » : le détail technique, replié et discret */
details.curieux { margin-top: 14px; border-top: 1px dashed var(--trait); padding-top: 8px; font-size: .875rem; color: var(--discret); }
details.curieux > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; color: var(--discret); }
details.curieux > summary::-webkit-details-marker { display: none; }
details.curieux > summary::before { content: "\25B8"; color: var(--lavande); transition: transform .15s; }
details.curieux[open] > summary::before { transform: rotate(90deg); }
details.curieux > summary:hover { color: var(--texte); }
details.curieux p { margin: 6px 0 0; font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
details.curieux code { font-size: .875rem; }
details.curieux .d-pre { display: block; white-space: pre-wrap; font-family: Consolas, "Cascadia Mono", monospace; }
.erreur details.curieux { border-top: 0; margin-top: 6px; padding-top: 0; }

@container page (max-width: 760px) {
  dialog.tiroir { width: 100vw; height: auto; max-height: 82vh; margin: auto 0 0 0; border-radius: 12px 12px 0 0; border: 1px solid var(--trait2); }
  html[data-mode="tel"] dialog.tiroir { width: min(430px, 100vw); margin: auto auto 0; }
}
