$out-duration: 0.1s;
$in-duration: $out-duration * 4;
$transition: all $out-duration cubic-bezier(0.59, 0.54, 0.6, 1.41);

ws-carousel {
  display: block;

  .slide-gutter {
    // Needed to stop a tall inactive slide from intercepting clicks destined
    // for the controls.
    overflow: hidden;

    // Needed so overflow: hidden doesn't also clip the animation.
    padding: 5%;
    margin: -5%;
  }

  .slide-container {
    position: relative;

    // Effectively slides before the current slide, due to the higher specificity
    // of .current-slide ~ *, below.
    > * {
      opacity: 0;
      transition: 0 all;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      visibility: hidden;
    }

    .previous-slide {
      transform: scale(0.9);
      transition: all $out-duration cubic-bezier(0.59, 0.54, 0.6, 1.41);
    }

    .current-slide {
      transition: all $in-duration cubic-bezier(0.59, 0.54, 0.6, 1.41);
      opacity: 1;
      position: relative;
      transform: none;
      visibility: visible;
    }

    .next-slide {
      transform: scale(1.05);
      transition: all $out-duration cubic-bezier(0.59, 0.54, 0.6, 1.41);
    }
  }

  .controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    padding-bottom: 6px;
    margin-top: $margin-vertical;
  }

  .slide-selector {
    button {
      background: $color-gray-20;
      width: 8px;
      height: 8px;
      border-radius: 4px;
      border: none;
      font-size: 1px;
      padding: 0px;
      margin: 4px;

      &:focus {
        outline:0;
      }
    }

    .active {
      background: $color-gray-80;
    }
  }

  .back-button,
  .next-button {
    display: block;
    height: 32px;
    width: 32px;
    border-radius: 16px;
    background: $color-white;
    text-decoration: none;
    font-size: 12px;
    line-height: 12px;
    padding: 10px;
    color: $color-yellow;
    border: none;
    margin: 0;

    &:focus {
      outline:0;
    }

    &:disabled {
      border: solid $color-gray-20 1px;
      color: $color-gray-20;
      background: none;
      padding: 9px;
    }
  }

  .chevron {
    &:before {
      border-style: solid;
      border-width: 2px 2px 0 0;
      content: '';
      display: inline-block;
      height: 8.5px;
      width: 8.5px;
      margin-top: 1px;
    }

    &.right:before {
      left: 0;
      transform: rotate(45deg);
      margin-left: -3px;
    }

    &.left:before {
      left: 0;
      transform: rotate(-135deg);
      margin-left: 3px;
    }
  }
}
