/*Stylesheet for CSS photo carousel

Thanks to Christian Schaefer for the original code
https://schepp.dev/posts/css-only-carousel/
*/


@keyframes tonext {
  75% {
    left: 0;
  }
  95% {
    left: 100%;
  }
  98% {
    left: 100%;
  }
  99% {
    left: 0;
  }
}

@keyframes tostart {
  75% {
    left: 0;
  }
  95% {
    left: -600%;/*This needs to be -100 less than -100 times the number of slides*/
  }
  98% {
    left: -600%;/*This one too*/
  }
  99% {
    left: 0;
  }
}

@keyframes snap {
  96% {
    scroll-snap-align: center;
  }
  97% {
    scroll-snap-align: none;
  }
  99% {
    scroll-snap-align: none;
  }
  100% {
    scroll-snap-align: center;
  }
}


.carousel * {
  scrollbar-color: transparent transparent; /* thumb and track color */
  scrollbar-width: 0px;
}

.carousel *::-webkit-scrollbar {
  width: 0;
}

.carousel *::-webkit-scrollbar-track {
  background: transparent;
}

.carousel *::-webkit-scrollbar-thumb {
  background: transparent;
  border: none;
}

.carousel * {
  -ms-overflow-style: none;
}

.carousel ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.carousel li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.carousel {
  position: relative;
  max-width: 64vw;
  padding-top: clamp(454px, 60vh, 100vw);/*This is the height adjustment, px=7.5*vh*/
  margin-bottom: -4px;
  perspective: 100px;
}

.carousel__viewport {
  position: absolute;
  top: 0;
  right: 0;
  bottom: -17px;
  left: 0;
  display: flex;
  overflow-x: scroll;
  counter-reset: item;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.carousel__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
}

.carousel__snapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
}

@media (hover: hover) {
  .carousel__snapper {
    animation-name: tonext, snap;
    animation-timing-function: ease;
    animation-duration: 5s;
    animation-iteration-count: infinite;
  }

  .carousel__slide:last-child .carousel__snapper {
    animation-name: tostart, snap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel__snapper {
    animation-name: none;
  }
}

.carousel:hover .carousel__snapper {
  animation-name: none;
}

.carousel__navigation {
	display: flex;
	justify-content: center;
  position: absolute;
  right: 0;
  bottom: 2.25vw;
  left: 0;
}

.carousel__navigation-list,
.carousel__navigation-item {
  display: inline-block;
}

.carousel__navigation-button {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  background-color: #333;
  background-clip: content-box;
  border: 0.25rem solid transparent;
  border-radius: 50%;
  font-size: 0;
  transition: transform 0.1s;
}


