@charset "UTF-8";

/* 
  ==========================================================================
  動画ギャラリー（sections/hotel/movie-gallery.php）
    - スライダーは /assets/main.js（global-nav.php で読み込み）の Splide を使用
    （設定は movie-gallery.php の data-splide）
  - JS は common_movie-gallery.js
  ========================================================================== 
 */

.movie-gallery .splide__track {
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.movie-gallery .splide__list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  backface-visibility: hidden;
}

.movie-gallery .splide__slide {
  position: relative;
  flex-shrink: 0;
  margin: 0;
  list-style: none;
  box-sizing: border-box;
}

/* --- セクション --- */
.movie-gallery {
  --movie-gallery-width: min(720px, 56vw);
  --movie-gallery-text-color: #333;
  --movie-gallery-bg: #fff;
}

/* --- 見出し --- */
.movie-gallery__title {
  line-height: 1.5;
}

.movie-gallery__lead {
  margin: 32px 0 0;
  color: var(--movie-gallery-text-color);
  font-size: 1.3rem;
  line-height: 1.6;
  letter-spacing: 0.07em;
  text-align: center;
}

.movie-gallery__sp-br {
  display: none;
}

/* --- 矢印（動画が2本以上のときのみ出力） --- */
/* /assets/main.css（Splide の標準スタイル）が後から読み込まれるため、詳細度を上げて上書きする */
.movie-gallery__arrows {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: min(1120px, 84%);
  margin: 0 auto 24px;
}

.movie-gallery .movie-gallery__arrows .movie-gallery__arrow {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  z-index: auto;
  display: block;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #333;
  border-radius: 50%;
  background: none;
  opacity: 1;
  transform: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.movie-gallery .movie-gallery__arrows .movie-gallery__arrow:hover {
  opacity: 0.6;
}

/* 最初・最後のスライドでは押せない（Splide が disabled を付ける） */
.movie-gallery .movie-gallery__arrows .movie-gallery__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.movie-gallery__arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid #333;
  border-right: 1px solid #333;
}

.movie-gallery__arrow--prev::before {
  transform: translate(-30%, -50%) rotate(-135deg);
}

.movie-gallery__arrow--next::before {
  transform: translate(-70%, -50%) rotate(45deg);
}

/* --- スライド --- */
.movie-gallery:not(.splide) .movie-gallery__list {
  justify-content: center;
}

.movie-gallery__item {
  width: var(--movie-gallery-width);
}

/* ループ用の複製スライド（iframe の代わりにサムネイル画像が入る） */
.movie-gallery__item.splide__slide--clone .movie-gallery__player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* --- 動画タイトル・プレイヤー --- */
.movie-gallery__movie-title {
  margin: 16px 0 0;
  color: #000;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.1em;
}

.movie-gallery__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

/* 枠より上下左右に 2px ずつ広げて中央に置き、はみ出した分は枠の overflow: hidden で隠す
   - 枠の幅・高さが小数のとき（56vw など）、iframe は整数に丸めて描画されるため、端に枠の背景（黒）が見える
   - YouTube のプレイヤー側でも、端の 1px が暗く描画されることがある */
.movie-gallery__player > iframe {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  border: 0;
}

/* --- キャプション（5行目をぼかして折りたたむ） --- */
.movie-gallery__caption-wrap {
  margin-top: 12px;
}

.movie-gallery__caption {
  --caption-line-height: 20px;
  --caption-lines: 5;
  position: relative;
  max-height: calc(var(--caption-line-height) * var(--caption-lines));
  margin: 0;
  overflow: hidden;
  color: var(--movie-gallery-text-color);
  font-size: 1.3rem;
  line-height: var(--caption-line-height);
  letter-spacing: 0.07em;
  transition: max-height 0.5s ease;
}

/* 段落の間は1行分あける */
.movie-gallery__caption-paragraph {
  margin: 0;
}

.movie-gallery__caption-paragraph + .movie-gallery__caption-paragraph {
  margin-top: var(--caption-line-height);
}

/* 閉じているときは、5行目に上から下へのグラデーション透過をかける（FAV LUX 長崎と同じ） */
.movie-gallery__caption::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--caption-line-height);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--movie-gallery-bg) 90%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* 開いた状態 */
.movie-gallery__caption-wrap.is-open .movie-gallery__caption {
  max-height: 200em;
}

.movie-gallery__caption-wrap.is-open .movie-gallery__caption::after {
  opacity: 0;
}

/* 5行に収まる場合は折りたたまない（JS が is-short を付与） */
.movie-gallery__caption-wrap.is-short .movie-gallery__caption {
  max-height: none;
}

.movie-gallery__caption-wrap.is-short .movie-gallery__caption::after,
.movie-gallery__caption-wrap.is-short .movie-gallery__more {
  display: none;
}

/* --- もっと見る／閉じる --- */
.movie-gallery__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--movie-gallery-text-color);
  font-size: 1.2rem;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.movie-gallery__more:hover {
  opacity: 0.6;
}

.movie-gallery__more-icon {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.movie-gallery__more-icon::before,
.movie-gallery__more-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
}

.movie-gallery__more-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* 開いているときは「−」にする */
.movie-gallery__caption-wrap.is-open .movie-gallery__more-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* ラベルの切り替え */
.movie-gallery__more-label--close,
.movie-gallery__caption-wrap.is-open .movie-gallery__more-label--open {
  display: none;
}

.movie-gallery__caption-wrap.is-open .movie-gallery__more-label--close {
  display: inline;
}

@media (max-width: 768px) {
  .movie-gallery {
    --movie-gallery-width: calc(100vw - 40px);
  }

  /* デザインでは、このセクションの見出しは他のセクション（20px）より小さい */
  .movie-gallery__title {
    font-size: 1.7rem;
  }

  .movie-gallery__lead {
    margin-top: 20px;
    font-size: 1.1rem;
    letter-spacing: 0.09em;
  }

  .movie-gallery__sp-br {
    display: inline;
  }

  .movie-gallery__arrows {
    width: calc(100% - 40px);
    margin-bottom: 16px;
  }

  .movie-gallery__movie-title {
    margin-top: 12px;
    font-size: 1.3rem;
    letter-spacing: 0.08em;
  }

  .movie-gallery__caption-wrap {
    margin-top: 12px;
  }

  .movie-gallery__caption {
    --caption-line-height: 18.6px;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
  }

  .movie-gallery__more {
    margin-top: 16px;
  }
}
