@charset "UTF-8";

/* =========================================
   3. コンポーネント (パーツ・部品)
   ========================================= */

/* --- Live更新バッジ --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 50px;
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

@media screen and (max-width: 768px) {
    .status-badge {
        margin-top: 5px;
        padding: 4px 12px;
        font-size: 0.75rem;
    }
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: #00FFCA;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px #00FFCA;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 202, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 255, 202, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 202, 0); }
}

/* --- フィルタータグ --- */
.filter-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid #EAEAEA;
    background: #FFFFFF;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    padding: 5px 12px;
    margin: 2px;
    border-radius: 6px;
    font-size: 0.75rem;
    box-shadow: 0 3px 0 #E0E0E0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.filter-tag:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 5px 10px rgba(255, 56, 92, 0.15);
}

.filter-tag.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    transform: translateY(2px);
    box-shadow: 0 0px 0 #D90B3E;
}

@media screen and (max-width: 768px) {
    .filter-tag {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

.more-toggle-btn {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 8px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-sub);
    transition: 0.2s;
    font-size: 0.85rem;
}
.more-toggle-btn:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

/* --- カードデザイン --- */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.03);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

/* --- カード画像修正版（Amazon・VOD向け最適化） --- */
.card img {
    width: 100%;
    /* 縦長(2/3)をやめて、Youtubeサムネと同じ「16:9」にする */
    /* これによりカード全体の高さがグッと抑えられ、一覧性が増します */
    aspect-ratio: 16 / 9; 
    
    /* 画像をトリミングせず、全体を枠内に収める */
    object-fit: contain; 
    
    /* Amazon画像の背景色に合わせて白にする（違和感を消す） */
    background-color: #ffffff;
    
    /* 少しだけ余白を持たせて、パッケージ全体を綺麗に見せる */
    padding: 10px; 
    box-sizing: border-box; /* paddingを含めたサイズ計算にする */
    
    /* 枠線を少し入れて、白い画像でも境界をはっきりさせる（お好みで） */
    border-bottom: 1px solid #f0f0f0;
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.5;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    margin-bottom: 15px;
}

.card-tags span {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-sub);
    background: #F3F4F6;
    padding: 4px 8px;
    border-radius: 6px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-weight: 700;
    transition: 0.2s;
}

.card:hover .card-tags span {
    background: #FFE4E6;
    color: var(--primary);
}

/* =========================================
   フッター (VODリンクエリア) - 3行スタック・未配信対応版
   ========================================= */

.service-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    width: 100%;
}

@media screen and (max-width: 480px) {
    .service-list {
        gap: 6px;
    }
}

/* --- リンクカード枠組み（共通） --- */
.service-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 上・中・下を均等配置 */
    padding: 10px 12px;
    text-decoration: none;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #ddd;
    color: inherit;
    min-height: 92px; /* 3行確保のため高さを確保 */
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.service-link:active {
    transform: scale(0.98);
}

/* --- 1行目：サービス名（全幅確保） --- */
.service-head {
    width: 100%;
    margin-bottom: 2px;
}

.service-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #333;
    
    /* 長い名前も1行目でしっかり表示 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    width: 100%;
    line-height: 1.4;
}

/* --- 2行目：価格 + バッジ --- */
.service-mid {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
    height: 1.4em; /* 高さ確保 */
}

.row-price {
    font-size: 0.75rem;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

/* バッジ共通設定（右寄せロジック） */
.badge-free, .badge-paid, .badge-unavailable {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 700;
    display: inline-block;
    line-height: 1;
    
    /* ★重要：価格の長さに関わらず右端へ固定 */
    margin-left: auto; 
}

/* バッジ色定義 */
.badge-free { 
    background: #E3FDF3; 
    color: #00875A; 
    border: 1px solid #bdfadd;
}
.badge-paid { 
    background: #f0f0f0; 
    color: #666; 
    border: 1px solid #ddd; 
}
.badge-unavailable {
    background: #eee;
    color: #aaa;
    border: 1px solid #e0e0e0;
}

/* --- 3行目：キャンペーンテキスト --- */
.service-tail {
    width: 100%;
    margin-top: auto; /* 下に寄せる */
    min-height: 1em; /* 空でもレイアウト崩れ防止 */
}

.row-trial {
    font-size: 0.65rem;
    color: #e53935;
    font-weight: 700;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(229, 57, 53, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    text-align: center;
}

/* =========================================
   状態別カラーリング（旧コードのデザイン思想を継承）
   ========================================= */

/* --- ベース：アフィリエイトボタン --- */
.btn-affiliate {
    border: 1px solid #ccc; /* fallback */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* アイコン共通（PC） */
.btn-affiliate .service-name::before {
    content: '▶';
    font-size: 0.55em;
    color: #fff;
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}
/* アイコン位置補正（スマホ） */
@media screen and (max-width: 480px) {
    .btn-affiliate .service-name::before {
        padding-top: 2px;
        padding-left: 2px;
    }
}

/* ----------------------------------
   A. 本命：見放題 (.type-unlimited)
   ---------------------------------- */
.btn-affiliate.type-unlimited {
    background: #fff !important; /* 完全な白 */
}
.btn-affiliate.type-unlimited .service-name {
    color: #0066cc; /* 鮮やかな青 */
    text-decoration: underline;
    text-decoration-color: rgba(0, 102, 204, 0.3);
    text-underline-offset: 3px;
}
.btn-affiliate.type-unlimited .service-name::before {
    background-color: #0066cc; /* 青アイコン */
}
/* ホバー時 */
.btn-affiliate.type-unlimited:hover {
    border-color: #0066cc !important;
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.15);
}

/* ----------------------------------
   B. 脇役：レンタル (.type-rental)
   ---------------------------------- */
.btn-affiliate.type-rental {
    background: #fdfdfd !important; /* 微かなグレー */
    border-color: #ddd !important;
}
.btn-affiliate.type-rental .service-name {
    color: #446688; /* 落ち着いたネイビー */
    text-decoration: underline;
    text-decoration-color: rgba(68, 102, 136, 0.2);
}
.btn-affiliate.type-rental .service-name::before {
    background-color: #446688; /* ネイビーアイコン */
}
/* ホバー時 */
.btn-affiliate.type-rental:hover {
    background: #fff !important;
    border-color: #bbb !important;
}

/* ----------------------------------
   C. 新規：未配信 (.btn-unavailable)
   ★ここを追加・定義しました
   ---------------------------------- */
.btn-unavailable {
    background: #f9f9f9 !important; /* 濃いめのグレー背景 */
    border: 1px solid #eee !important;
    color: #aaa !important;
    cursor: default;     /* クリック不可カーソル */
    pointer-events: none; /* リンク動作無効化 */
    box-shadow: none !important; /* 影なし（沈んでいる表現） */
}

.btn-unavailable .service-name {
    color: #aaa; /* 薄い文字色 */
    text-decoration: none;
}

/* 未配信アイコン（×印に変更） */
.btn-unavailable .service-name::before {
    content: '×'; /* バツ印 */
    background-color: #ccc; /* グレー背景 */
    font-size: 0.7em;
    padding: 0; /* 調整 */
}

/* 非アフィリエイト（予備） */
.btn-secondary {
    background: #fafafa !important;
    border: 1px solid #eee !important;
    color: #777;
}