/**
 * Projects Gallery - Grid + Modal
 */

#main-content .container::before {
    content: none;
}
.project-category-section:not(:last-of-type) {
    margin-top: 42px;
    margin-bottom: 42px;
    padding-bottom: 42px;
    border-bottom: 5px solid rgba(131, 173, 154, 0.13);
}

.project-category-section:last-of-type {
    margin-bottom: 100px;
}

.project-category-section__title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 25px;
    color: #1f1f1f;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-category-section__title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: #9ca183;
    margin-top: 6px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.project-card {
    cursor: pointer;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.project-card:hover,
.project-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
    outline: none;
}

.project-card__image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f2f2f2;
}

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

.project-card__placeholder {
    width: 100%;
    height: 100%;
    background: #efefe9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.project-card__placeholder img {
    max-width: 55%;
    max-height: 55%;
    object-fit: contain;
    opacity: 0.8;
}

.project-card__body {
    padding: 16px 18px;
}

.project-card__title {
    font-size: 1.1rem;
    margin: 0 0 6px;
}

.project-card__categories {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.projects-pagination {
    margin-top: 30px;
    text-align: center;
}

.projects-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
}

.projects-pagination .page-numbers.current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Modal */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.project-modal.is-open {
    display: block;
}

.project-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.project-modal__dialog {
    position: relative;
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 6px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1;
}

.project-modal__close {
    position: absolute;
    top: 0px;
    right: 0px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}
#project-modal-title {
    font-size: 2.5rem;
    line-height: 1.1em;
}
.project-modal__content {
    padding: 30px;
}

.project-modal__loading {
    text-align: center;
    padding: 40px 0;
}

.project-modal__featured-image {
    position: relative;
    width: 100%;
    height: 80vh;
    max-height: 700px;
    overflow: hidden;
}

.project-modal__featured-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.project-modal__featured-image img.img-placeholder {
    object-fit: contain;
    opacity: 0.8;
}

.project-modal__categories {
    color: #777;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    margin: 0 0 10px;
}

body.modal-open {
    overflow: hidden;
}
