/* ===== Galerie standard Autonome (.am-gallery) ===== */

.am-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 0.5rem;
}

.am-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.am-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
  cursor: zoom-in;              /* 👈 Curseur “zoom” */
}

/* Hover léger */
.am-gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(1.03);
}

/* Crédit */
.am-gallery-credit {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #888;
  text-align: right;
}

/* Mobile : une image par ligne */
@media (max-width: 640px) {
  .am-gallery {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
}

/* ===== Lightbox Autonome ===== */

.am-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.am-lightbox--open {
  display: flex;
}

.am-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.am-lightbox-inner {
  position: relative;
  max-width: 94vw;
  max-height: 90vh;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.am-lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.am-lightbox-close,
.am-lightbox-prev,
.am-lightbox-next {
  position: relative;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.am-lightbox-close {
  position: absolute;
  top: -2.2rem;
  right: -0.3rem;
  font-size: 1.6rem;
}

.am-lightbox-prev,
.am-lightbox-next {
  flex-shrink: 0;
}

.am-lightbox-prev:hover,
.am-lightbox-next:hover,
.am-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-1px);
}

.am-lightbox-counter {
  position: absolute;
  bottom: -1.9rem;
  right: 0;
  font-size: 0.8rem;
  color: #eee;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Body lock quand lightbox ouverte */
.am-lightbox-open {
  overflow: hidden;
}
