/* صفحه‌ی دسته‌ها (/news ، /news/exhibitions) — Pages/Category/Index.cshtml
   بعد از blog.css بارگذاری می‌شود (مسیر صفحه، صفحه‌بندی و متغیرهای --bl-* از آن‌جاست).
   انیمیشن ورود فقط CSS (keyframes با fill backwards): بدون جاوااسکریپت هم محتوا دیده می‌شود. */

.ct {
    --ct-red: var(--bl-red, #d71921);
    --ct-card: #ffffff;
    --ct-line: #e6e8eb;
    --ct-line-soft: #eef0f2;
    --ct-hi: #14171b;
    --ct-lo: #6b7280;
    --ct-mute: #9aa3ad;
    --ct-ease: cubic-bezier(.2, .8, .2, 1);
    overflow-x: clip;
}

.ct-shell { width: min(1320px, 100%); }

/* ═══════════ سربرگ ═══════════ */
.ct-head {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 40px;
    flex-wrap: wrap;
    padding-bottom: 1.35rem;
    margin-bottom: 1.6rem;
}

.ct-rule {
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: var(--ct-line);
    transform-origin: right;
    animation: ctRule 1s var(--ct-ease) .2s backwards;
}

    .ct-rule::after {
        content: '';
        position: absolute;
        top: -1px;
        bottom: -1px;
        right: 0;
        width: 82px;
        background: var(--ct-red);
        animation: ctFade .4s ease .9s backwards;
    }

.ct-kicker {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .7rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    color: var(--ct-red);
}

.ct-kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ct-red); }

.ct-title {
    margin: 0 0 .5rem;
    font-size: clamp(1.45rem, 2.6vw, 2rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.45;
    color: var(--ct-hi);
}

.ct-sub { margin: 0; font-size: .875rem; line-height: 1.95; color: var(--ct-lo); }

.ct-head-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    border: 1px solid var(--ct-line);
    border-radius: 5px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--ct-hi);
    text-decoration: none;
    white-space: nowrap;
    transition: background .25s ease, border-color .25s ease, color .25s ease, transform .25s var(--ct-ease);
}

    .ct-head-link svg { width: 14px; height: 14px; transition: transform .3s var(--ct-ease); }
    .ct-head-link:hover { background: var(--ct-red); border-color: var(--ct-red); color: #fff; transform: translateY(-2px); }
    .ct-head-link:hover svg { transform: translateX(-4px); }

/* ═══════════ دسته‌ها (لینک؛ هر کدام آدرس خودش) ═══════════ */
.ct-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.9rem; }

.ct-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border: 1px solid var(--ct-line);
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ct-lo);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .22s ease, color .22s ease, background .22s ease, transform .22s var(--ct-ease);
}

    .ct-chip b { font-size: .7rem; font-weight: 700; opacity: .7; }
    .ct-chip:hover { border-color: rgba(215,25,33,.5); color: var(--ct-red); transform: translateY(-1px); }
    .ct-chip.is-on { background: var(--ct-red); border-color: var(--ct-red); color: #fff; font-weight: 700; }
    .ct-chip.is-on b { opacity: .85; }

/* ═══════════ شبکه‌ی کارت‌ها ═══════════ */
.ct-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.ct-card { position: relative; animation: ctCard .8s var(--ct-ease) backwards; }

    .ct-card:nth-child(1) { animation-delay: .25s; }
    .ct-card:nth-child(2) { animation-delay: .33s; }
    .ct-card:nth-child(3) { animation-delay: .41s; }
    .ct-card:nth-child(4) { animation-delay: .49s; }
    .ct-card:nth-child(5) { animation-delay: .57s; }
    .ct-card:nth-child(6) { animation-delay: .65s; }
    .ct-card:nth-child(n+7) { animation-delay: .7s; }

.ct-link {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ct-line);
    border-radius: 8px;
    background: var(--ct-card);
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(20,27,38,.04);
    transition: border-color .28s ease, box-shadow .3s ease, transform .35s var(--ct-ease);
}

    .ct-link:hover {
        border-color: rgba(215,25,33,.45);
        box-shadow: 0 22px 48px -26px rgba(20,27,38,.46);
        transform: translateY(-6px);
    }

    .ct-link:focus-visible { outline: 2px solid var(--ct-red); outline-offset: 3px; }

.ct-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #eceef0, #f6f7f9);
}

    .ct-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transform: scale(1.02);
        transition: transform 1s var(--ct-ease);
    }

    /* درخشش عبوری */
    .ct-media::after {
        content: '';
        position: absolute;
        z-index: 1;
        top: -60%;
        right: -70%;
        width: 42%;
        height: 220%;
        pointer-events: none;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
        transform: rotate(16deg);
        transition: right .85s var(--ct-ease);
    }

.ct-link:hover .ct-media img { transform: scale(1.08); }
.ct-link:hover .ct-media::after { right: 125%; }

.ct-fade {
    position: absolute;
    z-index: 1;
    inset: auto 0 0 0;
    height: 40%;
    pointer-events: none;
    background: linear-gradient(to top, rgba(255,255,255,.96) 0%, rgba(255,255,255,.4) 46%, transparent 100%);
}

.ct-tag {
    position: absolute;
    z-index: 2;
    top: 13px;
    left: 13px;
    padding: 5px 12px;
    border-radius: 3px;
    background: rgba(10,12,14,.62);
    border: 1px solid rgba(255,255,255,.2);
    border-left: 2px solid var(--ct-red);
    backdrop-filter: blur(6px);
    font-size: .68rem;
    font-weight: 700;
    color: #fff;
    transition: background .3s ease, border-color .3s ease;
}

.ct-link:hover .ct-tag { background: rgba(215,25,33,.85); border-color: rgba(255,255,255,.3); }

/* ─── بدنه ─── */
.ct-body {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: 18px 20px;
    background: var(--ct-card);
}

.ct-date { display: inline-flex; align-items: center; gap: .42rem; font-size: .73rem; font-weight: 600; color: var(--ct-mute); }
    .ct-date svg { width: 14px; height: 14px; color: var(--ct-red); }

.ct-name {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--ct-hi);
    transition: transform .4s var(--ct-ease), color .25s ease;
}

.ct-link:hover .ct-name { transform: translateX(-4px); color: var(--ct-red); }

.ct-excerpt {
    flex: 1;
    margin: 0;
    font-size: .82rem;
    line-height: 1.9;
    color: var(--ct-lo);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ct-go {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--ct-line-soft);
}

.ct-go-txt { font-size: .82rem; font-weight: 700; color: var(--ct-lo); transition: color .25s ease; }
.ct-link:hover .ct-go-txt { color: var(--ct-red); }

.ct-arrow-sm {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 50%;
    border: 1px solid var(--ct-line);
    color: var(--ct-hi);
    overflow: hidden;
    transition: border-color .28s ease, color .28s ease, transform .4s var(--ct-ease);
}

    .ct-arrow-sm::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: var(--ct-red);
        transform: scale(0);
        transition: transform .45s var(--ct-ease);
    }

    .ct-arrow-sm svg { position: relative; z-index: 1; width: 14px; height: 14px; }

.ct-link:hover .ct-arrow-sm { border-color: var(--ct-red); color: #fff; transform: translateX(-4px); }
.ct-link:hover .ct-arrow-sm::before { transform: scale(1); }

/* خط قرمز کف کارت */
.ct-edge {
    position: absolute;
    z-index: 3;
    inset: auto 0 0 0;
    height: 2px;
    background: var(--ct-red);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .4s var(--ct-ease);
}

.ct-link:hover .ct-edge { transform: scaleX(1); }

.ct-empty { margin: 34px 0; text-align: center; font-size: .9rem; color: var(--ct-mute); }

/* ═══════════ ورود ═══════════ */
.ct-head-main > * { animation: ctUp .65s var(--ct-ease) backwards; }
    .ct-head-main > :nth-child(1) { animation-delay: .05s; }
    .ct-head-main > :nth-child(2) { animation-delay: .12s; }
    .ct-head-main > :nth-child(3) { animation-delay: .19s; }
.ct-head-link { animation: ctUp .6s var(--ct-ease) .26s backwards; }
.ct-filters { animation: ctUp .6s var(--ct-ease) .3s backwards; }

@keyframes ctUp { from { opacity: 0; transform: translateY(18px); } }
@keyframes ctFade { from { opacity: 0; } }
@keyframes ctRule { from { transform: scaleX(0); } }
@keyframes ctCard {
    from { opacity: 0; transform: translateY(34px) scale(.975); clip-path: inset(0 0 10% 0 round 8px); }
    to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 8px); }
}

/* ═══════════ واکنش‌گرا ═══════════ */
@media (max-width: 1099.98px) {
    .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599.98px) {
    .ct-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .ct-head-link { display: none; }   /* لینک وبلاگ در منوی سایت هست؛ در موبایل جا را برای تیتر بگذار */
    .ct-name { font-size: .96rem; }
    .ct-excerpt { font-size: .8rem; -webkit-line-clamp: 2; }

    /* دسته‌ها: یک ردیف قابل کشیدن، بدون شکستن خط */
    .ct-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 0 16px 4px; }
    .ct-filters::-webkit-scrollbar { display: none; }
    .ct-chip { flex: none; padding: 7px 15px; font-size: .78rem; }
}

/* ═══════════ کاهش حرکت ═══════════ */
@media (prefers-reduced-motion: reduce) {
    .ct *, .ct *::before, .ct *::after { animation: none !important; transition: none !important; }
    .ct-media img { transform: none !important; }
}
