/* ==========================================================================
   استایل پرمیوم شبکه نمونه‌کارها - ویراورک (نسخه‌ی فوق‌العاده)
   ========================================================================== */

.nmk-grid {
    direction: rtl;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    margin: 36px 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* کارت بیرونی: همین باکس، تنه‌ی قاب گرادیانی/نئونی رو تشکیل می‌ده */
.nmk-card {
    position: relative;
    border-radius: 22px;
    padding: 2px; /* ضخامت قاب دور کارت */
    background: #e6e9ef; /* حالت عادی: یک قاب نازک خاکستری روشن */
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    animation: nmk-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.nmk-grid .nmk-card:nth-child(1) { animation-delay: 0.05s; }
.nmk-grid .nmk-card:nth-child(2) { animation-delay: 0.12s; }
.nmk-grid .nmk-card:nth-child(3) { animation-delay: 0.19s; }
.nmk-grid .nmk-card:nth-child(4) { animation-delay: 0.26s; }
.nmk-grid .nmk-card:nth-child(5) { animation-delay: 0.33s; }
.nmk-grid .nmk-card:nth-child(6) { animation-delay: 0.4s; }

@keyframes nmk-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* گرادیان متحرک نئونی که هنگام هاور به‌عنوان قاب، دور تا دور کارت ظاهر می‌شود */
.nmk-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: linear-gradient(135deg, #6a5cff, #2f6fed, #22c1c3, #ff6b9d, #6a5cff);
    background-size: 300% 300%;
    animation: nmk-gradient-shift 5s ease infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

/* هاله‌ی نوری نئونی که پشت کارت پخش می‌شود */
.nmk-card::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 26px;
    background: linear-gradient(135deg, #6a5cff, #2f6fed, #22c1c3, #ff6b9d);
    filter: blur(26px);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.nmk-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(47, 111, 237, 0.25),
                0 10px 24px rgba(15, 23, 42, 0.14);
}

.nmk-card:hover::before { opacity: 1; }
.nmk-card:hover::after  { opacity: 0.4; }

@keyframes nmk-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* جعبه‌ی سفید داخلی: محتوای واقعی کارت، روی قاب می‌نشیند و فقط به اندازه padding کارت، قاب را نمایان می‌گذارد */
.nmk-card-inner {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ---------------- تصویر ---------------- */

.nmk-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #eef1f5, #e2e8f5);
}

.nmk-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.7s ease;
}

.nmk-card:hover .nmk-card-img img {
    transform: scale(1.12) rotate(0.4deg);
    filter: saturate(1.2) brightness(1.04);
}

/* افکت درخشش نوری که روی عکس رد می‌شود */
.nmk-card-img::after {
    content: '';
    position: absolute;
    top: 0;
    right: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: skewX(-20deg);
    transition: right 1s ease;
    pointer-events: none;
    z-index: 2;
}

.nmk-card:hover .nmk-card-img::after {
    right: 130%;
}

/* ---------------- بدنه کارت ---------------- */

.nmk-card-body {
    position: relative;
    padding: 24px 26px 28px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #ffffff;
}

/* بج شیشه‌ای (Glassmorphism) دسته‌بندی */
.nmk-card-cat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    color: #2f4dd6;
    background: linear-gradient(90deg, rgba(47, 111, 237, 0.12), rgba(106, 92, 255, 0.12));
    backdrop-filter: blur(6px);
    border: 1px solid rgba(47, 111, 237, 0.18);
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    letter-spacing: 0.2px;
}

.nmk-card-cat::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2f6fed, #6a5cff);
    box-shadow: 0 0 8px rgba(47, 111, 237, 0.7);
    flex-shrink: 0;
    animation: nmk-pulse 1.8s ease-in-out infinite;
}

@keyframes nmk-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(1.3); }
}

.nmk-card-title {
    font-size: 21px;
    font-weight: 800;
    color: #12141a;
    margin: 0 0 11px;
    line-height: 1.7;
    transition: all 0.4s ease;
}

.nmk-card:hover .nmk-card-title {
    background: linear-gradient(90deg, #2f6fed, #6a5cff, #22c1c3);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: nmk-text-shine 2.5s linear infinite;
}

@keyframes nmk-text-shine {
    to { background-position: -200% center; }
}

.nmk-card-desc {
    font-size: 14.5px;
    font-weight: 400;
    color: #667085;
    line-height: 2;
    margin: 0;
}

/* ---------------- ریسپانسیو ---------------- */

@media (max-width: 480px) {
    .nmk-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .nmk-card:hover {
        transform: translateY(-6px) scale(1);
    }
}
