/* ========================================
   SOPRINTY - MODAL GALLERY SYSTEM
   ======================================== */

/* ========================================
   Backdrop et Modal de base
   ======================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.show {
  display: block;
  opacity: 1;
}

.gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-modal.show {
  display: flex;
  opacity: 1;
}

/* ========================================
   Contenu du Modal
   ======================================== */
.modal-content-wrapper {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Image principale */
.modal-image-container {
  position: relative;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-container img {
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* Caption (texte alt) */
.modal-caption {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 10px 24px;
  border-radius: 50px;
  display: inline-block;
  margin-top: 20px;
  font-weight: 500;
  font-size: 0.95rem;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 90%;
}

/* Bouton de fermeture */
.modal-close-btn {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 44px;
  height: 44px;
  background: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background-color: #f1f5f9;
  transform: scale(1.1) rotate(90deg);
}

/* S'assurer que les conteneurs d'image sont en position relative */
.card-image {
  position: relative;
}
