/* ============================================
   BLOG LISTING SECTION - COMPLETE STYLES
   ============================================ */

.blog-listing-section {
    width: 100%;
    padding: 60px 0;
    background: var(--graphite);
    min-height: 100vh;
}

.blog-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.mobile-sidebar-trigger {
    display: none; /* Hidden on desktop */
}

.btn-sidebar-toggle {
    width: 100%;
    padding: 14px 20px;
        background: rgba(26, 26, 25, 0.654);
    border: 1px solid var(--border-light);
    color: var(--liquid-gold);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-sidebar-toggle:hover {
    background: var(--graphite);
    border-bottom-color: var(--liquid-gold);
}
.blog-sidebar {
    position: sticky;
    top: 100px; /* Adjust based on your header height */
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.blog-sidebar::-webkit-scrollbar {
    width: 4px;
}

.blog-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.blog-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.sidebar-widget {
    margin-bottom: 35px;
    opacity: 0;
    transform: translateY(20px);
}

.widget-title {
    color: var(--text-primary);
    font-family: var(--heading-font);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-title i {
    color: var(--molten-orange);
    font-size: 1.1rem;
}
/* Mobile Header Inside Sidebar */
.sidebar-header-mobile {
    display: none; /* Hidden on desktop */
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.mobile-title {
    color: var(--text-primary);
    font-family: var(--heading-font);
    font-size: 1.2rem;
    font-weight: 700;
}

#closeSidebarMobile {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#closeSidebarMobile:hover {
    background: var(--molten-orange);
    color: white;
    border-color: var(--molten-orange);
}
/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--liquid-gold);
    background: rgba(255, 255, 255, 0.08);
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-btn {
    padding: 12px 16px;
    background: var(--liquid-gold);
    border: none;
    border-radius: 8px;
    color: var(--graphite);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--molten-orange);
    transform: scale(1.05);
}

.search-results-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 20px;
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
    transform: translateX(5px);
}

.category-item.active {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--liquid-gold);
}

.category-item span:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.category-item .count {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.category-item.active .count {
    background: var(--liquid-gold);
    color: var(--graphite);
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--liquid-gold);
    color: var(--liquid-gold);
    transform: translateY(-2px);
}

.tag-item.active {
    background: var(--liquid-gold);
    border-color: var(--liquid-gold);
    color: var(--graphite);
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT STYLES
   ============================================ */

.blog-content {
    min-width: 0;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.header-left h1 {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-weight: 800;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-light);
}

.toggle-btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: var(--text-primary);
}

.toggle-btn.active {
    background: var(--liquid-gold);
    color: var(--graphite);
    font-weight: 600;
}

/* Sort Dropdown */
.sort-dropdown select {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1); /* Increased opacity for better visibility */
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove default browser styling */
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E"); /* Custom dropdown arrow */
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px; /* Space for arrow */
}

.sort-dropdown select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--liquid-gold);
}

.sort-dropdown select:focus {
    outline: none;
    border-color: var(--liquid-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1); /* Add focus ring */
}

/* Style the options for better visibility */
.sort-dropdown select option {
    background: var(--graphite);
    color: var(--text-primary);
    padding: 10px;
}

/* Active Filters */
.active-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 6px 12px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--liquid-gold);
    border-radius: 20px;
    color: var(--liquid-gold);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tag .remove-filter {
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.filter-tag .remove-filter:hover {
    opacity: 1;
}

.clear-all-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-btn:hover {
    border-color: var(--molten-orange);
    color: var(--molten-orange);
}

/* ============================================
   BLOG POSTS CONTAINER
   ============================================ */

.blog-posts-container {
    min-height: 400px;
}

/* GRID VIEW */
.blog-posts-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.blog-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    position: relative;
}

.card-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    text-decoration: none;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--liquid-gold);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 106, 0, 0.2));
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.placeholder-img i {
    font-size: 3rem;
    color: var(--liquid-gold);
    opacity: 0.5;
}

.blog-card:hover .card-image img {
    transform: scale(1.1);
}

.card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    background: rgba(212, 175, 55, 0.9);
    color: var(--graphite);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
}

.card-content {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.card-title {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
    font-weight: 700;
    transition: color 0.3s ease;
}

.blog-card:hover .card-title {
    color: var(--liquid-gold);
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.card-date, .card-read-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-date i, .card-read-time i {
    color: var(--molten-orange);
}

/* LIST VIEW */
.blog-posts-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-posts-container.list-view .blog-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
}

.blog-posts-container.list-view .card-image {
    width: 280px;
    height: 100%;
    min-height: 220px;
}

.blog-posts-container.list-view .card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-posts-container.list-view .card-excerpt {
    -webkit-line-clamp: 2;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
}

.page-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--liquid-gold);
    border-color: var(--liquid-gold);
    color: var(--graphite);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-number:hover {
    border-color: var(--liquid-gold);
    color: var(--liquid-gold);
}

.page-number.active {
    background: var(--liquid-gold);
    border-color: var(--liquid-gold);
    color: var(--graphite);
    font-weight: 700;
}

/* ============================================
   NO RESULTS & ERROR STATES
   ============================================ */

.no-results, .error-message {
    text-align: center;
    padding: 80px 20px;
}

.no-results i {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-bottom: 20px;
}

.no-results h3 {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0 0 25px 0;
}

.reset-btn {
    padding: 12px 24px;
    background: var(--liquid-gold);
    border: none;
    border-radius: 8px;
    color: var(--graphite);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: var(--molten-orange);
    transform: translateY(-2px);
}

.error-message {
    color: var(--molten-orange);
    font-size: 1.2rem;
    font-weight: 600;
}
.unified-split-footer-gap {
    height: 90vh;
}
/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .blog-container {
        grid-template-columns: 280px 1fr;
        gap: 30px;
        padding: 0 30px;
    }
    
    .blog-posts-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-container {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    
    .blog-sidebar {
        position: relative;
        top: 0;
        height: auto;
        overflow-y: visible;
        padding-right: 0;
        margin-bottom: 30px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .header-left h1 {
        font-size: 2rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .blog-posts-container.list-view .blog-card {
        grid-template-columns: 1fr;
    }
    
    .blog-posts-container.list-view .card-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .blog-posts-container.grid-view {
        grid-template-columns: 1fr;
    }
    
    .view-toggle {
        display: none;
    }
    
    .page-numbers {
        display: none;
    }
}
@media (max-width: 768px) {
    .mobile-sidebar-trigger {
        display: block;
        margin-bottom: 20px;
        position: sticky;
        top: 7%;
        z-index: 999;
    }

    .blog-sidebar {
        /* Reset desktop styles */
        position: fixed; /* Force fixed positioning */
        top: 0;
        left: 0;
        width: 85%; /* Better for mobile than fixed px */
        max-width: 320px;
        height: 100vh;
        z-index: 10000; /* Higher than backdrop */
        background: var(--graphite);
        padding: 24px;
        border-right: 1px solid var(--border-light);
        
        /* Animation State */
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
        
        /* CRITICAL SCROLL FIXES */
        overflow-y: auto; 
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scrollbar-width: thin;
        scrollbar-color: var(--border-light) transparent;
        
        /* Ensure it sits above everything */
        isolation: isolate; 
    }

    /* Custom Scrollbar for Mobile Sidebar */
    .blog-sidebar::-webkit-scrollbar {
        width: 4px;
    }
    .blog-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }
    .blog-sidebar::-webkit-scrollbar-thumb {
        background: var(--border-light);
        border-radius: 2px;
    }

    .blog-sidebar.active {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar-header-mobile {
        display: flex;
    }

    /* Dark backdrop when sidebar is open */
    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 9999; /* Just below sidebar */
        backdrop-filter: blur(4px);
        animation: fadeIn 0.3s ease;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}