/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;              /* masquée par défaut */
  align-items: center;
  justify-content: center;
  background: rgba(16, 28, 44, 0.95);
  z-index: 99999;
  box-sizing: border-box;
  backdrop-filter: blur(2px);
  animation: fadeInLightbox 0.2s ease;
}

/* Image */
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  margin: auto;
  border-radius: 18px;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 8px 48px rgba(161, 140, 209, 0.8),
              0 2px 12px rgba(255, 255, 255, 0.5);
  cursor: zoom-in; /* click -> next */

  /* Transition de fondu lors du changement d'image */
  opacity: 1;
  transition: opacity 0.24s ease;
}
.lightbox-img.is-fading {
  opacity: 0;
}

/* Close */
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 30px;
  color: #2196f3;
  cursor: pointer;
  z-index: 100000;
  font-size: 40px;
  font-weight: bold;
  text-shadow: 0 2px 12px rgba(43, 58, 103, 0.8);
  transition: color 0.2s ease;
}
.lightbox-close:hover,
.lightbox-close:focus { color: #e0f7fa; outline: none; }

/* Nav arrows */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(25,118,210,0.9);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.2s;
}
.lightbox-nav:hover,
.lightbox-nav:focus { background: rgba(18,81,163,1); transform: translateY(-50%) scale(1.06); outline: none; }

.lightbox-nav-prev { left: 24px; }
.lightbox-nav-next { right: 24px; }

/* Anim */
@keyframes fadeInLightbox { from { opacity: 0; } to { opacity: 1; } }

/* Accessibilité : réduire les animations */
@media (prefers-reduced-motion: reduce) {
  .lightbox { animation: none; }
  .lightbox-close, .lightbox-nav, .lightbox-img { transition: none; }
}

/* Bloquer le scroll quand la lightbox est ouverte */
body.modal-open { overflow: hidden; }
