/* ===== GALLERY PAGE ===== */

/* --- Filter Buttons --- */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 2px solid #ddd;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--color-text);
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform 0.3s;
}

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

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

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 58, 92, 0.0);
  transition: background 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.gallery-item:hover .gallery-item-overlay {
  background: rgba(27, 58, 92, 0.4);
}

.gallery-item-label {
  color: white;
  font-weight: 600;
  font-family: var(--font-heading);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
}

.gallery-item:hover .gallery-item-label {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item.hidden {
  display: none;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 3rem;
  padding: 1rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Gallery CTA Section --- */
.gallery-cta-section {
  background: var(--color-primary);
}

.gallery-cta-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.gallery-cta-inner h2 {
  color: white;
  margin-bottom: 0.75rem;
}

.gallery-cta-inner p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  /* Filter buttons — smaller on tablet */
  .filter-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Filter buttons — more compact on mobile, allow wrapping */
  .gallery-filters {
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  /* Lightbox arrows — smaller and better positioned on mobile */
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 1.75rem;
    padding: 0.5rem;
  }

  .lightbox-prev {
    left: 0.25rem;
  }

  .lightbox-next {
    right: 0.25rem;
  }

  /* Lightbox image — full width on small screens */
  .lightbox-image {
    max-width: 95vw;
    max-height: 80vh;
  }

  /* Lightbox close btn — bigger touch target */
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    padding: 0.5rem;
  }

  /* Gallery CTA section */
  .gallery-cta-inner h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
}
