/*========================================
=            Bildformatierung            =
========================================*/

.csc-textpic-image {
  //padding-top: floor(@grid-gutter-width/8);
  //padding-bottom: floor(@grid-gutter-width/8);
  img {
    .img-responsive();
    width: 100%;
  }
  .lightbox {
    display: block;
    position: relative;

    &:before {
      position: absolute;
      right: floor(@grid-gutter-width/2);
      bottom: floor(@grid-gutter-width/2);

      &:extend(.icon:before);
      &:extend(.icon-magnifier:before);
      color: #fff;
    }

  }
}

.csc-textpic-border {
  img {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: all .125s ease;
  }
  a {
    img {
      opacity: .9;
      transition: all .25s ease;
    }
    &:hover img, &:focus img {
      box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
      opacity: 1;
    }
  }
}

.csc-textpic-caption {
  .small();
  //font-size: @font-size-small;
  color: @gray;
  margin-top: floor(@grid-gutter-width/4);
  > span {
    display: block;
  }
  .img-title {
    font-weight: bold;

  }
}

/*========================================================
=            Bildelement mit mehreren Bildern            =
========================================================*/

.csc-textpic-above .csc-textpic-imagewrap {

  .make-row(floor(@grid-gutter-width/4));

  &[data-csc-cols="5"] {
    .csc-textpic-image {
      .make-sm-column(6, floor(@grid-gutter-width/4));
      .make-md-column(4, floor(@grid-gutter-width/4));
      .make-lg-column(2.4, floor(@grid-gutter-width/4));

      @media screen and (max-width: @screen-sm-max) {
        &:nth-child(2n+3) {
          clear: left;
          //outline: 1px solid green;
        }
      }

      @media screen and (min-width: @screen-md) and (max-width: @screen-md-max) {
        &:nth-child(3n+4) {
          clear: left;
          //outline: 1px solid yellow;
        }
      }

      @media screen and (min-width: @screen-lg) {
        &:nth-child(5n+6) {
          clear: left;
          //outline: 1px solid red;
        }
      }

    }
  }

  &[data-csc-cols="4"] {
    .csc-textpic-image {
      .make-sm-column(6, floor(@grid-gutter-width/4));
      .make-md-column(3, floor(@grid-gutter-width/4));

      @media screen and (max-width: @screen-sm-max) {
        &:nth-child(2n+3) {
          clear: left;
          //outline: 1px solid green;
        }
      }

      @media screen and (min-width: @screen-md) {
        &:nth-child(4n+5) {
          clear: left;
          //outline: 1px solid yellow;
        }
      }
    }
  }

  &[data-csc-cols="3"] {
    .csc-textpic-image {
      .make-sm-column(4, floor(@grid-gutter-width/4));

      @media screen and (min-width: @screen-xs-max) {
        &:nth-child(3n+4) {
          clear: left;
          //outline: 1px solid green;
        }
      }
    }
  }

  &[data-csc-cols="2"] {

    .csc-textpic-image {
      .make-sm-column(6, floor(@grid-gutter-width/4));
      @media screen and (min-width: @screen-xs-max) {
        &:nth-child(2n+3) {
          clear: left;
          //outline: 1px solid green;
        }
      }
    }
  }

  &[data-csc-cols="1"], &[data-csc-images="1"] {
    //.make-row(0);
    .csc-textpic-image {
      .make-xs-column(12, floor(@grid-gutter-width/4));
    }
  }

}

.csc-textpic {
  &-intext-left-nowrap .csc-textpic-imagewrap {
    float: left;

  }
  &-intext-left img {
    float: left;
    margin-right: @padding-base-horizontal;
  }
  &-intext-right img {
    float: right;
    margin-left: @padding-base-horizontal;
  }
}

.csc-textpic-slider {

  .section > & {
    .container();
  }

  .row > & {
    .make-row();
  }
}

.csc-texpic-bleeding {

  position: relative;
  overflow: hidden;

  .csc-textpic-imagewrap {
    margin-left: 0;
    margin-right: 0;
  }

  .csc-textpic-image {
    padding-left: 0!important;
    padding-right: 0!important;

    img {
      margin-left: auto;
      max-height: 130vh;
      width: auto;
      max-width: inherit;
    }
  }

  @media screen and (min-width: @grid-float-breakpoint) {

    margin-top: -8vw; // erratene Werte aus der Welle
    margin-bottom: -50vh;

    @rightmarginhelper: ceil(@grid-gutter-width / 2 * 1.5);

    margin-right: ~"calc(-50vw + 100% + @{rightmarginhelper})";

  }

  @media screen and (max-width: @grid-float-breakpoint-max) and (orientation: portrait) {
    margin-bottom: -32%;
    @rightmarginhelper: ceil(@grid-gutter-width / 2 );
    margin-right: ~"calc(-5vw - @{rightmarginhelper})";

    .csc-textpic-image img {
      width: 125vw;
      max-width: inherit;
      max-height: inherit;
    }
  }
}