﻿/* دسته‌بندی سایدبار */
.cat-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-radius: .95rem;
    padding: .72rem .9rem;
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    transition: background .15s ease, color .15s ease;
}

    .cat-btn:hover {
        background: #f1f5f9;
        color: #002af8;
    }

    .cat-btn.active {
        background: linear-gradient(90deg, #002AF8, #0019d6) !important;
        color: #fff !important;
        box-shadow: 0 10px 24px -8px rgba(0, 42, 248, 0.5);
    }

        .cat-btn.active:hover {
            background: linear-gradient(90deg, #002AF8, #0019d6) !important;
            color: #fff !important;
        }

        .cat-btn.active span {
            background: rgba(255, 255, 255, 0.2) !important;
            color: #fff !important;
        }

/* کارت مطالب */
.article-card {
    position: relative;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 1.6rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 28px -14px rgba(15, 23, 42, 0.12);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

    .article-card::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 3px;
        background: linear-gradient(90deg, #0284c7, #002AF8);
        opacity: 0;
        transition: opacity .22s ease;
    }

    .article-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 24px 48px -16px rgba(7, 28, 109, 0.18);
        border-color: rgba(2, 132, 199, 0.32);
    }

        .article-card:hover::after {
            opacity: 1;
        }

        .article-card:hover .card-img {
            transform: scale(1.06);
        }

        .article-card:hover .card-cta {
            background: #0284c7;
            color: #fff;
        }

.card-img {
    transition: transform .4s ease;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-media {
    position: relative;
    height: 11.5rem;
    overflow: hidden;
    background: #eef6ff;
}

    .card-media::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(to top, rgba(15, 23, 42, .28), transparent 55%);
        pointer-events: none;
    }

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.15rem 1.2rem 1.2rem;
}

.card-title {
    font-size: 13.5px;
    font-weight: 900;
    line-height: 1.85;
    color: #0f172a;
}

    .card-title a:hover {
        color: #0369a1;
    }

.card-excerpt {
    margin-top: .5rem;
    flex: 1;
    font-size: 12px;
    line-height: 1.85;
    color: #64748b;
}

.card-footer {
    margin-top: 1rem;
    padding-top: .85rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    padding: .4rem .8rem;
    font-size: 11px;
    font-weight: 900;
    transition: background .15s ease, color .15s ease;
}

.card-cta-rose {
    background: #fff1f2;
    color: #be123c;
}

.article-card:hover .card-cta-rose {
    background: #e11d48;
    color: #fff;
}

.card-badge {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 2;
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: 9px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .12);
}

/* فیلترها */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: .45rem .9rem;
    font-size: 11.5px;
    font-weight: 800;
    color: #475569;
    white-space: nowrap;
    transition: all .15s ease;
}

    .filter-chip:hover {
        border-color: #bae6fd;
        color: #0369a1;
        background: #f0f9ff;
    }

    .filter-chip.active {
        border-color: transparent;
        background: linear-gradient(90deg, #0284c7, #0369a1);
        color: #fff;
        box-shadow: 0 8px 18px -8px rgba(2, 132, 199, .55);
    }

/* موبایل دسته‌ها */
.mobile-cats {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .mobile-cats::-webkit-scrollbar {
        display: none;
    }

/* بج‌ها */
.badge-announce {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-update {
    background: #fff1f2;
    color: #be123c;
}


/* موبایل: اسکرول افقی دسته‌ها + جلوگیری از بیرون‌زدن کارت‌ها (مثل فایل بلاگ) */
.mobile-cats-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mobile-cats {
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: .4rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

    .mobile-cats::-webkit-scrollbar {
        display: none;
    }

    .mobile-cats .filter-chip {
        flex: 0 0 auto;
    }

.content-col {
    min-width: 0;
    max-width: 100%;
}

.cards-grid {
    width: 100%;
    min-width: 0;
}

.article-card {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 639px) {
    .article-card:hover {
        transform: none;
    }

    .cards-grid {
        gap: 1rem;
    }
}



/* === متن مقاله === */


.article-body p {
    margin-bottom: 1.05rem;
    line-height: 2;
    font-size: 14.5px;
    color: #334155;
}

.article-body .lead {
    font-size: 15.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 2.05;
    background: linear-gradient(90deg, #eef2ff 0%, #ffffff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 1rem;
    padding: 1rem 1.15rem;
}

.article-body h2 {
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    scroll-margin-top: 1rem;
    position: relative;
    padding-right: 0.85rem;
}

    .article-body h2::before {
        content: "";
        position: absolute;
        right: 0;
        top: 0.35rem;
        bottom: 0.35rem;
        width: 4px;
        border-radius: 999px;
        background: #002AF8;
    }

.article-body h3 {
    margin-top: 1.4rem;
    margin-bottom: 0.55rem;
    font-size: 15px;
    font-weight: 900;
    color: #1e293b;
}

.article-body ul,
.article-body ol {
    margin: 0.85rem 0 1.35rem;
    padding-right: 1.2rem;
    font-size: 14px;
    line-height: 2.05;
    color: #334155;
}

.article-body li {
    margin-bottom: 0.35rem;
}

.article-body a {
    color: #002AF8;
    font-weight: 700;
}

    .article-body a:hover {
        text-decoration: underline;
    }

.article-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.35rem 0;
    font-size: 13px;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

.article-body th,
.article-body td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0.9rem;
    text-align: right;
}

.article-body tr:last-child td {
    border-bottom: 0;
}

.article-body th {
    background: #f8fafc;
    font-weight: 900;
    color: #0f172a;
}

.article-body .note,
.article-body .warn,
.article-body .success {
    margin: 1.5rem 0;
    border-radius: 1.1rem;
    padding: 1rem 1.15rem;
    font-size: 13px;
    line-height: 1.95;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.article-body .note {
    border: 1px solid #c7d2fe;
    background: linear-gradient(135deg, #eef2ff 0%, #f8faff 100%);
    color: #1e3a8a;
}

.article-body .success {
    border: 1px solid #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #f7fef9 100%);
    color: #166534;
}

.article-body .warn {
    border: 1px solid #fecaca;
    background: linear-gradient(135deg, #fef2f2 0%, #fff7f7 100%);
    color: #991b1b;
}

.article-body blockquote {
    margin: 1.6rem 0;
    border-right: 4px solid #002AF8;
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 0 1.1rem 1.1rem 0;
    padding: 1.1rem 1.25rem;
    font-size: 14.5px;
    line-height: 2;
    color: #1e293b;
    font-weight: 800;
}

.article-body .code-box {
    margin: 1.35rem 0;
    overflow-x: auto;
    border-radius: 1.1rem;
    border: 1px solid #1e293b;
    background: #0b1220;
    color: #e2e8f0;
    padding: 1.05rem 1.15rem;
    font-size: 12px;
    line-height: 1.85;
    direction: ltr;
    text-align: left;
}

.article-body figure {
    margin: 1.45rem 0;
}

    .article-body figure img,
    .cover-img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: 1.15rem;
        border: 1px solid #e2e8f0;
        background: #eef2ff;
        object-fit: cover;
    }

.share-btn {
    transition: all .15s ease;
}

    .share-btn:hover {
        transform: translateY(-1px);
    }

details summary {
    list-style: none;
}

    details summary::-webkit-details-marker {
        display: none;
    }

details[open] summary {
    color: #002AF8;
}