/* ===== HOME GALLERY SECTION ===== */
.home-gallery {
  position: relative;
  background: #f8f2df;
  padding: 80px 0 70px;
  text-align: center;
  overflow: hidden;
}
.home-gallery .section-title {
  padding: 0 max(24px,6vw) 36px;
}

/* Marquee wrapper dengan fade mask kiri-kanan */
.home-gallery-marquee {
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
}

/* Setiap row: overflow hidden, height fixed */
.home-gallery-row {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(140px, 16vw, 200px);
}

/* Track: flex inline, position absolute agar bisa bergerak keluar container */
.home-gallery-track {
  display: flex;
  flex-direction: row;
  gap: 14px;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  /* width akan auto dari children */
  animation: hg-scroll-left var(--dur, 48s) linear infinite;
}
.home-gallery-row.hg-right .home-gallery-track {
  animation-name: hg-scroll-right;
}
.home-gallery-row:hover .home-gallery-track {
  animation-play-state: paused;
}

@keyframes hg-scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes hg-scroll-right {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* Item (button/gambar) */
.home-gallery-item {
  display: block;
  flex: 0 0 auto;
  width: clamp(140px, 16vw, 200px);  /* sama dengan height row */
  height: 100%;
  border: 0;
  padding: 0;
  background: #e8dfc8;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
}
.home-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
  pointer-events: none;
  user-select: none;
}
.home-gallery-item:hover img {
  transform: scale(1.07);
}

/* Tombol "Lihat semua galeri" - hitam dengan fill animasi gold */
.home-gallery-more {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  min-height: 48px;
  padding: 13px 32px;
  margin-top: 40px;
  border: 1.5px solid #17130b;
  border-radius: 4px;
  color: #17130b;
  background: linear-gradient(90deg, #d6b568 50%, transparent 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  transition: color .4s ease, background-position .4s ease, border-color .3s ease;
}
.home-gallery-more:hover {
  color: #17130b;
  border-color: #d6b568;
  background-position: 0% 0;
}
.home-gallery-more span:last-child {
  transition: transform .3s ease;
  color: #d6b568;
  font-size: 16px;
}
.home-gallery-more:hover span:last-child {
  transform: translateX(4px) translateY(-3px);
}

/* Lightbox dialog */
dialog.home-gallery-dialog {
  padding: 56px 16px 16px;
  border: 0;
  border-radius: 12px;
  background: #111;
  color: #fff;
  width: min(940px, 94vw);
  max-width: 94vw;
  max-height: 90dvh;
  overflow: auto;
}
.home-gallery-dialog::backdrop { background: rgba(0,0,0,.82); }
.home-gallery-dialog > img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 65dvh;
  object-fit: contain;
  margin: auto;
}
.home-gallery-dialog button {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid #d6b568;
  border-radius: 8px;
  background: #111;
  color: #f2dfad;
  font-size: 24px;
  cursor: pointer;
}
.home-gallery-close { position: absolute; right: 8px; top: 4px; }
.home-gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}

@media (max-width: 700px) {
  .home-gallery { padding: 48px 0 56px; }
  .home-gallery .section-title { padding: 0 18px 28px; }
  .home-gallery-row { height: clamp(100px, 26vw, 140px); }
  .home-gallery-item { width: clamp(100px, 26vw, 140px); }
  .home-gallery-marquee { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-gallery-track { animation: none; }
  .home-gallery-item:hover img { transform: none; }
  .home-gallery-more { transition: none; }
}
