/* ==========================================================================
   ARCADIA — index page styles
   Extracted from templates/core/index.html
   ========================================================================== */

/* ===== NEXTGEN SLIDER =====
   گذر با ماسک، نه محو شدن: تصویرِ تازه با clip-path از یک لبه باز می‌شود و
   همزمان خودِ تصویر داخل ماسک از ۱.۱۸ به ۱ اسکیل می‌خورد. حاصلش این است که
   تصویر در حین باز شدن ماسک ثابت به نظر برسد — همان چیزی که گذر را «پرده‌ای»
   می‌کند نه «کشویی».
   قاب overflow: hidden است و همه‌ی کنترل‌ها داخلش‌اند، پس هیچ‌وقت روی بخش بعدی
   نمی‌افتد و صفحه فاصله‌ی جبرانی لازم ندارد. */
.ngs {
    --ngs-ease: cubic-bezier(0.76, 0, 0.24, 1);
    --ngs-wipe: 1s;
    position: relative;
    width: 100%;
    height: clamp(520px, 78vh, 780px);
    border-radius: 28px;
    overflow: hidden;
    background: #080d18;
    box-shadow: var(--sh-lg);
    margin-bottom: var(--section-gap);
    isolation: isolate;
    touch-action: pan-y;
}

.ngs-stage {
    position: absolute;
    inset: 0;
}

/* visibility (نه فقط شفافیت) لینک‌ها و دکمه‌های اسلایدهای پنهان را از ترتیب
   تب بیرون می‌برد. */
.ngs-slide {
    position: absolute;
    inset: 0;
    z-index: 1;
    visibility: hidden;
}

.ngs-slide.is-active { z-index: 3; visibility: visible; }

/* اسلاید در حال رفتن یک پله زیر اسلاید تازه می‌ماند تا ماسک روی چیزی باز شود،
   نه روی زمینه‌ی خالی. */
.ngs-slide.is-leaving { z-index: 2; visibility: visible; }

.ngs-mask {
    position: absolute;
    inset: 0;
    overflow: hidden;
    /* بسته: از سمت چپ. جهت «قبلی» را data-dir روی قاب برمی‌گرداند. */
    clip-path: inset(0 0 0 100%);
    transition: clip-path var(--ngs-wipe) var(--ngs-ease);
    will-change: clip-path;
}

.ngs[data-dir="prev"] .ngs-slide:not(.is-active):not(.is-leaving) .ngs-mask {
    clip-path: inset(0 100% 0 0);
}

.ngs-slide.is-active .ngs-mask { clip-path: inset(0 0 0 0); }

/* اسلاید در حال رفتن باز می‌ماند و برنمی‌گردد؛ وقتی کلاس حذف شود همان لحظه
   پنهان هم شده، پس بسته‌شدنِ بی‌انتقالش دیده نمی‌شود. */
.ngs-slide.is-leaving .ngs-mask {
    clip-path: inset(0 0 0 0);
    transition: none;
}

.ngs-media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 24%;
    background-color: #141c2f;
    transform: scale(1.18);
    transition: transform calc(var(--ngs-wipe) + 0.35s) var(--ngs-ease);
    will-change: transform;
}

.ngs-slide.is-active .ngs-media { transform: scale(1); }
.ngs-slide.is-leaving .ngs-media { transform: scale(1.07); }

/* وقتی هیچ اثری برگزیده نشده، تصویری برای نشان دادن نیست. */
.ngs-media-fallback {
    background-image: linear-gradient(135deg, #1e3a5f 0%, #0f172a 55%, #241a3e 100%);
}

/* دو گرادیان متقاطع: یکی سمت متن (راست، در چیدمان راست‌به‌چپ) و یکی پای قاب.
   کلیدواژه‌های گرادیان فیزیکی‌اند، پس `to left` از لبه‌ی راست شروع می‌شود. */
.ngs-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to left, rgba(5, 8, 16, 0.94) 0%, rgba(5, 8, 16, 0.64) 36%, rgba(5, 8, 16, 0.05) 76%),
        linear-gradient(to top, rgba(5, 8, 16, 0.96) 0%, rgba(5, 8, 16, 0.45) 28%, transparent 62%);
}

.ngs-body {
    position: absolute;
    z-index: 2;
    right: clamp(20px, 6vw, 76px);
    left: clamp(20px, 6vw, 76px);
    /* دُک پایین قاب نشسته؛ این فاصله جای آن را باز می‌گذارد. با رفتنِ کارت
       «بعدی» بلندترین چیز دُک یک کلید ۴۸px است، پس فاصله کمتر از قبل است. */
    bottom: clamp(100px, 13vh, 136px);
    max-width: min(640px, 86%);
    text-align: right;
}

/* قابِ حرکت: محتوا از پایینِ همین قاب بالا می‌آید. padding/margin قرینه برای آن
   است که کشیدگی و اعراب فارسی از بالا و پایین بریده نشود. */
.ngs-reveal {
    overflow: hidden;
    padding: 0.16em 0;
    margin: -0.16em 0;
}

.ngs-reveal > * {
    transform: translateY(115%);
    opacity: 0;
    transition: transform 0.85s var(--ngs-ease), opacity 0.5s linear;
}

.ngs-slide.is-active .ngs-reveal > * {
    transform: none;
    opacity: 1;
}

/* متن بعد از آنکه ماسک تا نیمه باز شد راه می‌افتد، پس روی زمینه‌ی خالی ظاهر
   نمی‌شود. */
.ngs-slide.is-active .ngs-reveal:nth-child(1) > * { transition-delay: 0.30s; }
.ngs-slide.is-active .ngs-reveal:nth-child(2) > * { transition-delay: 0.38s; }
.ngs-slide.is-active .ngs-reveal:nth-child(3) > * { transition-delay: 0.48s; }
.ngs-slide.is-active .ngs-reveal:nth-child(4) > * { transition-delay: 0.56s; }
.ngs-slide.is-active .ngs-reveal:nth-child(5) > * { transition-delay: 0.64s; }

.ngs-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 clamp(12px, 2vw, 18px);
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    font-family: 'diba', sans-serif;
    font-size: clamp(11px, 1.3vw, 13px);
    letter-spacing: 0.03em;
    color: #dbe6ff;
}

.ngs-kicker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gradient-1);
    box-shadow: 0 0 0 4px var(--accent-glow, rgba(59, 130, 246, 0.22));
}

.ngs-title {
    margin: 0 0 clamp(12px, 2vw, 18px);
    font-family: 'barf', sans-serif;
    font-weight: 700;
    font-size: clamp(30px, 6.4vw, 68px);
    line-height: 1.18;
    color: #fff;
    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* هر مشخصه چیپ خودش است تا در عرض کم پاکیزه بشکند، نه اینکه جداکننده‌ها آویزان
   بمانند. */
.ngs-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    margin-bottom: clamp(12px, 2vw, 18px);
}

.ngs-fact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    font-family: 'mosalas', sans-serif;
    font-size: clamp(11px, 1.25vw, 13px);
    color: rgba(255, 255, 255, 0.86);
    white-space: nowrap;
}

.ngs-fact svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0.9; }

.ngs-fact-rating {
    color: #fcd34d;
    background: rgba(252, 211, 77, 0.12);
    border-color: rgba(252, 211, 77, 0.32);
}

.ngs-fact-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    flex: 0 0 auto;
}

.ngs-fact-status[data-status="ongoing"] .ngs-fact-pulse {
    animation: ngsPulse 2s ease-in-out infinite;
}

.ngs-fact-status[data-status="completed"] .ngs-fact-pulse { background: #60a5fa; }
.ngs-fact-status[data-status="hiatus"] .ngs-fact-pulse    { background: #fbbf24; }
.ngs-fact-status[data-status="dropped"] .ngs-fact-pulse   { background: #f87171; }

@keyframes ngsPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70%      { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}

.ngs-desc {
    margin: 0 0 clamp(16px, 2.4vw, 26px);
    max-width: 56ch;
    font-family: 'mosalas', sans-serif;
    font-size: clamp(12.5px, 1.4vw, 15px);
    line-height: 2;
    color: rgba(233, 240, 255, 0.72);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ngs-cta {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(8px, 1.2vw, 14px);
}

.ngs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(11px, 1.5vw, 15px) clamp(18px, 2.6vw, 30px);
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    font-family: 'diba', sans-serif;
    font-size: clamp(12.5px, 1.4vw, 14.5px);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease),
                background var(--t-fast), border-color var(--t-fast), gap var(--t-med) var(--ease);
}

.ngs-btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* var(--gradient-1) و نه یک آبی ثابت، تا دکمه با تم‌های روشن و تیمی هم‌رنگ شود. */
.ngs-btn-primary {
    background: var(--gradient-1-deep);
    color: #fff;
    box-shadow: 0 10px 28px var(--accent-glow);
}

.ngs-btn-primary:hover {
    transform: translateY(-2px);
    gap: 12px;
    box-shadow: 0 16px 38px var(--accent-glow);
}

.ngs-btn-ghost {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(14px);
    color: #fff;
}

.ngs-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.ngs-save.is-saved {
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.45);
    color: #a7f3d0;
}

.ngs-save.is-saved svg { fill: currentColor; }

/* ===== کلیدهای بعدی و قبلی =====
   دو سرِ دُک پایین قاب و همیشه دیده می‌شوند. پیش‌تر فلش‌ها وسط ارتفاع شناور بودند
   و فقط روی هاور ظاهر می‌شدند؛ روی لمس هاوری وجود ندارد و کنترلی که دیده نشود
   کنترل نیست، پس حالا جای ثابت دارند. راست‌به‌چپ: «قبلی» راست، «بعدی» چپ — همان
   ترتیبی که در قالب آمده، بی‌نیاز به قاعده‌ی مکانی جدا. */
.ngs-arrow {
    flex: 0 0 auto;
    width: clamp(44px, 4.2vw, 48px);
    height: clamp(44px, 4.2vw, 48px);
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(10, 15, 30, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px);
    box-shadow: var(--sh-md);
    color: #fff;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast),
                transform var(--t-med) var(--ease);
}

.ngs-arrow:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: translateY(-3px);
}

.ngs-arrow:active { transform: translateY(-1px); }
.ngs-arrow svg { width: 50%; height: 50%; }

/* ===== دُک پایین ===== */
.ngs-dock {
    position: absolute;
    z-index: 5;
    bottom: clamp(20px, 3.2vh, 34px);
    right: clamp(20px, 6vw, 76px);
    left: clamp(20px, 6vw, 76px);
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.6vw, 18px);
}

/* نقطه‌ها فاصله‌ی بین دو کلید را پر می‌کنند و پرش مستقیم می‌دهند. */
.ngs-dots {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

/* دکمه‌ی ۲۸px با نقطه‌ی ۷px داخلش: هدف لمس بزرگ می‌ماند بدون آنکه نقطه درشت
   دیده شود. */
.ngs-dot {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: none;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.ngs-dot > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
    transition: background var(--t-fast), width var(--t-med) var(--ease),
                border-radius var(--t-med) var(--ease);
}

.ngs-dot:hover > span { background: rgba(255, 255, 255, 0.6); }

.ngs-dot.is-active > span {
    width: 22px;
    border-radius: 4px;
    background: #fff;
}

/* ===== نوار پیشرفت ===== */
.ngs-rail {
    position: absolute;
    z-index: 6;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.09);
}

/* عرض این را JS هر فریم می‌نویسد؛ transition فقط تأخیر می‌آورد و برگشت به صفر
   را به‌شکل سُر خوردن به عقب نشان می‌دهد. */
.ngs-rail-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--gradient-1);
}

.ngs-btn:focus-visible,
.ngs-arrow:focus-visible,
.ngs-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* کشیدن با ماوس: در حین درگ متن انتخاب نشود. */
.ngs.is-dragging { cursor: grabbing; user-select: none; }

@media (prefers-reduced-motion: reduce) {
    .ngs { --ngs-wipe: 0.01ms; }
    .ngs-media,
    .ngs-reveal > * { transition-duration: 0.01ms; }
    .ngs-slide.is-active .ngs-media { transform: none; }
    .ngs-slide.is-active .ngs-reveal > * { transform: none; }
    .ngs-slide.is-active .ngs-reveal > * { transition-delay: 0s; }
    .ngs-arrow:hover { transform: none; }
}

@media (max-width: 768px) {
    .ngs {
        height: clamp(460px, 68vh, 580px);
        border-radius: 22px;
    }

    .ngs-body {
        bottom: clamp(100px, 13.5vh, 130px);
        max-width: none;
    }

    .ngs-fact { padding: 6px 11px; }
    .ngs-desc { line-height: 1.9; }
}

@media (max-width: 560px) {
    /* در این عرض دُک فقط دو کلید دارد؛ نقطه‌ها با پنج اثر جا نمی‌شوند و سوایپ
       جایشان را می‌گیرد. */
    .ngs-dots { display: none; }
    .ngs-dock { justify-content: space-between; }
}

@media (max-width: 480px) {
    .ngs {
        height: clamp(420px, 74vh, 520px);
        border-radius: 18px;
    }

    .ngs-body {
        right: 16px;
        left: 16px;
        bottom: clamp(92px, 12.5vh, 116px);
    }

    .ngs-dock { right: 16px; left: 16px; }

    /* دو دکمه‌ی تمام‌عرض روی هم بهتر از دو دکمه‌ی تنگ کنار هم است و هرکدام از
       هدف لمس ۴۴px رد می‌شود. */
    .ngs-cta { gap: 8px; }
    .ngs-btn {
        flex: 1 1 140px;
        justify-content: center;
        padding: 12px 18px;
    }
}

@media (max-width: 380px) {
    .ngs { height: clamp(400px, 72vh, 480px); }
}

/* Section heads and "بیشتر" links are shared (core/layout.css); the arrow icon
   inside the link is the only page-level tweak. */
.section-link svg { width: 14px; height: 14px; }
/* Rails, grids and card geometry live in components/manga-grid.css and
   components/manga-card.css — this page deliberately defines none of them.
   The latest-uploads feed is now components/upload-card.css. */
.genres-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
}
.genre-card-link {
    position: relative;
    min-width: 100px;
    padding: 14px 24px;
    border-radius: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.genre-card-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.genre-card-link:hover::before { opacity: 0.25; }
.genre-card-link:hover {
    transform: translateY(-4px);
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}
.genre-card-link span {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'haftad', sans-serif;
    position: relative;
    z-index: 1;
}
.genre-card-link:hover span { color: white; }
/* ===== JOB RAIL =====
   Same scroll mechanics as the manhwa rails (components/manga-grid.css), but
   the cards size themselves, so it gets its own class instead of borrowing
   .manga-grid-horizontal (whose > .manga-card rule does not apply here). */
.jobs-rail {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--card-gap);
    width: max-content;
    min-width: 100%;
    padding: 6px 2px 14px;
}
.job-mini-card {
    flex: 0 0 auto;
    width: clamp(240px, 30vw, 300px);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 28px 22px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.job-mini-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--card-color, var(--accent-blue));
    transition: height 0.3s;
}
.job-mini-card:hover {
    transform: translateY(-6px);
    border-color: var(--card-color, var(--accent-blue));
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.job-mini-card:hover::before { height: 8px; }
.job-mini-icon {
    width: 54px;
    height: 54px;
    background: var(--card-color, var(--accent-blue));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.job-mini-icon svg { width: 26px; height: 26px; stroke: white; }
.job-mini-card h4 {
    font-size: 17px;
    font-family: 'lalezar', sans-serif;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.job-mini-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    font-family: 'mosalas', sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.job-mini-arrow {
    margin-top: 16px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-family: 'diba', sans-serif;
    transition: gap 0.3s;
}
.job-mini-card:hover .job-mini-arrow { gap: 12px; }
.job-mini-arrow svg { width: 16px; height: 16px; }

/* Responsive Styles — the slider's own breakpoints live with the .ngs block
   above; what is left here belongs to the genre chips. */
@media (max-width: 768px) {
    .genres-grid { gap: 8px; }
    .genre-card-link { min-width: auto; padding: 10px 16px; }
    .genre-card-link span { font-size: 13px; }
}
