/* Photo gallery page */

.gallery-section {
  padding-block: var(--space-16);
}

.gallery-section h2 {
  margin-bottom: var(--space-2);
}

.gallery-section__subtitle {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

/* Thumbnail grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  display: block;
  cursor: pointer;
  box-shadow: var(--shadow-img);
}

.gallery-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base);
}

.gallery-item__overlay svg {
  width: 32px;
  height: 32px;
  color: white;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-item__img {
  transform: scale(1.06);
}

.gallery-item:hover .gallery-item__overlay {
  background: rgba(10, 22, 40, 0.5);
}

.gallery-item:hover .gallery-item__overlay svg {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox__caption {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
  text-align: center;
  margin-top: var(--space-3);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: white;
  font-size: var(--text-3xl);
  cursor: pointer;
  padding: var(--space-3);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: var(--color-gold);
}

.lightbox__close {
  top: var(--space-4);
  right: var(--space-4);
}

.lightbox__prev {
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    animation: none;
  }
}
