.title-gallery{
  text-align: center;
}

/* ===== PREMIUM GRID ===== */
.gallery{
  max-width:1200px;
  margin:auto;
  padding:20px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:15px;
}

.gallery img{
  width:100%;
  height:220px;
  object-fit:cover;
  border-radius:12px;
  cursor:pointer;
  transition:0.4s ease;
  box-shadow:0 10px 25px rgba(0,0,0,0.15);
}

.gallery img:hover{
  transform:scale(1.05);
  box-shadow:0 15px 35px rgba(0,0,0,0.25);
}

/* Tablet */
@media(max-width:992px){
  .gallery{
    grid-template-columns:repeat(2,1fr);
  }
}

/* Mobile */
@media(max-width:600px){
  .gallery{
    grid-template-columns:1fr;
  }
}

/* ===== PREMIUM MODAL ===== */
.lightbox-modal{
  display:none;
  position:fixed;
  z-index:9999;
  inset:0;
  background:rgba(0,0,0,0.9);
  backdrop-filter:blur(8px);
  animation:fadeIn 0.4s ease;
}

@keyframes fadeIn{
  from{opacity:0}
  to{opacity:1}
}

.lightbox-content{
  z-index: 10000;
  position:relative;
  max-width:1100px;
  margin:auto;
  padding:40px 20px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:100vh;
}

.slide{
  display:none;
  text-align:center;
}

.slide img{
  width:100%;
  max-height:80vh;
  object-fit:contain;
  border-radius:14px;
  animation:zoomIn 0.4s ease;
  pointer-events:none;
}

@keyframes zoomIn{
  from{transform:scale(0.9);opacity:0}
  to{transform:scale(1);opacity:1}
}

/* Close Button */
.close{
  position:fixed; /* PENTING: ubah dari absolute ke fixed */
  top:20px;
  right:25px;
  font-size:42px;
  color:#fff;
  cursor:pointer;
  z-index:10001; /* lebih tinggi dari modal-content */
  background:rgba(0,0,0,0.4);
  width:50px;
  height:50px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter:blur(6px);
  -webkit-tap-highlight-color: transparent;
}

/* Navigation Arrows */
.prev, .next{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  font-size:40px;
  color:white;
  padding:12px 18px;
  cursor:pointer;
  border-radius:10px;
  background:rgba(255,255,255,0.1);
  transition:0.3s;
  z-index:10002;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

.prev{left: 15px;}
.next{right: 15px;}

.prev:hover, .next:hover{
  background:rgba(255,255,255,0.3);
}

/* Caption */
.caption{
  color:white;
  text-align:center;
  margin-top:15px;
  font-size:18px;
}

/* Premium Thumbnail Bar */
.thumbnails{
  display:flex;
  gap:10px;
  overflow-x:auto;
  margin-top:20px;
  padding-bottom:10px;
  max-width:100%;
  scrollbar-width: thin;
}

.thumbnails::-webkit-scrollbar{
  height:6px;
}

.thumbnails img{
  width:100px;
  height:70px;
  object-fit:cover;
  border-radius:8px;
  opacity:0.6;
  cursor:pointer;
  transition:0.3s;
}

.thumbnails img.active,
.thumbnails img:hover{
  opacity:1;
  transform:scale(1.05);
  border:2px solid white;
}

/* Mobile arrow fix */
@media(max-width:768px){
  .prev{left:10px;}
  .next{right:10px;}
}