/**
 * @file
 * Carousel
 *
 * Contains styles for carousel object.
 */

 @use '_helper' as *;

.carousel {
  &__wrapper {
    &.js-transition {
      .carousel__caption {
        opacity: 0;
      }
    }
  }

  &__item {
    background-color: $color-blue-light;
    border-radius: 15px;
  }

  &__img {
    padding-top: 60.7%;
    position: relative;

    @media screen and (min-width: $break-medium) {
      padding-top: 60.2%;
    }

    @media screen and (min-width: $break-large) {
      padding-top: 60.1%;
    }
    
    img {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      object-fit: cover;
      border-top-left-radius: 15px;
      border-top-right-radius: 15px;
    }
  }

  &__caption {
    padding: 31px 27px 81px;
    background-color: $color-blue-light;
    position: relative;
    font-family: $font-dm-sans;
    font-size: rem(18px);
    line-height: 1.5;
    font-weight: 400;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;

    @media screen and (min-width: $break-medium) {
      @include body;
      padding: 30px 190px 30px 30px;
    }

    @media screen and (min-width: $break-large) {
      padding: 51px 290px 53px 55px;
    }
  }

  &__navigation {
    margin-top: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    @media screen and (min-width: $break-medium) {
      margin-top: 20px;
      gap: 11px;
    }

    @media screen and (min-width: $break-large) {
      margin-top: 30px;
    }

    li {
      margin: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;

      &::before {
        content: none;
      }
    }
  }

  &__dot {
    padding: 0;
    width: 14px;
    height: 14px;
    background-color: $color-white;
    border: solid 1px $color-blue-dark;
    border-radius: 100%;
    box-sizing: border-box;
    transition: 0.1s border-width;  
    
    @media screen and (min-width: $break-medium) {
      width: 15px;
      height: 15px;
      border-width: 1.5px;
    }

    @media screen and (min-width: $break-large) {
      width: 18px;
      height: 18px;
    }
    
    &.js-selected {
      border-width: 7px;

      @media screen and (min-width: $break-medium) {
        border-width: 7.5px;
      }

      @media screen and (min-width: $break-large) {
        border-width: 9px;
      }
    }
  }

  .slick-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    top: unset;
    bottom: 31px;
    transform: unset;
    background-color: $color-gold;
    border-radius: 100%;
    transition: 0.1s background-color;

    @media screen and (min-width: $break-medium) {
      width: 40px;
      height: 40px;
      top: 50%;
      bottom: unset;
      transform: translateY(-50%);
    }

    @media screen and (min-width: $break-large) {
      width: 54px;
      height: 54px;
      top: calc(50% - 1px);
    }

    &:hover {
      background-color: $color-blue-dark;

      .slick-arrow__icon {
        &::before,
        &::after {
          border-color: $color-white;
        }
      }
    }

    &.slick-prev {
      @media screen and (min-width: $break-medium) {
        right: 87px;
      }

      @media screen and (min-width: $break-large) {
        right: 126px;
      }

      .slick-arrow__icon {
        transform: rotate(180deg);
      }
    }

    &.slick-next {
      right: 26px;

      @media screen and (min-width: $break-medium) {
        right: 30px;
      }

      @media screen and (min-width: $break-large) {
        right: 55px;
      }
    }

    &::after {
      content: none;
    }

    &__icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      position: relative;

      &::before,
      &::after {
        content: '';
        position: absolute;
        transition: 0.1s border-color;
      }

      &::before {
        width: 14px;
        margin-left: -1px;
        border-top: solid 2.5px $color-black;

        @media screen and (min-width: $break-medium) {
          width: 17px;
        }

        @media screen and (min-width: $break-large) {
          width: 22px;
          border-top-width: 3px;
        }
      }

      &::after {
        width: 8px;
        height: 8px;
        border-top: solid 2.5px $color-black;
        border-right: solid 2.5px $color-black;
        transform: rotate(45deg);

        @media screen and (min-width: $break-medium) {
          width: 10px;
          height: 10px;
        }

        @media screen and (min-width: $break-large) {
          width: 14px;
          height: 14px;
          border-top-width: 3px;
          border-right-width: 3px;
        }
      }
    }
  }
}
