/* Wrapper utama */
.cgd-gallery-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Container grid utama */
.cgd-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 30px !important;
  max-width: 1200px !important;
  width: calc(100% - 60px); /* beri breathing space agar margin kanan-kiri sama */
  margin: 0 auto !important;
  box-sizing: border-box;
  justify-items: center; /* center tiap item horizontal */
  align-items: center; /* center vertikal */
}

/* Setiap item */
.cgd-item {
  background: #fff;
  border: 3px solid #000;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
  aspect-ratio: 1 / 1; /* menjaga proporsi persegi */
  max-width: 360px; /* biar semua item proporsional */
  width: 100%;
  box-sizing: border-box;
}

/* Gambar */
.cgd-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 20px !important;
  transition: transform 0.4s ease, border-radius 0.4s ease;
  display: block;
}

/* Hover zoom */
.cgd-item:hover img {
  transform: scale(1.08);
}

/* Pagination */
.cgd-pagination {
  text-align: center;
  margin: 40px 0 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cg-page {
  padding: 10px 16px;
  border: 2px solid #000;
  border-radius: 8px;
  color: #000;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
}

.cg-page:hover,
.cg-page.active {
  background: #000;
  color: #fff;
}

/* Responsive fix */
@media (max-width: 1200px) {
  .cgd-gallery {
    width: calc(100% - 40px);
    gap: 24px !important;
  }
}

@media (max-width: 1024px) {
  .cgd-gallery {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .cgd-gallery {
    grid-template-columns: 1fr !important;
    width: calc(100% - 30px);
  }
  .cg-page {
    padding: 8px 12px;
  }
}
