/* =================================================================
   Favorites List Page Styles (お気に入り一覧ページ専用CSS)
   ================================================================= */

/* ページのメインコンテナのスタイル */
.favorite-list-main .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

@media (max-width: 768px) {
    .favorite-list-main .container {
        padding: 0 1rem;
    }
}

.entry-content {
    margin-top: 5.5rem !important;
}


/* カードを並べるグリッドのスタイル */
.activity-grid.favorites-grid {
    display: grid;
    /* 画面幅に応じて列数を自動調整 */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
}

/* お気に入り件数が少ない（1〜2件）場合のスタイル調整 */
.favorites-grid.favorites-grid-align-center {
    /* 可変幅(1fr)を使わず、最大幅を固定値にする */
    grid-template-columns: repeat(auto-fit, 400px);
    /* グリッド全体を中央に配置する */
    justify-content: center;
}

@media (max-width: 768px) {
    .activity-grid.favorites-grid {
        grid-template-columns: 1fr; /* スマホでは1列に */
        gap: 1.5rem;
    }
}

/* アクティビティカード全体のスタイル */
.activity-card {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* カード自体をFlexコンテナに */
    flex-direction: column; /* 子要素（画像とコンテンツ）を縦に並べる */
}

.activity-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

/* カード全体を覆うリンク */
.card-link-wrapper {
    display: block;
    text-decoration: none;
    color: inherit; /* 親要素の色を継承 */
}

/* カード上部の画像エリア */
.card-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 のアスペクト比 (9 / 16 * 100) */
    background-color: #000; /* 動画読み込み中の背景色 */
    overflow: hidden; /* ← はみ出した部分を隠す（超重要）*/
    border-radius: 24px 24px 0 0; /* カードの角丸に合わせる */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像が引き伸ばされないように */
    transition: transform 0.4s ease;
}

.activity-card:hover .card-image img {
    transform: scale(1.05);
}

/* 画像左上のバッジ */
.card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* カード右上のハートボタンのラッパー */
.card-favorite-wrapper {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5; /* 他の要素より手前に表示 */
}
/* Favoritesプラグインが出力するボタン自体のスタイル */
.card-favorite-wrapper .simplefavorite-button {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--secondary-blue, #ff6645);
    padding: 0;
}
.card-favorite-wrapper .simplefavorite-button:hover,
.card-favorite-wrapper .simplefavorite-button.active {
    background: var(--secondary-blue, #ff6645);
    color: white;
    transform: scale(1.1);
}
.card-favorite-wrapper .simplefavorite-button.active .fa-heart {
    font-weight: 900;
}


/* カード下部のコンテンツエリア */
.card-content {
    padding: 1.5rem 2rem;
    display: flex; /* コンテンツエリアもFlexコンテナに */
    flex-direction: column; /* 子要素（タイトル、説明、詳細）を縦に並べる */
    flex-grow: 1; /* 空きスペースを埋めるように高さを伸ばす */
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.card-description {
    color: #6b7280; /* var(--text-gray) */
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    /* 最低でも2行分の高さを確保（任意） */
    min-height: 3.2rem; /* 0.95rem * 1.6 * 2 */
}

/* 詳細情報（対象年齢など）のエリア */
.card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb; /* var(--border-gray) */
    margin-top: auto; /* ★これがキーポイント！★ 上の要素との間にできる空きスペースを全てマージンにし、自身を最下部に押しやる */
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.detail-icon {
    width: 16px;  /* アイコンの幅を指定 */
    height: 16px; /* アイコンの高さを指定 */
    object-fit: contain; /* アスペクト比を保ったまま収める */
}

.detail-item i {
    color: #0c99ba; /* var(--primary-blue) */
    width: 16px;
    text-align: center;
}

/* videoタグを画像のように振る舞わせる */
.activity-card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* コンテナを覆うように拡大・縮小 */
}

/* 再生ボタンのスタイル */
.video-play-button {
    display: none; /* ← これだけでOKです！アイコンが非表示になります */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    /* opacity: 1; 最初は表示 */
}
.activity-card.is-playing .video-play-button {
    opacity: 0; /* 再生中は非表示 */
}
.video-play-button:hover {
    background: var(--primary-blue, #0c99ba);
    transform: translate(-50%, -50%) scale(1.1);
}

/* moreボタンのスタイル（front-page.phpのCSSを参考に）*/
.card-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* 2行分の高さを目安に最小高さを設定 */
    min-height: 5rem; /* 1.5rem * 1.3 * 2 + marginなど。値は適宜調整してください */
}
.more-btn {
    background: none;
    border: none;
    color: var(--primary-blue, #0c99ba);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}
.more-btn:hover i {
    transform: translateX(3px);
}