/* List view — project cards grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}
.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
}
.project-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f4f4f4;
    overflow: hidden;
}
.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.project-card-noimage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}
.project-card-title {
    padding: 12px 15px;
    font-size: 17px;
    font-weight: 600;
    color: var(--blue);
}

/* Detail view */
.project-back {
    margin-bottom: 15px;
}
.project-back a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}
.project-back a:hover {
    text-decoration: underline;
}
.project-detail h1 {
    color: var(--blue);
    margin-bottom: 15px;
}
.project-detail-description {
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 16px;
}
.project-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}
.project-detail-gallery-item {
    display: block;
    border-radius: 6px;
    overflow: hidden;
}
.project-detail-gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}
.project-detail-gallery-item:hover img {
    transform: scale(1.03);
}

@media (max-width: 576px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-detail-gallery {
        grid-template-columns: 1fr;
    }
    .project-detail-gallery-item img {
        height: 220px;
    }
}

/* Lightbox modal */
.project-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 30px;
}
.project-modal.is-open {
    display: flex;
    animation: projectModalFade 0.15s ease-out;
}
@keyframes projectModalFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.project-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    background: #111;
}
.project-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease;
}
.project-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}
