﻿/* ===== عنوان ===== */
.dgwin-title {
    text-align: center;
    color: #1a2a4a;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

    .dgwin-title span {
        font-weight: 700;
        background: rgba(255, 255, 255, 0.3);
        padding: 0.2rem 1.5rem;
        border-radius: 60px;
        backdrop-filter: blur(4px);
    }

/* ===== wrapper ===== */
.dgwin-grid {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.8rem;
}

/* ===== هر کارت ===== */
.dgwin-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    /* انیمیشن اسکرول */
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    animation: dgwinSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-play-state: paused;
}

    /* ===== عکس ===== */
    .dgwin-card .dgwin-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: filter 0.6s ease, transform 0.6s ease;
        filter: brightness(1) saturate(1);
        transform: scale(1);
    }

    /* ===== لایه شیشه‌ای ===== */
    .dgwin-card .dgwin-overlay {
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
        transition: background 0.5s ease, backdrop-filter 0.6s ease;
        pointer-events: none;
        border-radius: 2rem;
    }

    /* ===== باکس متن ===== */
    .dgwin-card .dgwin-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.8);
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 0.9rem 2rem;
        border-radius: 3rem;
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
        color: #1a2639;
        font-size: 1.1rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        white-space: nowrap;
        opacity: 0;
        transition: opacity 0.5s ease 0.1s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
        pointer-events: none;
        z-index: 10;
    }

/* ===== حالت هاور (دسکتاپ) ===== */
@media (hover: hover) {
    .dgwin-card:hover .dgwin-img {
        filter: brightness(0.65) saturate(0.8);
        transform: scale(1.05);
    }

    .dgwin-card:hover .dgwin-overlay {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .dgwin-card:hover .dgwin-text {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .dgwin-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    }
}

/* ===== حالت کلیک (موبایل/تبلت) ===== */
.dgwin-card:active .dgwin-img {
    filter: brightness(0.6) saturate(0.7);
    transform: scale(1.05);
}

.dgwin-card:active .dgwin-overlay {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.dgwin-card:active .dgwin-text {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== انیمیشن اسکرول ===== */
@keyframes dgwinSlideUp {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== تاخیرهای دونه‌دونه ===== */
.dgwin-card:nth-child(1) {
    animation-delay: 0.05s;
}

.dgwin-card:nth-child(2) {
    animation-delay: 0.12s;
}

.dgwin-card:nth-child(3) {
    animation-delay: 0.19s;
}

.dgwin-card:nth-child(4) {
    animation-delay: 0.26s;
}

.dgwin-card:nth-child(5) {
    animation-delay: 0.33s;
}

.dgwin-card:nth-child(6) {
    animation-delay: 0.40s;
}

.dgwin-card:nth-child(7) {
    animation-delay: 0.47s;
}

.dgwin-card:nth-child(8) {
    animation-delay: 0.54s;
}

/* ============================================ */
/* ===== ریسپانسیو: موبایل ۲ ستون ===== */
/* ============================================ */
@media (max-width: 768px) {
    .dgwin-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 600px;
    }

    .dgwin-card .dgwin-text {
        font-size: 0.9rem;
        padding: 0.5rem 1.2rem;
        white-space: nowrap;
    }

    .dgwin-card {
        border-radius: 1.5rem;
    }

        .dgwin-card .dgwin-overlay {
            border-radius: 1.5rem;
        }

    body {
        padding: 1rem 0.8rem;
    }

    .dgwin-title {
        font-size: 1.5rem;
        margin-bottom: 1.8rem;
    }
}

/* ===== موبایل خیلی کوچک ===== */
@media (max-width: 420px) {
    .dgwin-grid {
        gap: 0.7rem;
        max-width: 400px;
    }

    .dgwin-card .dgwin-text {
        font-size: 0.75rem;
        padding: 0.4rem 0.9rem;
        white-space: nowrap;
    }

    .dgwin-card {
        border-radius: 1rem;
    }

        .dgwin-card .dgwin-overlay {
            border-radius: 1rem;
        }

    .dgwin-title {
        font-size: 1.2rem;
    }
}

/* ===== تبلت و دسکتاپ: ۴ ستون ===== */
@media (min-width: 769px) {
    .dgwin-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.8rem;
    }

    .dgwin-card .dgwin-text {
        font-size: 1.1rem;
        padding: 0.8rem 1.8rem;
    }
}

/* ===== نمایشگرهای بزرگ ===== */
@media (min-width: 1400px) {
    .dgwin-grid {
        gap: 2.5rem;
    }

    .dgwin-card .dgwin-text {
        font-size: 1.3rem;
        padding: 1rem 2.5rem;
    }
}

/* ===== دسترسی ===== */
.dgwin-card:focus-visible {
    outline: 3px solid #2b5b8a;
    outline-offset: 4px;
}

/* ===== حالت کلیک لمسی ===== */
.dgwin-card.dgwin-tap .dgwin-img {
    filter: brightness(0.6) saturate(0.7);
    transform: scale(1.05);
}

.dgwin-card.dgwin-tap .dgwin-overlay {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.dgwin-card.dgwin-tap .dgwin-text {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
