/*
 * hashtag-rail.css - ハッシュタグ横並びレール
 * Why: Figmaノード(186:610)の5カード横並びレイアウトを追加する。
 */

.section-hashtag-rail {
  position: relative;
  isolation: isolate;
  background: #fff;
  overflow: hidden;
  min-height: 1100px;
  padding: 0;
}

.section-hashtag-rail__heading {
  position: absolute;
  top: 32px;
  left: 32px;
  display: flex;
  align-items: baseline;
  gap: 0.08em;
  margin: 0;
  font-family: var(--font-ja);
  font-size: 56px;
  font-weight: 800;
  color: #333;
  z-index: 2;
  pointer-events: none;
}

.section-hashtag-rail__heading-main {
  color: #333;
}

.section-hashtag-rail__heading-outline {
  color: #fff;
  -webkit-text-fill-color: #fff;
  -webkit-text-stroke: 1.4px #111;
  text-shadow: none;
  paint-order: stroke fill;
  -webkit-font-smoothing: antialiased;
}

@supports (-webkit-text-stroke: 1px #333) {
  .section-hashtag-rail__heading-outline {
    color: #fff;
    -webkit-text-fill-color: #fff;
    -webkit-text-stroke: 1.4px #111;
    text-shadow: none;
  }
}

.section-hashtag-rail::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 2000px;
  height: 1100px;
  background: url("../../img/top/hash/background_rail.png") no-repeat center
    center / cover;
  pointer-events: none;
}

.section-hashtag-rail > * {
  position: relative;
  z-index: 1;
}

.section-hashtag-rail__viewport {
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.section-hashtag-rail__viewport::-webkit-scrollbar {
  display: none;
}

.section-hashtag-rail__track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: max-content;
  margin-left: 10px;
  padding: 0px 73px 110px 0;
  will-change: transform;
}

.section-hashtag-rail__card {
  flex: 0 0 306px;
}

/* Figma 186:610 : 左端ほど低く・右端ほど高い線形stagger */
.section-hashtag-rail__card:nth-child(1) {
  margin-top: 224px;
}

.section-hashtag-rail__card:nth-child(2) {
  margin-top: 168px;
}

.section-hashtag-rail__card:nth-child(3) {
  margin-top: 112px;
}

.section-hashtag-rail__card:nth-child(4) {
  margin-top: 56px;
}

.section-hashtag-rail__card:nth-child(5) {
  margin-top: 0;
}

.section-hashtag-rail__card:nth-child(6) {
  margin-top: -56px;
}

.section-hashtag-rail__card:nth-child(7) {
  margin-top: -112px;
}

.section-hashtag-rail__card:nth-child(8) {
  margin-top: -168px;
}

.section-hashtag-rail__link {
  display: block;
  position: relative;
  color: var(--color-white);
}

.section-hashtag-rail__media {
  position: relative;
  width: 276px;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.72);
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.92);
}

.section-hashtag-rail__media img {
  width: 100%;
  aspect-ratio: 276 / 368;
  object-fit: cover;
}

.section-hashtag-rail__cta {
  position: absolute;
  right: -6px;
  top: 58%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  z-index: 1;
  pointer-events: none;
}

.section-hashtag-rail__title {
  max-width: 261px;
  margin-top: 28px;
  margin-left: 6px;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.5;
  min-height: 4.5em;
  letter-spacing: 0;
}

.section-hashtag-rail__date {
  margin-top: 22px;
  margin-left: 15px;
  font-family: var(--font-en-heading);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
}

.section-hashtag-rail__controls {
  position: absolute;
  right: 4.8vw;
  bottom: 300px;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.section-hashtag-rail__nav {
  width: 96px;
  height: 96px;
  border: 0;
  border-radius: 50%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  transition:
    transform var(--transition-base),
    opacity var(--transition-base);
  text-indent: -9999px;
  overflow: hidden;
  z-index: 1;
}

.section-hashtag-rail__nav--prev {
  background-image: url("../../img/top/hash/circle_prev.png");
}

.section-hashtag-rail__nav--next {
  background-image: url("../../img/top/hash/circle_next.png");
}

.section-hashtag-rail__nav:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.section-hashtag-rail__nav[disabled] {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.section-hashtag-rail__nav-label {
  display: none;
}

.section-hashtag-rail__nav-arrow {
  display: none;
}

.section-hashtag-rail__view-all {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--transition-base),
    opacity var(--transition-base);
}

.section-hashtag-rail__view-all img {
  width: 96px; /* nav ボタン（96px）とサイズを統一 */
  height: auto;
  display: block;
}

.section-hashtag-rail__view-all:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

@media (max-width: 1024px) {
  .section-hashtag-rail {
    /* min-height: 0; */
    padding: 72px 0 68px;
  }

  .section-hashtag-rail__track {
    gap: 14px;
    margin-left: 8px;
    padding: 0 40px 0 0;
  }

  .section-hashtag-rail__card {
    flex-basis: 250px;
  }

  .section-hashtag-rail__card:nth-child(1) {
    margin-top: 112px;
  }

  .section-hashtag-rail__card:nth-child(2) {
    margin-top: 84px;
  }

  .section-hashtag-rail__card:nth-child(3) {
    margin-top: 56px;
  }

  .section-hashtag-rail__card:nth-child(4) {
    margin-top: 28px;
  }

  .section-hashtag-rail__card:nth-child(6) {
    margin-top: -28px;
  }

  .section-hashtag-rail__card:nth-child(7) {
    margin-top: -56px;
  }

  .section-hashtag-rail__card:nth-child(8) {
    margin-top: -84px;
  }

  .section-hashtag-rail__media {
    width: 228px;
    border-radius: 24px;
  }

  .section-hashtag-rail__cta {
    right: 0px;
    width: 54px;
    height: 54px;
    font-size: 1.4rem;
  }

  .section-hashtag-rail__title {
    max-width: 228px;
    margin-top: 22px;
    font-size: 16px;
    min-height: 4.5em;
  }

  .section-hashtag-rail__date {
    margin-top: 18px;
  }

  /* .section-hashtag-rail__controls {
    right: 5vw;
    bottom: 18px;
  } */

  .section-hashtag-rail__nav {
    width: 82px;
    height: 82px;
  }

  .section-hashtag-rail__view-all img {
    width: 82px; /* 1024px breakpoint の nav と統一 */
  }
}

@media (max-width: 767px) {
  .section-hashtag-rail {
    padding: 40px 0 0px;
    min-height: 900px;
    overflow-x: hidden; /* 横方向のみクリップ */
    overflow-y: visible; /* SP controls が切れないよう縦方向は見せる */
    padding-bottom: 100px; /* controls 分の下余白を確保 */
  }

  .section-hashtag-rail::before {
    width: 1440px;
    height: 900px;
  }

  .section-hashtag-rail__heading {
    top: 16px;
    left: 0;
    right: 0;
    justify-content: center;
    text-align: center;
    font-size: 32px;
  }

  .section-hashtag-rail__viewport {
    width: 100%;
    overflow: hidden;
  }

  .section-hashtag-rail__track {
    display: flex;
    width: max-content;
    gap: 16px;
    margin-left: 0;
    padding: 60px 5vw 10px;
    will-change: transform;
    transition: transform 400ms ease;
  }

  /* .section-hashtag-rail__card {
    flex: 0 0 75vw;
  } */

  .section-hashtag-rail__media {
    width: 100%;
    border-radius: 24px;
  }

  .section-hashtag-rail__cta {
    right: -15px;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .section-hashtag-rail__title {
    max-width: 100%;
    min-height: 0;
    font-size: 15px;
    line-height: 1.45;
    margin-top: 14px;
  }

  .section-hashtag-rail__date {
    margin-top: 10px;
    margin-left: 4px;
    font-size: 11px;
  }

  .section-hashtag-rail__controls {
    position: static;
    justify-content: center;
    width: 100%;
    max-width: 252px;
    margin: 24px auto 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    z-index: 30;
  }

  .section-hashtag-rail__nav {
    width: 68px;
    height: 68px;
    background-size: 100% 100%;
  }

  .section-hashtag-rail__view-all img {
    width: 96px; /* SP は 96px 深さ */
  }
}

/* staggerをSPで無効化 */
@media (max-width: 767px) {
  .section-hashtag-rail__card:nth-child(1),
  .section-hashtag-rail__card:nth-child(2),
  .section-hashtag-rail__card:nth-child(3),
  .section-hashtag-rail__card:nth-child(4),
  .section-hashtag-rail__card:nth-child(5),
  .section-hashtag-rail__card:nth-child(6),
  .section-hashtag-rail__card:nth-child(7),
  .section-hashtag-rail__card:nth-child(8) {
    margin-top: 0;
  }
}
