/* Related Posts Module Styles */

/* Main Container */
.winit-related-posts-container {
    background-color: #f6f7f8;
    padding: 30px 30px;
    /* Reduced side padding to 20px */
    margin-top: 60px;
    margin-bottom: 20px;
}

/* Header */
.winit-related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
    /* Optional: Solid line under header for separation */
}

.winit-related-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1;
    /* Tighten line height for better centering */
}

.winit-related-icon {
    font-size: 1.7rem;
    font-weight: 500;
    color: #666;
    line-height: 1;
    margin-top: -3px;
    /* visual correction to center with text cap-height */
}

/* Grid Layout */
.winit-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* PC: 3 columns */
    gap: 20px;
}

/* Individual Card */
.winit-related-card {
    display: flex;
    flex-direction: column;
}

.winit-related-card a {
    text-decoration: none;
    color: inherit;
}

.winit-related-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 15px;
    background-color: #eee;
}

.winit-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.winit-related-card:hover .winit-related-thumb img {
    transform: scale(1.05);
}

.winit-related-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    margin: 0;

    /* Line Clamp (2 lines) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .winit-related-posts-container {
        padding: 20px;
        margin-top: 40px;
    }

    .winit-related-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Mobile: 2 columns */
        gap: 15px;
    }

    /* Hide 5th and 6th items on mobile to show only 2 rows (4 items) */
    .winit-related-card:nth-child(n+5) {
        display: none;
    }

    .winit-related-card-title {
        font-size: 0.95rem;
    }
}