/**
 * Related Posts - Runfish Apparel
 * Supports both post-optimizer grid structure and Bootstrap row structure
 */

.related-posts-section {
    padding: 3rem 1rem;
    border-top: 1px solid #e8ecf0;
    margin-top: 3rem;
    background: #F5F7FA;
}

.related-posts-header {
    text-align: center;
    margin-bottom: 2rem;
}

.related-posts-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0F2E44;
    margin: 0;
    line-height: 1.3;
}

/* ========== Structure A: Grid (post-optimizer) ========== */
.related-posts-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.related-posts-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 46, 68, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
}

.related-posts-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(15, 46, 68, 0.12);
}

.related-posts-card-media {
    display: block;
    overflow: hidden;
    background: #F5F7FA;
}

.related-posts-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.related-posts-card:hover .related-posts-card-image {
    transform: scale(1.05);
}

.related-posts-card-content {
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.related-posts-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.625rem;
    color: #0F2E44;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-posts-card-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-posts-card-link:hover {
    color: #3A7B9E;
}

.related-posts-card-excerpt {
    font-size: 0.9375rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== Structure B: Bootstrap Row (legacy) ========== */
.related-post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 46, 68, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(15, 46, 68, 0.12);
}

.related-post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.related-post-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.related-post-category {
    display: inline-block;
    color: #3A7B9E;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.related-post-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.625rem;
    color: #0F2E44;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post-title a:hover {
    color: #3A7B9E;
}

.related-post-excerpt {
    font-size: 0.9375rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== Responsive ========== */
@media (max-width: 991px) {
    .related-posts-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .related-posts-list {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .related-posts-title {
        font-size: 1.5rem;
    }
    .related-posts-section {
        padding: 2.5rem 1rem;
    }
}
