﻿/* ========== گالری با CSS Grid ========== */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 15px;
    grid-auto-flow: dense;
}

/* آیتم‌های گالری */
.grid-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: block;
    text-decoration: none;
    color: inherit;
}

    .grid-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    }

    .grid-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

    .grid-item:hover img {
        transform: scale(1.08);
    }

    /* کاور روی عکس */
    .grid-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 60%);
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 1;
    }

    .grid-item:hover::before {
        opacity: 1;
    }

/* متن روی عکس */
.item-overlay {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    padding: 20px;
    color: white;
    z-index: 2;
    transition: bottom 0.3s ease;
    text-align: center;
}

.grid-item:hover .item-overlay {
    bottom: 0;
}

.item-overlay h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.item-overlay p {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* ========== تعیین ابعاد مختلف برای عکس‌ها ========== */

/* عرض 2 برابر (افقی بزرگ) */
.grid-item--width2 {
    grid-column: span 2;
}

/* ارتفاع 2 برابر (عمودی بزرگ) */
.grid-item--height2 {
    grid-row: span 2;
}

/* عرض و ارتفاع 2 برابر (مربع بزرگ) */
.grid-item--large {
    grid-column: span 2;
    grid-row: span 2;
}

/* ========== ریسپانسیو ========== */
@media (max-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 180px;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
        gap: 10px;
    }

    .mt-on-mobile {
        margin-top: 10rem !important;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 130px;
        gap: 8px;
    }

    .item-overlay h3 {
        font-size: 0.8rem;
    }

    .item-overlay p {
        font-size: 0.65rem;
    }
}

