/**
 * Related Posts Styles
 * 
 * Styles for the related posts section.
 * 3x1 grid on desktop, vertical stack on mobile.
 * 
 * @package KidsColoringClub
 * @since 2.35.0
 */

/* Container */
.kcc-related-posts {
    margin: 1rem 0;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 0px 2px #ccc;
}

/* Title */
.kcc-related-posts__title {
    font-size: 24px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 1rem 0;
    text-align: center;
}

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

/* Individual Item */
.kcc-related-posts__item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
}

.kcc-related-posts__item:hover .kcc-related-posts__image {
    transform: scale(1.1);
}

/* Image */
.kcc-related-posts__image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: contain;
    border-radius: 6px;
    background: none;
    transition: transform 0.3s ease;
}

/* Post Title */
h4.kcc-related-posts__post-title {
    font-size: var(--size--1);
    font-weight: 500;
    color: #333333;
    margin: 12px 0 0 0;
    line-height: 1.4;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile Responsive - Vertical Stack */
@media (max-width: 768px) {
    .kcc-related-posts {
        margin: 30px 0;
        padding: 15px;
    }
    
    .kcc-related-posts__title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .kcc-related-posts__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    h4.kcc-related-posts__post-title {
        font-size: 15px;
    }
}

/* Tablet Responsive - 2x2 Grid */
@media (min-width: 769px) and (max-width: 1024px) {
    .kcc-related-posts__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading State */
.kcc-related-posts--loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Empty State */
.kcc-related-posts--empty {
    display: none;
}

/* Animation for items appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kcc-related-posts__item {
    animation: fadeInUp 0.3s ease forwards;
}

.kcc-related-posts__item:nth-child(1) {
    animation-delay: 0.1s;
}

.kcc-related-posts__item:nth-child(2) {
    animation-delay: 0.2s;
}

.kcc-related-posts__item:nth-child(3) {
    animation-delay: 0.3s;
}