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

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

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

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

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

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

  > .active {
    left: 0;
  }

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

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

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

@media (max-width: @screen-sm-max) {
  .carousel-inner {
    > .item > img {
      width: 100%;
    }
  }
}

//
// Carousel 1
// --------------------------------------------------

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

.carousel-1 {
  .carousel-inner > .item {
    img {
      width: 100%;
      height: auto;
    }
  }

  .carousel-control {
    position: absolute;
    top: 50%;
    margin-top: -50px;
    bottom: 0;
    background: #111;
    line-height: 100px;
    color: #999 !important;
    text-align: center;
    z-index: 15;
    border: 1px solid #222;
    .size(20px,100px);
    .opacity(.3);
    // 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
    &.left { 
      left: 0;
    }
    &.right {
      right: 0;
    }

    .carousel:hover& {
      .opacity(1);
    }
   
    // Hover/focus state
    &:hover {
      background: @link-hover-color;
      border-color: @link-hover-color;
      color: #fff !important;
      .box-shadow(0 0 5px @link-hover-color);
    }

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

    .icon-prev {
      &:before {
        content: '\f053';// icon chevron right 
      }
    }
    .icon-next {
      &:before {
        content: '\f054';// icon chevron left 
      }
    }
  }


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

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

    li {
      display: inline-block;
      margin: 0 1px;
      text-indent: -999px;
      border: 1px solid #fff;
      border-radius: 10px;
      cursor: pointer;
      .square(10px);

      img {
        clip: rect(0,0,0,0);
        position: absolute;
      }
    }

    .active {
      background-color: #fff;
    }
  }

  // Optional captions
  // -----------------------------
  // Hidden by default for smaller viewports
  .carousel-caption {
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 10;
    padding: 20px 30px 40px;
    color: #fff !important;
    text-align: center;
    #gradient > .vertical(rgba(0,0,0,0), rgba(0,0,0,.6));

    a {
      color: #fff !important;

      &:hover {
        color: @link-hover-color !important;
        text-shadow: 0 0 5px @link-hover-color !important;
      }
    }
  }
}


//
// Carousel 2
// --------------------------------------------------

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

.carousel-2 {
  border-top: 1px solid rgba(51,51,51,.3); 

  .carousel-inner > .item {
    .attachment-homepage-wide,
    > img,
    > a > img {
      width: 100%;
      height: auto;
    }
  }

  .carousel-control-wrap {
  }

  .carousel-control {
    position: absolute;
    top: 20px;
    background: #111;
    background: rgba(0, 0, 0, 0.5);
    color: #999 !important;
    text-align: center;
    z-index: 15;
    .square(30px);
    // 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
    &.left { 
      left: 20px;
    }
    &.right {
      left: 51px;
    }
   
    // Hover/focus state
    &:hover {
      color: #fff !important;
      border-color: @brand-primary;
      background: @brand-primary;
      .box-shadow(0 0 10px @brand-primary); 
    }

    // Toggles
    .icon-prev,
    .icon-next {
      line-height: 30px;
      display: block;
      z-index: 5;
      font-size: 14px;
      font-family: FontAwesome;
    }

    .icon-prev {
      &:before {
        content: '\f0d9';// icon-caret-up
      }
    }
    .icon-next {
      &:before {
        content: '\f0da';// icon-caret-down
      }
    }
  }


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

  .carousel-indicators-wrap {
    width: 80px;
    height: 100%;
    background: #111;
    background: rgba(0,0,0,.5);
    position: absolute;
    top: 0;
    right: 0;
    z-index: 15;
    overflow: hidden;

    .carousel-indicators {
      padding: 0;
      list-style: none;
      margin: 0 auto;
      width: 60px;
      position: absolute;
      left: 50%;
      top: 50%;
      margin-left: -30px;
      overflow: hidden;
      width: 80px;
      z-index: 15;
      .translate(0, -50%);

      .lt-ie9 & {
        top: 0;
      }
      
    }

    li {
      cursor: pointer;
      margin-bottom: 10px;
      .transition(box-shadow .3s);

      &:first-child {
        margin-top: 10px;
      }

      img {
        width: 58px;
        height: 58px;
        border: 1px solid transparent;
        .transition(all .5s);
      }
    }

    .active,
    li:hover {
      img {
        .box-shadow(0 0 5px @brand-primary);
        border-color: @brand-primary;
      }
    }

    @media(max-width: @screen-xs-max) {
      display: none;
    }
  }

  // Optional captions
  // -----------------------------
  // Hidden by default for smaller viewports
  .carousel-caption {
    position: absolute;
    left: 10px;
    bottom: 5%;
    z-index: 10;
    padding: 20px;
    color: #fff;
    background: #111;
    background: rgba(0,0,0,.8);
    max-width: 70%;

    a:hover {
      color: @link-hover-color !important;
      text-shadow: 0 0 5px @link-hover-color;
    }

    @media(max-width: @screen-xs-max) {
      display: none;
    }
  }

  .carousel-title {
    margin: 0 0 5px;
    a {
      color: #fff !important;
    }
  }

  .carousel-meta a {
    font-size: 11px;
    color: #666 !important;
  }
}


//
// Carousel 3
// --------------------------------------------------

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

.carousel-3 {
  background: #111;
  padding: 50px 20px 20px;
  @media(min-width: @screen-lg) {
    border-top: 1px solid #333;
  }
  
  a {
    position: relative;
    z-index: 1;
  }

  .widget-title {
    position: absolute;
    z-index: 15;
    top: 17px;
    margin-top: 0;
  }

  .carousel-inner > .item {
    overflow: hidden;
  }

  .attachment-thumbnail {
    width: 100px;
    height: auto;
    float: left;
    margin-right: 20px;
    position: relative;
  }

  .carousel-caption {
    max-height: 100px;
    position: relative;
    padding-right: 5px;

    a:hover {
      color: @link-hover-color;
      text-shadow: 0 0 5px @link-hover-color;
    }
  }

  .carousel-title {
    font-size: 14px;
    margin: 0 0 5px;
    a {
      color: #fff;
    }
  }

  .carousel-content {
    color: #888;
  }

  .carousel-control {
    position: absolute;
    top: 15px;
    width: 20px;
    height: 20px;
    border: 1px solid #222;
    font-family: FontAwesome;

    &.left {
      right: 50px ;
    }

    &.right {
      right: 20px;
    }

    &:hover {
      color: #fff;
      border-color: @brand-primary;
      background: @brand-primary;
      .box-shadow(0 0 10px @brand-primary);
    }

    // Toggles
    .icon-prev,
    .icon-next {
      line-height: 18px;
      display: block;
      z-index: 5;
      font-size: 14px;
      font-family: FontAwesome;
      text-align: center;
    }

    .icon-prev {
      &:before {
        content: '\f0d9';// icon-caret-left
      }
    }
    .icon-next {
      &:before {
        content: '\f0da';// icon-caret-right
      }
    }
  }

  .carousel-meta {
    font-size: 11px;
  }

  .carousel-indicators {
    position: absolute;
    clip: rect(0,0,0,0);
  }
}

//
// Carousel 4
// --------------------------------------------------
.carousel-4 {
  padding: 0 35px;

  .carousel-inner {
    > .item img {
      width: 100%;
      height: auto;
    }
  }
  
  @media(max-width: @screen-xs-max) {
    .col-sm-3 {
      margin-bottom: 20px;
    }
  }

  .carousel-control {
    width: 20px;
    height: 100px;
    top: 50%;
    margin-top: -50px;
    position: absolute;
    background: #111;
    border: 1px solid #222;
    color: #999 !important;
    text-align: center;
    z-index: 15;
    // We can't have this transition here because webkicarousel-indicators-wrapt cancels the carousel
    // animation if you trip this while in the middle of another animation.

    // Set gradients for backgrounds
    &.left { 
      left: 0;
    }
    &.right {
      right: 0;
    }
   
    // Hover/focus state
    &:hover {
      color: #fff !important;
      border-color: @brand-primary;
      background: @brand-primary;
      .box-shadow(0 0 10px @brand-primary);
    }

    // Toggles
    .icon-prev,
    .icon-next {
      line-height: 100px;
      display: block;
      z-index: 5;
      font-size: 14px;
      font-family: FontAwesome;
    }

    .icon-prev {
      &:before {
        content: '\f0d9';// icon-caret-left
      }
    }
    .icon-next {
      &:before {
        content: '\f0da';// icon-caret-right
      }
    }
  }

  .carousel-caption {
    a:hover {
      color: @link-hover-color;
      text-shadow: 0 0 5px @link-hover-color;
    }
  }

  .carousel-title {
    font-size: 14px;
    margin-bottom: 5px;

    a {
      color: #fff;
    }
  }

  .carousel-meta {
    font-size: 11px;
  }

  .carousel-indicators {
    position: absolute;
    clip: rect(0,0,0,0);
  }
}