/* ===== GALLERY PAGE ===== */

.gallery-hero {
  padding-top: 150px;
  padding-bottom: 60px;
  background: var(--bg-secondary);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.gallery-hero .section-badge { margin: 0 auto 16px; }
.gallery-hero .section-desc  { margin: 0 auto; }

/* ===== MASONRY GRID ===== */
.gallery-section { background: var(--bg-primary); }

.masonry-grid {
  columns: 3;
  column-gap: 16px;
  margin-top: 48px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.masonry-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-dark);
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.masonry-item:hover img {
  transform: scale(1.03);
}

/* Overlay */
.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.masonry-item:hover .masonry-overlay { opacity: 1; }

.masonry-overlay-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-left: auto;
  transition: transform 0.3s ease;
}

.masonry-item:hover .masonry-overlay-icon {
  transform: scale(1.1);
}

/* Empty state */
.gallery-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray);
}

.gallery-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

.gallery-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: 8px;
}

.gallery-empty p {
  font-size: 0.88rem;
  color: var(--gray-light);
}

/* ===== LIGHTBOX ===== */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

#lightbox.open {
  opacity: 1;
  visibility: visible;
}

#lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transform: scale(0.92);
  transition: transform 0.35s ease;
}

#lightbox.open img { transform: scale(1); }

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  line-height: 1;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.2); }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .masonry-grid { columns: 2; }
}

@media (max-width: 500px) {
  .masonry-grid { columns: 1; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
