/* Gallery page: masonry photos and a lightbox. Shares tokens and components with styles.css. */

.hero-gallery {
  padding-bottom: 48px;
}

.photos {
  padding-bottom: 40px;
}

.masonry {
  columns: 3 300px;
  column-gap: 20px;
}

.ph {
  margin: 0 0 24px;
  break-inside: avoid;
}

.ph-btn {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: var(--soft);
  cursor: zoom-in;
}

.ph-btn img {
  width: 100%;
  transition: transform 0.9s var(--ease-out);
}

.ph-btn:hover img {
  transform: scale(1.035);
}

.ph figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.back {
  margin-top: 24px;
  text-align: center;
}

.lightbox {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #111218;
  color: #fff;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(17, 18, 24, 0.82);
  backdrop-filter: blur(4px);
}

.lightbox[open] {
  animation: pop 0.35s var(--ease-out);
}

.lightbox figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.lightbox img {
  width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
  background: #111218;
}

.lightbox figcaption {
  padding: 14px 20px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
}

.lb-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(17, 18, 24, 0.55);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.lb-btn:hover {
  background: rgba(17, 18, 24, 0.8);
}

.lb-close {
  top: 14px;
  right: 14px;
}

.lb-prev,
.lb-next {
  top: 50%;
  margin-top: -40px;
}

.lb-prev {
  left: 14px;
}

.lb-next {
  right: 14px;
}

html:has(.lightbox[open]) {
  overflow: hidden;
}

html:has(.lightbox[open]) .cursor-ring {
  opacity: 0;
}
