/*!
 * NESTORLAND — صفحه تک‌مقاله (nsa-*). فقط روی is_singular('post') لود می‌شود.
 * رنگ‌ها از توکن‌های قالب (--c-*) تا با حالت روز/شب و رنگ برند هماهنگ باشد.
 */
.nsa { --nsa-card: var(--c-surface); --nsa-line: var(--c-border); --nsa-soft: rgba(255,255,255,.04); --nsa-r: 22px; padding: 20px 0 64px; }
html[data-theme="light"] .nsa { --nsa-soft: rgba(15,23,41,.04); --nsa-line: rgba(15,23,41,.09); }
.nsa .np-ico { flex-shrink: 0; }
.nsa a { text-decoration: none; }
.nsa-muted { color: var(--c-text-muted); font-size: 12px; }

/* نوار پیشرفت بالای صفحه */
.nsa-progress { position: fixed; z-index: 300; top: 0; right: 0; left: 0; height: 3px; pointer-events: none; }
.nsa-progress span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--c-primary-l), var(--c-primary)); transform: scaleX(var(--p, 0)); transform-origin: right; }
body.admin-bar .nsa-progress { top: 32px; }

/* کاور */
.nsa-cover { position: relative; margin: 0; overflow: hidden; border-radius: var(--nsa-r); background: var(--c-surface-2); aspect-ratio: 21/9; }
.nsa-cover__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nsa-cover figcaption { position: absolute; bottom: 12px; right: 12px; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; }
@media (max-width: 640px) { .nsa-cover { aspect-ratio: 16/10; border-radius: 18px; } }

/* کارت اطلاعات */
.nsa-info { position: relative; z-index: 1; margin: 0 auto 20px; padding: 24px 28px; border: 1px solid var(--nsa-line); border-radius: var(--nsa-r); background: var(--nsa-card); box-shadow: 0 18px 40px -20px var(--c-shadow); }
.nsa-info.has-cover { width: calc(100% - 48px); margin-top: -64px; }
@media (max-width: 640px) { .nsa-info { padding: 18px; } .nsa-info.has-cover { width: calc(100% - 20px); margin-top: -36px; } }
.nsa-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--c-text-muted); font-size: 12px; }
.nsa-crumb a { color: var(--c-text-muted); }
.nsa-crumb a:hover { color: var(--c-primary); }
.nsa-crumb .np-ico { opacity: .6; }
.nsa-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.nsa-chip { padding: 4px 12px; border-radius: 99px; background: color-mix(in srgb, var(--c-primary) 13%, transparent); color: var(--c-primary) !important; font-size: 12px; font-weight: 800; }
.nsa-chip:hover { background: var(--c-primary); color: #fff !important; }
.nsa-title { margin: 0 0 10px; color: var(--c-white); font-size: clamp(1.35rem, 3vw, 2.15rem); font-weight: 900; line-height: 1.5; }
.nsa-lead { margin: 0 0 6px; color: var(--c-text-muted); font-size: 14.5px; line-height: 2; }
.nsa-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--nsa-line); }
.nsa-meta__by { display: flex; align-items: center; gap: 10px; }
.nsa-av { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.nsa-meta__by > span { display: flex; flex-direction: column; }
.nsa-meta__by strong { color: var(--c-white); font-size: 14px; }
.nsa-meta__by small { color: var(--c-text-muted); font-size: 12px; }
.nsa-meta__stats { display: flex; flex-wrap: wrap; gap: 8px; }
.nsa-meta__stats > * { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; background: var(--nsa-soft); color: var(--c-text-muted); font-size: 12px; font-weight: 700; }
.nsa-meta__stats a:hover { color: var(--c-primary); }
.nsa-meta__stats .np-ico { color: var(--c-primary); }

/* بدنه + نوار شناور + سایدبار */
.nsa-shell { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; align-items: start; }
.nsa-float { align-self: stretch; }
/* نوار شناور: دکمه‌ها در یک کپسول به‌هم‌پیوسته */
.nsa-float__in { position: sticky; top: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--nsa-line); border-radius: 20px; background: var(--nsa-card); box-shadow: 0 10px 30px -18px var(--c-shadow); }
.nsa-fbtn { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 13px; background: transparent; color: var(--c-text); cursor: pointer; transition: color .2s, background .2s; }
.nsa-fbtn:hover { background: var(--nsa-soft); color: var(--c-primary); }
.nsa-fbtn b { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); min-width: 16px; padding: 0 4px; border-radius: 99px; background: var(--c-surface-2); color: var(--c-text-muted); font-size: 9px; line-height: 1.6; text-align: center; }
.nsa-fbtn b:empty { display: none; }
.nsa-like.is-on { color: #ef4444; }
.nsa-like.is-on .np-ico { fill: currentColor; }
.nsa-like.is-pop .np-ico { animation: nsa-pop .35s ease; }
@keyframes nsa-pop { 50% { transform: scale(1.3); } }
/* نوار پیشرفت فقط وقتی مقاله به‌قدر کافی بلند است */
.nsa-float__bar { position: relative; width: 4px; height: 70px; margin-top: 4px; overflow: hidden; border-radius: 99px; background: var(--nsa-soft); }
.nsa-float__bar i { position: absolute; inset: 0; background: var(--c-primary); transform: scaleY(var(--p, 0)); transform-origin: top; transition: transform .15s linear; }
.nsa-shell.is-short .nsa-float__bar { display: none; }

.nsa-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.nsa-body { min-width: 0; padding: 28px 32px; border: 1px solid var(--nsa-line); border-radius: var(--nsa-r); background: var(--nsa-card); }
.nsa-body h2, .nsa-body h3 { scroll-margin-top: 110px; }
.nsa-body img, .nsa-body iframe, .nsa-body video { max-width: 100%; height: auto; }
.nsa-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nsa-body th, .nsa-body td { padding: 10px; border: 1px solid var(--nsa-line); }
.nsa-side { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 14px; }

.nsa-box { padding: 18px; border: 1px solid var(--nsa-line); border-radius: var(--nsa-r); background: var(--nsa-card); }
.nsa-box__title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--c-white); font-size: 15px; font-weight: 900; }
.nsa-box__title .np-ico { color: var(--c-primary); }

/* فهرست مطالب */
.nsa-toc summary { display: flex; align-items: center; gap: 8px; color: var(--c-white); font-size: 15px; font-weight: 900; list-style: none; cursor: pointer; }
.nsa-toc summary::-webkit-details-marker { display: none; }
.nsa-toc summary > .np-ico:first-child { color: var(--c-primary); }
.nsa-toc__chev { margin-inline-start: auto; color: var(--c-text-muted); transition: transform .2s; }
.nsa-toc[open] .nsa-toc__chev { transform: rotate(180deg); }
.nsa-toc ol { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; margin: 12px 0 0; padding: 0; overflow-y: auto; list-style: none; counter-reset: t; }
.nsa-toc li.is-h3 { padding-inline-start: 14px; }
.nsa-toc a { position: relative; display: block; padding: 8px 12px; border-radius: 10px; color: var(--c-text-muted); font-size: 13px; line-height: 1.7; transition: background .15s, color .15s; }
.nsa-toc a::before { position: absolute; top: 8px; right: 0; bottom: 8px; width: 3px; border-radius: 99px; background: transparent; content: ""; }
.nsa-toc a:hover { background: var(--nsa-soft); color: var(--c-white); }
.nsa-toc a.is-active { background: color-mix(in srgb, var(--c-primary) 10%, transparent); color: var(--c-white); font-weight: 700; }
.nsa-toc a.is-active::before { background: var(--c-primary); }

/* مرتبط‌ها */
.nsa-rel { display: flex; flex-direction: column; gap: 8px; }
.nsa-rel .nsa-box__title { margin-bottom: 4px; }
.nsa-rel__item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; transition: background .15s; }
.nsa-rel__item:hover { background: var(--nsa-soft); }
.nsa-rel__img { display: grid; flex-shrink: 0; place-items: center; width: 64px; height: 64px; overflow: hidden; border-radius: 12px; background: color-mix(in srgb, var(--c-primary) 12%, var(--c-surface-2)); color: var(--c-primary); }
.nsa-rel__img img { width: 100%; height: 100%; object-fit: cover; }
.nsa-rel__txt { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.nsa-rel__txt small { color: var(--c-primary); font-size: 11px; font-weight: 800; }
.nsa-rel__txt strong { display: -webkit-box; overflow: hidden; color: var(--c-white); font-size: 13px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.nsa-rel__item:hover strong { color: var(--c-primary); }
.nsa-rel__txt em { color: var(--c-text-muted); font-size: 11px; font-style: normal; }

/* پایین مقاله */
.nsa-foot { display: flex; flex-direction: column; gap: 16px; margin: 20px 0 0; padding-inline-start: 84px; }
.nsa-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nsa-tags > span { display: inline-flex; align-items: center; gap: 6px; color: var(--c-text-muted); font-size: 13px; font-weight: 700; }
.nsa-tags a { padding: 5px 12px; border: 1px solid var(--nsa-line); border-radius: 99px; color: var(--c-text-muted); font-size: 12px; transition: color .15s, border-color .15s; }
.nsa-tags a:hover { border-color: var(--c-primary); color: var(--c-primary); }

.nsa-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border: 1px solid color-mix(in srgb, var(--c-primary) 25%, var(--nsa-line)); border-radius: var(--nsa-r);
	background: radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--c-primary) 14%, transparent), transparent 70%), var(--nsa-card); scroll-margin-top: 110px; }
.nsa-share h2 { margin: 0 0 4px; color: var(--c-white); font-size: 16px; font-weight: 900; }
.nsa-share p { margin: 0; color: var(--c-text-muted); font-size: 13px; }
.nsa-share__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.nsa-sbtn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--nsa-line); border-radius: 12px; background: var(--c-surface-2); color: var(--c-text) !important; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.nsa-sbtn:hover { border-color: var(--c-primary); color: var(--c-primary) !important; }
.nsa-sbtn.is-telegram .np-ico { color: #29a9eb; }
.nsa-sbtn.is-whatsapp .np-ico { color: #25d366; }
.nsa-sbtn.is-bale .np-ico { color: #00a8a8; }
.nsa-sbtn--like b { padding: 0 6px; border-radius: 99px; background: var(--nsa-soft); font-size: 11px; }
.nsa-sbtn--like.is-on { border-color: rgba(239,68,68,.45); color: #ef4444 !important; }
.nsa-sbtn--like.is-on .np-ico { fill: currentColor; }
.nsa-sbtn.is-done { border-color: var(--c-primary); color: var(--c-primary) !important; }

.nsa-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nsa-pn__a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--nsa-line); border-radius: 18px; background: var(--nsa-card); transition: border-color .2s; }
.nsa-pn__a:hover { border-color: var(--c-primary); }
.nsa-pn__a small { display: inline-flex; align-items: center; gap: 4px; color: var(--c-text-muted); font-size: 12px; }
.nsa-pn__a strong { display: -webkit-box; overflow: hidden; color: var(--c-white); font-size: 14px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.nsa-pn__a.is-next { text-align: left; }
.nsa-pn__a.is-next small { align-self: flex-end; }

/* سرتیتر بخش‌ها */
.nsa-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.nsa-sec-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--c-white); font-size: 1.15rem; font-weight: 900; }
.nsa-sec-head h2 .np-ico { color: var(--c-primary); }
.nsa-sec-head > a { display: inline-flex; align-items: center; gap: 4px; color: var(--c-primary); font-size: 13px; font-weight: 700; }

/* محصولات پرفروش */
.nsa-prods { margin: 36px 0 0; }
.nsa-prods__rail { display: flex; gap: 12px; padding-bottom: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.nsa-prods__rail::-webkit-scrollbar { display: none; }
.nsa-prod { display: flex; flex: 0 0 min(190px, 44%); flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--nsa-line); border-radius: 20px; background: var(--nsa-card); scroll-snap-align: start; transition: border-color .2s, transform .2s; }
.nsa-prod:hover { border-color: color-mix(in srgb, var(--c-primary) 45%, transparent); transform: translateY(-3px); }
.nsa-prod__img { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: var(--c-surface-2); }
.nsa-prod__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nsa-prod__img i { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 11px; font-style: normal; font-weight: 900; }
.nsa-prod strong { display: -webkit-box; overflow: hidden; color: var(--c-white); font-size: 13px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.nsa-prod__price { display: flex; flex-direction: column; color: var(--c-primary); font-size: 14px; font-weight: 900; }
.nsa-prod__price del { color: var(--c-text-muted); font-size: 11px; font-weight: 500; }
.nsa-prod__price ins { text-decoration: none; }

/* دیدگاه‌ها */
.nsa-comments { margin-top: 28px; padding: 24px; }
.nsa-comment-list { margin-bottom: 8px; }
.nsa-comments .children { margin: 0 0 0; padding-inline-start: 28px; border-inline-start: 2px solid var(--nsa-line); }
html[data-theme="light"] .nsa .nsp-comment-card,
html[data-theme="light"] .nsa .nsp-comment-form { background: var(--c-surface-2); border-color: var(--nsa-line); }
html[data-theme="light"] .nsa .nsp-field { background: #fff; border-color: rgba(15,23,41,.14); }

/* نوار اکشن موبایل + اعلان */
.nsa-mbar { display: none; }
.nsa-toast { position: fixed; z-index: 400; bottom: 24px; left: 50%; padding: 10px 18px; border-radius: 12px; background: var(--c-white); color: var(--c-bg); font-size: 13px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.3); transform: translateX(-50%); }

@media (max-width: 1100px) {
	.nsa-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 960px) {
	.nsa-shell { grid-template-columns: 1fr; }
	.nsa-float { display: none; }
	.nsa-layout { grid-template-columns: 1fr; }
	.nsa-side { position: static; order: -1; }
	.nsa-rel { display: none; }
	.nsa-foot { padding-inline-start: 0; }
	.nsa-body { padding: 22px 20px; }
	.nsa-mbar { position: fixed; z-index: 99; right: 50%; bottom: calc(108px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 4px; padding: 6px; border: 1px solid var(--nsa-line); border-radius: 18px; background: color-mix(in srgb, var(--c-surface) 92%, transparent); backdrop-filter: blur(14px); box-shadow: 0 10px 30px var(--c-shadow); transform: translateX(50%); }
	.nsa-mbar > * { position: relative; display: inline-flex; align-items: center; gap: 4px; min-width: 44px; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--c-text); font: inherit; font-size: 12px; cursor: pointer; justify-content: center; }
	.nsa-mbar > *:active { background: var(--nsa-soft); }
	.nsa-mbar b { font-size: 11px; color: var(--c-text-muted); }
	.nsa-mbar .nsa-like.is-on { color: #ef4444; }
	.nsa-mbar .nsa-like.is-on .np-ico { fill: currentColor; }
	.nsa-toast { bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 961px) and (max-width: 1023px) { .nsa-mbar { bottom: 20px; } }
@media (max-width: 640px) {
	.nsa-pn { grid-template-columns: 1fr; }
	.nsa-share { padding: 18px; }
	.nsa-share__btns { width: 100%; }
	.nsa-sbtn { flex: 1 1 auto; justify-content: center; }
	.nsa-comments { padding: 18px 14px; }
	.nsa-meta__stats { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .nsa * { transition: none !important; animation: none !important; } }
