﻿

/* grid gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 15px;
    padding: 30px;
}

@media(max-width:1000px) {
    .gallery {
        grid-template-columns: repeat(3,1fr);
    }
}

@media(max-width:700px) {
    .gallery {
        grid-template-columns: repeat(2,1fr);
    }
}

@media(max-width:450px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

.item {
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
}

    .item img {
        width: 100%;
        height: 220px;
        object-fit: contain;
        transition: .4s;
    }

    /* hover effect */
    .item:hover img {
        transform: scale(1.1);
        filter: brightness(.8);
    }

    /* overlay small label */
    .item::after {
        content: "برای مشاهده روی عکس کلیک کنید";
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(0,0,0,.5);
        padding: 5px 10px;
        font-size: 12px;
        border-radius: 8px;
        opacity: 0;
        transition: .3s;
        color: white;
    }

    .item:hover::after {
        opacity: 1;
    }

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

    .modal img {
        max-width: 85%;
        max-height: 85%;
        border-radius: 18px;
        transform: scale(.6);
        opacity: 0;
        transition: .3s ease;
        box-shadow: 0 0 40px rgba(0,0,0,.6);
    }

    /* active state */
    .modal.show {
        display: flex;
    }

        .modal.show img {
            transform: scale(1);
            opacity: 1;
        }

/* close button */
.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #fff;
}


