/**
 * assets/css/gallery.css
 * Auto-scroll image gallery — chạy liên tục phải→trái, loop vô tận.
 * Thuần CSS @keyframes, không JS. Pause khi hover (desktop).
 */

.section-gallery {
  padding: clamp(48px, 8vw, 80px) 0;
  background: var(--cream);
  overflow: hidden;
}

.gallery-track {
  display: flex;
  gap: clamp(12px, 1.5vw, 20px);
  width: max-content;
  animation: gallery-scroll 40s linear infinite;
}

/* Pause khi hover — cho khách xem kỹ ảnh nào đang quan tâm */
.gallery-track:hover {
  animation-play-state: paused;
}

@keyframes gallery-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Dịch đúng 50% (= 1 bộ ảnh), bộ 2 tiếp nối liền mạch */
    transform: translateX(-50%);
  }
}

.gallery-slide {
  flex-shrink: 0;
  width: clamp(260px, 28vw, 380px);
  aspect-ratio: 3 / 4;
  border-radius: clamp(12px, 1.5vw, 16px);
  overflow: hidden;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Mobile: ảnh nhỏ hơn, chạy nhanh hơn --- */
@media (max-width: 640px) {
  .gallery-track {
    animation-duration: 25s;
  }

  .gallery-slide {
    width: 200px;
  }
}
