/* =========================================================
   NewsDetail — جزئیات خبر (Liquid Glass، هماهنگ با بقیه‌ی سایت)
   ========================================================= */
.nd-page {
    --nd-gold: var(--fk-gold, #c9a84c);
    --nd-gold-hi: #f2d98a;
    --nd-silver: #c9ced6;
    /* خط عمودی طلایی‌نقره‌ای */
    --nd-gs-v: linear-gradient(180deg, var(--nd-gold-hi), var(--nd-gold) 45%, var(--nd-silver));
    --nd-gs-h: linear-gradient(270deg, var(--nd-silver), var(--nd-gold-hi) 40%, var(--nd-gold));
    width: 100%;
    background: var(--fk-bg);
    color: var(--fk-text-main);
    direction: rtl;
    padding-top: 110px;
    padding-bottom: 80px;
    min-height: 60vh;
}

/* نوار پیشرفت مطالعه (بهبود تدریجی؛ فقط مرورگرهای پشتیبان scroll-timeline) */
.nd-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    z-index: 9998;
    pointer-events: none;
    transform-origin: 100% 50%;
    transform: scaleX(0);
    background: linear-gradient(270deg, #dfe3ea, #f2d98a 40%, var(--fk-gold));
}

@supports (animation-timeline: scroll()) {
    .nd-progress {
        animation: nd-read linear both;
        animation-timeline: scroll(root block);
    }

    @keyframes nd-read {
        to { transform: scaleX(1); }
    }
}

/* ---------- هدر ---------- */
.nd-hero {
    padding: 26px 0 10px;
    text-align: right;
}

.nd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: .85rem;
    color: rgba(var(--fk-white-rgb), .55);
    margin-bottom: 18px;
}

    .nd-breadcrumb a {
        color: rgba(var(--fk-white-rgb), .72);
        text-decoration: none;
        transition: color .2s;
    }

        .nd-breadcrumb a:hover { color: var(--fk-text-main); }

.nd-bc-current {
    color: var(--fk-text-main);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nd-cat {
    display: inline-block;
    padding: 6px 16px;
    margin-bottom: 14px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--fk-text-main);
    border: 1px solid var(--fk-glass-border);
    background: var(--fk-glass-ctrl-bg);
    -webkit-backdrop-filter: var(--fk-glass-ctrl-filter);
    backdrop-filter: var(--fk-glass-ctrl-filter);
    box-shadow: var(--fk-glass-ctrl-shadow);
}

.nd-title {
    margin: 0 0 16px;
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    font-weight: 800;
    line-height: 1.6;
    color: var(--fk-text-main);
    animation: nd-rise .8s cubic-bezier(.2, .7, .2, 1) backwards;
}

.nd-meta {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.nd-meta-item {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: rgba(var(--fk-white-rgb), .68);
    font-size: .9rem;
}

.nd-featured {
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--fk-text-main);
    color: #111;
    font-size: .74rem;
    font-weight: 800;
}

@keyframes nd-rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
}

/* ---------- چیدمان ---------- */
.nd-section { padding: 18px 0 0; }

.nd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.nd-article {
    min-width: 0;
    padding: clamp(16px, 3vw, 32px);
    border-radius: 26px;
    border: 1px solid var(--fk-glass-border);
    background: var(--fk-glass-card-bg);
    -webkit-backdrop-filter: var(--fk-glass-card-filter);
    backdrop-filter: var(--fk-glass-card-filter);
    box-shadow: var(--fk-glass-card-shadow);
}

.nd-cover {
    margin: 0 0 24px;
    border-radius: 18px;
    overflow: hidden;
    background: #140e08;
}

.nd-cover-img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 640px;
    object-fit: cover;
}

.nd-video, .nd-inline-video { margin: 0 0 24px; border-radius: 16px; overflow: hidden; background: #000; }
.nd-video-el { display: block; width: 100%; max-height: 520px; }

.nd-excerpt {
    margin: 0 0 26px;
    padding-inline-start: 18px;
    border-inline-start: 3px solid var(--nd-gold);
    text-align: justify;
    text-align-last: start;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 2.1;
    color: var(--fk-text-soft, var(--fk-text-main));
}

/* ---------- بدنه ---------- */
.nd-body { font-size: 1.02rem; line-height: 2.2; color: var(--fk-text-main); overflow-wrap: anywhere; }
.nd-body::after { content: ""; display: block; clear: both; }
.nd-p { margin: 0 0 18px; text-align: justify; text-align-last: start; }
.nd-p a, .nd-quote a, .nd-callout a, .nd-list a { color: var(--fk-gold); text-decoration: underline; text-underline-offset: 4px; }

.nd-h2 {
    clear: both;
    position: relative;
    margin: 38px 0 16px;
    padding-inline-start: 16px;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.7;
}

    .nd-h2::before {
        content: "";
        position: absolute;
        inset-inline-start: 0;
        top: .35em;
        bottom: .35em;
        width: 4px;
        border-radius: 4px;
        background: var(--nd-gs-v);
        box-shadow: 0 0 12px rgba(var(--fk-gold-rgb), .35);
    }

.nd-h3 { clear: both; margin: 28px 0 12px; font-size: 1.2rem; font-weight: 800; line-height: 1.8; color: var(--fk-gold); }

.nd-list { margin: 0 0 18px; padding-inline-start: 26px; text-align: justify; text-align-last: start; }
.nd-list li { margin-bottom: 6px; padding-inline-start: 4px; }
.nd-list li::marker { color: var(--nd-gold); font-weight: 800; }

.nd-callout {
    position: relative;
    clear: both;
    margin: 22px 0;
    padding: 18px 26px 18px 22px;
    border-radius: 16px;
    border: 1px solid rgba(var(--fk-gold-rgb), .3);
    background: linear-gradient(135deg, rgba(var(--fk-gold-rgb), .13), rgba(201, 206, 214, .05));
    font-weight: 600;
    line-height: 2;
    text-align: justify;
    text-align-last: start;
}

    .nd-callout::before {
        content: "";
        position: absolute;
        inset-inline-start: 0;
        top: 12px;
        bottom: 12px;
        width: 4px;
        border-radius: 4px;
        background: var(--nd-gs-v);
    }

.nd-quote {
    clear: both;
    margin: 24px 0;
    padding: 18px 24px;
    border-inline-start: 4px solid var(--nd-gold);
    border-radius: 14px;
    background: rgba(var(--fk-white-rgb), .05);
    font-size: 1.1rem;
    font-style: italic;
    line-height: 2.1;
    text-align: justify;
    text-align-last: start;
}

.nd-divider {
    clear: both;
    margin: 34px auto;
    width: 100%;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 206, 214, .55) 30%, rgba(var(--fk-gold-rgb), .8) 50%, rgba(201, 206, 214, .55) 70%, transparent);
}

/* تصویر داخل متن: همیشه تمام‌عرض و ۴:۳ (بدون بزرگ‌نمایی) */
.nd-figure { clear: both; margin: 24px 0; }
.nd-figure-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; }
.nd-figure figcaption { margin-top: 8px; text-align: center; font-size: .86rem; color: var(--fk-text-muted); line-height: 1.8; }

/* گالری کوچک داخل متن: ۳ تصویر در هر ردیف، حداکثر ۶ تصویر (دو ردیف)؛ با کلیک بزرگ می‌شود */
.nd-mini { clear: both; margin: 24px 0; }
.nd-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nd-mini-item {
    position: relative; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; cursor: zoom-in;
    border-radius: 12px; border: 1px solid rgba(var(--fk-gold-rgb), .25); background: #140e08;
    transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.nd-mini-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nd-mini-item:hover, .nd-mini-item:focus-visible {
    border-color: var(--nd-gold); transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .4), 0 0 0 1px rgba(var(--fk-gold-rgb), .5), 0 0 22px rgba(var(--fk-gold-rgb), .25);
    outline: 0;
}
.nd-mini figcaption { margin-top: 8px; text-align: center; font-size: .86rem; color: var(--fk-text-muted); line-height: 1.8; }

.nd-html, .nd-table-wrap { clear: both; margin: 18px 0; }
.nd-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(var(--fk-white-rgb), .12); }
.nd-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.nd-table th, .nd-table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid rgba(var(--fk-white-rgb), .08); }
.nd-table th { background: rgba(var(--fk-white-rgb), .08); font-weight: 800; }
.nd-table tr:last-child td { border-bottom: 0; }

/* ---------- گالری ---------- */
.nd-gallery { clear: both; margin-top: 34px; }
.nd-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.nd-gal-item {
    aspect-ratio: 4 / 3; padding: 0; border: 1px solid var(--fk-glass-border); border-radius: 14px; overflow: hidden;
    cursor: zoom-in; background: #140e08; transition: transform .3s ease, box-shadow .3s ease;
}
.nd-gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.nd-gal-item:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0, 0, 0, .4); }
.nd-gal-item:hover img { transform: scale(1.08); }

/* ---------- فایل‌ها ---------- */
.nd-files { margin-top: 30px; }
.nd-files ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nd-files a {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; text-decoration: none;
    color: var(--fk-text-main); border: 1px solid var(--fk-glass-border); background: rgba(var(--fk-white-rgb), .04);
    transition: background .25s, transform .25s;
}
.nd-files a:hover { background: rgba(var(--fk-white-rgb), .1); transform: translateX(-4px); }
.nd-files small { margin-inline-start: auto; opacity: .6; }

/* ---------- پایین مقاله ---------- */
.nd-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(var(--fk-white-rgb), .1);
}
.nd-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; color: var(--fk-text-muted); }
.nd-share a, .nd-share button {
    padding: 6px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: .85rem; text-decoration: none;
    color: var(--fk-text-main); border: 1px solid var(--fk-glass-border); background: var(--fk-glass-ctrl-bg);
    -webkit-backdrop-filter: var(--fk-glass-ctrl-filter); backdrop-filter: var(--fk-glass-ctrl-filter);
    transition: transform .2s, background .2s;
}
.nd-share a:hover, .nd-share button:hover { transform: translateY(-2px); background: rgba(var(--fk-white-rgb), .14); }

.nd-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px; text-decoration: none;
    font-weight: 700; color: var(--fk-text-main); border: 1px solid var(--fk-glass-border); background: var(--fk-glass-ctrl-bg);
    -webkit-backdrop-filter: var(--fk-glass-ctrl-filter); backdrop-filter: var(--fk-glass-ctrl-filter);
    box-shadow: var(--fk-glass-ctrl-shadow); transition: transform .25s, background .25s, color .25s;
}
.nd-btn:hover { transform: translateY(-2px); background: rgba(var(--fk-white-rgb), .92); color: var(--fk-bg); }

.nd-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.nd-pn-item {
    display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 16px; text-decoration: none;
    color: var(--fk-text-main); border: 1px solid var(--fk-glass-border); background: rgba(var(--fk-white-rgb), .04);
    transition: transform .25s, background .25s;
}
.nd-pn-item:hover { transform: translateY(-3px); background: rgba(var(--fk-white-rgb), .1); }
.nd-pn-item small { color: var(--fk-text-muted); font-size: .76rem; }
.nd-pn-item strong { font-size: .95rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nd-pn-end { text-align: left; }

/* ---------- سایدبار ---------- */
.nd-side {
    position: sticky; top: 100px; padding: 20px; border-radius: 24px;
    border: 1px solid var(--fk-glass-border); background: var(--fk-glass-card-bg);
    -webkit-backdrop-filter: var(--fk-glass-card-filter); backdrop-filter: var(--fk-glass-card-filter);
    box-shadow: var(--fk-glass-card-shadow);
}
.nd-side-title { margin: 0 0 14px; font-size: 1.1rem; font-weight: 800; }
.nd-side-item {
    display: flex; gap: 12px; align-items: center; padding: 10px; margin-inline: -10px; border-radius: 14px;
    text-decoration: none; color: var(--fk-text-main); transition: background .25s, transform .25s;
}
.nd-side-item:hover { background: rgba(var(--fk-white-rgb), .08); transform: translateX(-3px); }
.nd-side-thumb { flex: 0 0 96px; width: 96px; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: #140e08; }
.nd-side-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nd-side-date { display: block; font-size: .74rem; color: var(--fk-text-muted); margin-bottom: 3px; }
.nd-side-name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; line-height: 1.7; }

/* ---------- Lightbox ---------- */
.nd-lb {
    position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
    padding: 24px; background: rgba(8, 5, 3, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    animation: nd-fade .25s ease;
}
.nd-lb figure { margin: 0; max-width: min(1100px, 92vw); text-align: center; }
.nd-lb img { max-width: 100%; max-height: 80vh; border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.nd-lb figcaption { margin-top: 10px; color: #fff; opacity: .85; }
.nd-lb-close, .nd-lb-nav {
    position: absolute; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; color: #fff; font-size: 1.3rem;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1);
}
.nd-lb-close { top: 20px; left: 20px; }
.nd-lb-nav { top: 50%; transform: translateY(-50%); font-size: 2rem; line-height: 1; }
.nd-lb-prev { right: 20px; }
.nd-lb-next { left: 20px; }
@keyframes nd-fade { from { opacity: 0; } }

/* ---------- حالت‌های خالی/بارگذاری ---------- */
.nd-empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.nd-empty-icon { opacity: .5; }
.nd-empty-title { margin: 0; font-size: 1.5rem; font-weight: 800; }
.nd-skel { display: flex; flex-direction: column; gap: 14px; padding: 30px 0; }
.nd-skel span { display: block; height: 18px; border-radius: 9px; width: 60%; background: linear-gradient(110deg, rgba(255,255,255,.05) 8%, rgba(255,255,255,.14) 18%, rgba(255,255,255,.05) 33%); background-size: 200% 100%; animation: nd-shimmer 1.6s linear infinite; }
.nd-skel span:first-child { height: 34px; width: 80%; }
.nd-skel span:last-child { width: 40%; }
@keyframes nd-shimmer { to { background-position-x: -200%; } }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 960px) {
    .nd-layout { grid-template-columns: minmax(0, 1fr); }
    .nd-side { position: static; }
}

@media (max-width: 600px) {
    .nd-page { padding-top: 90px; }
    .nd-body { font-size: .98rem; line-height: 2.1; }
    .nd-mini-grid { gap: 6px; }
    .nd-pn { grid-template-columns: 1fr; }
    .nd-bc-current { max-width: 180px; }
    .nd-h2 { font-size: 1.28rem; }
}

@media (prefers-reduced-motion: reduce) {
    .nd-title, .nd-lb { animation: none; }
    .nd-progress { display: none; }
}

/* نوار پیش‌نمایش (فقط وقتی از پنل مدیریت باز شود) */
.nd-preview-bar { position: sticky; top: 0; z-index: 50; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 16px; text-align: center; font-size: .84rem; color: #1b1408; background: linear-gradient(90deg, #c9ced6, #f6e7b0, #d4af37); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.nd-preview-bar b { font-weight: 800; }
