.gallery-index {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  padding: 16px 40px;
  border-bottom: 1px solid #eaeaea;
}

.gallery-index a {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--color-text);
}

.gallery-index a:hover {
  color: var(--color-accent);
}

.gallery-index span {
  font-size: 0.85rem;
  color: #cccccc;
}

.gallery-section {
  padding: 60px 40px;
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.gallery-section + .gallery-section {
  border-top: 2px solid var(--color-accent);
}

.gallery-section h2 {
  margin-bottom: 24px;
}

.gallery-grid {
  column-count: 3;
  column-gap: 16px;
}

.gallery-grid img {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  break-inside: avoid;
  border-radius: 2px;
  cursor: pointer;
}

.gallery-grid__empty {
  color: #6b6b68;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .gallery-section {
    padding: 40px 20px;
  }
  .gallery-index {
    padding: 16px 20px;
    gap: 16px;
    overflow-x: auto;
  }
  .gallery-grid {
    column-count: 1;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-accent-dark) 92%, transparent);
  z-index: 100;
}

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .lightbox {
    background: var(--color-accent-dark);
  }
}

.lightbox[hidden] {
  display: none;
}

.lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 2px;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: none;
  border: none;
  color: var(--color-white-soft);
  cursor: pointer;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.lightbox__close {
  top: 24px;
  right: 32px;
  padding: 8px;
  font-size: 2rem;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  font-size: 3rem;
}

.lightbox__nav--prev {
  left: 16px;
}

.lightbox__nav--next {
  right: 16px;
}

@media (max-width: 640px) {
  .lightbox__close {
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
  }

  .lightbox__nav {
    font-size: 2rem;
    padding: 8px;
  }

  .lightbox__nav--prev {
    left: 4px;
  }

  .lightbox__nav--next {
    right: 4px;
  }
}
