.projects-hero {
    background-image: url('https://images.unsplash.com/photo-1617280137702-32e761be8b26?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NXx8Z3Jhc3MlMjBmaWVsZHxlbnwwfHwwfHx8MA%3D%3D&w=1000&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.projects-hero-highlight {
    color: #f3b638;
}

/* Horizontal project filters bar (match publications filter style) */
.project-filters {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgb(233, 231, 231);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.project-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    align-items: flex-end;
}

.project-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 0.5rem;
    text-align: left;
    line-height: 1.2;
}

.project-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Project cards grid */
#projectsContainer {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    row-gap: 1rem;
}

#projectsContainer>[class*='col-'] {
    padding: 0 10px;
}

.project-card {
    height: 100%;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease; */
    margin-bottom: 1rem;
    border: 1px solid rgb(230, 224, 224);
}

.project-img {
    position: relative;
    padding-top: 65%;
    overflow: hidden;
    border-radius: 0;
}

.project-img__media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 0;
}

.project-card:hover {
    /* transform: translateY(-5px); */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project-img {
    position: relative;
    padding-top: 65%;
    overflow: hidden;
}

.project-img__media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* 
.project-card:hover .project-img__media {
    transform: scale(1.05);
} */

.project-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-content {
    padding: 20px;
    background: white;
}

.project-header {
    margin-bottom: 12px;
}

.project-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 2px 0;
}

.project-duration {
    color: #718096;
    font-size: 0.85rem;
    margin: 0 0 5px 0;
    margin-bottom: 0.8em;
    line-height: 1.3;
    font-weight: 400;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: #4a5568;
}

.project-meta>div {
    flex: 1;
    min-width: 120px;
}

.project-meta strong {
    display: block;
    color: #718096;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    #projectsContainer {
        row-gap: 20px;
    }

    #projectsContainer>[class*='col-'] {
        padding: 0 8px;
    }

    .project-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 767.98px) {
    #projectsContainer {
        margin: 0 -5px;
        row-gap: 15px;
    }

    #projectsContainer>[class*='col-'] {
        padding: 0 5px;
    }

    .project-content {
        padding: 15px;
    }

    .project-meta {
        gap: 10px;
    }

    .project-meta>div {
        min-width: calc(50% - 10px);
    }
}

.project-filter-actions .btn {
    white-space: nowrap;
}

/* Project filter inputs - match publication filter style */
.project-filter-form .form-control {
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-height: 2.5rem;
    height: 2.5rem;
    box-sizing: border-box;
    line-height: 1.2;
    width: 100%;
    background-color: #fff;
    color: #4a4a4a;
}

.project-filter-form .form-control:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Project filter buttons - match publication filter buttons */
.project-filter-actions .btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
}

#applyFilterBtn {
    background: #1e3a8a;
    color: #fff;
}

#applyFilterBtn:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

#clearFilterBtn {
    background: #e5e7eb;
    color: #4a4a4a;
    border: none;
}

#clearFilterBtn:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

/* On medium/smaller screens, show exactly two filters per row, then one per row on very small screens */
@media (max-width: 992px) {
    .project-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .project-filters {
        padding: 0.75rem;
    }

    .project-filter-form {
        grid-template-columns: 1fr;
    }

    .project-filter-actions {
        width: 100%;
    }
}

.work-section form h5 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.work-section form label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: -1px;
}

.work-section .select2-container .select2-selection--multiple {
    min-height: 40px;
    border-radius: 8px;
    border-color: #ced4da;
    display: flex;
    align-items: center;
    padding-top: 2px;
    padding-bottom: 2px;
}

.work-section .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.work-section .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 0;
    font-size: 0.75rem;
}

.work-section .row .col-lg-12.mt-3 {
    margin-top: 0.75rem !important;
}

.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card {
    width: 100%;
    border-radius: 20px;
    /* subtle, tighter shadow */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    /* border: 1px solid rgb(29, 29, 29); */
    overflow: hidden;
    border: 0;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
    /* transform: translateY(-2px); */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.12);
}

/* Add some horizontal gap between filter column and cards column */
.work-section .col-lg-10 {
    padding-left: 2rem;
}

.project-img {
    position: relative;
    /* width: calc(100% - 32px); */
    height: 210px;
    /* border-radius: 18px; */

    margin: 0.2rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    background-color: #eaeaea;
    overflow: hidden;
}

.project-img__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-status-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 247, 204, 0.95);
    color: #000;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.project-content {
    padding: 0 24px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-header {
    min-height: 1em;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.project-title {
    color: #1f5134;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.35;
    margin: 0 3px 0 0;
    text-transform: capitalize;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    height: 2.6em;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    font-size: 12px;
    gap: 16px;
}

.project-meta div {
    flex: 1;
}

.project-meta strong {
    display: block;
    color: #000;
    font-size: 0.8rem;
}

.project-meta span {
    display: block;
    color: gray;
    font-size: 0.85rem;
    margin-top: 2px;
}

.projects-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.projects-empty-icon {
    font-size: 64px;
    color: #ccc;
}

.projects-error-icon {
    color: #dc3545;
}

.projects-spinner {
    color: #198754;
}

/* Fine-tune Projects filter width between col-2 and col-3 on large screens */
@media (min-width: 992px) {
    .work-section .col-lg-3.p-0 {
        flex: 0 0 22%;
        max-width: 22%;
    }

    .work-section .col-lg-9 {
        flex: 0 0 78%;
        max-width: 78%;
    }
}

@media (max-width: 991.98px) {
    .work-section .col-lg-2 {
        margin-bottom: 1.5rem;
    }
}

/* Projects pagination (shared look with events/innovations) */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination .page-link {
    color: #28a745;
    border: 1px solid #28a745;
    cursor: pointer;
    padding: 8px 15px;
    margin: 0 3px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover:not(.disabled) {
    background-color: #28a745;
    color: #fff;
}

.pagination .page-item.active .page-link {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

@media (max-width: 767px) {
    .pagination .page-link {
        padding: 6px 12px;
        font-size: 0.9rem;
        margin: 0 2px;
    }
}