/*
 styles adapted from https://www.w3schools.com/w3css/4/w3.css
 arrow styles adapted from https://codepen.io/minustalent/pen/Frhaw
 */

$border-color: darken(#FFF, 5%);

.display-none {
  display: none !important;
}

.fs-container {
  display: block;
  cursor: pointer;
  position: fixed;
  z-index: 1;
  top: 16px;
  left: 16px;
  width: 46px;
  height: 46px;
  text-align: center;
  padding: 0;
  background-color: rgba(0,0,0,0.2);
  transition: all .2s ease-in-out;

  &:hover {
    background-color: rgba(0,0,0,0.33);
  }

  .arrow-exitfs {
    display: block;
    width: 30px;
    height: 30px;
    background: transparent;
    border: {
      top: 2px solid $border-color;
    }
    transition: all .2s ease-in-out;

    &.prev {
      transform: rotate(-45deg);
      position: relative;
      left: 18px;
      top: 18px;
    }

    &:after {
      content: '';
      width: 30px;
      height: 30px;
      background: transparent;
      border: {
        top: 2px solid $border-color;
      }
      transform: rotate(90deg);
      position: absolute;
      left: -15px;
      top: -17px;
    }
  }
}

.slideshow-container.slideshow-container-fs {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.slideshow-container {
  position: relative;
  display: block;
  margin: auto;
  height: 100%;
  width: 100%;
  overflow: hidden;

  .hide-slide {
    visibility: hidden;
    position: absolute;
    top: -100vw;
    // transform: translate3d(-100vw, 0, 0);
    left: -100vw;
    opacity: 0;
  }

  .slides {
    touch-action: pan-y; // only allow browser vertical scroll
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    visibility: visible;
    opacity: 1;
    display: block;

    &.selected {
      // transform: translate3d(0, 0, 0);
      left: 0;
    }

    &.left-slide {
      // transform: translate3d(-100%, 0, 0);
      left: -100%;
    }

    &.right-slide {
      // transform: translate3d(100%, 0, 0);
      left: 100%;
    }

    &.slide-in-left {
      // transform: translate3d(0, 0, 0);
      left: 0;
      animation: slideInLeft 0.5s cubic-bezier(0.42, 0, 0.58, 1);
    }

    &.slide-in-right {
      // transform: translate3d(0, 0, 0);
      left: 0;
      animation: slideInRight 0.5s cubic-bezier(0.42, 0, 0.58, 1);
    }

    &.slide-out-left {
      // transform: translate3d(-100%, 0, 0);
      left: -100%;
      animation: slideOutLeft 0.5s cubic-bezier(0.42, 0, 0.58, 1);
    }

    &.slide-out-right {
      // transform: translate3d(100%, 0, 0);
      left: 100%;
      animation: slideOutRight 0.5s cubic-bezier(0.42, 0, 0.58, 1);
    }

    &.link {
      cursor: pointer;
    }

    &:not(.link) {
      cursor: default;
    }
  }

  .caption {
    position: absolute;
    bottom: 0;
    padding: 10px;
    width: 100%;
  }

  .arrow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    height: 100%;
    width: auto;
    cursor: pointer;
    background-size: 100%;
    background-image: linear-gradient(transparent, transparent);
    z-index: 100;
    user-select: none;

    &:before {
      display: block;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      opacity: 0;
      width: 100%;
      z-index: -100;
      transition: opacity 0.45s;
    }

    &.prev {
      left: 0;

      &:before {
        background-image: linear-gradient(to left, transparent, rgba(0, 0, 0, 0.75));
        content: '';
      }
    }

    &.next {
      right: 0;

      &:before {
        background-image: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.75));
        content: '';
      }
    }

    .arrow {
      display: block;
      margin: auto;
      width: 30px;
      height: 30px;
      background: transparent;
      border: {
        top: 2px solid $border-color;
        left: 2px solid $border-color;
      }
      transition: all .2s ease-in-out;
      user-select: none;

      &:before {
        display: block;
        height: 200%;
        width: 200%;
        margin: {
          left: -50%;
          top: -50%;
        }
        content: "";
        transform: rotate(45deg);
      }

      &.prev {
        transform: rotate(-45deg);
        position: relative;
        left: 20px;
        margin-right: 10px;
      }

      &.next {
        transform: rotate(135deg);
        position: relative;
        right: 20px;
        margin-left: 10px;
      }
    }
  }

  .slick-dots {
    display: block;
    bottom: 15px;
    z-index: 1;
    text-align: center;
    position: absolute;
    padding: 0;
    left: 0;
    right: 0;
    margin: 0 auto;

    & li {
      display: inline;
      margin: 0;
      padding: 0;

      & button {
        border: none;
        background: none;
        text-indent: -9999px;
        font-size: 0;
        width: 20px;
        height: 20px;
        outline: none;
        position: relative;
        z-index: 1;
        cursor: pointer;

        &:before {
          content: '';
          width: 4px;
          height: 4px;
          background: var(--dot-color, #FFF);
          border-radius: 4px;
          display: block;
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          opacity: .7;
          transition: all .5s ease-out;
        }
      }

      &.slick-active {
        & button:before {
          transform: translate(-50%, -50%) scale(1.4);
          opacity: 1;
        }
      }
    }
  }
}

@media screen and (min-width: 768px) {
  .slideshow-container {
    .arrow-container {
      &:hover {
        &:before {
          opacity: 1;
        }
        .arrow {
          border: {
            width: 4px;
          }
        }
      }
      .arrow {
        &:hover {
          border: {
            width: 4px;
          }
        }
      }
    }
  }
}

@keyframes slideInRight {
  0% {
    // transform: translate3d(-100%, 0, 0);
    left: -100%;
  }

  100% {
    // transform: translate3d(0, 0, 0);
    left: 0;
  }
}

@keyframes slideInLeft {
  0% {
    // transform: translate3d(100%, 0, 0);
    left: 100%;
  }

  100% {
    // transform: translate3d(0, 0, 0);
    left: 0;
  }
}

@keyframes slideOutRight {
  0% {
    // transform: translate3d(0, 0, 0);
    left: 0;
  }

  100% {
    // transform: translate3d(-100%, 0, 0);
    left: -100%;
  }
}

@keyframes slideOutLeft {
  0% {
    // transform: translate3d(0, 0, 0);
    left: 0;
  }

  100% {
    // transform: translate3d(100%, 0, 0);
    left: 100%;
  }
}

.loader {
  position: absolute;
  left: 50%;
  margin-left: -20px;
  top: 50%;
  margin-top: -20px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #555;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
