@charset "utf-8";
/*
 * Cards.css - カード型レイアウト専用スタイル
 * 軸馬先生テーマ - モダンカードデザイン Ver 2.1
 */

/* ===== カードコンテナ ===== */
.posts-container,
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

/* デスクトップでは2カラム可能 */
@media (min-width: 1200px) {
    .posts-container,
    .posts-grid {
        max-width: 1200px;
        grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
        gap: 40px;
    }
}

/* ===== モダンカードデザイン ===== */
.post-card,
article.post-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(30, 58, 138, 0.1);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 0;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* カード上部のアクセント線 */
.post-card::before,
article.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg, 
        var(--color-primary) 0%, 
        var(--color-crystal) 50%, 
        var(--color-accent) 100%
    );
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left;
    z-index: 1;
}

/* ホバー時のエフェクト */
.post-card:hover::before,
article.post-card:hover::before {
    transform: scaleX(1);
}

.post-card:hover,
article.post-card:hover {
    transform: translateY(-12px);
    box-shadow: 
        0 20px 40px rgba(30, 58, 138, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(245, 158, 11, 0.3);
}

/* ===== カード内のサムネイル ===== */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    aspect-ratio: 16/9;
    background: var(--color-bg-light);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

/* ===== カード内コンテンツ ===== */
.post-content {
    padding: var(--spacing-xl);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* メタ情報 */
.post-meta {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.post-meta span {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--transition);
}

.post-date {
    background: rgba(30, 58, 138, 0.1);
    color: var(--color-primary);
    border-color: rgba(30, 58, 138, 0.2);
}

.post-type {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-crystal);
    border-color: rgba(59, 130, 246, 0.2);
}

.post-racetrack,
.post-category {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-accent);
    border-color: rgba(245, 158, 11, 0.2);
}

.post-card:hover .post-meta span {
    transform: translateY(-1px);
}

/* タイトル */
.post-title,
.post-card h2,
.post-card h3 {
    font-size: 20px;
    margin: 0 0 var(--spacing-md) 0;
    line-height: 1.4;
    color: var(--color-primary);
    position: relative;
    font-weight: 700;
}

/* タイトル下のアクセント線 */
.post-title::after,
.post-card h2::after,
.post-card h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-crystal));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.post-card:hover .post-title::after,
.post-card:hover h2::after,
.post-card:hover h3::after {
    width: 80px;
}

/* タイトルリンク */
.post-title a,
.post-card h2 a,
.post-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover,
.post-card h2 a:hover,
.post-card h3 a:hover {
    color: var(--color-accent);
}

/* 本文・概要 */
.post-excerpt,
.post-card p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
    flex: 1;
}

/* ===== カードアクション（ボタンエリア） ===== */
.post-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    flex-wrap: wrap;
}

.post-actions .btn {
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 20px;
}

.reading-time {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 4px 8px;
    background: var(--color-bg-light);
    border-radius: 12px;
}

.premium-badge {
    background: linear-gradient(135deg, var(--color-accent), var(--jikuma-secondary-light));
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 16px;
    animation: premium-shine 2s ease-in-out infinite;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

@keyframes premium-shine {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    }
    50% { 
        opacity: 0.9;
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
    }
}

/* ===== 特別なカードタイプ ===== */
/* 予想カード */
.post-card.prediction-card,
article.prediction-card {
    border-left: 4px solid var(--color-crystal);
}

.post-card.prediction-card:hover,
article.prediction-card:hover {
    border-left-color: var(--color-accent);
}

/* 実績カード */
.post-card.result-card,
article.result-card {
    border-left: 4px solid var(--color-success);
}

.post-card.result-card:hover,
article.result-card:hover {
    border-left-color: var(--color-accent);
}

/* お知らせカード */
.post-card.announcement-card,
article.announcement-card {
    border-left: 4px solid var(--color-accent);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 204, 0, 0.02));
}

/* ===== カード内要素の追加スタイル ===== */
/* カードタグ */
.card-tags,
.post-tags {
    margin-top: var(--spacing-md);
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.card-tag,
.post-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(30, 58, 138, 0.1);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 58, 138, 0.2);
}

.card-tag:hover,
.post-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

/* ===== 記事がない場合の表示 ===== */
.no-posts {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    border: 2px dashed rgba(30, 58, 138, 0.3);
    backdrop-filter: blur(10px);
    margin: 40px 0;
    grid-column: 1 / -1; /* グリッド全体にスパン */
}

.no-posts h3 {
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    font-size: 24px;
    font-weight: 700;
}

.no-posts p {
    color: var(--color-text-light);
    font-size: 16px;
    margin-bottom: 0;
    line-height: 1.6;
}

/* ===== 読み込み中のスケルトン ===== */
.card-skeleton {
    background: linear-gradient(90deg, var(--jikuma-gray-100) 25%, var(--jikuma-gray-200) 50%, var(--jikuma-gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 20px;
    height: 300px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== レスポンシブ対応 ===== */
@media (max-width: 768px) {
    .posts-container,
    .posts-grid {
        gap: 24px;
        padding: 0 var(--spacing-sm);
    }
    
    .post-card,
    article.post-card {
        border-radius: 16px;
    }
    
    .post-content {
        padding: var(--spacing-lg);
    }
    
    .post-title,
    .post-card h2,
    .post-card h3 {
        font-size: 18px;
        margin-bottom: var(--spacing-sm);
    }
    
    .post-excerpt,
    .post-card p {
        font-size: 14px;
        margin-bottom: var(--spacing-md);
    }
    
    .post-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .post-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .no-posts {
        padding: 40px 20px;
        margin: 20px 0;
    }
    
    .no-posts h3 {
        font-size: 20px;
    }
    
    .no-posts p {
        font-size: 14px;
    }
    
    .post-thumbnail {
        border-radius: 16px 16px 0 0;
    }
}

@media (max-width: 480px) {
    .post-content {
        padding: var(--spacing-md);
    }
    
    .post-title,
    .post-card h2,
    .post-card h3 {
        font-size: 16px;
    }
    
    .post-excerpt,
    .post-card p {
        font-size: 13px;
    }
    
    .post-meta {
        gap: var(--spacing-xs);
    }
    
    .post-meta span {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* ===== アクセシビリティ改善 ===== */
/* フォーカス表示 */
.post-card:focus-within {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

.post-card a:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 高コントラストモード */
@media (prefers-contrast: high) {
    .post-card,
    article.post-card {
        border: 2px solid var(--color-primary);
        background: white;
    }
    
    .post-card:hover,
    article.post-card:hover {
        border-color: var(--color-accent);
        background: white;
    }
    
    .post-meta span {
        border: 2px solid currentColor;
    }
}

/* アニメーション削減 */
@media (prefers-reduced-motion: reduce) {
    .post-card,
    article.post-card,
    .post-card::before,
    .post-title::after,
    .post-card h2::after,
    .post-card h3::after,
    .post-thumbnail img,
    .card-tag,
    .post-tag,
    .premium-badge {
        transition: none;
        animation: none;
    }
    
    .post-card:hover,
    article.post-card:hover {
        transform: none;
    }
    
    .card-skeleton {
        animation: none;
        background: var(--jikuma-gray-100);
    }
}

/* ===== 印刷対応 ===== */
@media print {
    .post-card,
    article.post-card {
        background: white;
        border: 1px solid var(--jikuma-gray-300);
        box-shadow: none;
        backdrop-filter: none;
        break-inside: avoid;
        margin-bottom: 20pt;
    }
    
    .post-card::before,
    .post-title::after,
    .post-card h2::after,
    .post-card h3::after {
        display: none;
    }
    
    .post-actions,
    .card-tags,
    .post-tags {
        display: none;
    }
    
    .post-meta span {
        background: var(--jikuma-gray-100);
        color: var(--jikuma-gray-700);
    }
}