/**
 * 固定ページ下部の関連記事グリッドスタイル
 * PC: 4カラム / スマホ: 2カラム
 */

/* メインコンテナ */
.related-posts-section {
    margin-top: 60px;
    padding: 40px 0;
    background-color: #f8f9fa;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.related-posts-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

/* グリッドレイアウト */
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* グリッドアイテム */
.related-posts-grid .grid-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-posts-grid .grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* リンクスタイル */
.related-posts-grid .grid-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* サムネイル */
.related-posts-grid .thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%; /* 3:2のアスペクト比 */
    overflow: hidden;
    background-color: #f0f0f0;
}

.related-posts-grid .thumbnail-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-posts-grid .grid-item:hover .thumbnail-wrapper img {
    transform: scale(1.05);
}

/* タイトル */
.related-posts-grid h3 {
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    margin: 0;
    min-height: 3.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* すべて見るリンク */
.view-all-link {
    text-align: center;
    margin-top: 40px;
}

.view-all-link a {
    display: inline-block;
    padding: 12px 30px;
    background-color: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.view-all-link a:hover {
    background-color: #005a87;
}

/* タブレット対応 (768px - 1024px) */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* スマートフォン対応 (768px以下) */
@media screen and (max-width: 768px) {
    .related-posts-section {
        margin-top: 40px;
        padding: 30px 0;
    }
    
    .related-posts-section h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    /* スマホでは2カラム表示 */
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px;
    }
    
    .related-posts-grid h3 {
        font-size: 0.9rem;
        padding: 12px;
        min-height: 3em;
    }
    
    .view-all-link {
        margin-top: 30px;
    }
    
    .view-all-link a {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

/* 超小型デバイス対応 (480px以下) */
@media screen and (max-width: 480px) {
    .related-posts-grid {
        gap: 12px;
        padding: 0 10px;
    }
    
    .related-posts-grid h3 {
        font-size: 0.85rem;
        padding: 10px;
    }
}



