/* ===== GALLERY SECTION ===== */
.gallery-section {
  padding: var(--space-2xl) 0;
  background: var(--color-light);
}

.gallery-filters{
  max-width: 60vw;
  margin: auto;
}

/* TRUE MASONRY - CSS Columns */
.gallery-masonry {
  column-count: 4;
  column-gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

/* Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-view-btn {
  background: var(--color-accent-coral);
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.gallery-view-btn:hover {
  background: var(--color-primary);
  transform: scale(1.05);
}

.gallery-view-btn svg {
  stroke: white;
}

/* Load More Button */
.gallery-loadmore {
  text-align: center;
}

.loadmore-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.loadmore-btn:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(66, 153, 225, 0.3);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-image {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--color-accent-coral);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
  .gallery-masonry {
    column-count: 3;
    column-gap: var(--space-md);
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding: var(--space-xl) 0;
  }

  .gallery-filters{
    max-width: none;
  }
  
  .gallery-masonry {
    column-count: 2;
    column-gap: var(--space-sm);
  }
  
  .gallery-item {
    margin-bottom: var(--space-md);
  }
  
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

/* Gallery Filters */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: var(--color-primary);
  color: white;
}

@media (max-width: 768px) {
  .gallery-filters {
    gap: 0.5rem;
    margin-bottom: var(--space-xl);
  }
  
  .filter-btn {
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
  }
}

/* Loading Spinner */
.gallery-loading {
  text-align: center;
  padding: 3rem;
  background: var(--color-light);
  border-radius: 16px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-gray-light);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gallery-loading p {
  color: var(--color-gray);
  font-size: 0.95rem;
}

.gallery-empty svg {
  opacity: 0.5;
}

.gallery-empty h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}