/* Entrée dynamique (Charly P. solutions, 16/11/2026)
   Module autonome : aucun lien avec le reste du site.
   Toutes les classes commencent par « ed- » pour ne rien casser ailleurs. */

/* Avant que l'entrée ne s'affiche : on cache la page pour éviter un éclair de l'accueil */
html.ed-cache { background: #000; }
html.ed-cache body { visibility: hidden; }

.ed {
  position: fixed; inset: 0; z-index: 2147483000;
  display: grid; grid-template-columns: minmax(300px, 20vw) 1fr;   /* bandeau à gauche, comme Charly P. */
  background: #000; color: #f2f2f2;
  font-family: inherit;
  transition: opacity 0.6s ease;
}
.ed.ed-sortie { opacity: 0; pointer-events: none; }

.ed-scene { position: relative; overflow: hidden; grid-column: 2; grid-row: 1; background: #000; }
/* Le plan = la zone où joue l'animation (plein écran ou miniature) */
.ed-plan { position: absolute; inset: 0; overflow: hidden; perspective: 1000px; }

/* Une photo = un bloc avec l'image en fond (pas de clic droit, pas de glisser) */
.ed-photo {
  position: absolute; left: 50%; top: 50%;
  background: #111 center / cover no-repeat;
  backface-visibility: visible;
  user-select: none; -webkit-user-select: none; pointer-events: none;
  will-change: transform, opacity;
}

/* Bandeau : repris du site de Charly P. (04/11/2026) */
.ed-cote {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px;
  padding: 40px clamp(24px, 2.5vw, 40px);
  background: #000;
}
.ed-nom { margin: 0; text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.95rem; white-space: nowrap; }
.ed-sous-titre { margin: 0 0 18px; color: #bdbdbd; letter-spacing: 0.06em; }
.ed-entrer {
  font: inherit; font-size: 1.1rem; letter-spacing: 0.04em; cursor: pointer;
  padding: 14px 26px; border-radius: 999px; white-space: nowrap;
  border: 1px solid #f2f2f2; background: #f2f2f2; color: #1b1b1b;
  transition: background 0.2s, color 0.2s;
}
.ed-entrer:hover { background: transparent; color: #f2f2f2; }
.ed-entrer span { display: inline-block; transition: transform 0.2s; }
.ed-entrer:hover span { transform: translateX(4px); }
.ed-entrer:focus-visible, .ed-fermer:focus-visible { outline: 2px solid #f2f2f2; outline-offset: 3px; }
.ed-fermer {
  position: absolute; z-index: 5; top: 16px; right: 16px; width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: #f2f2f2; background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(242, 242, 242, 0.35); border-radius: 50%;
}
.ed-fermer:hover { background: rgba(242, 242, 242, 0.1); border-color: #f2f2f2; }
.ed-fermer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Téléphone et tablette : bandeau en bas */
@media (max-width: 899px) {
  .ed { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .ed-scene { grid-column: 1; grid-row: 1; }
  .ed-cote {
    grid-column: 1; grid-row: 2;
    flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); gap: 8px 16px;
  }
  .ed-nom { font-size: 0.9rem; }
  .ed-sous-titre { display: none; }
  .ed-entrer { width: 100%; font-size: 1.05rem; padding: 13px 20px; }
}

/* Miniature (site de vente) : l'animation dans un cadre de la page */
.ed-mini { position: relative; overflow: hidden; background: #000; }

/* 1. Empilement : diapositives posées sur une table sombre (comme Charly P.) */
.ed-table { background: #2b2b2b radial-gradient(ellipse at center, #3a3a3a 0%, #1d1d1d 75%); }
.ed-diapo {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 2. Explosion */
.ed-tuile { overflow: hidden; background: none; }
.ed-tuile > div { position: absolute; inset: 0; background-repeat: no-repeat; }
.ed-tuile .ed-entiere { background-position: center; background-size: cover; opacity: 0; }

/* 3. Tunnel */
.ed-tunnel { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.ed-tunnel .ed-photo { left: 0; top: 0; }

/* 5. Apesanteur */
.ed-vide { background: radial-gradient(ellipse at 50% 40%, #1c1f26 0%, #07080a 70%); }
.ed-espace { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.8s ease-out; }
.ed-flotte { aspect-ratio: 3 / 2; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); }

/* 6. Rideau */
.ed-panneau { position: absolute; top: -10%; bottom: -10%; overflow: hidden; } /* plus haut que l'écran : il peut coulisser sans laisser de bande noire */
.ed-panneau .ed-photo { inset: 0; left: 0; top: 0; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) { .ed { transition: none; } }
