@import '../../_global/styles/mixins';
@import '../../_global/styles/vars';

.slider {
  opacity: 0;
  transition: opacity 0.4s linear;

  &.initiated {
    opacity: 1;
  }

  &.single-slide {
    .controls {
      display: none;
    }
  }

  .slide-overflow {
    overflow: hidden;
    transition: height 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  img.loading {
    opacity: 0;
  }

  img.loaded {
    transition: 0.3s ease;
    opacity: 1;
  }

  .slide-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 10000%;
    contain: layout;

    &.no-transition {
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;

      .image-box:after {
        content: "";
        @include full-size;
        z-index: 2;
      }
    }

    img, a {
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      -webkit-user-drag: none;
      -moz-user-drag: none;
    }
  }

  .slide {
    position: relative;
    width: 1%;
    min-width: 1%;
    max-width: 1%;
  }

  .prev-clone,
  .next-clone {
    position: absolute;
    display: flex;
    width: 100%;
  }

  .prev-clone {
    position: absolute;
    right: 100%;
    justify-content: flex-end;
  }
}

.rotation {
  margin: var(--section-margin) auto;
}

.rotation .slider {
  position: relative;
  display: block;
  border-bottom: var(--border-width) solid var(--theme-color-secondary);
  background-color: var(--theme-color-primary);

  @media(max-width: 567px) {
    margin: var(--section-margin) calc(var(--container-padding) * -1);
  }

  .slide {
    &:not(.current) {
      height: 0;
    }

    &.text-only .outer {
      @media(max-width: 999px) {
        .text-box {
          min-height: calc(40vw + 100px);
        }
      }
      @media(min-width: 1000px) {
        &:after {
          content: "";
          position: relative;
          display: block;
          padding-top: calc(44.4444% - 13.3333px);
        }
      }
    }
  }

  .outer {
    margin: 0 -20px;
    display: flex;

    @media(max-width: 999px) {
      flex-direction: column;
      margin: 0;
      overflow: hidden;
    }

    &.download .text-box .btn:before {
      @include icon-small-download;
    }
    &.intranet .text-box .btn:before{
      @include icon-small-schloss;
    }
    &.extranet .text-box .btn:before{
      @include icon-small-stern;
    }
    &.extern .text-box .btn:before{
      @include icon-small-link-external;
    }
  }

  .image-box {
    position: relative;
    order: 1;
    flex: 1 1 100%;

    &:before {
      content: "";;
      position: relative;
      display: block;
      padding-top: 66.66667%;
    }

    > img, .gallery {
      position: absolute;
      left: 0;
      top: 0;
      height: 100%;
      width: 100%;
      object-fit: cover;
    }

    @media(min-width: 1000px) {
      padding-right: 20px;
      flex: 1 1 66.66667%;
      max-width: 66.66667%;

      > img, .gallery {
        width: calc(100% - 20px);
        left: 1px;
      }
    }
  }

  .text-box {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 1 33.33333%;
    max-width: 33.3333%;
    min-width: 400px;
    color: var(--theme-color-background);
    z-index: 2;
    padding: 40px 20px 40px 80px;
    font-size: var(--font-size-small);

    @media(max-width: 1339px) {
      min-width: 360px;
      padding: 30px 10px 30px 60px;
    }

    @media(max-width: 1199px) and (min-width: 1000px) {
      min-height: 500px;
      font-size: 16px;
    }

    @media(max-width: 999px) {
      padding: 40px 40px 10px;
      min-width: 0;
      max-width: none;
    }

    @media(max-width: 567px) {
      padding: 28px var(--container-padding) 10px;
    }

    &:first-child {
      padding: 100px 80px;
      position: static;
      background-color: transparent;
      max-width: none;

      @media(max-width: 999px) {
        //justify-content: flex-start;
        padding: 40px;
      }
      @media(max-width: 567px) {
        padding: 28px 20px 100px;
      }

      &:after {
        content: "";
        background: linear-gradient(130deg, var(--theme-color-gradient-01) 10%, var(--theme-color-gradient-02) 80%, var(--theme-color-gradient-03) 100%);
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 800px;
      }

      > * {
        max-width: 800px;
        z-index: 1;
      }
    }

    &:not(:first-child):before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: var(--theme-color-primary);
      z-index: -1;

      @media(min-width: 1000px) {
        top: 0;
        margin: -15% -14% -15% 20px;
        border-top-right-radius: 28% 50%;
        border-bottom-right-radius: 28% 50%;
      }
      @media(max-width: 999px) {
        padding-top: 70%;
        margin-right: 0;
        margin: 0 -15% -8%;
        border-bottom-left-radius: 50% 28%;
        border-bottom-right-radius: 50% 28%;
      }
    }
  }

  .context-box {
    position: absolute;
    right: 0;
    top: 40px;
    z-index: 100;
    min-width: 100px;
    min-height: 47px;
    padding: 8px 10px 10px 10px;
    @include h4();
    margin: 0;
    text-align: right;
    color: var(--theme-color-white);
    background: linear-gradient(90deg, var(--theme-color-gradient-01) 25%,var(--theme-color-gradient-02) 57%,var(--theme-color-gradient-03) 112%);
    @media(max-width: 999px) {
      min-height: auto;
    }
    &--image {
      padding: 4px 10px;
      display: flex;
      img {
        height: 39px;
      }
    }
  }
  .image-box {
    .context-box {
      right: 20px;
      @media(max-width: 999px) {
        top: 110px;
        right: 0;
      }
      @media(max-width: 567px) {
        top: 60px;
      }
      @media(max-width: 319px) {
        top: 40px;
      }
    }
  }
  .text-box {
    &.context {
      @media(max-width: 767px) {
        padding-top: 100px;
      }
    }
  }

  .slider-tabs {
    position: absolute;
    display: flex;
    right: 0;
    bottom: 0;
    list-style: none;
    padding: 0;
    margin: 20px;

    .btn {
      --button-hover-shadow-opacity: 0.4;
      margin: 5px;

      @media(max-width: 767px) {
        margin: 4px;
      }
    }

    .active .btn {
      --button-bg-color: var(--theme-color-background);
      --button-text-color: var(--theme-color-primary);

      &:hover::after {
        box-shadow: none;
      }
    }
  }

  h2, .like-h2 {
    margin-top: 0.3em;
    margin-bottom: 0.4em;
  }

  .btn {
    margin-top: 0.8em;
  }

  .prev, .next, .count {
    display: none;
  }
}