/**
 * Bright Infosystem Website
 *
 * @file blog_listing_section.css
 * @description Styles for the blog listing page with a professional news layout.
 * @version 2.2 (Added Category Header)
 */

.blog-listing-section {
    padding: 100px 20px;
}

.blog-listing-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Hero Header --- */
.blog-hero-header {
    text-align: center;
    margin-bottom: 60px;
}
.blog-hero-header h1 {
    font-size: 44px;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.blog-hero-header p {
    font-size: 18px;
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Top 3 Blog Posts --- */
.top-blogs-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 60px;
}
.top-blog-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    height: 350px;
}
.top-blogs-grid .top-blog-card:first-child {
    grid-row: span 2;
    height: 100%;
}
.top-blog-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.top-blog-card:hover .top-blog-image {
    transform: scale(1.05);
}
.top-blog-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(6, 6, 6, 0.8) 20%, transparent);
}
.top-blog-content h3 {
    font-size: 18px;
    line-height: 1.4;
}

/* --- New Category Header --- */
.category-header {
    text-align: center;
    margin-bottom: 40px;
}
.category-header h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.category-header p {
    font-size: 16px;
    color: var(--text-color);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Category Filters --- */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px;
}
.category-badge {
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid var(--dark-divider-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.category-badge:hover {
    background-color: var(--divider-color);
    color: var(--primary-color);
}
.category-badge.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--accent-color);
}

/* --- Main Blog Grid (Homepage Style) --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
    text-align: left;
}
.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.blog-card {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    height: 450px; /* Slightly smaller than homepage */
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
.blog-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(to top, rgba(6, 6, 6, 0.95) 20%, rgba(6, 6, 6, 0.7) 60%, transparent);
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}
.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 15px;
}
.blog-date {
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.blog-title {
    font-size: 20px;
    margin: 0 0 15px 0;
    line-height: 1.4;
    font-weight: 600;
    color: var(--primary-color);
}
.blog-excerpt {
    font-size: 15px;
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.read-more {
    font-weight: 600;
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease, gap 0.3s ease;
}
.read-more i {
    transition: transform 0.3s ease;
}
.blog-card:hover .read-more i {
    transform: translateX(5px);
}
.no-posts-message {
    grid-column: 1 / -1;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.pagination-link {
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid var(--dark-divider-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.pagination-link:hover {
    background-color: var(--divider-color);
    color: var(--primary-color);
}
.pagination-link.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--accent-color);
}
.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .top-blogs-grid {
        grid-template-columns: 1fr 1fr;
    }
    .top-blogs-grid .top-blog-card:first-child {
        grid-column: span 2;
        height: 350px;
    }
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .top-blogs-grid {
        grid-template-columns: 1fr;
    }
     .top-blogs-grid .top-blog-card:first-child {
        height: 300px;
    }
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

