/* Place du Rhin — images annonces V8 galerie */

.result-thumb {
  overflow: hidden;
}

.result-thumb img {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* Image principale détail : taille fixe et propre */
.gallery-main {
  overflow: hidden;
  height: 420px;
  max-height: 420px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(226,246,248,.9), rgba(235,250,240,.9));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* Miniatures */
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.gallery-thumb {
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border, #dbe3ef);
  background: #fff;
  border-radius: 14px;
  height: 86px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.gallery-thumb.is-active {
  border-color: rgba(14,116,144,.65);
  background: #eef9fb;
  box-shadow: 0 0 0 3px rgba(14,116,144,.12);
}

/* Lightbox grande image */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 15, 28, .88);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 34px;
}

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

.lightbox-image-wrap {
  width: min(1200px, 92vw);
  height: min(760px, 82vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  background: #fff;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .18s ease, background .18s ease;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  transform: scale(1.06);
  background: rgba(255,255,255,.22);
}

.lightbox-close {
  top: 22px;
  left: 22px;
  width: 46px;
  height: 46px;
  font-size: 1.35rem;
  font-weight: 800;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  width: 54px;
  height: 54px;
  font-size: 2rem;
  font-weight: 700;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

.lightbox-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .9rem;
}

.image-debug-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: #64748b;
  margin-top: 8px;
}

@media (max-width: 960px) {
  .gallery-main {
    height: 300px;
    max-height: 300px;
  }

  .gallery-main img {
    max-height: 300px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lightbox {
    padding: 18px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 46px;
    height: 46px;
    font-size: 1.6rem;
  }

  .lightbox-prev {
    left: 12px;
  }

  .lightbox-next {
    right: 12px;
  }

  .lightbox-close {
    top: 14px;
    left: 14px;
  }
}
