// --------------------- //
// CONTENT HEADER
//
#carousel-header, .header-content, .hwk-header-content {
  // get rid of margin on top
  margin-top: -@content-margin-top;
  margin-bottom: @content-margin-top;
  @media (max-width: @screen-xs-max) {
    margin-top: -@content-margin-top-xs;
    margin-bottom: @content-margin-top-xs;
  }
}


// --------------------- //
// CAROUSEL HEADER
//
#carousel-header.carousel {
  margin: -@content-margin-top auto @content-margin-top auto;
  @media (min-width: @screen-xl-min) {
    height: @header-slider-height-xl;
    width: @container-xl;
  }
  @media (min-width: @screen-lg-min)and (max-width: @screen-lg-max) {
    height: @header-slider-height-lg;
    width: @container-lg;
  }
  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
    height: @header-slider-height-md;
    width: @container-md;
  }
  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
    height: @header-slider-height-sm;
    width: @container-sm;
  }

  .item {

    &.active, .slider-text, .slider-image {
      @media (min-width: @screen-xl-min) {
        height: @header-slider-height-xl;
        max-height: @header-slider-height-xl;
      }
      @media (min-width: @screen-lg-min)and (max-width: @screen-lg-max) {
        height: @header-slider-height-lg;
        max-height: @header-slider-height-lg;
      }
      @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
        height: @header-slider-height-md;
        max-height: @header-slider-height-md;
      }
      @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
        height: @header-slider-height-sm;
        max-height: @header-slider-height-sm;
      }
    }
    .note.inside {
      font-size: 10px;
      background: none;
    }
    // ---------------------------- //
    // default
    //
    &:not(.text-on-top) {
      background-color: transparent !important;

      .container {
        display: flex;
        padding-right: 0;
        padding-left: 0;
      }

      .slider-text {
        background-color: #fff !important;
        flex: 1;
        order: 2;

        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px 40px 20px (@header-slider-default-deco-width + 30);
        position: relative;


        h1, .h1 {
          font-size: 46px;
          @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
            font-size: 36px;
          }
          color: @color-colored;
          position: relative;
          width: 100%;

          span:not(.slider-text-h1-deco):not(.slider-text-h1-text) {
            position: absolute;
            top: -35px;
            margin-top: 0;
          }

          &:before {
            content: '';
            display: none;
            width: @header-slider-default-deco-width;
            height: @header-slider-default-deco-height;
            background-color: @color-colored;
            top: 8px;
            left: -(@header-slider-default-deco-width + 30);
            position: absolute;
          }
        }

        p {
          color: @gray-dark;
          font-size: @font-size-small;
          font-weight: 500;
          line-height: 1.4;
          width: 100%;
        }

        p:not(.lead) {
          a {
            position: relative;
            top: 20px;
            margin: 0;
            font-size: 12px;
            color: @color-colored;
            border: 1px solid @color-background;
            padding: 10px 20px;
          }
        }
      }

      .slider-deco {
        display: none;
      }

      .slider-image {
        order: 3;
        flex-basis: 56%;
        left: 0;
        img {
          display: none;
          //height: 100%;
          //object-fit: cover;
        }
        @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
          flex-basis: 50%;
        }
      }

      .note.inside {
        left: auto;
        right: 0;
        bottom: 0;
        width: auto;
        background: none;
        padding: 20px 30px;
      }
    }

    // ------------------------------ //
    // text on top
    //
    &.text-on-top {

      background-color: transparent;

      .container {
        position: relative;
      }

      // has color info
      .slider-deco-text-on-top {
        display: none;
      }

      .slider-text {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        float: none;
        left: 0;
        padding-left: 0;

        :first-child {
          margin-top: 0;
        }

        :last-child {
          margin-bottom: 0;
        }

        & > div {
          padding: 30px 0;
        }

        h1, .h1 {
          font-size: 56px;
          font-weight: 600;
          color: @color-colored;
          position: relative;
          margin: 0;
          background-color: white;
          display: inline;
          box-decoration-break: clone;
          line-height: 1.3;
          padding: 10px @header-slider-ontop-padding-width 10px (@header-slider-ontop-padding-width + @grid-gutter-width);
          left: -@grid-gutter-width-half;
          // deco line vertical
          .slider-text-h1-deco {
            display: none;
          }
          @media (min-width: @screen-xl-min) {
            padding-left: @header-slider-ontop-padding-width + @grid-gutter-width-xl;
            left: -@grid-gutter-width-xl;
          }

          @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
            font-size: 50px;
          }
          @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
            font-size: 42px;
          }
        }

        .slider-text-h1 {
          & + p {
            color: white;
            margin-top: 30px;
            padding-right: 10%;
            margin-bottom: 10px;
          }
        }

        .btn-white {
          background-color: #fff;
          color: @color-colored;
          border-color: #fff;

          &:active,
          &:focus,
          &:hover {
            color: @color-colored;
            background-color: #fff;
            border-color: #fff;
          }

          width: auto;
        }

        .slider-text-container > *:not(.slider-text-h1) {
          margin-left: @grid-gutter-width-half + @header-slider-ontop-padding-width;
        }

        // large screen
        @media (min-width: @screen-xl-min) {
          max-width: 45%;
          .slider-text-container {
            padding-bottom: 60px;
          }

          h1 {
            .slider-text-h1-deco {
              left: -60px;
              width: 60px;
            }
          }
        }
      }
      
      .slider-image-text-on-top {
        display: none;
      }
      .note.inside {
        text-align: right;
        margin-bottom: 10px;
      }
    }
  }

  // @since 2.0.1
  .slider-link {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 2;
  }

  .carousel-control {
    width: 100px;
    .glyphicon {
      font-size: 30px;
    }
    &.left, &.right {
      &:focus,
      &:hover {
        background-image: none;
      }
    }
    &.left {
      left: -60px;
    }
    &.right {
      right: -60px;
    }
    @media (max-width: @screen-md-max) {
      &.left {
        left: 0px;
      }
      &.right {
        right: 0px;
      }
    }
  }

  // -- CAROUSEL HEADER -- //
  @media (min-width: @screen-lg-min) {
    .carousel-inner {
      // -- default -- //
      .item:not(.text-on-top) {
        .slider-text, .slider-image {
          min-height: 380px;
        }

        h1, .h1 {
          margin-top: 35px;
        }
      }
    }
  }
  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
    .carousel-inner {
      // -- default -- //
      .item:not(.text-on-top) {
        .slider-text, .slider-image {
          min-height: 300px;
        }

        h1, .h1 {
          margin-top: 60px;
        }
      }
    }
  }
  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
    .carousel-inner {
      // -- default -- //
      .item:not(.text-on-top) {
        .slider-text, .slider-image {
          min-height: 300px;
        }

        h1, .h1 {
          /*font-size: 40px !important;*/
          margin-top: 60px;
        }
      }
      .text-on-top {
        p {
          font-size: @font-size-small;
        }
      }
    }
  }
  // -- CAROUSEL HEADER - MOBILE -- //
  @media (max-width: @screen-xs-max) {
    margin-bottom: 20px;
    .carousel-inner {
      .item {
        img {
          height: @header-slider-image-height-xs;
          width: 100%;
          object-fit: cover;
        }
      }
      .slider-image {
        position: relative;
      }
      // -- default -- //
      .item:not(.text-on-top) {
        .container {
          flex-direction: column;
          padding: 0;

          .slider-image, .bg-image {
            order: 1;
            //flex-basis: 100%;
            width: 100vw !important;
            max-height: 230px;
            img {
              display: block;
            }
          }

          .slider-text {
            padding: 30px 20px 20px 30px;
            width: 100vw;
            h1, .h1 {
              font-size: 24px !important;
              margin-bottom: 10px;
              margin-top: 30px;

              span {
                top: -26px !important;
              }

              &::before {
                width: 20px;
                height: 40px;
                background-color: #408FE5;
                top: 4px;
                left: -30px;
              }
            }
          }
        }

        .note.inside {
          left: @grid-gutter-width-half-xs;
          right: auto;
          bottom: 5px;
          padding: 0;
        }
      }

      // -- on top -- //
      .item.text-on-top {
        background: white !important;
        &, .container {
          width: 100vw;
          padding: 0;
        }

        .container {
          background-image: none !important;
          display: flex;
          flex-direction: column;

          .slider-text {
            order: 3;

            .slider-text-container {
              padding: 0 0 15px 0;
            }

            // @since 2.0.1 (updated)
            .slider-text-h1 {
              overflow: hidden;
              padding-top: 4px;
              padding-bottom: 4px;
              h1, .h1 {
                font-size: 24px;
                line-height: 1.5;
              }
            }

            p, a {
              color: @text-color;
            }
            p:not(.note) {
              font-size: @font-size-small;
            }

            .btn-white {
              color: @color-colored;
              border-color: @color-colored;
            }
          }

          .note.inside {
            position: relative;
            right: 0;
            left: 0;
            bottom: 20px;
            order: 2;
            padding: 0 15px;
            margin-top: 0;
            text-align: left;
          }

          .slider-image-text-on-top {
            display: block;
            position: relative;
            order: 1
          }
        }
      }
    }

    .carousel-control {
      align-items: flex-start;
      span.glyphicon {
        top: calc(@header-slider-image-height-xs / 2 + 15px);
      }
    }

    .carousel-indicators {
      display: none;
    }
  }
}


// --------------------- //
// HEADER CONTENT
//
.hwk-header-content {
  //margin-top: -40px;
  display: flex;

  // 1. column text
  .hwk-header-content-text { // .col
    background-color: @color-colored;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    flex: @hwk-header-content-text-prop;
    min-height: @hwk-header-content-height;
    @media (min-width: @screen-xl-min) {
      min-height: @hwk-header-content-height-xl;
    }

    .header-text {
      padding: 50px 10%;
      max-width: ((@container-lg - @grid-gutter-width) / 2);
      @media (min-width: @screen-xl-min) {
        max-width: ((@container-xl - (@grid-gutter-width-xl * 2)) / 2);
      }
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .header-deco {
      display: flex;
      width: 100%;

      div {
        height: 24px;

        &:first-child {
          flex: 1;
        }

        &:last-child {
          flex: 3;
        }
      }
    }

    @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
      flex: @hwk-header-content-text-prop-md;
    }
    @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
      flex: @hwk-header-content-text-prop-sm;
    }
  }

  // 2. Column Image
  .hwk-header-content-image {
    flex: @hwk-header-content-image-prop;
    @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
      flex: @hwk-header-content-image-prop-md;
    }
    @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
      flex: @hwk-header-content-image-prop-sm;
    }
  }

  @media (max-width: @screen-xs-max) {
    flex-direction: column;
    width: 100%;
    .hwk-header-content-image {
      flex: 1 230px;
      order: 1;
    }

    .hwk-header-content-text {
      flex: 1;
      order: 2;
      align-items: flex-start;
      min-height: 1px;

      .header-text {
        padding: 30px 20px;
      }
    }
  }
}