/* Related Posts System Styles */
.related-posts-section {
    margin: 2rem 0;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

.related-posts-section .container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.section-title {
    text-align: center;
    color: #222;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 2rem 0;
    padding: 0 15px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

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

.post-card:hover .post-image {
    transform: scale(1.03);
}

.post-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
}

.post-category {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    align-self: flex-start;
    text-decoration: none;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.post-title a:hover {
    color: #ee5a52;
}

.post-excerpt {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #95a5a6;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: #ee5a52;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .post-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .post-image {
        height: 200px;
    }
}

/* Fix for IE11 */
@supports not (display: grid) {
    .posts-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .post-card {
        width: calc(50% - 1rem);
        margin-bottom: 2rem;
    }
    
    @media (max-width: 480px) {
        .post-card {
            width: 100%;
        }
    }
}
