/*
 * TPH Video Access Manager - フロントエンドスタイル
 * Mana Flowデザインシステムに準拠
 * カラー: Deep Ocean Teal (var(--tph-teal)) / Living Coral (var(--tph-coral)) / Sand Ivory (var(--tph-sand))
 * v1.3.2: 5カテゴリタブ（ダンス振付/ワークショップ/クラフト/言語/音楽）対応
 */

/* ─── ベース ────────────────────────────────────────────── */
.tph-va-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: inherit;
}

/* ─── タブナビゲーション ──────────────────────────────────
   2026-07-17 リデザイン: 下線式は「タブがある」と気づきにくかったため
   ピル型ボタンに変更（選択中=ティール塗り・非選択=枠付き白ボタン） */
.tph-va-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: none;
    padding-bottom: 0;
}

.tph-va-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.15rem;
    background: #fff;
    border: 1.5px solid var(--tph-sand-dark);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tph-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--tph-radius-pill, 999px);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--tph-shadow-sm, 0 2px 8px rgba(10,61,92,0.06));
}

.tph-va-tab:hover {
    color: var(--tph-teal);
    border-color: var(--tph-teal);
    background: #fff;
}

.tph-va-tab.is-active {
    color: #fff;
    background: var(--tph-teal);
    border-color: var(--tph-teal);
    box-shadow: 0 3px 10px rgba(10,61,92,0.25);
}

.tph-va-tab-icon {
    font-size: 1.1rem;
}

/* ─── タブパネル ────────────────────────────────────────── */
.tph-va-tab-panel {
    animation: tph-fade-in 0.25s ease;
}

/* ─── セクション説明 ────────────────────────────────────── */
.tph-va-section-desc {
    background: var(--tph-white);
    border-left: 4px solid var(--tph-teal);
    padding: 0.875rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.75rem;
}
.tph-va-section-desc p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--tph-text-muted);
    line-height: 1.6;
}

/* ─── ログイン必須 ──────────────────────────────────────── */
.tph-va-login-required {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--tph-white);
    border-radius: var(--tph-radius-md);
    border: 1px solid var(--tph-sand-dark);
}
.tph-va-login-required .tph-va-lock-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.tph-va-login-required h2 {
    color: var(--tph-teal);
    margin-bottom: 0.75rem;
}

/* ─── コレクショングリッド ──────────────────────────────── */
.tph-va-collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ─── コレクションカード ────────────────────────────────── */
.tph-va-collection-card {
    background: #ffffff;
    border-radius: var(--tph-radius-md);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(10, 61, 92, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}
.tph-va-collection-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(10, 61, 92, 0.15);
}
.tph-va-collection-card.is-locked {
    opacity: 0.85;
}

/* サムネイル */
.tph-va-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--tph-teal);
}
.tph-va-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.tph-va-collection-card:hover .tph-va-card-thumb img {
    transform: scale(1.05);
}
.tph-va-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--tph-teal) 0%, var(--tph-teal-light) 100%);
}

/* カルチャーレッスンのプレースホルダーは別色 */
[data-category="culture"] .tph-va-card-thumb-placeholder {
    background: linear-gradient(135deg, var(--tph-wood-dark) 0%, var(--tph-wood) 100%);
}

/* ロックオーバーレイ */
.tph-va-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tph-va-lock-overlay .tph-va-lock-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* 動画数バッジ */
.tph-va-video-count {
    position: absolute;
    bottom: 8px;
    right: 10px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* カード情報 */
.tph-va-card-info {
    padding: 1.25rem;
}
.tph-va-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tph-teal);
    margin: 0 0 0.25rem;
    line-height: 1.4;
}
.tph-va-card-date {
    font-size: 0.8rem;
    color: var(--tph-text-muted);
    margin: 0 0 1rem;
}

/* ロック情報 */
.tph-va-locked-info {
    word-break: keep-all;
    overflow-wrap: break-word;
}
.tph-va-locked-msg {
    font-size: 0.85rem;
    color: var(--tph-text-muted);
    margin: 0 0 0.75rem;
    writing-mode: horizontal-tb;
    white-space: normal;
}

/* ─── ボタン ────────────────────────────────────────────── */
.tph-va-btn {
    display: inline-block;
    box-sizing: border-box;      /* パディング込みで幅計算＝カードからはみ出さない */
    padding: 0.6rem 1.4rem;
    border-radius: var(--tph-radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    max-width: 100%;
}
/* ログイン要求カードのボタンは全幅にせずコンパクトに中央表示 */
.tph-va-login-required .tph-va-btn {
    width: auto;
    min-width: 200px;
}
.tph-va-btn-primary {
    background: var(--tph-teal);
    color: var(--tph-sand);
}
.tph-va-btn-primary:hover {
    background: var(--tph-teal-light);
    color: var(--tph-sand);
    transform: translateY(-1px);
}
.tph-va-btn-purchase {
    background: var(--tph-coral);
    color: #fff;
}
.tph-va-btn-purchase:hover {
    background: var(--tph-coral-dark);
    color: #fff;
    transform: translateY(-1px);
}
.tph-va-btn-ghost {
    background: transparent;
    color: var(--tph-teal);
    border: 2px solid var(--tph-teal);
}
.tph-va-btn-ghost:hover {
    background: var(--tph-teal);
    color: var(--tph-sand);
}

/* ─── 動画プレーヤーパネル ──────────────────────────────── */
.tph-va-player-panel {
    animation: tph-fade-in 0.3s ease;
}
@keyframes tph-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tph-va-player-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--tph-sand-dark);
}
.tph-va-back-btn {
    background: none;
    border: none;
    color: var(--tph-teal);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
    white-space: nowrap;
}
.tph-va-back-btn:hover {
    background: rgba(10,61,92,0.07);
}
.tph-va-player-title {
    font-size: 1.4rem;
    color: var(--tph-teal);
    margin: 0;
}

/* 動画リスト */
.tph-va-videos-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tph-va-video-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(10, 61, 92, 0.08);
}
.tph-va-video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}
.tph-va-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.tph-va-video-meta {
    padding: 1rem 1.25rem;
}
.tph-va-video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tph-teal);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   振付動画: ドロップダウン + サムネイルグリッド + 大画面プレーヤー
   ═══════════════════════════════════════════════════════════ */

/* ドロップダウン */
.tph-va-dropdown-wrap {
    margin-bottom: 1.5rem;
}
.tph-va-dropdown-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tph-text-muted);
    margin-bottom: 0.5rem;
}
.tph-va-dropdown-select {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--tph-sand-dark);
    border-radius: var(--tph-radius-sm);
    background: #fff;
    color: var(--tph-teal);
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230A3D5C' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.tph-va-dropdown-select:focus {
    outline: none;
    border-color: var(--tph-teal);
    box-shadow: 0 0 0 3px rgba(10, 61, 92, 0.12);
}

/* ロックバナー */
.tph-va-locked-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    background: var(--tph-white);
    border: 1px solid var(--tph-sand-dark);
    border-radius: var(--tph-radius-sm);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}
.tph-va-locked-banner-msg {
    margin: 0;
    color: var(--tph-wood-dark);
    font-size: 0.9rem;
    flex: 1 1 100%;
}

/* 大画面プレーヤー */
.tph-va-dance-player {
    animation: tph-fade-in 0.3s ease;
}
.tph-va-main-player {
    margin-bottom: 1rem;
    background: #0a0a0a;
    border-radius: 12px;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tph-va-main-player .tph-va-muted {
    padding: 3rem;
    color: #666;
}
.tph-va-main-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}
.tph-va-main-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 再生中タイトル */
.tph-va-now-playing {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tph-teal);
    margin: 0 0 1.25rem;
    padding-left: 0.25rem;
}

/* サムネイルグリッド */
.tph-va-thumb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tph-va-thumb-item {
    cursor: pointer;
    border-radius: var(--tph-radius-md);
    overflow: hidden;
    background: #fff;
    border: 2px solid transparent;
    box-shadow: 0 1px 6px rgba(10, 61, 92, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.tph-va-thumb-item:hover {
    border-color: var(--tph-teal);
    box-shadow: 0 4px 16px rgba(10, 61, 92, 0.15);
    transform: translateY(-2px);
}
.tph-va-thumb-item.is-active {
    border-color: var(--tph-coral);
    box-shadow: 0 4px 16px rgba(200, 80, 58, 0.25);
}

.tph-va-thumb-img {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    overflow: hidden;
}
.tph-va-thumb-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tph-va-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    color: #555;
}
.tph-va-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}
.tph-va-thumb-item:hover .tph-va-thumb-play {
    opacity: 1;
}
.tph-va-thumb-item.is-active .tph-va-thumb-play {
    opacity: 0;
}

.tph-va-thumb-title {
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--tph-teal);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── ローディング ──────────────────────────────────────── */
.tph-va-loading {
    text-align: center;
    padding: 3rem;
    color: var(--tph-text-muted);
    font-size: 1rem;
}
.tph-va-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--tph-sand-dark);
    border-top-color: var(--tph-teal);
    border-radius: 50%;
    animation: tph-spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}
@keyframes tph-spin {
    to { transform: rotate(360deg); }
}

/* ─── 購入モーダル ──────────────────────────────────────── */
.tph-va-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    backdrop-filter: blur(4px);
}
.tph-va-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: min(480px, 90vw);
    animation: tph-modal-in 0.3s ease;
}
@keyframes tph-modal-in {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
.tph-va-modal-inner {
    background: #fff;
    border-radius: var(--tph-radius-md);
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.tph-va-modal-inner h2 {
    color: var(--tph-teal);
    margin: 0 0 0.75rem;
}
.tph-va-modal-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tph-teal);
    background: rgba(10,61,92,0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}
.tph-va-modal-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--tph-coral);
    margin: 0.5rem 0;
}
.tph-va-modal-desc {
    font-size: 0.875rem;
    color: var(--tph-text-muted);
    margin-bottom: 1.5rem;
}
.tph-va-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ─── 結果ページ ────────────────────────────────────────── */
.tph-va-result-page {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 480px;
    margin: 0 auto;
}
.tph-va-result-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}
.tph-va-result-page h2 {
    color: var(--tph-teal);
    margin-bottom: 1rem;
}
.tph-va-muted {
    color: var(--tph-text-muted);
    font-size: 0.875rem;
}

/* ─── レスポンシブ ──────────────────────────────────────── */
/* ─── タブ: タブレット ─────────────────────────────────── */
/* 2026-07-18: 横スクロール式は画面外のタブに気づけず「切れて見える」ため
   全幅で折返し（チップ）式に統一。モバイルは2行に収まる */
@media (max-width: 900px) {
    .tph-va-tabs {
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    .tph-va-tab {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }
}

/* ─── サムネイルグリッド: タブレット ────────────────────── */
@media (max-width: 900px) {
    .tph-va-thumb-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

/* ─── タブ: モバイル ───────────────────────────────────── */
@media (max-width: 640px) {
    .tph-va-login-required { padding: 2.5rem 1.2rem; }
    .tph-va-login-required .tph-va-btn { min-width: 0; width: 100%; }
    /* 題名〜タブ間の余白圧縮（PC: archive上32px → モバイル: 8px） */
    .tph-va-archive { padding-top: 0.5rem; }
    /* タブは3列グリッドで必ず2行以内に（2026-07-19: flex折返しだと
       iPhone Safariのフォント幅で4行に散らばっていた）。アイコンは非表示 */
    .tph-va-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
        margin-bottom: 1.25rem;
    }
    .tph-va-tab {
        padding: 0.55rem 0.3rem;
        font-size: 0.78rem;
        gap: 0;
        justify-content: center;
        min-width: 0;
    }
    .tph-va-tab-icon { display: none; }
    .tph-va-tab-label {
        /* モバイルではラベル短縮 */
    }
    .tph-va-collections-grid {
        grid-template-columns: 1fr;
    }
    .tph-va-thumb-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .tph-va-thumb-title {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    .tph-va-dropdown-select {
        max-width: 100%;
    }
    .tph-va-locked-banner {
        flex-direction: column;
        text-align: center;
    }
    .tph-va-player-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── [tph_collection_thumbnails] コレクションサムネ一覧 ───── */
.tph-va-colthumbs {
    display: grid;
    grid-template-columns: repeat(var(--tph-colthumb-cols, 3), 1fr);
    gap: 1.5rem;
    margin: 1.75rem 0;
}
.tph-va-colthumb {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(10, 61, 92, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tph-va-colthumb:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(10, 61, 92, 0.14);
}
.tph-va-colthumb-img {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #F2E8D0 0%, #E8D8B8 100%);
    overflow: hidden;
}
.tph-va-colthumb-real {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tph-va-colthumb-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: 0.45;
}
.tph-va-colthumb-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 27, 42, 0.35);
    color: #fff;
    font-size: 1.8rem;
}
.tph-va-colthumb-body {
    padding: 0.9rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tph-va-colthumb-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    color: #1a2a3a;
}
.tph-va-ct-badge {
    align-self: flex-start;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    background: rgba(10, 61, 92, 0.08);
    color: #5a6a7a;
}
.tph-va-ct-badge.is-open { background: rgba(45, 128, 96, 0.12); color: #1e6b4a; }
.tph-va-ct-badge.is-buy  { background: rgba(200, 80, 58, 0.12); color: #a83828; }
.tph-va-ct-badge.is-plan { background: rgba(10, 61, 92, 0.10); color: #0A3D5C; }

@media (max-width: 768px) {
    .tph-va-colthumbs { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (max-width: 480px) {
    .tph-va-colthumbs { grid-template-columns: 1fr; }
}
