/**
 * トップページスライダーのスタイル
 * 高さの設定を明確に定義し、レスポンシブ対応を最適化
 */

/* スライドショー基本構造 */
.slideshow {
  width: 100%;
  height: var(--size-700); /* PCサイズでは700pxに固定 */
  position: relative;
  overflow: hidden;
}

/* Swiper関連要素の高さ管理 */
.slideshow .swiper,
.slideshow .swiper-wrapper,
.slideshow .swiper-slide {
  width: 100%;
  height: 100%; /* 親要素の高さを継承 */
}

/* スライド画像 */
.slideshow__item {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* スライド下部のグラデーション - トップスライダー専用 */
.slideshow .swiper-slide::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 33.33%; /* 下から3分の1 */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  z-index: 5;
  pointer-events: none; /* クリックイベントを通過させる */
}

/* テキスト関連要素 - PC/タブレット向け初期設定 */
/* メインヘッドライン */
.slideshow__headline {
  position: absolute;
  bottom: calc(var(--size-48) + var(--size-62));
  left: var(--size-170);
  color: var(--color-white);
  font-size: var(--size-62);
  font-family: "游明朝", "Yu Mincho", YuMincho, "Hiragino Mincho Pro", serif;
  z-index: 10;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* スライドラベル */
.slideshow__label {
  position: absolute;
  bottom: var(--size-48);
  left: var(--size-170);
  color: var(--color-white);
  font-size: var(--size-24);
  font-weight: var(--font-weight-bold);
  z-index: 10;
  border-radius: var(--size-4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* インジケーター関連 */
.slideshow-indicator-container {
  position: absolute;
  bottom: var(--size-48);
  right: var(--size-170);
  z-index: 10;
}

/* スライドインジケーター */
.slideshow-indicator {
  display: flex;
  align-items: center;
  gap: var(--size-10);
  color: var(--color-white);
  padding: var(--size-1) var(--size-4);
  border-radius: var(--size-4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slideshow-indicator__current {
  font-size: var(--size-14);
  color: var(--color-white);
}

.slideshow-indicator__all {
  font-size: var(--size-14);
  color: var(--color-white);
}

/* プログレスバー */
.slideshow-indicator__bar-container {
  width: var(--size-32);
  height: var(--size-2);
  border-radius: var(--size-1);
  overflow: hidden;
}

.slideshow-indicator__bar {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  position: relative;
  --progress: -100%;
  --transition: none;
}

.slideshow-indicator__bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-white);
  transform: translateX(var(--progress));
  transition: transform var(--transition);
}

/* レスポンシブ対応 */
/* タブレット対応 (1024px以下) */
@media screen and (max-width: 1024px) {
  /* テキスト要素の位置調整 */
  .slideshow__headline {
    bottom: calc(var(--size-48) + var(--size-36));
    left: var(--size-48);
    font-size: var(--size-48);
  }

  .slideshow__label {
    bottom: var(--size-48);
    left: var(--size-48);
    font-size: var(--size-18);
  }

  .slideshow-indicator-container {
    right: var(--size-24);
  }
}

/* スマホ対応 (768px以下) */
@media screen and (max-width: 768px) {
  /* 基本構造 - 固定高さに変更 */
  .slideshow {
    height: 480px;
  }

  /* Swiper要素の高さもすべて明示的に固定 */
  .slideshow .swiper,
  .slideshow .swiper-wrapper,
  .slideshow .swiper-slide {
    height: 480px !important; /* 重要: 動的な高さ計算を上書き */
  }

  /* テキスト要素の位置とサイズ調整 */
  .slideshow__headline {
    bottom: var(--size-80);
    left: var(--size-24);
    font-size: var(--size-36);
    width: 85%;
  }

  .slideshow__label {
    bottom: var(--size-32);
    left: var(--size-24);
    font-size: var(--size-14);
  }

  /* インジケーター調整 */
  .slideshow-indicator-container {
    right: var(--size-16);
    bottom: var(--size-32);
  }

  .slideshow-indicator {
    padding: var(--size-4) var(--size-8);
    gap: var(--size-8);
  }

  .slideshow-indicator__current,
  .slideshow-indicator__all {
    font-size: var(--size-12);
  }

  .slideshow-indicator__bar-container {
    width: var(--size-24);
    height: var(--size-2);
  }
}
