/* ==========================================================================
   Section: Gallery
   ADVANCE v2
   ========================================================================== */

.s-gallery {
  display: grid;
  gap: clamp(8px, 1vw, 16px);
}

.s-gallery--col-2 { grid-template-columns: repeat(2, 1fr); }
.s-gallery--col-3 { grid-template-columns: repeat(3, 1fr); }
.s-gallery--col-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Item ---------- */
.s-gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--btn-radius);
  cursor: pointer;
  aspect-ratio: 1;
}

.s-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}

.s-gallery__item:hover img {
  transform: scale(1.08);
}

/* ---------- Overlay on hover ---------- */
.s-gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--transition-normal);
  pointer-events: none;
}

.s-gallery__item:hover::after {
  background: rgba(0, 0, 0, 0.15);
}

/* Lightbox trigger icon */
.s-gallery__zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  z-index: 2;
  color: #fff;
  font-size: 1.5rem;
  pointer-events: none;
}

.s-gallery__item:hover .s-gallery__zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- Caption ---------- */
.s-gallery__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: #fff;
  font-size: 0.8rem;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.s-gallery__item:hover .s-gallery__caption {
  opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .s-gallery--col-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .s-gallery--col-3,
  .s-gallery--col-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .s-gallery--col-2,
  .s-gallery--col-3,
  .s-gallery--col-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
