.works-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.work-item {
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.work-item:hover {
    transform: scale(1.03);
}

.work-item img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content.modal-bg-image {
    background-image: url('../img/project/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.modal-bg-image2 {
    background-image: url('../img/project/bg2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.modal-bg-image3 {
    background-image: url('../img/project/bg3.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.modal-content {
    position: relative;
    background-color: rgba(255, 255, 255, 0.85);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 80%;
    max-width: 700px;
    text-align: center;
}

.modal-content h3,
.modal-content p,
.modal-features {
    color: #ffffff;
}

.modal-content img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

.modal-gallery {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 1rem 0;
    justify-content: flex-start;
    scroll-snap-type: x mandatory;
}

.modal-gallery img {
    height: 200px;
    width: auto;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: contain;
    scroll-snap-align: center;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.modal-features {
    text-align: left;
    margin-top: 1rem;
}

.modal-features h4 {
    margin-bottom: 0.5rem;
}

.modal-features ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.modal-features li {
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

/* ===== スマホ対応レスポンシブ ===== */
@media (max-width: 768px) {
    .works-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .work-item {
        padding: 1rem;
    }

    .work-item img {
        max-height: 180px;
    }

    .modal-content {
        width: 90%;
        padding: 1.5rem;
    }

    .modal-content img {
        max-height: 300px;
    }

    .modal-gallery img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .work-item img {
        max-height: 150px;
    }

    .modal-content {
        padding: 1rem;
    }

    .modal-content img {
        max-height: 250px;
    }

    .modal-gallery img {
        height: 120px;
    }

    .modal-features li {
        font-size: 0.85rem;
    }
}