@import url('./partials/header.css');
@import url('./partials/page-title.css');
@import url('./partials/footer.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ベーススタイル */
body {
    font-family: Montserrat, 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.partner-footer,
footer {
    flex-shrink: 0;
}

/* ヘッダー */
header {
    position: relative;
    z-index: 2;
    height: 80px;
}

/* 月別セレクター */
.selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    align-items: center;
}

.selector label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #c40000;
    margin-right: 8px;
}

.selector select {
    font-size: 1.05rem;
    background: #fff;
    border: 1.5px solid #c40000;
    color: #222;
    border-radius: 6px;
    padding: 7px 14px;
    transition: border 0.2s;
}

.selector select:focus {
    border: 2px solid #c40000;
    outline: none;
}


/* ブログリスト */
.news-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.news-card {
    border: 1px solid #eee;
    border-left: 5px solid #c40000;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    background-color: #fff8f8;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* 新しいブログカードのレイアウト */
.news-card-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.news-card-text {
    flex: 1;
    min-width: 0; /* flexアイテムの縮小を可能にする */
}

/* 画像がない場合は全幅表示 */
.news-card:not(:has(.news-card-image)) .news-card-text {
    flex: none;
    width: 100%;
}

.news-card-image {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    overflow: hidden;
    border-radius: 6px;
    background-color: #f5f5f5;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 画像全体を表示 */
    background-color: #fff;
}

.category {
    font-size: 0.8rem;
    color: #c40000;
    font-weight: bold;
    text-transform: uppercase;
}

.news-title {
    margin: 5px 0;
    font-size: 1.4rem;
    color: #111;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-date {
    font-size: 0.9rem;
    color: #999;
}

.excerpt {
    margin-top: 10px;
    font-size: 1rem;
    color: #444;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #c40000;
    font-weight: bold;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* 見出しとリンクのスタイル */
h1, h2, h3 {
    color: #c40000;
    font-family: Montserrat, 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
}

a {
    color: #c40000;
    transition: 0.3s;
}

a:hover {
    opacity: 0.7;
}

/* アニメーション定義 */
@keyframes fade-in-menu {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ブログ投稿なしメッセージのスタイル */
.no-posts-message,
.no-filtered-posts-message {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 40px auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.no-posts-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    opacity: 0.7;
}

.no-posts-title {
    color: #6c757d;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    font-family: 'Noto Sans JP', sans-serif;
}

.no-posts-description {
    color: #868e96;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    font-family: 'Noto Sans JP', sans-serif;
}

/* フェードインアニメーション */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-menu {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ================================================================
   レスポンシブデザイン統合セクション
   ================================================================ */

/* レスポンシブ対応 */
@media (max-width: 768px) {
    header {
        height: 60px;
    }

    .news-card {
        padding: 10px;
    }

    .news-card-content {
        position: relative;
    }
    
    .news-card-image {
        position: absolute;
        top: 0;
        right: 0;
        width: 110px; /* SP版では少し小さめに */
        height: 90px; /* アスペクト比を保持 */
    }

    .news-title {
        font-size: 1.2rem;
        margin-top: 0;
    }

    .excerpt {
        margin-top: 5px;
    }

    .news-card-content:has(.news-card-image) .news-title {
        padding-right: 120px; /* 画像のスペースを確保 */
        height: 90px;
    }

    .no-posts-message,
    .no-filtered-posts-message {
        padding: 40px 16px;
        margin: 20px auto;
    }
    
    .no-posts-icon {
        font-size: 2.5rem;
        margin-bottom: 16px;
    }
    
    .no-posts-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .no-posts-description {
        font-size: 0.9rem;
    }
}

/* デスクトップ対応（1024px以上） */
@media (min-width: 1024px) {
    .blog-grid {
        max-width: 1200px;
        margin: 0 auto;
    }

    .news-card {
        padding: 25px;
    }

    .news-title {
        font-size: 1.4rem;
    }

    .news-card-image {
        width: 140px;
        height: 100px;
    }
}