/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Raleway:wght@300;400;500;600&display=swap');

/* --- SECTION CONFIG --- */
.dabilux-gallery-section {
  padding: 80px 0;
  background-color: #171717; /* Nền tối sang trọng */
  font-family: 'Raleway', sans-serif;
  color: #fff;
}

/* Break out of theme containers and span full viewport width */
.dabilux-gallery-section.dabilux-gallery-fullwidth {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow-x: hidden;
}

.dabilux-gallery-header {
  text-align: center;
  margin-bottom: 60px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 15px;
}

.dabilux-gallery-sub {
  font-size: 13px;
  letter-spacing: 4px;
  color: #b45309; /* Vàng cam đất */
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 15px;
}

.dabilux-gallery-title {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

/* --- MASONRY GRID --- */
.dabilux-gallery-grid {
  column-count: 3; /* 3 Cột */
  column-gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Full width grid */
.dabilux-gallery-section.dabilux-gallery-fullwidth .dabilux-gallery-grid {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 24px;
}

/* Item Ảnh */
.dabilux-gallery-item {
  break-inside: avoid; /* Tránh bị cắt đôi */
  margin-bottom: 20px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  animation: fadeInItem 0.6s ease forwards;
  /* Masonry thật: để chiều cao tự theo ảnh */
  height: auto;
  display: block;
}

/* Ẩn các item vượt quá 9 item đầu tiên */
.dabilux-gallery-item.dabilux-gallery-item-hidden {
  display: none !important;
}

/* Hiển thị khi có class visible - giữ nguyên chiều cao để cắt ảnh */
.dabilux-gallery-item.visible {
  display: block !important;
  height: auto;
}

@keyframes fadeInItem {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.dabilux-gallery-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease;
}

/* Overlay khi Hover */
.dabilux-gallery-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(1, 68, 33, 0.9), rgba(0,0,0,0.2)); /* Xanh rêu đậm */
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
}

.dabilux-gallery-item:hover .dabilux-gallery-img {
  transform: scale(1.1); /* Zoom ảnh */
}

.dabilux-gallery-item:hover .dabilux-gallery-overlay {
  opacity: 1;
}

.dabilux-img-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #fff;
  margin: 0 0 5px 0;
  transform: translateY(20px);
  transition: transform 0.4s ease 0.1s;
}

.dabilux-img-desc {
  font-size: 13px;
  color: #d1d5db;
  margin: 0;
  font-style: italic;
  transform: translateY(20px);
  transition: transform 0.4s ease 0.2s;
}

.dabilux-gallery-item:hover .dabilux-img-title,
.dabilux-gallery-item:hover .dabilux-img-desc {
  transform: translateY(0);
}

.dabilux-zoom-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
}

.dabilux-gallery-item:hover .dabilux-zoom-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* --- LOAD MORE BUTTON --- */
.dabilux-load-more-wrapper {
  text-align: center;
  margin-top: 40px;
}

.dabilux-btn-load {
  background: transparent;
  border: 1px solid #b45309;
  color: #b45309;
  padding: 15px 40px;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dabilux-btn-load:hover {
  background: #b45309;
  color: #fff;
}

/* --- LIGHTBOX MODAL --- */
.dabilux-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.98); /* Nền tối gần như đen tuyệt đối */
  /* Always above theme header/footer/sticky elements */
  z-index: 2147483647;
  isolation: isolate;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dabilux-lightbox.active {
  display: flex;
  opacity: 1;
}

/* Lock page scroll when lightbox is open */
html.dabilux-lightbox-open,
body.dabilux-lightbox-open {
  overflow: hidden !important;
}

.dabilux-lightbox-img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 2px;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.dabilux-lightbox.active .dabilux-lightbox-img {
  transform: scale(1);
}

.dabilux-lb-caption {
  position: absolute;
  bottom: 20px;
  left: 0; right: 0;
  text-align: center;
  color: #d1d5db;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  pointer-events: none;
}

/* Controls */
.dabilux-lb-btn {
  position: absolute;
  color: #737373;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 20px;
  transition: color 0.3s, transform 0.2s;
}
.dabilux-lb-btn:hover { color: #fff; transform: scale(1.1); }
.dabilux-lb-close { top: 20px; right: 20px; }
.dabilux-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.dabilux-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* RESPONSIVE */
@media (min-width: 1366px) {
  .dabilux-gallery-grid { column-count: 6; }
}
@media (max-width: 1024px) {
  .dabilux-gallery-grid { column-count: 2; }
}
@media (max-width: 600px) {
  .dabilux-gallery-grid { column-count: 1; }
  .dabilux-lb-prev, .dabilux-lb-next { padding: 10px; }
  .dabilux-gallery-title { font-size: 32px; }
}
