@charset "UTF-8";
/* ==========================================================================
   伊達市シティプロモーション 新動画プレイヤーCSS
   （単一YouTubeプレイヤー制御・既存デザイン完全再現・レスポンシブ対応）
   ========================================================================== */

/* 全体ラッパー（伊達市デザインの .movieBox 互換） */
.promotion-movie-box {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* 動画再生エリアとサムネイルの高さを完全に一致させる */
    margin: 0 auto;
    padding-top: 60px;
    width: 980px;
    box-sizing: border-box;
    gap: 30px;
}

/* メイン動画外枠（伊達市既存の movie_in スタイルを完全継承） */
.promotion-movie-frame {
    flex: 1;
    min-width: 0;
    padding: 20px;
    background-color: #2b1f1d;
    background-image: url('/img/promotion/movie_bg.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    border: solid 2px #4f352d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

/* 16:9 アスペクト比維持スクリーン */
.promotion-video-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 6px;
    overflow: hidden;
}

/* 単一 iframe プレイヤー */
.promotion-video-screen iframe,
.promotion-video-screen #promotion-player-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 動画キャプション（タイトル表示・YouTubeコントロールバーの上部に配置） */
.promotion-video-caption {
    position: absolute;
    bottom: 48px;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.03em;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}

/* サムネイル一覧エリア（PCでは右側縦配置・動画フレームと高さを完全に同期） */
.promotion-thumb-area {
    width: 156px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
    height: auto;
    position: relative;
}

/* スクロール操作ボタン（PC: 上下 / SP: 左右） */
.promotion-thumb-nav-btn {
    background: #4f352d;
    border: 1px solid #744e43;
    color: #fff;
    width: 100%;
    height: 22px;
    cursor: pointer;
    display: none; /* デフォルト非表示。枚数が多くあふれた時のみJSで表示 */
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, opacity 0.2s;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.promotion-thumb-nav-btn.prev {
    margin-bottom: 4px;
}

.promotion-thumb-nav-btn.next {
    margin-top: 4px;
}

.promotion-thumb-nav-btn:hover {
    background: #6a473d;
}

.promotion-thumb-nav-btn:active {
    opacity: 0.7;
}

.promotion-thumb-nav-btn::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}

.promotion-thumb-nav-btn.prev::before {
    transform: rotate(-45deg);
    margin-top: 3px;
}

.promotion-thumb-nav-btn.next::before {
    transform: rotate(135deg);
    margin-top: -3px;
}

/* サムネイルスクロールトラック */
.promotion-thumb-track {
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 5件時は動画フレーム上端〜下端に完全フィット */
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    list-style: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 53, 45, 0.6) transparent;
}

/* 6件以上あふれてボタンが表示される場合 */
.promotion-thumb-area.has-nav-buttons .promotion-thumb-track {
    justify-content: flex-start;
    gap: 6px;
}

.promotion-thumb-track::-webkit-scrollbar {
    width: 4px;
}

.promotion-thumb-track::-webkit-scrollbar-thumb {
    background: rgba(79, 53, 45, 0.6);
    border-radius: 2px;
}

/* サムネイル単体項目（伊達市既存の thumbnail-image-wrapper スタイル再現） */
.promotion-thumb-item {
    width: 100%;
    cursor: pointer;
    position: relative;
    border: 3px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    box-sizing: border-box;
    opacity: 0.6;
    transition: border-color 0.3s ease, opacity 0.3s ease, transform 0.2s ease;
    background-color: #000;
    flex-shrink: 0;
}

.promotion-thumb-item:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* アクティブ状態：伊達市デザイン特有の緑枠線（#00a651） */
.promotion-thumb-item.is-active {
    border-color: #00a651;
    opacity: 1;
    box-shadow: 0 0 10px rgba(0, 166, 81, 0.6);
}

/* サムネイル画像（16:9比率） */
.promotion-thumb-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background-color: #111;
}

.promotion-thumb-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 再生中インジケーター */
.promotion-thumb-item.is-active::after {
    content: '▶';
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 9px;
    color: #fff;
    background: #00a651;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
    z-index: 2;
}

/* サムネイルタイトル表示（伊達市デザイン準拠：画像のみ表示しテキストは非表示） */
.promotion-thumb-title {
    display: none;
}

/* ==========================================================================
   スマートフォン表示（max-width: 767px）対応
   ========================================================================== */
@media screen and (max-width: 767px) {
    .promotion-movie-box {
        display: block;
        width: 95%;
        padding-top: 30px;
        gap: 0;
    }

    .promotion-movie-frame {
        width: 100%;
        padding: 12px;
        margin-bottom: 15px;
    }

    .promotion-video-caption {
        font-size: 1.1rem;
        bottom: 44px;
        padding: 6px 10px;
    }

    .promotion-thumb-area {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    /* SPでは左右ボタン */
    .promotion-thumb-nav-btn {
        width: 28px;
        height: 60px;
        flex-shrink: 0;
        margin: 0;
    }

    .promotion-thumb-nav-btn.prev::before {
        transform: rotate(-135deg);
        margin-top: 0;
        margin-left: 3px;
    }

    .promotion-thumb-nav-btn.next::before {
        transform: rotate(45deg);
        margin-top: 0;
        margin-right: 3px;
    }

    /* SPでは横スクロールトラック */
    .promotion-thumb-track {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        margin: 0;
        gap: 8px;
        scroll-snap-type: x mandatory;
        padding: 4px 2px;
    }

    .promotion-thumb-track::-webkit-scrollbar {
        height: 4px;
    }

    .promotion-thumb-item {
        flex: 0 0 calc((100% - 16px) / 3);
        min-width: 95px;
        scroll-snap-align: start;
    }
}