/* Container for related coloring pages */
.related-posts-grid {
    display: grid;
    /* 4 columns at ~950px, collapse to 3/2/1 automatically */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* RTL support (Arabic, etc.) */
.related-posts-grid-rtl {
    direction: rtl;
}

/* Individual related post card */
.related-post-item {
background: linear-gradient(41deg, #fff6fa 0%, #e7f5ff 100%);
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%; /* equalize card heights per row */
}

/* Make entire card clickable */
.related-post-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Hover effect on card */
.related-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* Thumbnail wrapper */
.related-post-thumbnail {
    width: 100%;
    overflow: hidden;
}

/* Thumbnail image (fusion-400) – force 4:3 aspect ratio */
.related-post-thumbnail-img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Title text */
.related-post-title {
    margin: 15px 10px 10px 10px;
    text-align: center;
    font-size: 15px !important;
    font-weight: bold !important;
    color: #03a9f4 !important;
    transition: color 0.2s ease;
}

/* Title hover: pink */
.related-post-title:hover {
    color: #e87fa2 !important;
    cursor: pointer;
}

/* RTL title alignment */
.related-posts-grid-rtl .related-post-title {
    text-align: right;
}

/* Optional heading style */
.related-posts-heading {
    margin: 0 0 15px;
    font-size: 22px !important;
    font-weight: 600 !important;
    text-align: center;
    position: relative;
}

/* Ensure text sits nicely between the lines */
.related-posts-heading > span,
.related-posts-heading {
    white-space: nowrap;
}

/* Extra small screens: tighten gap a bit */
@media (max-width: 480px) {
    .related-posts-grid {
        gap: 10px;
    }

    .related-posts-heading::before,
    .related-posts-heading::after {
        width: 40px;
    }
}
