index.scss

@import '../../../assets/scss/mixins.scss';

$ps: 24; // padding: 12px

.slider-cards {
  margin: 12px 0 24px;
  a {
    text-decoration: none;
  }

  .slider-items {
    display: flex;
    width: max-content;
  }
  .slider-card {
    box-sizing: content-box;
    padding: #{$ps / 2}px;
    .title {
      font-family: var(--subtitle-font), serif;
      position: relative;
      color: var(--h3-color);
      overflow: hidden;
      font-weight: 400;
      @include desktop() {
        font-size: var(--h3-md);
        line-height: 1.8rem;
        height: 3.6rem;
      }
      @include tablet() {
        font-size: var(--h3-sm);
        line-height: 1.6rem;
        height: 3.2rem;
      }
      @include mobile() {
        font-size: var(--h3-xs);
        line-height: 1.4rem;
        height: 2.8rem;
      }
    }
  }
  .slider-image {
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--white-secondory);
  }
  .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: #{$ps / 2}px;
  }
  .slider-header-title {
    margin: 0;
    color: var(--h2-color);
    font-family: var(--title-font), sans-serif;
    font-weight: 600;
    @include desktop() {
      font-size: var(--h2-md);
    }
    @include tablet() {
      font-size: var(--h2-sm);
    }
    @include mobile() {
      font-size: var(--h2-xs);
    }
  }
  .slider-indicators li {
    background: var(--bg-indicator);
    &.active {
      background: var(--bg-indicator-active);
    }
  }

  @include pointer() {
    .slider-body {
      position: relative;
      overflow: hidden;
    }
    .slider-indicators {
      display: flex;
      list-style: none;
      margin: 0;
    }
    .slider-indicators li {
      box-sizing: content-box;
      -ms-flex: 0 1 auto;
      flex: 0 1 auto;
      width: 20px;
      height: 3px;
      margin-right: 3px;
      margin-left: 3px;
      text-indent: -999px;
      cursor: pointer;
      background-clip: padding-box;
    }

    .slider-body:hover .slider-control {
      opacity: 1;
      transition: opacity 0.3s linear 0.15s;
    }
    .slider-control {
      opacity: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .slider-control-prev,
    .slider-control-next {
      position: absolute;
      top: 0;
      bottom: 0;
      z-index: 1;
    }
    .slider-control-next {
      right: 0;
    }
    .icon {
      width: 50px;
      height: 50px;
      margin: 0.5em;
      background: var(--bg-hover-button);
      stroke: var(--color-hover-button);
      opacity: 0.5;
      padding: 8px;
      border-radius: 50px;
      box-sizing: border-box;
      cursor: pointer;
      margin-bottom: 36px;
    }
    .icon.prev-chevron {
      transform: rotate(180deg);
    }
  }
}

@include touch() {
  .slider-cards {
    margin: 4px 0;

    .slider-body {
      overflow: hidden;
      overflow-x: scroll;
      overflow-y: hidden;
    }
    .slider-body::-webkit-scrollbar {
      display: none; /* Hide scrollbar for Chrome, Safari and Opera */
    }
    .slider-body {
      -ms-overflow-style: none; /* IE and Edge */
      scrollbar-width: none; /* Firefox */
    }
    .slider-control {
      display: none;
    }
    .slider-indicators {
      display: none;
    }
    .slider-card {
      margin-bottom: 4px;
    }
    @media (max-width: 576px) {
      .slider-items {
        padding-left: 6px;
        .slider-card {
          padding: 6px;
        }
      }
    }
  }
}