.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 48px 72px;
  background: #10272ef2;
  overflow: hidden;
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.lightbox img {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  max-width: 100%;
  max-height: calc(100vh - 115px);
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
}

.lightbox button {
  position: static;
  z-index: 2;
  width: 50px;
  height: 50px;
  border: 1px solid #ffffff66;
  border-radius: 50%;
  background: #10272e99;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  background: var(--terra);
  border-color: var(--terra);
}

.lightbox-prev { grid-column: 1; grid-row: 1; }
.lightbox-next { grid-column: 3; grid-row: 1; }
.lightbox .lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
}

.lightbox-counter {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  color: #fff;
  font-size: .75rem;
  letter-spacing: .12em;
}

@media (max-width: 650px) {
  .lightbox { padding: 54px 10px 20px; }
  .lightbox[open] { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; }
  .lightbox button { width: 40px; height: 40px; font-size: 1.9rem; }
  .lightbox img { max-height: calc(100vh - 125px); }
}
