.stories-slider {
  position: relative;
  margin: 100px 0;

  @include sm {
    margin: 60px 0;
  }

  &__wrap {
    max-width: $max-width;
    padding: 0 $gutter;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
  }

  &__header {
    width: calc(100% / 12 * 6);
    margin: 0 auto;
    text-align: center;

    @include sm {
      width: 100%;
    }

    h2 {
      color: $primary-color;
      margin: 0 0 2rem;

      @include sm {
        font-size: 2.7rem;
        line-height: 3.3rem;
        margin: 0 0 1.5rem;
      }
    }

    p {
      font-size: 2.1rem;
      color: $primary-color;

      @include sm {
        font-size: 1.8rem;
      }
    }

    a {
      font-weight: 700;
      text-decoration: underline;
    }
  }

  &__slider {
    margin: 50px auto 0;
    width: calc(100% / 12 * 4 + 40px);
    overflow: visible;

    @include sm {
      margin: 40px auto 0;
      width: calc(100% - 14px);
    }
  }

  &__slider-img {
    position: relative;
    padding-top: 120%;
    height: 0;
    background-color: $white;

    img {
      position: absolute;
      top: 0;
      left: 0;
      width: 101%;
      height: 101%;
      object-fit: cover;
    }
  }

  .swiper-slide {
    pointer-events: none;
    width: 100%;

    &.swiper-slide-active {
      pointer-events: all;
    }

    img {
      opacity: 0.2;
      transition: opacity 0.3s linear;
    }
  }

  .swiper-slide-prev img,
  .swiper-slide-next img {
    opacity: 0.6;
  }

  .swiper-slide.swiper-slide-active img {
    opacity: 1;
  }

  .swiper-slide-prev img,
  .swiper-slide-next img {
    opacity: 0.6;
  }

  &__slide-legend {
    margin-top: -10%;

    @include sm {
      margin-top: 0;
    }

    a {
      position: relative;
      display: block;
      background-color: $secondary-color;
      color: #fff;
      width: 75%;
      margin: 0 auto;
      text-align: center;
      padding: 18px 15px 20px;
      pointer-events: none;
      opacity: 0;
      transform: translateY(66px);
      transition: opacity 0.3s linear, transform 0.3s ease-out;

      @include sm {
        font-size: 1.4rem;
        line-height: 1.7rem;
        width: 100%;
      }

      div {
        pointer-events: none;
      }

      .swiper-slide-active & {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
        transition-delay: 0.3s;
      }

      .open-detail__title {
        font-size: 2.1rem;
        font-weight: 700;
        line-height: 2.7rem;
        margin-bottom: 2px;

        @include sm {
          font-size: 1.8rem;
          line-height: 2.7rem;
        }
      }
    }
  }

  &__nav-next,
  &__nav-prev {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 250ms ease-out;
    position: absolute;
    top: calc(50% - 75px);
    left: 10px;
    z-index: 2;
    background: #fff;
    cursor: pointer;

    &::after {
      content: ' ';
      height: 17px;
      width: 17px;
      border-top: 2px solid #fff;
      border-right: 2px solid #fff;
      border-color: $primary-color;
      display: block;
      transform: rotate(-135deg);
      margin-left: 6px;
      transition: border-color 250ms ease-out;
    }

    @include sm {
      width: 40px;
      height: 40px;
      top: calc(50% - 88px);

      &::after {
        height: 12px;
        width: 12px;
      }
    }
  }

  &__nav-next {
    left: auto;
    right: 10px;

    &:after {
      transform: rotate(45deg);
      margin-left: -6px;
    }
  }

  &__modal-box {
    position: relative;
    max-width: 910px;
    background-color: $white;
    margin: 60px auto;
    transform: translateY(-100%);
    transition: transform 0.4s ease-out;
    min-height: 100vh;

    @include sm {
      margin: 0 auto;
    }

    .js-show & {
      transform: translateY(0);
    }
  }

  &__modal-img {
    max-width: 440px;
    margin: auto;

    & > div {
      position: relative;
      padding-top: 100%;
    }

    img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }
  }

  &__modal-story {
    opacity: 0;
    display: none;
    transition: all 250ms ease-out;
    padding-top: 100px;

    @include sm {
      padding-top: 50px;
    }

    &.js-active {
      opacity: 1;
    }
  }

  &__modal-header {
    padding: 30px $gutter;
    text-align: center;

    @include sm {
      padding: 24px $gutter-mobile 40px;
    }

    h2 {
      font-size: 2.6rem;
      line-height: 3rem;
      font-weight: 700;
      margin: 0 0 4px;
      color: $primary-color;

      @include sm {
        font-size: 2.1rem;
      }
    }

    p {
      margin: 0;
      font-size: 1.8rem;
      color: $primary-color;

      @include sm {
        font-size: 1.4rem;
      }
    }
  }

  &__story-items {
    max-width: 560px;
    margin: auto;
    padding: 0 $gutter;

    @include sm {
      padding: 0 $gutter-mobile;
    }
  }

  &__story-item {
    display: flex;
    padding: 23px 0 5px;
    border-top: 1px solid $gray-bluish;
    color: $primary-color;
    font-size: 1.8rem;
    line-height: 2.7rem;

    @include sm {
      font-size: 1.6rem;
      line-height: 2.3rem;
    }

    h4 {
      margin: 0;
      font-size: 2.1rem;
      line-height: 2.7rem;
      color: $primary-color;

      @include sm {
        font-size: 1.8rem;
        line-height: 2.4rem;;
      }
    }

    p {
      margin: 1.6rem 0;

      @include sm {
        &:first-of-type {
          margin-top: 0.8rem;
        }
      }
    }
  }

  &__story-item-number {
    position: relative;
    width: 70px;
    background: url("../assets/img/svg/Q.svg") no-repeat 0 4px;
    background-size: 32px auto;
    font-size: 1.4rem;
    color: $secondary-color;
    font-weight: 700;
    flex-shrink: 0;

    @include sm {
      width: 48px;
      background-size: 25px auto;
    }

    span {
      position: absolute;
      top: 20px;
      left: 34px;

      @include sm {
        top: 13px;
        font-size: 1.2rem;
        left: 26px;
      }
    }
  }

  &__modal-control {
    text-align: center;
    padding: 15px 0 100px;
    transition: all 150ms ease-out;

    @include sm {
      padding: 15px 0 60px;
    }

    .js-changing & {
      pointer-events: none;
      opacity: 0;
      transform: translateY(40px);
    }

    button {
      width: 100%;
      max-width: 440px;

      @include sm {
        max-width: 256px;
      }
    }
  }

  &__modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
  }
}
