/* Gallery-specific styles */

.gallery-hero {
  padding: calc(var(--nav-height) + 2.5rem) 0 1.5rem;
  text-align: center;
}

.gallery-hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.gallery-intro {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.07);
}

.filter-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4a7ae0);
  border-color: transparent;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.gallery-section {
  padding: 1.5rem 0 4rem;
}

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

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.gallery-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

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

.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #000;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

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

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

.gallery-item figcaption {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gallery-item figcaption strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gallery-item figcaption span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: min(1100px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-primary);
}

.lightbox-caption h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.lightbox-caption p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  z-index: 1001;
}

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

.lightbox-close {
  top: 1.25rem;
  right: 1.25rem;
  font-size: 1.75rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

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

  .gallery-item figcaption strong {
    font-size: 0.8rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }
}
