/* Page galerie : presentation type blog, photos empilees verticalement, ratio natif preserve. */

.gallery-page {
  margin: 0 auto;
  padding: 0 0 2rem;
}

.gallery-page__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .gallery-page__header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.gallery-page__title {
  font-size: clamp(1rem, 4.4vw, 1.5rem);
  font-weight: 800;
  color: rgb(14, 165, 233);
  margin: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.gallery-page__title-icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  color: rgb(14, 165, 233);
}

@media (min-width: 768px) {
  .gallery-page__title { font-size: 2rem; }
}

.gallery-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.gallery-page__back:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .gallery-page__header {
    gap: 0.15rem;
    margin-bottom: 0.35rem;
    padding-inline: 12px;
  }
  .gallery-page__back {
    font-size: 0.7rem;
  }
  .gallery-page__back svg {
    width: 11px !important;
    height: 11px !important;
  }
}

.gallery-page__description {
  max-width: 900px;
  margin: 0 auto 1.25rem;
  padding: 0 4px;
  color: #1f2937;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-line;
}

@media (max-width: 767px) {
  .gallery-page__description {
    padding: 0 12px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }
}

.gallery-mosaic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .gallery-mosaic {
    gap: 16px;
  }
}

.gallery-mosaic__item {
  border-radius: 0.5rem;
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
  display: block;
  border: none;
  width: auto;
  max-width: 100%;
  padding: 0;
  margin: 0 auto;
}

.gallery-mosaic__item img {
  display: block;
  max-width: 100%;
  max-height: 860px;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.gallery-empty {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  color: #475569;
}

/* Lightbox */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox__img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

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

.gallery-lightbox__btn:hover { background: rgba(255, 255, 255, 0.3); }
.gallery-lightbox__btn svg { width: 24px; height: 24px; }

[dir="rtl"] .gallery-lightbox__btn--prev { right: 1rem; left: auto; }
[dir="rtl"] .gallery-lightbox__btn--next { left: 1rem; right: auto; }
[dir="ltr"] .gallery-lightbox__btn--prev { left: 1rem; right: auto; }
[dir="ltr"] .gallery-lightbox__btn--next { right: 1rem; left: auto; }

.gallery-lightbox__close {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
}

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

.gallery-lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
