/* ── Photo Gallery ──────────────────────────────────────────────────────── */

.photo-gallery__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--color-on-surface);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* ── Colonnes flex — chaque colonne empile ses images indépendamment ────── */

.photo-gallery__columns {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

/* Mobile : 2 colonnes */
.photo-gallery__col {
  flex: 0 0 calc(50% - 0.375rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Cacher col 2 et 3 sur mobile, afficher seulement les 2 premières */
@media (max-width: 767px) {
  .photo-gallery__col:nth-child(3),
  .photo-gallery__col:nth-child(4) {
    display: none;
  }
}

/* Desktop : 4 colonnes égales */
@media (min-width: 768px) {
  .photo-gallery__col {
    flex: 1;
  }
}

/* Colonnes paires (2e et 4e) : décalage = (tall - short) / 2.
   Avec cette valeur, le "lead" bascule à chaque rangée entre col paires/impaires
   → aucune rangée n'est jamais alignée, stagger constant de ±55px. */
.photo-gallery__col:nth-child(even) {
  padding-top: 55px; /* (300 - 190) / 2 */
}

@media (max-width: 767px) {
  .photo-gallery__col:nth-child(even) {
    padding-top: 40px; /* (220 - 140) / 2 */
  }
}

/* ── Item ───────────────────────────────────────────────────────────────── */

.photo-gallery__item {
  display: block;
  border-radius: 1.25rem;
  overflow: hidden;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.photo-gallery__item:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.photo-gallery__item img {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

/* Hauteur haute */
.photo-gallery__item.is-tall img {
  height: 300px;
}

/* Hauteur basse */
.photo-gallery__item.is-short img {
  height: 190px;
}

/* Mobile : hauteurs réduites sur les 2 colonnes visibles */
@media (max-width: 767px) {
  .photo-gallery__item.is-tall img  { height: 220px; }
  .photo-gallery__item.is-short img { height: 140px; }
}

/* ── Lightbox overlay ───────────────────────────────────────────────────── */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 1rem;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.gallery-lightbox__img.is-loading {
  opacity: 0;
}

/* ── Boutons navigation ─────────────────────────────────────────────────── */

.gallery-lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gallery-lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox__btn--prev { left: 1.25rem; }
.gallery-lightbox__btn--next { right: 1.25rem; }

.gallery-lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background 0.2s ease;
}

.gallery-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox__counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}
