/* Popup/Modal */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, .97);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

body.popup-open {
  overflow: hidden;
}
body.popup-open .popup {
    opacity: 1;
    visibility: visible;
}

/* Navigation arrows */
.popup nav {
  width: 100%;
  max-width: 600px;
  margin: auto;
  padding: var(--half-spacing);
  pointer-events: none;
  display: flex;
  justify-content: space-around;
}

.popup nav span {
  text-align: center;
  cursor: pointer;
  border-radius: 50%;
  border: 1px solid var(--default-color);
  background: var(--background-color);
  width: 30px;
  height: 30px;
  font-size: 20px;
  pointer-events: all;
  transition: filter var(--default-transition-speed);
}

.popup nav span img {
  filter: invert(1);
}

.popup nav span:hover {
  filter: invert(1);
  border: 1px solid transparent;
}

.popup nav span.prev {
  transform: rotate(90deg);
}

.popup nav span.close {
  font-weight: 600;
  width: 29px;
  height: 29px;
  font-size: 25px;
  line-height: 22px;
}

.popup nav span.next {
  transform: rotate(-90deg);
}

.popup nav span img {
  width: 15px;
}


.first nav span:first-child,
.last nav span:last-child {
  pointer-events: none;
  opacity: 0;
}

/* Carousel container */
.popup .carousel {
  display: flex;
  width: 100vw;
  height: 100vh;
}

.popup .carousel li {
  flex: 0 0 100%;
  scroll-snap-align: start;
  padding-left: 0 calc(calc(100vw - var(--site-width)) / 2);
}

/* Layout */
.popup .carousel li figcaption {
  padding: var(--half-spacing);
  text-align: center;
}
/* Image */
.popup .carousel li img {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: contain;
}

/* Caption */
.popup .carousel li figcaption h4 {
  font-size: 18px;
  line-height: 110%;
  font-weight: 600;
}

.popup .carousel li figcaption h5 {
  font-size: 14px;
  line-height: 110%;
  font-weight: 600;
}

.popup .carousel li figcaption em {
  font-style: italic;
}

@media (min-height: 600px) {
  .arrows {
    padding: var(--default-spacing);
  }
  .popup .carousel li figcaption {
    padding: var(--default-spacing);
  }
}

@media (max-height: 400px) {
  .popup .carousel li {
    display: flex;
    align-items: center;
  }
}

@media (min-width: 600px) {
  .popup .carousel li img {
    max-height: 70vh;
  }
}
