.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(12 5 9 / 0.95);
  color: var(--paper);
}

.lightbox::backdrop {
  background: transparent;
}

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

.lightbox__figure {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  justify-items: center;
  gap: var(--space-s);
  margin: 0;
  padding-block: var(--space-l);
}

.lightbox__image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 7rem);
  object-fit: contain;
}

.lightbox__counter {
  color: var(--muted);
  font-size: var(--step--1);
}

.lightbox__close,
.lightbox__nav {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  cursor: pointer;
}

.lightbox__close {
  position: absolute;
  top: var(--space-s);
  right: var(--space-s);
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
}

.lightbox__close:hover {
  background: var(--cellar-line);
}

.lightbox__nav {
  grid-row: 1;
  width: 3.5rem;
  height: 3.5rem;
  margin: var(--space-s);
  border: 1px solid var(--cellar-line);
  background: rgb(28 14 22 / 0.6);
}

.lightbox__nav--prev {
  grid-column: 1;
}

.lightbox__nav--next {
  grid-column: 3;
}

@media (max-width: 45rem) {
  .lightbox[open] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
  }

  .lightbox__figure {
    grid-column: 1 / -1;
  }

  .lightbox__nav {
    grid-row: 2;
  }

  .lightbox__nav--prev {
    grid-column: 1;
    justify-self: end;
  }

  .lightbox__nav--next {
    grid-column: 2;
    justify-self: start;
  }
}
