/* =============================================
   galerie.css — Version Finale & Premium
   ============================================= */

#galerie {
  height: 100vh; /* La section remplit exactement l'écran */
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── 1. Header (Espace optimisé) ── */
.galerie-header {
  text-align: center;
  padding: 40px 20px 20px;
  flex-shrink: 0; /* Empêche le header de s'écraser */
}

.galerie-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--orange-mazot);
  margin-bottom: 8px;
  display: block;
}

.galerie-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--violet-mazot);
  margin: 0;
  line-height: 1.1;
}

/* ── 2. Grille Graphique (1 Gauche / 2 Droite) ── */
.galerie-grid {
  flex-grow: 1; /* Remplit l'espace restant dans le viewport */
  display: flex;
  gap: 4px;
  padding: 0 4px 4px 4px;
  height: 100%;
}

.galerie-item {
  position: relative;
  overflow: hidden;
  height: 100%;
  cursor: pointer;
  background-color: #F4EBD4;
}

/* Image principale (60% de largeur) */
.galerie-item--large {
  flex: 1.5;
}

/* Colonne de droite (40% de largeur) */
.galerie-column-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Les deux images de droite prennent chacune 50% de hauteur */
.galerie-column-right .galerie-item {
  height: 50%;
}

.galerie-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.galerie-item:hover img {
  transform: scale(1.05);
}

.galerie-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42, 9, 78, 0.15); /* Teinte Mazot légère au survol */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.galerie-item:hover .galerie-overlay {
  opacity: 1;
}

/* ── 3. Lightbox (Modal) ── */
.lightbox {
  display: none; /* Masqué par défaut */
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 15, 0.98); /* Fond quasi noir */
  z-index: 9999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: zoom-out;
}

/* Classe activée via JS */
.lightbox--open {
  display: flex;
  opacity: 1;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  animation: modalZoom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalZoom {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── 4. La Croix de fermeture (Ajustée) ── */
.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 35px;
  line-height: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10001;
  border: none;
  padding: 0;
}

.lightbox-close:hover {
  background: var(--orange-mazot);
  transform: rotate(90deg) scale(1.1);
  color: #fff;
}

/* ── 5. Responsive Mobile ── */
@media (max-width: 768px) {
  #galerie {
    height: auto;
    min-height: 100vh;
  }

  .galerie-grid {
    flex-direction: column;
    height: auto;
    gap: 2px;
  }

  .galerie-item--large {
    height: 50vh; /* Grande image sur mobile */
  }

  .galerie-column-right {
    height: 100vh; /* Les deux petites images ensemble */
  }

  .lightbox-close {
    top: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: rgba(0, 0, 0, 0.6);
  }
}