/* Seed Sowing Affiliate - カード型記事一覧スタイル */

/* メインコンテナ */
.seed-post-cards-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 10px;
    box-sizing: border-box;
}

/* グリッドレイアウト - PC3列、スマホ2列 */
.seed-post-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px; /* PC表示のカード間余白を上下左右5pxに */
    margin-bottom: 40px;
}

/* スマホ表示: 2列 */
@media (max-width: 767px) {
    .seed-post-cards-container {
        padding: 0 10px 15px 10px; /* 上部余白なし */
        margin-top: 0 !important;
    }
    
    .seed-post-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 50px !important; /* ページネーションとの余白を確保 */
        margin-top: 0 !important;
    }
    
    .seed-post-card-image {
        height: 150px;
    }
    
    .seed-post-cards-container .seed-post-card-content .seed-post-card-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
        margin-bottom: 5px !important;
    }
    
    .seed-post-card-excerpt {
        font-size: 10px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }
    
    .seed-post-card-content {
        padding: 5px 8px 8px 8px;
    }
}

/* さらに小さい画面でも2列維持 */
@media (max-width: 480px) {
    .seed-post-cards-container {
        padding: 0 8px 10px 8px; /* 上部余白なし */
        margin-top: 0 !important;
    }
    
    .seed-post-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 40px !important; /* ページネーションとの余白を確保 */
        margin-top: 0 !important;
    }
    
    .seed-post-card-image {
        height: 120px;
    }
    
    .seed-post-card-content {
        padding: 3px 8px 8px 8px;
    }
}

/* カード基本スタイル - 画像全体表示対応 */
.seed-post-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* カード画像エリア - 統一高さで画像全体表示 */
.seed-post-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seed-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seed-card-thumbnail {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.seed-card-no-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
}

/* カードコンテンツ - 適度な余白に調整 */
.seed-post-card-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* タイトル - 適度なフォントサイズと余白（詳細度を上げて強制上書き） */
.seed-post-cards-container .seed-post-card-content .seed-post-card-title {
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #333 !important;
    text-align: left !important;
}

.seed-post-cards-container .seed-post-card-content .seed-post-card-title a {
    color: #333 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
}

.seed-post-cards-container .seed-post-card-content .seed-post-card-title a:hover {
    color: #007cba !important;
}

/* 抜粋文 - 適度な余白とフォントサイズ */
.seed-post-card-excerpt {
    font-size: 11px;
    line-height: 1.4;
    color: #666;
    margin: 0;
    padding: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

@media (max-width: 767px) {
    .seed-post-card-title {
        font-size: 12px;
    }
    
    .seed-post-card-excerpt {
        font-size: 10px;
        -webkit-line-clamp: 2;
        margin-top: 3px;
    }
    
    .seed-post-card-content {
        padding: 5px 10px 10px 10px;
    }
}

/* 投稿がない場合 */
.seed-no-posts {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
    border: 1px solid #e0e0e0;
}

/* ページネーション - 画像に合わせて調整 */
.seed-pagination {
    text-align: center;
    margin-top: 40px;
    padding: 0 20px;
}

.seed-pagination-title {
    font-size: 16px;
    color: #333;
    margin: 0 0 20px 0;
    font-weight: normal;
}

.seed-pagination-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fce4ec;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid #f8bbd9;
}

.seed-pagination a,
.seed-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    color: #666;
    padding: 0 4px;
}

.seed-pagination a:hover {
    background: rgba(233, 30, 99, 0.1);
    color: #e91e63;
}

.seed-pagination .current {
    background: #e91e63;
    color: #fff !important;
    font-weight: 600;
}

.seed-pagination .dots {
    cursor: default;
    color: #999;
    background: transparent !important;
}

.seed-pagination .next {
    font-size: 18px;
    font-weight: bold;
}

/* ページネーションのレスポンシブ対応 */
@media (max-width: 767px) {
    .seed-pagination-title {
        font-size: 14px;
    }

    .seed-pagination-nav {
        padding: 10px 16px;
        gap: 6px;
    }
    
    .seed-pagination a,
    .seed-pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* アクセシビリティ */
.seed-post-card:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* モバイル専用：テーマ干渉対策とアニメーション無効化 */
@media (max-width: 767px) {
    /* 上部余白の完全削除 */
    body .seed-post-cards-container,
    html body .seed-post-cards-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* 前の要素からの余白も削除 */
    * + .seed-post-cards-container,
    h1 + .seed-post-cards-container,
    h2 + .seed-post-cards-container,
    h3 + .seed-post-cards-container,
    h4 + .seed-post-cards-container,
    h5 + .seed-post-cards-container,
    h6 + .seed-post-cards-container,
    p + .seed-post-cards-container,
    div + .seed-post-cards-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* カードのスクロールアニメーション無効化 */
    .seed-post-card,
    .seed-post-card.seed-card-visible,
    .seed-post-card.seed-touch-device,
    .seed-post-card[style*="transform"] {
        transform: none !important;
        transition: none !important;
    }
    
    /* 480px以下でも画像アニメーション完全無効化 */
    .seed-card-thumbnail,
    .seed-card-image-link img,
    .seed-post-card-image img,
    .seed-post-card img,
    .seed-post-card-image *,
    .seed-card-image-link * {
        animation: none !important;
        transition: none !important;
        filter: none !important;
        opacity: 1 !important;
        transform: none !important;
        -webkit-animation: none !important;
        -webkit-transition: none !important;
        -webkit-filter: none !important;
        -webkit-transform: none !important;
    }
    
    .seed-card-thumbnail:hover,
    .seed-card-thumbnail:focus,
    .seed-card-image-link:hover img,
    .seed-card-image-link:focus img,
    .seed-post-card:hover img,
    .seed-post-card:focus img,
    .seed-post-card-image:hover *,
    .seed-post-card-image:focus * {
        animation: none !important;
        transition: none !important;
        filter: none !important;
        opacity: 1 !important;
        transform: none !important;
        -webkit-animation: none !important;
        -webkit-transition: none !important;
        -webkit-filter: none !important;
        -webkit-transform: none !important;
    }
    
    /* 画像の光る効果・アニメーションを完全無効化 */
    .seed-card-thumbnail,
    .seed-card-image-link img,
    .seed-post-card-image img,
    .seed-post-card img,
    .seed-post-card-image *,
    .seed-card-image-link * {
        animation: none !important;
        transition: none !important;
        filter: none !important;
        opacity: 1 !important;
        transform: none !important;
        -webkit-animation: none !important;
        -webkit-transition: none !important;
        -webkit-filter: none !important;
        -webkit-transform: none !important;
    }
    
    /* ホバー・フォーカス効果も完全無効化 */
    .seed-card-thumbnail:hover,
    .seed-card-thumbnail:focus,
    .seed-card-image-link:hover img,
    .seed-card-image-link:focus img,
    .seed-post-card:hover img,
    .seed-post-card:focus img,
    .seed-post-card-image:hover *,
    .seed-post-card-image:focus * {
        animation: none !important;
        transition: none !important;
        filter: none !important;
        opacity: 1 !important;
        transform: none !important;
        -webkit-animation: none !important;
        -webkit-transition: none !important;
        -webkit-filter: none !important;
        -webkit-transform: none !important;
    }
}

@media (max-width: 480px) {
    /* 480px以下でも同様の対策 */
    body .seed-post-cards-container,
    html body .seed-post-cards-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    * + .seed-post-cards-container,
    h1 + .seed-post-cards-container,
    h2 + .seed-post-cards-container,
    h3 + .seed-post-cards-container,
    h4 + .seed-post-cards-container,
    h5 + .seed-post-cards-container,
    h6 + .seed-post-cards-container,
    p + .seed-post-cards-container,
    div + .seed-post-cards-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .seed-post-card,
    .seed-post-card.seed-card-visible,
    .seed-post-card.seed-touch-device,
    .seed-post-card[style*="transform"] {
        transform: none !important;
        transition: none !important;
    }
}