/* Gallery page + lightbox. Site fonts, colors, and header come from main CSS. */

.gallery-page .lede {
  margin-bottom: 1.25rem;
}

.gallery-page .gallery-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.75rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.gallery-item {
  display: block;
  background: var(--gray-2);
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  filter: brightness(1.04);
}

@media (min-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: #140f0f;
  padding: 3.5rem 3.75rem 2.5rem;
}

.lightbox.is-open {
  display: flex;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1200px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #111;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.lightbox-btn {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: rgba(31, 31, 31, 0.7);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  background: var(--red);
  border-color: var(--white);
  color: var(--white);
}

.lightbox-btn svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
  display: block;
}

.lightbox-close {
  top: 0.85rem;
  right: 0.85rem;
}

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

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

.lightbox-status {
  position: absolute;
  left: 50%;
  bottom: 0.7rem;
  transform: translateX(-50%);
  margin: 0;
  color: #f3f3f3;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 3.5rem 0.75rem 2.4rem;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 0.45rem;
    transform: none;
  }

  .lightbox-prev {
    left: 0.6rem;
  }

  .lightbox-next {
    right: 0.6rem;
  }

  .lightbox-figure img {
    max-height: calc(100vh - 8rem);
  }
}
