/* ============================================================
   MON TEX GRASS — Projects Page Styles
   ============================================================ */

/* ============================================================
   ۱) Hero صفحه نمونه کارها
   ============================================================ */
.page-hero-projects::before {
    background-image: url('../images/hero-projects.jpg');
    /* اگر تصویر ندارید، این خط را حذف کنید تا رنگ سبز نمایش داده شود */
}

/* ============================================================
   ۲) گالری نمونه کارها
   ============================================================ */
.projects-gallery {
    background: var(--bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 16px;
    width: 100%;
}

.gallery-item {
    margin: 0;
    padding: 0;
    min-width: 0;
    transition: transform .3s ease;
}

.gallery-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(18, 82, 40, .08);
    transition: transform .3s ease, box-shadow .3s ease;
    aspect-ratio: 4 / 3;
}

.gallery-item:hover .gallery-btn {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(18, 82, 40, .18);
}

.gallery-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.gallery-item:hover .gallery-btn img {
    transform: scale(1.08);
}

/* لایه روی تصویر */
.gallery-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg,
            rgba(10, 40, 20, 0) 0%,
            rgba(10, 40, 20, .15) 50%,
            rgba(10, 40, 20, .75) 100%);
    opacity: 0;
    transition: opacity .3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-zoom {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--green-dark);
    display: grid;
    place-items: center;
    transform: scale(0.7);
    transition: transform .3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.gallery-item:hover .gallery-zoom {
    transform: scale(1);
}

/* کپشن پایین */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
    transform: translateY(100%);
    transition: transform .3s ease;
    background: linear-gradient(180deg, transparent, rgba(10, 40, 20, .9));
    pointer-events: none;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* دکمه "بیشتر" */
.gallery-load-more {
    text-align: center;
    margin-top: 32px;
}

/* ============================================================
   ۳) بخش آمار و اعتماد
   ============================================================ */
.projects-stats {
    background: var(--white);
}

/* ============================================================
   ۴) فرآیند همکاری
   ============================================================ */
.projects-process {
    background: var(--bg);
}

/* ============================================================
   ۵) Lightbox
   ============================================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 15, 10, .95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    user-select: none;
}

.lightbox-caption {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    padding: 8px 20px;
    background: rgba(0, 0, 0, .35);
    border-radius: 20px;
    max-width: 90vw;
    overflow-wrap: anywhere;
}

/* دکمه‌های ناوبری */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, .12);
    border: 1.5px solid rgba(255, 255, 255, .25);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: background .25s ease, transform .25s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, .25);
    transform: scale(1.08);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 22px;
    font-weight: 300;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    padding-bottom: 6px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.08);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* شمارنده */
.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    background: rgba(0, 0, 0, .4);
    padding: 6px 18px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    direction: rtl;
}

/* ============================================================
   ۶) ریسپانسیو
   ============================================================ */

/* موبایل بزرگ — ۲ ستونه */
@media (min-width: 380px) and (max-width: 639px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* تبلت */
@media (min-width: 640px) and (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }
}

/* دسکتاپ */
@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 16px;
    }
}

/* موبایل کوچک */
@media (max-width: 480px) {
    .gallery-grid {
        gap: 8px;
    }

    .gallery-zoom {
        width: 44px;
        height: 44px;
    }

    .gallery-zoom svg {
        width: 22px;
        height: 22px;
    }

    .gallery-caption {
        font-size: 11px;
        padding: 8px 10px;
    }

    .lightbox {
        padding: 50px 12px;
    }

    .lightbox-close {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
        font-size: 18px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 42px;
        height: 42px;
        font-size: 28px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-content img {
        max-height: calc(100vh - 140px);
    }

    .lightbox-caption {
        font-size: 13px;
    }

    .lightbox-counter {
        font-size: 12px;
        padding: 5px 14px;
        bottom: 16px;
    }
}

/* موبایل خیلی کوچک */
@media (max-width: 379px) {
    .gallery-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
}
/* ============================================================
   نمایش تصاویر Thumbnail — با blur placeholder
   ============================================================ */
.gallery-btn img {
    /* پس‌زمینه سبز کم‌رنگ هنگام لود شدن thumbnail */
    background-color: #eaf7ee;
    background-image:
        repeating-linear-gradient(45deg, rgba(30, 122, 60, .04) 0 8px, transparent 8px 16px);
    transition: opacity .3s ease, transform .5s ease;
}

/* وقتی تصویر لود شد، پس‌زمینه محو می‌شود */
.gallery-btn img.loaded {
    background: none;
}

/* در Lightbox، تصویر اصلی با fade-in نرم */
.lightbox-content img {
    transition: opacity .3s ease;
}