/**
 * Next Level - Blog Listing Styles
 * Standard: Mobile-First, CSS Grid, Hardware Accelerated Transitions
 */

/* --- 0. SECTION BACKGROUND --- */
.blog-main {
    background-color: rgb(244, 245, 247); 
}

/* --- 1. TOOLBAR & FILTERS --- */
.toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 30px 0;
    border-bottom: 1px solid rgba(8, 24, 50, 0.1);
    margin-bottom: 40px;
}

.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cat-btn {
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    color: var(--color-black);
    border: 1.5px solid rgba(8, 24, 50, 0.15);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cat-btn.active, 
.cat-btn:hover,
.cat-btn:focus-visible {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
    outline: none;
}

.search-wrap {
    position: relative;
    width: 100%;
}

.search-wrap input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 100px;
    border: 1.5px solid rgba(8, 24, 50, 0.15);
    background: var(--color-white);
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--color-black);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap input:focus {
    outline: none;
    border-color: var(--color-yellow);
    box-shadow: 0 0 0 3px rgba(253, 211, 44, 0.2);
}

.search-wrap svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(8, 24, 50, 0.4);
}

/* --- 2. GRID LAYOUTS (Mobile First) --- */
.featured-post {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--color-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    margin-bottom: 40px;
    position: relative; 
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}

/* Mobile height enforcement so the absolute image functions */
.featured-post .featured-img {
    min-height: 260px;
    width: 100%;
    position: relative;
}

/* Mobile padding for the featured content */
.featured-content {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.blog-card {
    background: var(--color-white);
    border-radius: 16px;
    border: 1px solid rgba(8, 24, 50, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s;
    will-change: transform, opacity; 
}

/* --- 3. THE OVERLAY LINK --- */
.card-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: block;
}

/* --- 4. HOVER INTERACTIONS --- */
.featured-post:hover,
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(8, 24, 50, 0.08);
    border-color: rgba(8, 24, 50, 0.15);
}

.featured-post:hover .arrow-icon,
.blog-card:hover .arrow-icon {
    background: var(--color-yellow) !important;
    border-color: var(--color-yellow) !important;
}

.featured-post:hover .arrow-icon svg,
.blog-card:hover .arrow-icon svg {
    transform: translateX(2px) scale(1.1);
}

.card-click-overlay:focus-visible {
    outline: 3px solid var(--color-yellow);
    outline-offset: 4px;
    border-radius: inherit; 
}

/* --- 5. RESPONSIVE PAGINATION (Mobile First) --- */
.pagination-area {
    text-align: center;
    padding-top: 30px !important;
    padding-bottom: 0px !important;
}

/* --- 6. SCALING UP (Desktop Math) --- */
@media (min-width: 768px) {
    .toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .search-wrap {
        width: 300px;
    }
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pagination-area {
        padding-top: 40px !important;
    }
}

@media (min-width: 992px) {
    .featured-post {
        grid-template-columns: 1.2fr 1fr;
        margin-bottom: 80px;
    }
    
    /* On Desktop, the image stretches naturally to match the text column */
    .featured-post .featured-img {
        min-height: 100%;
        height: 100%;
    }

    .featured-content {
        padding: 60px 50px; 
    }

    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* JS Animation Class */
@keyframes slideIn {
    to { opacity: 1; transform: translateY(0); }
}