/* slider */
@keyframes infinity-scroll-left {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes infinity-scroll-right {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

.scroll-infinity {
  margin-top: 3rem;
}

.scroll-infinity__wrap {
  display: flex;
  overflow: hidden;
}

.scroll-infinity__list {
  /* 複製したリスト同士を横につなげて流す */
  display: flex;
  flex-shrink: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.scroll-infinity__list img {
  display: block;
  object-fit: contain;
}

.scroll-infinity__list--left {
  animation: infinity-scroll-left 80s linear 0.5s infinite both;
}

.scroll-infinity__list--right {
  animation: infinity-scroll-right 80s linear 0.5s infinite both;
}

.top-carousel .scroll-infinity__list img {
  /* 画面幅に応じて枚数感を保ちつつ大きくなりすぎないよう制御 */
  flex: 0 0 clamp(18rem, 32vw, 26rem);
  width: clamp(18rem, 32vw, 26rem);
  margin-inline: 0.5rem;
}

/* hero */
.hero-slides {
  position: relative;
  height: 100vh;
}

.js-crossFade {
  /* 画像を重ねるための土台 */
  position: relative;
  height: 100vh;
}

.js-crossFade img {
  /* 全画像を同じ位置に重ねて active だけ見せる */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 3s ease-in-out;
}

.js-crossFade img.active {
  opacity: 1;
}

.hero-slides__dots {
  /* JSで生成したインジケーターをヒーロー下部中央に重ねる */
  position: absolute;
  right: 0;
  bottom: 1.5rem;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.hero-slides__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transition: background-color 0.35s ease;
}

.hero-slides__dot.is-active {
  background: #fff;
}
