.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.4s ease;
  background: var(--white);
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item .grid-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: var(--white);
}

.gallery-item:hover .grid-overlay {
  opacity: 1;
}

.grid-overlay h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.gallery-item:hover .grid-overlay h3 {
  transform: translateY(0);
}

.grid-overlay p {
  font-size: 0.85rem;
  opacity: 0.9;
  transform: translateY(10px);
  transition: transform 0.3s ease 0.05s;
}

.gallery-item:hover .grid-overlay p {
  transform: translateY(0);
}

/* Filter Buttons */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 50px;
  background: var(--white);
  color: var(--dark);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--gradient-1);
  color: var(--white);
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
  transform: translateY(-2px);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--white);
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: var(--gradient-2);
  color: var(--white);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.4);
}

.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }

@media (max-width: 768px) {
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 20px 15px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: var(--white);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

.gallery-caption h4 {
  font-size: 1rem;
  margin-bottom: 3px;
}

.gallery-caption p {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Masonry-ish effect with alternating heights */
.gallery-item.tall { aspect-ratio: 3/4; }
.gallery-item.wide { aspect-ratio: 16/9; }
