/* =====================================================
   News.css — صفحه مقالات (لیست + جزئیات)
   همه کلاس‌ها با پیشوند nw- برای جلوگیری از تداخل
   ===================================================== */

.nw-page {
    --nw-navy: #0B3954;
    --nw-navy-2: #14507a;
    --nw-red: #d0202f;
    --nw-red-dark: #b01826;
    --nw-red-soft: #fdecee;
    --nw-red-line: #f8d0d5;
    --nw-ink: #1d2b3a;
    --nw-muted: #6b7a8c;
    --nw-line: #e6ebf2;
    --nw-bg: #f5f8fc;
    --nw-card: #ffffff;
    --nw-radius: 18px;
    --nw-shadow: 0 1px 2px rgba(11, 57, 84, .04), 0 8px 24px rgba(11, 57, 84, .06);
    --nw-shadow-hover: 0 2px 4px rgba(11, 57, 84, .06), 0 16px 36px rgba(11, 57, 84, .12);
    direction: rtl;
    text-align: right;
    /* این خط را حذف کن یا transparent بگذار */
    background: transparent;
    color: var(--nw-ink);
    font-family: inherit;
    padding-bottom: 72px;
    box-sizing: border-box;
}

    .nw-page *,
    .nw-page *::before,
    .nw-page *::after {
        box-sizing: border-box;
    }

.nw-wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.nw-wrap--narrow {
    max-width: 900px;
}

/* ---------- Hero ---------- */
.nw-hero {
    text-align: center;
    padding: 56px 24px 40px;
    background: transparent;
}

.nw-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--nw-red-soft);
    border: 1px solid var(--nw-red-line);
    color: var(--nw-red);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
}

.nw-hero h1 {
    margin: 18px 0 0;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: var(--nw-navy);
    line-height: 1.4;
}

.nw-hero-bar {
    display: block;
    width: 64px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--nw-red) 0 50%, var(--nw-navy-2) 50% 100%);
}

.nw-hero p {
    margin: 16px auto 0;
    max-width: 560px;
    color: var(--nw-muted);
    font-size: 15px;
    line-height: 2;
}

/* ---------- Layout ---------- */
.nw-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin-top: 8px;
}

.nw-side {
    flex: 0 0 280px;
    width: 280px;
    position: sticky;
    top: 24px;
}

.nw-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- Sidebar ---------- */
.nw-side-card {
    background: var(--nw-card);
    border: 1px solid var(--nw-line);
    border-radius: var(--nw-radius);
    box-shadow: var(--nw-shadow);
    padding: 18px 14px;
}

.nw-side-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 6px 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--nw-line);
    font-size: 16px;
    font-weight: 800;
    color: var(--nw-navy);
}

    .nw-side-title::before {
        content: "";
        width: 4px;
        height: 20px;
        border-radius: 4px;
        background: var(--nw-red);
    }

.nw-cats,
.nw-cats ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .nw-cats li {
        margin: 2px 0;
    }

    .nw-cats a.parent {
        position: relative;
        display: block;
        padding: 11px 14px;
        border-radius: 12px;
        color: var(--nw-ink);
        font-size: 14px;
        font-weight: 600;
        line-height: 1.7;
        text-decoration: none;
        transition: background .2s, color .2s;
    }

        .nw-cats a.parent:hover {
            background: #f1f5fa;
            color: var(--nw-navy);
        }

    .nw-cats li.active > a.parent {
        background: var(--nw-red-soft);
        color: var(--nw-red);
    }

    /* فلش برای گروه‌هایی که زیرمجموعه دارند */
    .nw-cats a.parent[href="#"] {
        padding-left: 38px;
    }

        .nw-cats a.parent[href="#"]::after {
            content: "";
            position: absolute;
            left: 16px;
            top: 50%;
            width: 7px;
            height: 7px;
            margin-top: -6px;
            border-left: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            transform: rotate(-45deg);
            transition: transform .2s;
            opacity: .6;
        }

    .nw-cats li.open > a.parent[href="#"]::after {
        transform: rotate(-135deg);
        margin-top: -2px;
    }

    /* زیرمنوها */
    .nw-cats ul.collapse {
        display: none;
    }

    .nw-cats li.open > ul,
    .nw-cats ul.in {
        display: block;
    }

    .nw-cats ul {
        margin: 4px 14px 6px 0;
        padding-right: 10px;
        border-right: 2px solid var(--nw-line);
    }

        .nw-cats ul a.parent {
            font-size: 13.5px;
            font-weight: 500;
            padding: 9px 12px;
        }

/* دکمه فیلتر در موبایل */
.nw-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
    padding: 13px 18px;
    border: 1px solid var(--nw-line);
    border-radius: 14px;
    background: var(--nw-card);
    color: var(--nw-navy);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--nw-shadow);
}

    .nw-filter-btn svg {
        width: 18px;
        height: 18px;
    }

/* ---------- Cards ---------- */
.nw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.nw-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--nw-card);
    border: 1px solid var(--nw-line);
    border-radius: var(--nw-radius);
    box-shadow: var(--nw-shadow);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

    .nw-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--nw-shadow-hover);
        border-color: var(--nw-red-line);
    }

.nw-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #eaf1f9, #f8fbff);
}

    .nw-card-media img.nw-cover {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .5s ease;
    }

.nw-card:hover .nw-card-media img.nw-cover {
    transform: scale(1.06);
}

.nw-card-media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, rgba(208, 32, 47, .08), transparent 55%), linear-gradient(135deg, #e6eef8, #f7faff);
}

    .nw-card-media--empty img.nw-ph {
        width: 38%;
        max-width: 120px;
        height: auto;
        opacity: .55;
    }

.nw-card-media .nw-pill {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(4px);
    font-size: 12px;
    padding: 4px 12px;
}

.nw-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 20px 22px 18px;
}

.nw-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-bottom: 12px;
    color: var(--nw-muted);
    font-size: 12.5px;
}

    .nw-card-meta span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .nw-card-meta svg {
        width: 14px;
        height: 14px;
        flex: none;
    }

.nw-card-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.9;
}

    .nw-card-title a {
        color: var(--nw-navy);
        text-decoration: none;
        transition: color .2s;
    }

        /* کل کارت قابل کلیک می‌شود */
        .nw-card-title a::after {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 1;
        }

.nw-card:hover .nw-card-title a {
    color: var(--nw-red);
}

.nw-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
    color: var(--nw-muted);
    font-size: 14px;
    line-height: 2;
}

    .nw-card-excerpt * {
        margin: 0;
        font-size: inherit !important;
        color: inherit !important;
    }

.nw-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px dashed var(--nw-line);
    font-size: 13px;
}

.nw-source {
    color: var(--nw-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 55%;
}

.nw-more {
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--nw-red);
    font-weight: 800;
}

    .nw-more i {
        font-style: normal;
        display: inline-block;
        transition: transform .25s;
    }

.nw-card:hover .nw-more i {
    transform: translateX(-5px);
}

/* ---------- Empty ---------- */
.nw-empty {
    text-align: center;
    padding: 64px 24px;
    background: var(--nw-card);
    border: 1px dashed var(--nw-line);
    border-radius: var(--nw-radius);
    color: var(--nw-muted);
    font-size: 15px;
    line-height: 2;
}

    .nw-empty strong {
        display: block;
        margin-bottom: 6px;
        color: var(--nw-navy);
        font-size: 18px;
    }

/* ---------- Pager ---------- */
.nw-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

    .nw-pager div,
    .nw-pager ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .nw-pager li {
        display: contents;
    }

    .nw-pager a,
    .nw-pager span,
    .nw-pager b,
    .nw-pager strong {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        height: 42px;
        padding: 0 12px;
        border: 1px solid var(--nw-line);
        border-radius: 12px;
        background: var(--nw-card);
        color: var(--nw-navy);
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        transition: all .2s;
    }

        .nw-pager a:hover {
            border-color: var(--nw-red);
            color: var(--nw-red);
            transform: translateY(-2px);
        }

        .nw-pager b,
        .nw-pager strong,
        .nw-pager .active,
        .nw-pager .current,
        .nw-pager a.selected {
            background: var(--nw-red);
            border-color: var(--nw-red);
            color: #fff;
        }

/* =====================================================
   صفحه جزئیات مقاله
   ===================================================== */
.nw-detail-top {
    padding: 36px 0 0;
}

.nw-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--nw-muted);
    font-size: 13px;
}

    .nw-crumbs a {
        color: var(--nw-muted);
        text-decoration: none;
        transition: color .2s;
    }

        .nw-crumbs a:hover {
            color: var(--nw-red);
        }

    .nw-crumbs em {
        font-style: normal;
        opacity: .5;
    }

.nw-article {
    background: var(--nw-card);
    border: 1px solid var(--nw-line);
    border-radius: 24px;
    box-shadow: var(--nw-shadow);
    padding: 44px 48px;
}

.nw-article-head {
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 1px dashed var(--nw-line);
}

    .nw-article-head h1 {
        margin: 16px 0 18px;
        font-size: clamp(22px, 3.2vw, 32px);
        font-weight: 800;
        line-height: 1.9;
        color: var(--nw-navy);
    }

.nw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nw-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: #f1f5fa;
    color: var(--nw-muted);
    font-size: 13px;
}

    .nw-chip svg {
        width: 15px;
        height: 15px;
        flex: none;
    }

    .nw-chip b {
        color: var(--nw-navy);
        font-weight: 700;
    }

/* متن مقاله */
.nw-prose {
    font-size: 16.5px;
    line-height: 2.15;
    color: #2a3a4c;
    overflow-wrap: break-word;
}

    .nw-prose h1,
    .nw-prose h2,
    .nw-prose h3,
    .nw-prose h4 {
        color: var(--nw-navy);
        font-weight: 800;
        line-height: 1.8;
        margin: 1.8em 0 .6em;
    }

    .nw-prose h2 {
        font-size: 1.45em;
    }

    .nw-prose h3 {
        font-size: 1.25em;
    }

    .nw-prose h2::before {
        content: "";
        display: inline-block;
        width: 5px;
        height: 1em;
        margin-left: 10px;
        vertical-align: -3px;
        border-radius: 4px;
        background: var(--nw-red);
    }

    .nw-prose p {
        margin: 0 0 1.1em;
    }

    .nw-prose a {
        color: var(--nw-red);
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    .nw-prose img {
        max-width: 100%;
        height: auto !important;
        border-radius: 14px;
        margin: 10px auto;
    }

    .nw-prose ul,
    .nw-prose ol {
        padding-right: 24px;
        margin: 0 0 1.2em;
    }

    .nw-prose li {
        margin-bottom: .4em;
    }

    .nw-prose blockquote {
        margin: 1.4em 0;
        padding: 16px 22px;
        border-right: 4px solid var(--nw-red);
        border-radius: 12px;
        background: var(--nw-red-soft);
        color: var(--nw-ink);
    }

    .nw-prose table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
        margin: 1.2em 0;
    }

    .nw-prose th,
    .nw-prose td {
        padding: 10px 14px;
        border: 1px solid var(--nw-line);
    }

    .nw-prose th {
        background: #f1f5fa;
        color: var(--nw-navy);
    }

    .nw-prose iframe,
    .nw-prose video {
        max-width: 100%;
        border-radius: 14px;
    }

/* گالری تصاویر */
.nw-gallery {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px dashed var(--nw-line);
}

.nw-gallery-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 800;
    color: var(--nw-navy);
}

    .nw-gallery-title::before {
        content: "";
        width: 4px;
        height: 20px;
        border-radius: 4px;
        background: var(--nw-red);
    }

.nw-gallery .boxItemImage {
    position: relative;
    padding: 0 6px;
}

.nw-gallery .swiper-slide {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    cursor: zoom-in;
}

    .nw-gallery .swiper-slide img {
        display: block;
        width: 100%;
        height: 170px;
        object-fit: cover;
        transition: transform .4s;
    }

    .nw-gallery .swiper-slide:hover img {
        transform: scale(1.06);
    }

.nw-gallery .Expand {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(11, 57, 84, .75);
    opacity: 0;
    transition: opacity .25s;
}

    .nw-gallery .Expand img {
        width: 16px;
        height: 16px;
        object-fit: contain;
    }

.nw-gallery .swiper-slide:hover .Expand {
    opacity: 1;
}

.nw-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding: 11px 22px;
    border: 1px solid var(--nw-line);
    border-radius: 999px;
    background: var(--nw-card);
    color: var(--nw-navy);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s;
}

    .nw-back:hover {
        border-color: var(--nw-red);
        color: var(--nw-red);
    }

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 991px) {
    .nw-layout {
        flex-direction: column;
        gap: 0;
    }

    .nw-filter-btn {
        display: flex;
    }

    .nw-side {
        display: none;
        position: static;
        width: 100%;
        flex: none;
        margin-bottom: 20px;
    }

        .nw-side.is-open {
            display: block;
        }

    .nw-main {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .nw-wrap {
        padding: 0 16px;
    }

    .nw-hero {
        padding: 36px 16px 28px;
    }

    .nw-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .nw-article {
        padding: 26px 20px;
        border-radius: 18px;
    }

    .nw-prose {
        font-size: 15.5px;
    }

    .nw-gallery .swiper-slide img {
        height: 150px;
    }
}
