/* 📰 Professional Blog Listing Styles */

:root {
    --blog-primary: #4f46e5;
    --blog-primary-hover: #4338ca;
    --blog-text-main: #1e293b;
    --blog-text-muted: #64748b;
    --blog-text-light: #94a3b8;
    --blog-bg-card: #ffffff;
    --blog-bg-page: #f8fafc;
    --blog-border: #e2e8f0;
    --blog-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --blog-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --blog-radius: 16px;
    --blog-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

/* Post Card Styling */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    background: var(--blog-bg-card);
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow-sm);
    border: 1px solid var(--blog-border);
    transition: var(--blog-transition);
    display: flex;
    flex-direction: row;
    min-height: 240px;
    height: auto;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--blog-shadow-lg);
    border-color: var(--blog-primary);
}

.post-image {
    flex: 0 0 320px;
    position: relative;
    overflow: hidden;
    background: var(--blog-bg-page);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.post-content {
    padding: 1.75rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

/* Metadata Styling */
.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.post-category {
    background: #eef2ff;
    color: var(--blog-primary);
    padding: 4px 12px;
    border-radius: 9999px;
    font-weight: 600;
}

.post-date {
    color: var(--blog-text-muted);
}

.post-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-card h2 a {
    color: var(--blog-text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.post-card h2 a:hover {
    color: var(--blog-primary);
}

.post-excerpt {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.post-views {
    font-size: 0.875rem;
    color: var(--blog-text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Adjustments for smaller desktop screens */
@media (max-width: 1200px) {
    .post-image {
        flex: 0 0 260px;
    }
}

/* Sidebar Styling */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.sidebar-widget h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
    border-left: 4px solid #4f46e5;
    padding-left: 12px;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    color: #475569;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.category-list a:hover {
    background: #f1f5f9;
    color: #4f46e5;
    padding-left: 16px;
}

.popular-posts {
    list-style: none;
    padding: 0;
}

.popular-posts li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.popular-posts li:last-child {
    border-bottom: none;
}

.popular-posts a {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9375rem;
    display: block;
    margin-bottom: 4px;
}

.popular-posts a:hover {
    color: #4f46e5;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .blog-layout {
        gap: 1.5rem;
    }
    
    .post-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .post-image {
        flex: 0 0 220px;
        width: 100%;
    }
    
    .post-content {
        padding: 1.25rem 1.5rem;
    }
    
    .post-card h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .post-excerpt {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
        -webkit-line-clamp: 2; /* Shorter excerpt on mobile */
    }
}