//
// Carousel
// --------------------------------------------------


// Wrapper for the slide container and indicators
.bk-bs-carousel {
  position: relative;
}

.bk-bs-carousel-inner {
  position: relative;
  overflow: hidden;
  width: 100%;

  > .bk-bs-item {
    display: none;
    position: relative;
    .bk-bs-transition(.6s ease-in-out left);

    // Account for jankitude on images
    > img,
    > a > img {
      &:extend(.bk-bs-img-responsive);
      line-height: 1;
    }
  }

  > .bk-bs-active,
  > .bk-bs-next,
  > .bk-bs-prev { display: block; }

  > .bk-bs-active {
    left: 0;
  }

  > .bk-bs-next,
  > .bk-bs-prev {
    position: absolute;
    top: 0;
    width: 100%;
  }

  > .bk-bs-next {
    left: 100%;
  }
  > .bk-bs-prev {
    left: -100%;
  }
  > .bk-bs-next.bk-bs-left,
  > .bk-bs-prev.bk-bs-right {
    left: 0;
  }

  > .bk-bs-active.bk-bs-left {
    left: -100%;
  }
  > .bk-bs-active.bk-bs-right {
    left: 100%;
  }

}

// Left/right controls for nav
// ---------------------------

.bk-bs-carousel-control {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: @carousel-control-width;
  .bk-bs-opacity(@carousel-control-opacity);
  font-size: @carousel-control-font-size;
  color: @carousel-control-color;
  text-align: center;
  text-shadow: @carousel-text-shadow;
  // We can't have this transition here because WebKit cancels the carousel
  // animation if you trip this while in the middle of another animation.

  // Set gradients for backgrounds
  &.bk-bs-left {
    #gradient > .bk-bs-horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001));
  }
  &.bk-bs-right {
    left: auto;
    right: 0;
    #gradient > .bk-bs-horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5));
  }

  // Hover/focus state
  &:hover,
  &:focus {
    outline: none;
    color: @carousel-control-color;
    text-decoration: none;
    .bk-bs-opacity(.9);
  }

  // Toggles
  .bk-bs-icon-prev,
  .bk-bs-icon-next,
  .bk-bs-glyphicon-chevron-left,
  .bk-bs-glyphicon-chevron-right {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: inline-block;
  }
  .bk-bs-icon-prev,
  .bk-bs-glyphicon-chevron-left {
    left: 50%;
  }
  .bk-bs-icon-next,
  .bk-bs-glyphicon-chevron-right {
    right: 50%;
  }
  .bk-bs-icon-prev,
  .bk-bs-icon-next {
    width:  20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    font-family: serif;
  }

  .bk-bs-icon-prev {
    &:before {
      content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)
    }
  }
  .bk-bs-icon-next {
    &:before {
      content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A)
    }
  }
}

// Optional indicator pips
//
// Add an unordered list with the following class and add a list item for each
// slide your carousel holds.

.bk-bs-carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 15;
  width: 60%;
  margin-left: -30%;
  padding-left: 0;
  list-style: none;
  text-align: center;

  li {
    display: inline-block;
    width:  10px;
    height: 10px;
    margin: 1px;
    text-indent: -999px;
    border: 1px solid @carousel-indicator-border-color;
    border-radius: 10px;
    cursor: pointer;

    // IE8-9 hack for event handling
    //
    // Internet Explorer 8-9 does not support clicks on elements without a set
    // `background-color`. We cannot use `filter` since that's not viewed as a
    // background color by the browser. Thus, a hack is needed.
    //
    // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we
    // set alpha transparency for the best results possible.
    background-color: #000 \9; // IE8
    background-color: rgba(0,0,0,0); // IE9
  }
  .bk-bs-active {
    margin: 0;
    width:  12px;
    height: 12px;
    background-color: @carousel-indicator-active-bg;
  }
}

// Optional captions
// -----------------------------
// Hidden by default for smaller viewports
.bk-bs-carousel-caption {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 20px;
  z-index: 10;
  padding-top: 20px;
  padding-bottom: 20px;
  color: @carousel-caption-color;
  text-align: center;
  text-shadow: @carousel-text-shadow;
  & .bk-bs-btn {
    text-shadow: none; // No shadow for button elements in carousel-caption
  }
}


// Scale up controls for tablets and up
@media screen and (min-width: @screen-sm-min) {

  // Scale up the controls a smidge
  .bk-bs-carousel-control {
    .bk-bs-glyphicon-chevron-left,
    .bk-bs-glyphicon-chevron-right,
    .bk-bs-icon-prev,
    .bk-bs-icon-next {
      width: 30px;
      height: 30px;
      margin-top: -15px;
      margin-left: -15px;
      font-size: 30px;
    }
  }

  // Show and left align the captions
  .bk-bs-carousel-caption {
    left: 20%;
    right: 20%;
    padding-bottom: 30px;
  }

  // Move up the indicators
  .bk-bs-carousel-indicators {
    bottom: 20px;
  }
}
