/* --- PROJECTS PAGE CSS --- */

/* Hero Section */
.projects-hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); /* Premium slate gradient */
    padding: 60px 0;
    border-bottom: 1px solid #cbd5e1;
}

.projects-hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: #0c0e1b;
    letter-spacing: -1px;
}

.projects-hero-desc {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: #4a4a52;
    max-width: 750px;
    line-height: 1.6;
}

/* Category Tabs (Pill Style) */
.projects-tabs {
    gap: 12px;
}
.projects-tabs .nav-link {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #4a4a52;
    background-color: transparent;
    border: 1px solid #ced4da;
    border-radius: 50px;
    padding: 10px 30px;
    transition: all 0.3s ease;
}
.projects-tabs .nav-link:hover {
    border-color: #0c0e1b;
    color: #0c0e1b;
}
.projects-tabs .nav-link.active {
    background-color: #0c0e1b;
    border-color: #0c0e1b;
    color: #ffffff;
}

/* --- GRID OVERRIDES --- */
.projects-grid .testi-card,
.projects-grid .b2b-project-card {
    width: 100% !important; 
    max-width: none; /* Let it stretch naturally in the col-lg-4 grid */
    margin: 0 auto; 
    aspect-ratio: 5 / 5; 
    height: auto !important; 
}

/* Base override to ensure text doesn't overflow on large screen grid views */
.projects-grid .b2b-project-overlay,
.projects-grid .testi-quote-overlay {
    height: auto; 
}

/* --- MOBILE RESPONSIVE TWEAKS --- */
@media (max-width: 991.98px) {
    /* Hero Adjustments */
    .projects-hero-section {
        padding: 30px 0;
    }
    .projects-hero-title {
        font-size: 32px;
    }
    .projects-hero-desc {
        font-size: 14px;
        padding: 0 15px;
    }

    /* Tab Scrolling */
    .projects-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow: visible;
        justify-content: center;
        align-items: stretch;
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }
    .projects-tabs .nav-item {
        flex: 1 1 0;
        min-width: 0;
    }
    .projects-tabs .nav-link {
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
        padding: 8px 10px;
        border-radius: 999px;
        line-height: 1.1;
    }
    
    /* Auto-show the Residential Quotes on Mobile (Matches C&I logic) */
    .projects-grid .testi-quote-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(12, 14, 27, 0.95) 0%, rgba(12, 14, 27, 0.3) 60%, rgba(12, 14, 27, 0) 100%);
        padding-top: 60px;
    }
    .projects-grid .testi-info-default {
        display: none; /* Hide default title to prevent overlapping */
    }
    .projects-grid .testi-card,
.projects-grid .b2b-project-card {
    aspect-ratio: 3 / 4; 
}
}

.project-empty-msg {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #4a4a52;
    text-align: center;
    padding: 48px 16px;
    width: 100%;
}

.res-projects-swiper:has(.project-empty-msg) + .res-controls-wrapper,
.b2b-projects-swiper:has(.project-empty-msg) + .b2b-controls-wrapper {
    display: none !important;
}
