/* SAZEH POUYESH — NEWS DETAIL (v6 · Industrial Silver · Typography + Rich content) */
.sp-nd {
    --sx-accent: var(--sp-orange, #F2691E);
    --sx-steel: #AEBCC6;
    --sx-deep: #55697A;
    --sx-deeper: #3B4C5A;
    --sx-mist: #F4F7F9;
    --sx-line: #DCE3E8;
    --sx-ink: #1B2630;
    --sx-soft: #55616B;
    --sx-ease: cubic-bezier(.22,1,.36,1);
    /* مقیاس تایپوگرافی */
    --nd-fs-title: clamp(1.6rem, 1.15rem + 2vw, 2.5rem);
    --nd-fs-h2: clamp(1.35rem, 1.15rem + .8vw, 1.7rem);
    --nd-fs-h3: clamp(1.15rem, 1.05rem + .4vw, 1.35rem);
    --nd-fs-h4: 1.08rem;
    --nd-fs-lead: clamp(1.05rem, 1rem + .25vw, 1.18rem);
    --nd-fs-body: clamp(1rem, .96rem + .2vw, 1.1rem);
    --nd-fs-quote: clamp(1.08rem, 1rem + .35vw, 1.25rem);
    --nd-fs-small: .86rem;
    --nd-lh-body: 2.15;
    /* ارتفاع ثابت تصاویر */
    --nd-img-h: 440px;
    --nd-gal-h: 220px;
    position: relative;
    background: linear-gradient(180deg,#E9EEF1 0,#F4F7F9 380px,#fff 700px);
    color: var(--sx-ink);
    min-height: 60vh;
    overflow-x: clip;
    padding-bottom: 80px;
    font-size: var(--nd-fs-body);
}

    .sp-nd *, .sp-nd *::before, .sp-nd *::after {
        box-sizing: border-box;
    }

/* نوار پیشرفت مطالعه */
.sp-nd-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 4px;
    z-index: 1200;
    background: var(--sx-accent);
    transform-origin: 100% 50%;
    pointer-events: none;
}

.sp-nd-state {
    text-align: center;
    padding: 90px 20px;
    color: var(--sx-soft);
}

.sp-nd-wrap {
    max-width: 940px;
    margin: 0 auto;
    padding: 36px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sp-nd-card {
    background: #fff;
    border: 1px solid var(--sx-line);
    border-radius: 24px;
    padding: clamp(18px, 3.5vw, 44px);
    box-shadow: 0 20px 50px rgba(27,38,48,.07);
}

/* ---------- بالای کارت ---------- */
.sp-nd-card-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.sp-nd-back-link, .sp-nd-back {
    color: var(--sx-deeper);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 99px;
    background: var(--sx-mist);
    transition: background .3s, transform .3s var(--sx-ease);
}

    .sp-nd-back-link:hover, .sp-nd-back:hover {
        background: var(--sx-steel);
        transform: translateX(4px);
    }

.sp-nd-cat {
    padding: 5px 16px;
    border-radius: 99px;
    background: var(--sx-mist);
    color: var(--sx-deep);
    font-weight: 800;
    font-size: var(--nd-fs-small);
    border-inline-start: 3px solid var(--sx-accent);
}

/* ---------- تصویر شاخص ---------- */
.sp-nd-hero {
    margin: 0 0 28px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--sx-mist);
}

.sp-nd-hero-media {
    display: block;
    width: 100%;
    height: var(--nd-img-h);
    max-height: none;
    object-fit: cover;
    object-position: center;
}

.sp-nd-hero .sp-vp-mount, .sp-nd-hero video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    max-height: 560px;
}

/* ---------- عنوان، متا، خلاصه ---------- */
.sp-nd-title {
    margin: 0 0 14px;
    font-size: var(--nd-fs-title);
    line-height: 1.75;
    font-weight: 800;
    color: var(--sx-ink);
    /*text-align: justify;*/
    text-justify: inter-word;
}

    .sp-nd-title::after {
        content: "";
        display: block;
        width: 44px;
        height: 2px;
        margin-top: 16px;
        background: var(--sx-accent);
        border-radius: 2px;
    }

.sp-nd-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    color: var(--sx-soft);
    font-size: var(--nd-fs-small);
}

.sp-nd-lead {
    margin: 20px 0 0;
    padding: 18px 22px;
    background: var(--sx-mist);
    border-inline-start: 3px solid var(--sx-steel);
    border-radius: 0 14px 14px 0;
    font-size: var(--nd-fs-lead);
    line-height: 2.1;
    font-weight: 500;
    color: var(--sx-deeper);
    text-align: justify;
    text-justify: inter-word;
}

/* ---------- متن مقاله ---------- */
.sp-nd-article {
    font-size: var(--nd-fs-body);
    line-height: var(--nd-lh-body);
    color: #26323C;
    text-align: justify;
    text-justify: inter-word;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: none;
}

    .sp-nd-article > * + * {
        margin-top: 20px;
    }

    .sp-nd-p, .sp-nd-article p {
        margin: 0;
        font-size: var(--nd-fs-body);
        line-height: var(--nd-lh-body);
        text-align: justify;
        text-justify: inter-word;
        text-align-last: start;
    }

        .sp-nd-p + .sp-nd-p {
            margin-top: 16px;
        }

        /* سطرهای خالی و br داخل متن */
        .sp-nd-p br + br {
            display: block;
            content: "";
            margin-top: .6em;
        }

    /* ---------- عنوان‌های میان متن ---------- */
    .sp-nd-h2, .sp-nd-article h2 {
        position: relative;
        margin: 40px 0 0 !important;
        padding-inline-start: 18px;
        font-size: var(--nd-fs-h2);
        line-height: 1.7;
        font-weight: 800;
        color: var(--sx-ink);
        text-align: justify;
        text-justify: inter-word;
    }

        .sp-nd-h2::before, .sp-nd-article h2::before {
            content: "";
            position: absolute;
            inset-inline-start: 0;
            top: .4em;
            bottom: .4em;
            width: 4px;
            border-radius: 4px;
            background: linear-gradient(var(--sx-accent), var(--sx-steel));
        }

    .sp-nd-article h1 {
        font-size: var(--nd-fs-h2);
        line-height: 1.7;
        font-weight: 800;
        margin-top: 36px;
        text-align: justify;
    }

    .sp-nd-article h3 {
        margin-top: 30px;
        font-size: var(--nd-fs-h3);
        line-height: 1.75;
        font-weight: 800;
        color: var(--sx-deeper);
        text-align: justify;
    }

    .sp-nd-article h4, .sp-nd-article h5, .sp-nd-article h6 {
        margin-top: 24px;
        font-size: var(--nd-fs-h4);
        line-height: 1.8;
        font-weight: 700;
        color: var(--sx-deep);
        text-align: justify;
    }

    /* ---------- قالب‌بندی داخل متن (بولد، ایتالیک، لینک، لیست، کد ...) ---------- */
    .sp-nd-article strong, .sp-nd-article b {
        font-weight: 800;
        color: var(--sx-ink);
    }

    .sp-nd-article em, .sp-nd-article i {
        font-style: italic;
    }

    .sp-nd-article u {
        text-underline-offset: 5px;
        text-decoration-thickness: 1.5px;
    }

    .sp-nd-article s, .sp-nd-article del {
        color: var(--sx-soft);
    }

    .sp-nd-article mark {
        background: rgba(242,105,30,.16);
        color: inherit;
        padding: 0 5px;
        border-radius: 4px;
    }

    .sp-nd-article small {
        font-size: var(--nd-fs-small);
        color: var(--sx-soft);
    }

    .sp-nd-article sub, .sp-nd-article sup {
        font-size: .72em;
        line-height: 0;
    }

    .sp-nd-article a {
        color: var(--sx-deeper);
        font-weight: 700;
        text-decoration: underline;
        text-decoration-color: var(--sx-accent);
        text-decoration-thickness: 2px;
        text-underline-offset: 6px;
        transition: color .25s, text-decoration-color .25s;
    }

        .sp-nd-article a:hover {
            color: var(--sx-accent);
        }

    .sp-nd-article ul, .sp-nd-article ol {
        margin: 0;
        padding-inline-start: 1.6em;
        display: grid;
        gap: 8px;
        text-align: justify;
    }

    .sp-nd-article li {
        padding-inline-start: 4px;
        line-height: var(--nd-lh-body);
        font-size: var(--nd-fs-body);
        text-align: justify;
        text-justify: inter-word;
    }

        .sp-nd-article li::marker {
            color: var(--sx-accent);
            font-weight: 800;
        }

    .sp-nd-article ul ul, .sp-nd-article ol ol, .sp-nd-article ul ol, .sp-nd-article ol ul {
        margin-top: 8px;
    }

    .sp-nd-article hr {
        border: 0;
        height: 1px;
        margin: 34px 0;
        background: linear-gradient(90deg, transparent, var(--sx-steel), transparent);
    }

    .sp-nd-article code {
        font-family: ui-monospace, Consolas, monospace;
        font-size: .9em;
        direction: ltr;
        unicode-bidi: embed;
        padding: 2px 8px;
        border-radius: 6px;
        background: var(--sx-mist);
        border: 1px solid var(--sx-line);
    }

    .sp-nd-article pre {
        direction: ltr;
        text-align: left;
        overflow-x: auto;
        padding: 18px 20px;
        border-radius: 14px;
        background: var(--sx-deeper);
        color: #EAF0F4;
        font-size: .92rem;
        line-height: 1.8;
    }

        .sp-nd-article pre code {
            background: transparent;
            border: 0;
            padding: 0;
            color: inherit;
        }
    /* هر استایل/اندازه‌ای که از ادیتور آمده باشد از کادر بیرون نزند */
    .sp-nd-article * {
        max-width: 100%;
    }

    .sp-nd-article [style*="font-family"] {
        font-family: inherit !important;
    }

    .sp-nd-article [style*="width"]:not(img):not(video):not(iframe):not(table) {
        width: auto !important;
    }

    /* ---------- نقل‌قول ---------- */
    .sp-nd-quote, .sp-nd-article blockquote {
        position: relative;
        margin: 30px 0;
        padding: 22px 28px;
        background: var(--sx-mist);
        border-inline-start: 4px solid var(--sx-accent);
        border-radius: 0 18px 18px 0;
        color: var(--sx-deeper);
        font-size: var(--nd-fs-quote);
        line-height: 2.1;
        font-weight: 500;
        text-align: justify;
        text-justify: inter-word;
    }

        .sp-nd-quote::before, .sp-nd-article blockquote::before {
            content: "“";
            position: absolute;
            top: -6px;
            inset-inline-end: 18px;
            font-size: 3.6rem;
            line-height: 1;
            color: var(--sx-steel);
            opacity: .7;
            pointer-events: none;
        }

    /* ---------- تصاویر میان متن: ارتفاع ثابت، کاور، کلیک برای نمایش کامل ---------- */
    .sp-nd-figure, .sp-nd-article figure {
        position: relative;
        margin: 30px 0;
        padding: 0;
    }

        .sp-nd-figure img, .sp-nd-article figure img, .sp-nd-article p img, .sp-nd-article .sp-nd-zoomable {
            display: block;
            width: 100% !important;
            height: var(--nd-img-h) !important;
            max-width: 100%;
            object-fit: cover;
            object-position: center;
            border-radius: 20px;
            background: var(--sx-mist);
            cursor: zoom-in;
            transition: transform .6s var(--sx-ease), box-shadow .5s, filter .4s;
        }

        .sp-nd-figure:hover img, .sp-nd-article figure:hover img {
            box-shadow: 0 22px 46px rgba(27,38,48,.18);
            filter: brightness(1.03);
        }
        /* برچسب «مشاهده کامل» روی تصویر */
        .sp-nd-figure::after, .sp-nd-article figure:has(img)::after {
            content: "مشاهده کامل تصویر ⤢";
            position: absolute;
            inset-inline-start: 14px;
            top: 14px;
            padding: 6px 14px;
            border-radius: 99px;
            font-size: .78rem;
            font-weight: 700;
            color: #fff;
            background: rgba(27,38,48,.62);
            backdrop-filter: blur(6px);
            pointer-events: none;
            opacity: 0;
            transform: translateY(-4px);
            transition: opacity .3s, transform .4s var(--sx-ease);
        }

        .sp-nd-figure:hover::after, .sp-nd-article figure:has(img):hover::after {
            opacity: 1;
            transform: none;
        }

@media (hover: none) {
    .sp-nd-figure::after, .sp-nd-article figure:has(img)::after {
        opacity: 1;
        transform: none;
    }
}

.sp-nd-figure figcaption, .sp-nd-article figcaption, .sp-nd-gallery-grid figcaption {
    margin-top: 12px;
    padding-inline: 6px;
    font-size: var(--nd-fs-small);
    line-height: 1.9;
    color: var(--sx-soft);
    text-align: justify;
    text-justify: inter-word;
    text-align-last: center;
}

/* ---------- ویدیو و iframe ---------- */
.sp-nd-article .sp-vp-mount, .sp-nd-article video, .sp-nd-article iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    border: 0;
    border-radius: 20px;
    background: #1B2630;
    overflow: hidden;
}

/* ---------- جدول ---------- */
.sp-nd-table-wrap, .sp-nd-table-scroll {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--sx-line);
    -webkit-overflow-scrolling: touch;
}

.sp-nd-article table {
    width: 100%;
    border-collapse: collapse;
    font-size: .96rem;
    line-height: 1.9;
}

.sp-nd-article th, .sp-nd-article td, .sp-nd-mud-table th, .sp-nd-mud-table td {
    padding: 12px 16px;
    text-align: justify;
    text-justify: inter-word;
    border-bottom: 1px solid var(--sx-line);
    vertical-align: top;
    min-width: 110px;
}

.sp-nd-article th, .sp-nd-mud-table th {
    background: var(--sx-mist) !important;
    color: var(--sx-deeper) !important;
    font-weight: 800;
    white-space: nowrap;
    border-bottom: 2px solid var(--sx-steel);
}

.sp-nd-article tbody tr:nth-child(even) td {
    background: #FAFBFC;
}

.sp-nd-article tbody tr:hover td {
    background: var(--sx-mist);
}

.sp-nd-article tr:last-child td {
    border-bottom: 0;
}

/* ---------- عنوان بخش‌ها ---------- */
.sp-nd-sec-title {
    position: relative;
    margin: 0 0 24px;
    padding-bottom: 12px;
    font-size: var(--nd-fs-h2);
    font-weight: 800;
    line-height: 1.6;
    text-align: justify;
}

    .sp-nd-sec-title::after {
        content: "";
        position: absolute;
        bottom: 0;
        inset-inline-start: 0;
        width: 36px;
        height: 2px;
        background: var(--sx-accent);
    }

/* ---------- گالری: ارتفاع ثابت ---------- */
.sp-nd-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

    .sp-nd-gallery-grid figure {
        position: relative;
        margin: 0;
    }

    .sp-nd-gallery-grid img {
        display: block;
        width: 100%;
        height: var(--nd-gal-h);
        object-fit: cover;
        object-position: center;
        border-radius: 16px;
        cursor: zoom-in;
        background: var(--sx-mist);
        transition: transform .5s var(--sx-ease), box-shadow .5s;
    }

        .sp-nd-gallery-grid img:hover {
            transform: translateY(-5px) scale(1.02);
            box-shadow: 0 18px 36px rgba(27,38,48,.18);
        }

/* ---------- فایل‌های ضمیمه ---------- */
.sp-nd-files ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.sp-nd-files a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1px solid var(--sx-line);
    border-radius: 14px;
    color: var(--sx-ink);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .35s var(--sx-ease);
}

    .sp-nd-files a:hover {
        border-color: var(--sx-steel);
        background: var(--sx-mist);
        transform: translateX(-5px);
    }

.sp-nd-file-icon {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--sx-deeper);
    color: #fff;
}

/* ---------- لایت‌باکس: تصویر کامل بدون برش ---------- */
.sp-lb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(27,38,48,.9);
    backdrop-filter: blur(6px);
    animation: sxLb .3s ease;
}

@keyframes sxLb {
    from {
        opacity: 0;
    }
}

.sp-lb-inner {
    position: relative;
    max-width: 96vw;
    max-height: 94vh;
}

.sp-lb-stage {
    overflow: auto;
    max-height: 82vh;
    border-radius: 14px;
}

    .sp-lb-stage img {
        display: block;
        margin: auto;
        width: auto !important;
        height: auto !important;
        max-width: 94vw;
        max-height: 80vh;
        object-fit: contain !important;
        border-radius: 12px;
        cursor: zoom-out;
        transition: transform .25s;
    }

.sp-lb-close, .sp-lb-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: var(--sx-deeper);
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform .3s var(--sx-ease);
}

    .sp-lb-close:hover, .sp-lb-btn:hover {
        transform: scale(1.1);
    }

.sp-lb-close {
    position: absolute;
    top: -52px;
    inset-inline-end: 0;
}

.sp-lb-tools {
    position: absolute;
    top: -52px;
    inset-inline-start: 0;
    display: flex;
    gap: 8px;
}

.sp-lb-cap {
    margin-top: 14px;
    color: #fff;
    font-size: .95rem;
    line-height: 1.9;
    text-align: center;
}

.sp-nd a:focus-visible, .sp-nd button:focus-visible {
    outline: 2px solid var(--sx-accent);
    outline-offset: 3px;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 900px) {
    .sp-nd {
        --nd-img-h: 340px;
        --nd-gal-h: 200px;
    }
}

@media (max-width: 600px) {
    .sp-nd {
        --nd-img-h: 240px;
        --nd-gal-h: 170px;
        --nd-lh-body: 2.05;
    }

    .sp-nd-wrap {
        padding-inline: 12px;
        gap: 20px;
    }

    .sp-nd-card {
        border-radius: 18px;
    }

    .sp-nd-quote, .sp-nd-article blockquote {
        padding: 18px 20px;
    }

    .sp-nd-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-nd *, .sp-lb {
        transition: none !important;
        animation: none !important;
    }
}
/* ---------- قفل راست‌چین برای تمام متن‌ها، حتی اگر با انگلیسی شروع شوند ---------- */
.sp-nd,
.sp-nd-card,
.sp-nd-title,
.sp-nd-lead,
.sp-nd-article,
.sp-nd-article *:not(pre):not(code):not(pre *) {
    direction: rtl !important;
    unicode-bidi: normal !important;
    /*text-align: justify !important;*/
    text-justify: inter-word;
    text-align-last: right !important;
}

    /* تیترها، نقل‌قول‌ها، لیست‌ها، جدول و زیرنویس‌ها */
    .sp-nd-h2, .sp-nd-article h1, .sp-nd-article h2, .sp-nd-article h3,
    .sp-nd-article h4, .sp-nd-article h5, .sp-nd-article h6,
    .sp-nd-quote, .sp-nd-article blockquote,
    .sp-nd-article li, .sp-nd-article th, .sp-nd-article td,
    .sp-nd-mud-table th, .sp-nd-mud-table td,
    .sp-nd-sec-title {
        direction: rtl !important;
        unicode-bidi: normal !important;
        text-align: justify !important;
        text-align-last: right !important;
    }

    /* زیرنویس عکس‌ها وسط‌چین بماند */
    .sp-nd-figure figcaption, .sp-nd-article figcaption,
    .sp-nd-gallery-grid figcaption, .sp-lb-cap {
        direction: rtl !important;
        text-align: center !important;
        text-align-last: center !important;
    }

    /* لیست: نقطه‌ها سمت راست */
    .sp-nd-article ul, .sp-nd-article ol {
        direction: rtl !important;
        padding-inline-start: 1.6em;
        padding-inline-end: 0;
    }

    /* فقط کد و بلوک کد چپ‌چین بمانند */
    .sp-nd-article pre, .sp-nd-article pre *, .sp-nd-article code {
        direction: ltr !important;
        text-align: left !important;
        text-align-last: left !important;
        unicode-bidi: embed !important;
    }