/* ========================================
   独自スライダー専用CSS
   プレフィックス: .c-custom-slider
   ======================================== */

/* ベーススタイル（SWELLの影響を受けないようリセット） */
.c-custom-slider,
.c-custom-slider *,
.c-custom-slider *::before,
.c-custom-slider *::after {
  box-sizing: border-box;
}

/* コンテナ */
.c-custom-slider {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #ffffff;
  padding: 20px 60px;
  display: grid;
  grid-template-rows: auto auto;
  row-gap: 1rem;
  align-items: center;
  /* SWELL側のスタイルをリセット */
  font-family: inherit;
  line-height: inherit;
}

@media (max-width: 600px) {
	.c-custom-slider {
		row-gap: 0.5rem;
	}
}

/* 初期描画が完了するまで下段を見せない（チラつき防止） */
.c-custom-slider:not(.is-ready) .c-custom-slider__thumbs {
  visibility: hidden;
}

/* 上段メイン：10:3 比率ボックス */
.c-custom-slider__main {
  width: 100%;
}

.c-custom-slider__main-link {
  display: block;
  text-decoration: none; /* SWELL側のリンクスタイルをリセット */
}

.c-custom-slider__main-ratio {
  position: relative;
  width: 100%;
  padding-top: 30%; /* 10:3 */
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

.c-custom-slider__main-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* メインバナー：ホバー時に透明度を下げる */
.c-custom-slider__main-link {
  transition: opacity 0.2s ease;
}
.c-custom-slider__main-link:hover,
.c-custom-slider__main-link:focus-visible {
  opacity: 0.6;
}

/* 下段サムネイル */
.c-custom-slider__thumbs {
  width: 100%;
}

.c-custom-slider__thumbs-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.c-custom-slider__thumbs-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  column-gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0 !important;
}

.c-custom-slider__thumb {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background-color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.c-custom-slider__thumb-ratio {
  position: relative;
  width: 100%;
  padding-top: 30%; /* 10:3 */
}

.c-custom-slider__thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c-custom-slider__thumb:hover,
.c-custom-slider__thumb:focus-visible {
  /* ホバー時に影を出さない */
  box-shadow: none;
  /* ホバー時の透明度（任意で調整） */
  opacity: 0.6;
  /* 上下移動も不要なら、次の行も削除してください */
  transform: translateY(-2px);
}

/* 矢印ナビゲーション（Font Awesome） */
.c-custom-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #003b83;
  font-size: 2.2rem;
  padding: 0;
  cursor: pointer;
  z-index: 20;
  transition: opacity 0.2s ease;
  /* SWELL側のボタンスタイルをリセット */
  font-family: inherit;
  font-weight: normal;
  line-height: 1;
}
.c-custom-slider__nav::before {
  /* Font Awesome の読み込みが前提 */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  display: inline-block;
  line-height: 1;
}
.c-custom-slider__nav--prev::before {
  content: "\f137";
}
.c-custom-slider__nav--next::before {
  content: "\f138";
}

.c-custom-slider__nav:hover {
  opacity: 0.7;
}

.c-custom-slider__nav--prev {
  left: 16px;
}

.c-custom-slider__nav--next {
  right: 16px;
}

.c-custom-slider__nav:focus-visible {
  outline: 3px solid #003b83;
  outline-offset: 2px;
}

/* レスポンシブ */
@media (max-width: 960px) {
  .c-custom-slider {
    padding: 16px 40px;
  }
}

@media (max-width: 768px) {
  .c-custom-slider {
    padding: 16px 16px;
  }
  .c-custom-slider__thumbs-list {
    column-gap: 8px;
    grid-auto-columns: calc(50% - 4px); /* 2枚表示 */
  }
  .c-custom-slider__nav {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  .c-custom-slider {
    margin: 20px auto;
    padding: 12px 12px;
  }
  .c-custom-slider__nav {
    font-size: 1rem;
	top: 30%;
  }
}

/* メイン画像のアニメーション */
.c-custom-slider__main-image.slide-out-left {
  animation: customSliderSlideOutLeft 0.4s ease forwards;
}

.c-custom-slider__main-image.slide-in-right {
  animation: customSliderSlideInRight 0.4s ease forwards;
}

.c-custom-slider__main-image.slide-out-right {
  animation: customSliderSlideOutRight 0.4s ease forwards;
}

.c-custom-slider__main-image.slide-in-left {
  animation: customSliderSlideInLeft 0.4s ease forwards;
}

/* 下部サムネイルリストのアニメーション */
.c-custom-slider__thumbs-list.slide-out-left {
  animation: customSliderThumbsOutLeft 0.4s ease forwards;
}

.c-custom-slider__thumbs-list.slide-in-right {
  animation: customSliderThumbsInRight 0.4s ease forwards;
}

.c-custom-slider__thumbs-list.slide-out-right {
  animation: customSliderThumbsOutRight 0.4s ease forwards;
}

.c-custom-slider__thumbs-list.slide-in-left {
  animation: customSliderThumbsInLeft 0.4s ease forwards;
}

/* keyframes（メイン）- 名前空間を付けて衝突回避 */
@keyframes customSliderSlideOutLeft {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-20%);
  }
}

@keyframes customSliderSlideInRight {
  0% {
    opacity: 0;
    transform: translateX(20%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes customSliderSlideOutRight {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(20%);
  }
}

@keyframes customSliderSlideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-20%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* keyframes（下部サムネイル） */
@keyframes customSliderThumbsOutLeft {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-10%);
  }
}

@keyframes customSliderThumbsInRight {
  0% {
    opacity: 0;
    transform: translateX(10%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes customSliderThumbsOutRight {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(10%);
  }
}

@keyframes customSliderThumbsInLeft {
  0% {
    opacity: 0;
    transform: translateX(-10%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}