.fullscreen-gallery::backdrop {
  
}

.body:has(.fullscreen-gallery[open]) {
  overflow: hidden;
}

.fullscreen-gallery:focus-visible {
  outline: none;
}

.fullscreen-gallery {
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  background: none;
  border: none;
  overflow-x: scroll;
  padding: 0;
  scroll-snap-type: x mandatory;
  background-color: var(--backdrop);
  -ms-overflow-style: none;
  scrollbar-width: none;
  align-items: stretch;
}

.fullscreen-gallery::-webkit-scrollbar {
  display: none;
  /* Safari and Chrome browsers */
}

.fullscreen-gallery[open] {
  display: flex;
}


.fullscreen-gallery__item {
  width: calc(100vw - 1.5rem);
  padding-inline: .75rem;
  height: 100vh;
  flex-shrink: 0;
  scroll-snap-align: start;
  overflow-y: auto;
  display: flex;
  align-items:center;
  justify-content: center;
  box-sizing: content-box;
}

.fullscreen-gallery__item > * {
  max-height: calc(100vh - 1.5rem);
  max-width: calc(100vw - 1.5rem);
}


.fullscreen-gallery__close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  color: #fff;
}



.fullscreen-gallery__left,
.fullscreen-gallery__right {
  position: fixed;
  top: 50%;
  translate: 0 -50%;
}

.fullscreen-gallery__left {
  left: 1.5rem;
  margin-left: max(-6rem,
      (100% - 100vw) / 2);
}

.fullscreen-gallery__right {
  right: 1.5rem;
  margin-right: max(-6rem,
      (100% - 100vw) / 2);
}

.fullscreen-gallery__left_hide,
.fullscreen-gallery__right_hide {
  display: none;
  pointer-events: none;
}

[data-fullscreen-gallery] {
  cursor: pointer;
}

@media not (hover: hover) {
  .fullscreen-gallery__left,
  .fullscreen-gallery__right {
    display: none;
  }
}