.section-ui-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 3.5rem 1rem;
  border: 0;
  background: transparent;
  color: white;
}

.section-ui-lightbox[open] {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
}

.section-ui-lightbox::backdrop {
  background: rgb(0 0 0 / 94%);
}

.section-ui-lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
}

.section-ui-lightbox > form {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  margin: 0;
}

.section-ui-lightbox__close {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.section-ui-lightbox__navigation:not([hidden]) {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.section-ui-lightbox__navigation > button {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.section-ui-lightbox__spinner,
.section-ui-lightbox__error {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  pointer-events: none;
}

.section-ui-lightbox__spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: section-ui-lightbox-spin 700ms linear infinite;
}

@keyframes section-ui-lightbox-spin {
  to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
  .section-ui-lightbox__spinner {
    animation: none;
  }
}
