/* Related posts grid container */
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns per row */
    gap: 20px; /* Column spacing */
    margin: 20px 0;
}

/* Single post card */
.related-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Thumbnail */
.related-thumb {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Maintain aspect ratio and fill container */
    transition: transform 0.3s ease;
}

.related-item:hover .related-thumb img {
    transform: scale(1.05); /* Zoom on hover */
}

/* Placeholder for posts without thumbnail */
.related-thumb.no-thumb {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* Post title */
.related-title {
    font-size: 14px;
    line-height: 1.4;
    padding: 12px;
    margin: 0;
    color: #333;
}

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

.related-title a:hover {
    color: #0073aa;
}

/* Responsive adaptation: 2 columns on tablet */
@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive adaptation: 1 column on mobile */
@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}