.lightbox {
  background-color: oklch(var(--lch-white) / 0.66);
  block-size: 100dvh;
  border: 0;
  inline-size: 100dvw;
  inset: 0;
  margin: auto;
  max-height: unset;
  max-width: unset;
  overflow: hidden;
  padding: var(--block-space) var(--inline-space);

  &[open] {
    display: grid;
    place-items: center;
  }

  &::backdrop {
    -webkit-backdrop-filter: blur(66px);
    backdrop-filter: blur(66px);
  }
}

.lightbox__btn {
  align-self: start;
  grid-area: 1/1;
  justify-self: end;
  z-index: 10;
}

.lightbox__btn--download {
  align-self: end;
  grid-area: 1/1;
  justify-self: end;
  z-index: 10;
}

.lightbox__btn--share {
  align-self: start;
  grid-area: 1/1;
  justify-self: start;
  z-index: 10;
}

.lightbox__zoom-controls {
  grid-area: 1/1;
  align-self: end;
  justify-self: center;
  display: flex;
  gap: var(--inline-space-half);
  z-index: 10;
}

.lightbox__nav-btn {
  --btn-background: oklch(var(--lch-white) / 0.8);
  --btn-border-color: var(--color-border);
  backdrop-filter: blur(10px);
  grid-area: 1/1;
  align-self: center;
  z-index: 10;

  &:disabled {
    opacity: 0.4;
    pointer-events: none;
  }
}

.lightbox__nav-btn--prev {
  justify-self: start;
}

.lightbox__nav-btn--next {
  justify-self: end;
}

.lightbox__counter {
  grid-area: 1/1;
  align-self: start;
  justify-self: center;
  z-index: 10;
  background-color: oklch(var(--lch-white) / 0.8);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: var(--text-xs);
  line-height: 1;
  backdrop-filter: blur(10px);
}

.lightbox__zoom-btn {
  --btn-background: oklch(var(--lch-white) / 0.8);
  --btn-border-color: var(--color-border);
  backdrop-filter: blur(10px);
}

.lightbox__image {
  grid-area: 1/1;
  max-inline-size: calc(100dvw - (var(--inline-space) * 2));
  max-block-size: calc(100dvh - (var(--block-space) * 2));
  transition: none;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  touch-action: none;
  cursor: default;

  &:hover {
    cursor: grab;
  }
}
