/* صفحه نمایش خبر — هدر، متن، پیوست، دیدگاه‌ها و اخبار مرتبط (روشن و شب) */
.nd-hero, .nd-wrap {
    --nd-bg: #f3f6f9;
    --nd-surface: #ffffff;
    --nd-surface-2: #f6f9fb;
    --nd-line: #e1e8ee;
    --nd-ink: #1c2b39;
    --nd-ink-2: #3d4f5f;
    --nd-muted: #6b7c8a;
    --nd-navy: #0b3d5c;
    --nd-teal: #1a7a6d;
    --nd-teal-soft: rgba(26, 122, 109, .1);
    --nd-gold: #c59b27;
    --nd-shadow: 0 1px 2px rgba(11, 61, 92, .06), 0 10px 30px rgba(11, 61, 92, .08);
}
html[data-theme="dark"] .nd-hero,
html[data-theme="dark"] .nd-wrap {
    --nd-bg: #0d1a26;
    --nd-surface: #14283a;
    --nd-surface-2: #112334;
    --nd-line: #28445a;
    --nd-ink: #e6eef4;
    --nd-ink-2: #c2d1dc;
    --nd-muted: #8fa5b6;
    --nd-navy: #7cc4ff;
    --nd-teal: #4fc3b1;
    --nd-teal-soft: rgba(79, 195, 177, .14);
    --nd-gold: #e0b94a;
    --nd-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .35);
}

/* ---------- هدر ---------- */
.nd-hero {
    position: relative;
    padding: 132px 0 96px;
    background: linear-gradient(135deg, #0a3350 0%, #0f4d6e 55%, #137a73 100%);
    color: #fff;
    overflow: hidden;
}
.nd-hero::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 255, 255, .10), transparent 42%),
        radial-gradient(circle at 88% 80%, rgba(79, 195, 177, .22), transparent 46%);
    pointer-events: none;
}
html[data-theme="dark"] .nd-hero { background: linear-gradient(135deg, #0a1620 0%, #0d2a40 55%, #0f4a52 100%); }
.nd-hero-inner { position: relative; max-width: 980px; }
.nd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 18px; color: rgba(255, 255, 255, .75); }
.nd-crumbs a { color: rgba(255, 255, 255, .92); text-decoration: none; }
.nd-crumbs a:hover { text-decoration: underline; }
.nd-crumb-current { color: rgba(255, 255, 255, .7); }
.nd-badge {
    display: inline-block; padding: 5px 14px; margin-bottom: 14px;
    border-radius: 999px; font-size: 12.5px; font-weight: 700;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
}
.nd-title {
    margin: 0 0 20px; color: #fff !important;
    font-size: clamp(1.35rem, 2.6vw + .6rem, 2.1rem); line-height: 1.75; font-weight: 700;
}
.nd-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: rgba(255, 255, 255, .88); }
.nd-meta li { display: inline-flex; align-items: center; gap: 7px; }
.nd-meta i { opacity: .8; }

/* ---------- ظرف اصلی ---------- */
.nd-wrap { max-width: 980px; margin-top: -56px; position: relative; padding-bottom: 56px; }
.nd-article, .nd-gallery, .nd-comments, .nd-related {
    background: var(--nd-surface); color: var(--nd-ink);
    border: 1px solid var(--nd-line); border-radius: 20px; box-shadow: var(--nd-shadow);
    padding: clamp(18px, 3.2vw, 38px); margin-bottom: 26px;
}
.nd-h2 { margin: 0 0 18px; font-size: 1.15rem; font-weight: 700; color: var(--nd-ink) !important; display: flex; align-items: center; gap: 10px; }
.nd-h2::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: var(--nd-teal); }

/* ---------- تصویر شاخص ---------- */
.nd-cover { margin: 0 0 26px; border-radius: 16px; overflow: hidden; background: var(--nd-surface-2); }
.nd-cover a { display: block; }
.nd-cover img { display: block; width: 100%; max-height: 460px; object-fit: cover; }

/* ---------- متن خبر ---------- */
.nd-body { font-size: 1.04rem; line-height: 2.15; color: var(--nd-ink-2); text-align: justify; overflow-wrap: anywhere; }
.nd-body p { margin: 0 0 1.1em; }
.nd-body h2, .nd-body h3, .nd-body h4 { margin: 1.6em 0 .6em; line-height: 1.7; color: var(--nd-ink); }
.nd-body img { max-width: 100%; height: auto !important; border-radius: 12px; margin: 10px auto; display: block; }
.nd-body a { color: var(--nd-teal); text-decoration: underline; }
.nd-body ul, .nd-body ol { padding-inline-start: 1.6em; margin-bottom: 1.1em; }
.nd-body blockquote { margin: 1.2em 0; padding: 12px 18px; border-inline-start: 4px solid var(--nd-gold); background: var(--nd-surface-2); border-radius: 10px; }
.nd-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0; }
.nd-body td, .nd-body th { border: 1px solid var(--nd-line); padding: 8px 12px; }
.nd-body iframe, .nd-body video { max-width: 100%; border-radius: 12px; }
/* متن‌هایی که ویرایشگر با رنگ ثابت (مثلا مشکی) ذخیره کرده، در حالت شب باید خوانا بمانند */
html[data-theme="dark"] .nd-body :where(p, span, div, li, td, th, strong, em, b, i, u, font, h1, h2, h3, h4, h5, h6) {
    color: inherit !important;
    background-color: transparent !important;
}
html[data-theme="dark"] .nd-body :where(h1, h2, h3, h4, h5, h6) { color: var(--nd-ink) !important; }
html[data-theme="dark"] .nd-body a, html[data-theme="dark"] .nd-body a :where(span, strong) { color: var(--nd-teal) !important; }

/* ---------- برچسب‌ها و اشتراک‌گذاری ---------- */
.nd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.nd-tag {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 13px; border-radius: 999px; font-size: 12.5px;
    background: var(--nd-teal-soft); color: var(--nd-teal) !important; text-decoration: none; border: 1px solid transparent;
}
.nd-tag:hover { border-color: var(--nd-teal); }
.nd-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--nd-line); }
.nd-share-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; color: var(--nd-ink); margin-inline-end: 6px; }
.nd-share-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; cursor: pointer;
    font: inherit; font-size: 13px; color: var(--nd-ink) !important; text-decoration: none;
    background: var(--nd-surface-2); border: 1px solid var(--nd-line);
}
.nd-share-btn:hover { border-color: var(--nd-teal); color: var(--nd-teal) !important; }

/* ---------- پیوست‌ها ---------- */
.nd-attach { margin-top: 28px; }
.nd-attach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nd-attach-list a {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; text-decoration: none;
    background: var(--nd-surface-2); border: 1px solid var(--nd-line); color: var(--nd-ink) !important;
}
.nd-attach-list a:hover { border-color: var(--nd-teal); }
.nd-attach-list i { font-size: 22px; color: var(--nd-teal); }
.nd-attach-name { flex: 1; font-size: 14px; }
.nd-attach-dl { font-size: 12.5px; padding: 4px 12px; border-radius: 999px; background: var(--nd-teal-soft); color: var(--nd-teal); }

/* ---------- گالری ---------- */
.nd-gallery img { border-radius: 14px; }

/* ---------- دیدگاه‌ها ---------- */
.nd-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px;
    border-radius: 999px; font-size: 13px; background: var(--nd-teal-soft); color: var(--nd-teal);
}
.nd-form { background: var(--nd-surface-2); border: 1px solid var(--nd-line); border-radius: 16px; padding: clamp(16px, 2.6vw, 26px); margin-bottom: 28px; }
.nd-form-title { margin: 0 0 16px; font-size: 1rem; font-weight: 700; color: var(--nd-ink); }
.nd-field { margin-bottom: 14px; }
.nd-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--nd-ink-2); }
.nd-input {
    width: 100%; padding: 11px 14px; font: inherit; font-size: 14.5px; line-height: 1.8;
    color: var(--nd-ink); background: var(--nd-surface); border: 1px solid var(--nd-line); border-radius: 12px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.nd-input::placeholder { color: var(--nd-muted); }
.nd-input:focus { border-color: var(--nd-teal); box-shadow: 0 0 0 3px var(--nd-teal-soft); }
.nd-textarea { resize: vertical; min-height: 130px; }
.nd-counter { display: block; margin-top: 4px; text-align: left; color: var(--nd-muted); font-size: 12px; }
.nd-form .nz-captcha-label { color: var(--nd-ink-2); }
.nd-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.nd-send {
    display: inline-flex; align-items: center; gap: 9px; padding: 11px 26px; border: 0; border-radius: 12px; cursor: pointer;
    font: inherit; font-size: 14.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #0f4d6e, #1a7a6d);
}
.nd-send:hover { filter: brightness(1.08); }
.nd-send:disabled { opacity: .6; cursor: wait; }
.nd-note { color: var(--nd-muted); font-size: 12.5px; }

.nd-comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.nd-comment { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--nd-line); border-radius: 16px; background: var(--nd-surface); }
.nd-avatar {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px; color: #fff; background: linear-gradient(135deg, #0f4d6e, #1a7a6d);
}
.nd-comment-main { flex: 1; min-width: 0; }
.nd-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 6px; }
.nd-comment-name { color: var(--nd-ink); font-size: 14.5px; }
.nd-comment-date { color: var(--nd-muted); font-size: 12.5px; }
.nd-comment-text { margin: 0; color: var(--nd-ink-2); font-size: 14.5px; line-height: 2; white-space: pre-line; overflow-wrap: anywhere; }
.nd-reply { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--nd-teal-soft); border-inline-start: 4px solid var(--nd-teal); }
.nd-reply-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 4px; font-size: 12.5px; color: var(--nd-muted); }
.nd-reply-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--nd-teal); }
.nd-reply-text { color: var(--nd-ink-2); font-size: 14px; line-height: 1.95; }
.nd-empty { margin: 0; padding: 22px; text-align: center; color: var(--nd-muted); border: 1px dashed var(--nd-line); border-radius: 14px; }

/* ---------- اخبار مرتبط ---------- */
.nd-related-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.nd-rcard {
    display: flex; flex-direction: column; border: 1px solid var(--nd-line); border-radius: 14px; overflow: hidden;
    text-decoration: none; background: var(--nd-surface-2); transition: transform .15s, border-color .15s;
}
.nd-rcard:hover { transform: translateY(-3px); border-color: var(--nd-teal); }
.nd-rcard-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--nd-line); }
.nd-rcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nd-rcard-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }
.nd-rcard-title { color: var(--nd-ink); font-size: 14px; font-weight: 700; line-height: 1.85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nd-rcard-date { color: var(--nd-muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 767px) {
    .nd-hero { padding: 96px 0 78px; }
    .nd-wrap { margin-top: -44px; padding-inline: 12px; }
    .nd-body { font-size: 1rem; line-height: 2.05; text-align: right; }
    .nd-related-grid { grid-template-columns: 1fr; }
    .nd-comment { padding: 12px; gap: 10px; }
    .nd-avatar { flex-basis: 38px; width: 38px; height: 38px; font-size: 16px; }
}
@media (min-width: 768px) and (max-width: 991px) {
    .nd-related-grid { grid-template-columns: repeat(2, 1fr); }
}
