*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
}

.gallery {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #111;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translate(0, 0);
  transition: transform 0.5s ease, opacity 0.5s ease;
  will-change: transform, opacity;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.arrow {
  position: absolute;
  z-index: 10;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease, background 0.2s ease;
  pointer-events: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.arrow.show {
  opacity: 1;
  pointer-events: auto;
}

.arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.arrow:active {
  background: rgba(255, 255, 255, 0.45);
}

.arrow-left {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.arrow-right {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.arrow-top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.arrow-bottom {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.gallery {
  height: 100dvh;
}

.arrow-left,
.arrow-right {
  display: none;
}

.arrow-top,
.arrow-bottom {
  display: flex;
}

.slide {
  padding: 32px 20px;
}

body.desktop .gallery {
  height: 100vh;
}

body.desktop .arrow-left,
body.desktop .arrow-right {
  display: flex;
}

body.desktop .arrow-top,
body.desktop .arrow-bottom {
  display: none;
}

body.desktop .slide {
  padding: 0;
}

@media (hover: none) and (pointer: coarse) {
  .arrow {
    width: 56px;
    height: 56px;
  }
}
