/* =====================================================================
 * single.css — دیزاینی لاپەڕەی بابەتی تاک (single.php + header-single.php)
 *
 * تێم: ڕەنگەکان وەک گۆڕاوی CSS لەسەر :root دانراون و لە html[data-theme="dark|sepia"]
 *      دەگۆڕدرێن؛ فۆنت لە html[data-font]، و قەبارەی نووسین لە --lk-scale (بڕوانە single.js)
 * ===================================================================== */

:root {
  --lk-page: #fff;  --lk-surface: #f4f4f5;  --lk-card: #fff;  --lk-text: #1c1c1e;  --lk-muted: #7a7a82;
  --lk-line: #e3e3e6;  --lk-accent: #2f8de4;  --lk-accent-soft: #cfe8fb;  --lk-accent-text: #0b4a80;
  --lk-bar: #f0f0f2;  --lk-scale: 1;
  --lk-font: 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif;
}
html[data-theme="dark"] {
  --lk-page: #0f131a;  --lk-surface: #171c26;  --lk-card: #1d2330;  --lk-text: #e6e9ef;  --lk-muted: #9aa3b2;
  --lk-line: #2a3140;  --lk-accent: #6db3f2;  --lk-accent-soft: #1d3550;  --lk-accent-text: #bcdcfa;  --lk-bar: #1d2330;
}
html[data-theme="sepia"] {
  --lk-page: #f4ecd8;  --lk-surface: #eadfc4;  --lk-card: #faf4e4;  --lk-text: #433422;  --lk-muted: #8a7558;
  --lk-line: #dccfae;  --lk-accent: #b5651d;  --lk-accent-soft: #ecd6b0;  --lk-accent-text: #6b3a0c;  --lk-bar: #e8dcbc;
}
html[data-font="vazir"] { --lk-font: 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif; }
html[data-font="naskh"] { --lk-font: 'Noto Naskh Arabic', 'Scheherazade New', serif; }
html[data-font="kufi"]  { --lk-font: 'Noto Kufi Arabic', 'Noto Sans Arabic', sans-serif; }
html[data-font="sans"]  { --lk-font: 'Noto Sans Arabic', 'Vazirmatn', sans-serif; }

body.lk-single-page, body.lk-bar-page { background: var(--lk-page) !important; color: var(--lk-text); font-family: var(--lk-font); transition: background .3s, color .3s; }
body.lk-single-page a { color: var(--lk-accent); }
body.lk-single-page .lk-single, .lk-bar, .lk-sheet { font-family: var(--lk-font); }

/* ───────────── نواری ئایکۆنی (کاپسوڵ) ───────────── */
.lk-bar-wrap { position: fixed; top: 0; left: 0; right: 0; z-index: 1040; display: flex; justify-content: center; pointer-events: none; padding-top: 14px; }
.lk-bar {
  pointer-events: auto; display: flex; align-items: center; gap: .15rem; direction: rtl;
  width: min(300px, calc(100vw - 32px)); padding: .35rem .6rem; border-radius: 999px;
  background: var(--lk-bar); border: 1px solid var(--lk-line);
  animation: lkBarIn .6s cubic-bezier(.2,.8,.2,1) both;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .3s, width .3s, background .3s;
}
@keyframes lkBarIn { from { transform: translateY(-80px); opacity: 0; } to { transform: none; opacity: 1; } }
/* لەگەڵ سکرۆڵ: نوارەکە بەرەو خوارەوە دەخلیسکێت و سێبەر و شووشەیی وەردەگرێت */
.lk-bar.is-scrolled { transform: translateY(6px); box-shadow: 0 10px 30px rgba(0,0,0,.14); background: color-mix(in srgb, var(--lk-bar) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lk-bar-gap { flex: 1; }
.lk-ic { position: relative; width: 2.3rem; height: 2.3rem; border: 0; background: none; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--lk-text); cursor: pointer; transition: background .2s, transform .2s; }
.lk-ic:hover { background: var(--lk-line); transform: scale(1.08); }
.lk-ic:focus-visible { outline: 2px solid var(--lk-accent); outline-offset: 1px; }
.lk-ic svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lk-ic.is-on svg path { fill: currentColor; }
.lk-badge { position: absolute; top: -.35rem; inset-inline-start: -.2rem; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: 999px; background: var(--lk-accent); color: #fff; font-size: .62rem; line-height: 1.25rem; font-weight: 700; text-align: center; }
.lk-badge[hidden] { display: none; }

/* ───────────── مۆداڵەکان ───────────── */
.lk-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-start; justify-content: center; padding: 70px 1rem 1rem; background: rgba(10,14,22,.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: lkFade .2s both; }
.lk-modal[hidden] { display: none; }
@keyframes lkFade { from { opacity: 0; } to { opacity: 1; } }
.lk-sheet { width: min(440px, 100%); max-height: calc(100vh - 90px); overflow: auto; background: var(--lk-card); color: var(--lk-text); border: 1px solid var(--lk-line); border-radius: 22px; padding: 1.1rem 1.2rem 1.3rem; box-shadow: 0 24px 60px rgba(0,0,0,.28); text-align: right; animation: lkSheet .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes lkSheet { from { transform: translateY(-24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.lk-sheet-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.lk-sheet-head h2 { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--lk-text); }
.lk-x { border: 0; background: var(--lk-surface); color: var(--lk-text); width: 2rem; height: 2rem; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.lk-x:hover { background: var(--lk-line); }
.lk-pill { font-size: .75rem; background: var(--lk-accent-soft); color: var(--lk-accent-text); padding: .2rem .7rem; border-radius: 999px; }
.lk-list { list-style: none; margin: 0; padding: 0; }
.lk-list li a { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .8rem; border-radius: 12px; color: var(--lk-text) !important; text-decoration: none; transition: background .2s; }
.lk-list li a:hover { background: var(--lk-surface); }
.lk-list li em { font-style: normal; font-size: .75rem; background: var(--lk-surface); color: var(--lk-muted); padding: .1rem .6rem; border-radius: 999px; }
.lk-search { display: flex; gap: .5rem; }
.lk-search input { flex: 1; min-width: 0; border: 1px solid var(--lk-line); background: var(--lk-surface); color: var(--lk-text); border-radius: 12px; padding: .7rem 1rem; font-family: inherit; }
.lk-search input:focus { outline: 2px solid var(--lk-accent); }
.lk-search button, .lk-btn { border: 0; border-radius: 12px; padding: .6rem 1.1rem; background: var(--lk-surface); color: var(--lk-text); font-family: inherit; cursor: pointer; transition: background .2s, transform .2s; }
.lk-search button, .lk-btn-main { background: var(--lk-accent); color: #fff; }
.lk-btn:hover, .lk-search button:hover { transform: translateY(-1px); }
.lk-btn-main { display: block; width: 100%; margin-bottom: .8rem; }
.lk-btn-ghost { background: transparent; border: 1px solid var(--lk-line); }
.lk-empty { color: var(--lk-muted); text-align: center; margin: 1rem 0 0; }
.lk-bm-list li { display: flex; align-items: center; }
.lk-bm-list li a { flex: 1; min-width: 0; }
.lk-bm-del { border: 0; background: none; color: var(--lk-muted); font-size: 1.2rem; cursor: pointer; }
.lk-bm-del:hover { color: #e04a4a; }

/* تۆڕی دوو-ستوونی (مێنیۆ: پۆلەکان + تۆڕە کۆمەڵایەتییەکان) */
.lk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.lk-tile { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 3rem; padding: .6rem .85rem; border-radius: 14px; background: var(--lk-surface); border: 1px solid transparent; color: var(--lk-text) !important; font-size: .88rem; text-decoration: none; transition: transform .2s, background .2s, border-color .2s, box-shadow .2s; }
.lk-tile:hover { transform: translateY(-2px); background: var(--lk-accent-soft); border-color: var(--lk-accent); box-shadow: 0 6px 16px rgba(0,0,0,.08); text-decoration: none; }
.lk-tile em { font-style: normal; font-size: .7rem; background: var(--lk-card); color: var(--lk-muted); padding: .1rem .55rem; border-radius: 999px; }
.lk-tile i, .lk-tile svg { font-size: 1.15rem; width: 1.15rem; height: 1.15rem; color: var(--lk-accent); flex: none; }
.lk-tile.lk-soc { justify-content: flex-start; gap: .65rem; }
.lk-tile.lk-soc svg path { fill: currentColor; }
.lk-sheet .lk-sec:first-of-type { margin-top: 0; }

/* ڕێکخستنەکان */
.lk-sec { font-size: .85rem; color: var(--lk-muted); margin: 1.1rem 0 .5rem; font-weight: 600; }
.lk-opts { display: grid; gap: .5rem; }
.lk-opts-2 { grid-template-columns: repeat(2, 1fr); }
.lk-opts-3 { grid-template-columns: repeat(3, 1fr); }
.lk-opt { border: 2px solid var(--lk-line); background: var(--lk-surface); color: var(--lk-text); border-radius: 14px; padding: .7rem .5rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: 1rem; transition: border-color .2s, transform .2s; }
.lk-opt small { font-size: .72rem; color: var(--lk-muted); }
.lk-opt:hover { transform: translateY(-2px); }
.lk-opt[aria-pressed="true"] { border-color: var(--lk-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lk-accent) 25%, transparent); }
.lk-th-light { background: #fff; color: #1c1c1e; }
.lk-th-dark  { background: #0f131a; color: #e6e9ef; }
.lk-th-sepia { background: #f4ecd8; color: #433422; }
.lk-size { display: flex; align-items: center; gap: .5rem; }
.lk-size-val { flex: 1; text-align: center; font-weight: 700; }

/* ───────────── ناوەڕۆکی لاپەڕە ───────────── */
.lk-single { max-width: 1000px; margin: 0 auto; padding: 5.2rem 1.1rem 3rem; direction: rtl; }
.lk-title { font-size: 1.5rem; font-weight: 800; line-height: 1.9; margin: 1.2rem 0 1.4rem; text-align: right; color: var(--lk-text); }

.lk-top-row { display: grid; grid-template-columns: 1fr 200px; gap: 1.5rem; align-items: start; }
.lk-cover { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 2 / 1; background: #5fd0d8; }
.lk-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lk-facts { position: absolute; inset-inline-start: 0; bottom: 1.2rem; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.lk-facts li { background: rgba(20,60,70,.55); color: #fff; font-size: .75rem; padding: .3rem .8rem; border-radius: 0 8px 8px 0; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html[dir="rtl"] .lk-facts li, .lk-single .lk-facts li { border-radius: 8px 0 0 8px; }
.lk-meta { padding-top: 5rem; }
.lk-meta-h { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; color: var(--lk-text); }
.lk-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.4rem; }
.lk-chip { display: inline-block; font-size: .8rem; background: var(--lk-surface); color: var(--lk-text) !important; padding: .25rem .8rem; border-radius: 8px; text-decoration: none; transition: background .2s; }
.lk-chip:hover { background: var(--lk-accent-soft); text-decoration: none; }
.lk-author { display: flex; align-items: center; gap: .7rem; color: var(--lk-text) !important; text-decoration: none; }
.lk-author b { display: block; font-size: .95rem; }
.lk-author small { color: var(--lk-muted); font-size: .75rem; }
.lk-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

.lk-body-row { display: grid; grid-template-columns: 1fr 230px; gap: 2rem; margin-top: 2rem; align-items: start; }
.lk-aside { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 1rem; }
.lk-share { border: 0; border-radius: 10px; padding: .75rem 1rem; background: var(--lk-accent-soft); color: var(--lk-accent-text); font-family: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: transform .2s; }
.lk-share:hover { transform: translateY(-2px); }
.lk-toc { background: var(--lk-surface); border-radius: 12px; padding: 1rem; }
.lk-toc[hidden] { display: none; }
.lk-toc h3 { font-size: .9rem; margin: 0 0 .8rem; font-weight: 700; color: var(--lk-text); }
.lk-toc ol { list-style: none; margin: 0; padding: 0 0 0 0; position: relative; max-height: 55vh; overflow: auto; }
.lk-toc ol::after { content: ""; position: absolute; top: .3rem; bottom: .3rem; left: .35rem; border-left: 2px dotted var(--lk-line); }
.lk-toc li { position: relative; padding-left: 1.4rem; }
.lk-toc li::after { content: ""; position: absolute; left: .12rem; top: .85rem; width: 9px; height: 9px; border-radius: 50%; background: var(--lk-line); z-index: 1; transition: background .2s, transform .2s; }
.lk-toc li.is-active::after { background: var(--lk-accent); transform: scale(1.3); }
.lk-toc a { display: block; padding: .3rem 0; font-size: .82rem; line-height: 1.7; color: var(--lk-muted) !important; text-decoration: none; }
.lk-toc li.is-active a, .lk-toc a:hover { color: var(--lk-text) !important; }
.lk-toc li.lk-h3 a { padding-right: .8rem; font-size: .78rem; }

/* ناوەڕۆکی بابەت — قەبارە بە --lk-scale دەگۆڕدرێت */
.lk-article { font-size: calc(1rem * var(--lk-scale)); line-height: 2.15; text-align: justify; color: var(--lk-text); min-width: 0; overflow-wrap: anywhere; }
.lk-article h2, .lk-article h3, .lk-article h4 { font-weight: 800; line-height: 1.8; margin: 1.6rem 0 .5rem; color: var(--lk-text); scroll-margin-top: 90px; }
.lk-article h2 { font-size: 1.25em; } .lk-article h3 { font-size: 1.1em; }
.lk-article p { margin: 0 0 1rem; }
.lk-article img, .lk-article video, .lk-article iframe { max-width: 100%; height: auto; border-radius: 12px; }
.lk-article pre { direction: ltr; text-align: left; background: var(--lk-surface); color: var(--lk-text); padding: 1rem; border-radius: 12px; overflow: auto; font-size: .85em; }
.lk-article code { direction: ltr; unicode-bidi: embed; background: var(--lk-surface); color: var(--lk-text); padding: .1rem .4rem; border-radius: 6px; }
.lk-article pre code { background: none; padding: 0; }
.lk-article blockquote { margin: 1rem 0; padding: .5rem 1rem; border-inline-start: 4px solid var(--lk-accent); background: var(--lk-surface); border-radius: 8px; }
.lk-article table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; }
.lk-article td, .lk-article th { border: 1px solid var(--lk-line); padding: .4rem .7rem; }
.lk-article a { color: var(--lk-accent); }
.lk-article-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--lk-line); font-size: .85rem; color: var(--lk-muted); font-size: .85rem; }
.lk-foot-row { margin-bottom: .6rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.lk-foot-row b { color: var(--lk-text); }

/* بابەتی پەیوەندیدار */
.lk-related { margin-top: 3rem; background: var(--lk-surface); border-radius: 18px; padding: 1.2rem; }
.lk-related h2 { font-size: 1rem; font-weight: 700; margin: 0 0 1rem; color: var(--lk-text); }
.lk-rel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.lk-rel-card { display: flex; align-items: center; gap: .8rem; background: var(--lk-card); border-radius: 12px; padding: .7rem; color: var(--lk-text) !important; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: transform .2s, box-shadow .2s; }
.lk-rel-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.12); text-decoration: none; }
.lk-rel-card img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.lk-rel-card small { display: block; color: var(--lk-muted); font-size: .7rem; margin-bottom: .2rem; }
.lk-rel-card b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .82rem; line-height: 1.8; font-weight: 600; }

/* زەنگی «نوێ» لە ناونیشان */
.lk-title .lk-bell { font-size: .7em; }

/* فووتەر لە شەو/کاهی */
html[data-theme="dark"] .footer.lk-footer { background-image: none !important; background-color: #0f131a !important; }
html[data-theme="sepia"] .footer.lk-footer { background: #eadfc4 !important; }
html[data-theme="dark"] .lk-foot-desc, html[data-theme="sepia"] .lk-foot-desc { color: var(--lk-muted); }
html[data-theme="dark"] .lk-foot-logo { mix-blend-mode: screen; filter: invert(.9) hue-rotate(180deg); }

/* مۆبایل */
@media (max-width: 767px) {
  .lk-single { padding-top: 4.6rem; }
  .lk-title { font-size: 1.2rem; }
  .lk-top-row { grid-template-columns: 1fr; gap: 1rem; }
  .lk-meta { padding-top: .4rem; } /* لە مۆبایل ٥rem زۆرە */
  .lk-body-row { grid-template-columns: 1fr; gap: 1rem; }
  .lk-aside { position: static; order: -1; }
  .lk-toc ol { max-height: 14rem; }
  .lk-rel-grid { grid-template-columns: 1fr; }
  .lk-modal { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) { .lk-bar, .lk-sheet, .lk-modal, .lk-bell { animation: none !important; } }
@media print { .lk-bar-wrap, .lk-modal, .lk-aside, .lk-related { display: none !important; } }

/* لاپەڕەی یەکەم: نوارەکە لەسەر هیرۆ دەوەستێت */
body.lk-bar-page .lk-bar-wrap { z-index: 1050; }

/* دوگمەی کۆپی بۆ <code> (single.js) — لەناو بلۆکی کۆد */
.lk-code-wrap { position: relative; margin: 1rem 0; background: var(--lk-surface); border: 1px solid var(--lk-line); border-radius: 12px; overflow: hidden; }
.lk-code-wrap pre { margin: 0 !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; padding: 2.6rem 1rem 1rem !important; }
.lk-copy { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 1px solid var(--lk-line); border-radius: 9px; background: var(--lk-card); color: var(--lk-muted); cursor: pointer; vertical-align: middle; transition: color .2s, background .2s, border-color .2s, transform .2s, box-shadow .2s; }
.lk-copy svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lk-copy:hover { color: var(--lk-accent); border-color: var(--lk-accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.lk-copy:focus-visible { outline: 2px solid var(--lk-accent); outline-offset: 2px; }
.lk-code-wrap .lk-copy { position: absolute; top: .5rem; right: .5rem; opacity: .85; }
.lk-code-wrap:hover .lk-copy, .lk-copy:focus { opacity: 1; }
.lk-copy-inline { width: 1.4rem; height: 1.4rem; border-radius: 6px; margin-inline-start: .4rem; margin-inline-end: -.15rem; background: transparent; user-select: none; }
.lk-copy-inline svg { width: .85rem; height: .85rem; }
.lk-copy.is-done { color: #fff; background: #22a35a; border-color: #22a35a; }
.lk-copy-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px); background: #22a35a; color: #fff; font-size: .7rem; padding: .15rem .55rem; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-family: var(--lk-font); }
.lk-copy.is-done .lk-copy-tip { opacity: 1; transform: translate(-50%, 0); }
@media print { .lk-copy { display: none !important; } }

/* ڕێڕەوی لاپەڕە (تۆ لێرەیت) لە ژێر وێنەی سەرەکی */
.lk-cover-col { min-width: 0; }
.lk-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .8rem; margin: .9rem 0 0; padding: .6rem 1rem; background: var(--lk-surface); border: 1px solid var(--lk-line); border-radius: 14px; font-size: .85rem; }
.lk-crumb-label { color: var(--lk-muted); white-space: nowrap; }
.lk-crumb-label i { color: var(--lk-accent); margin-inline-end: .25rem; }
.lk-crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; margin: 0; padding: 0; list-style: none; min-width: 0; flex: 1; }
.lk-crumb li { display: inline-flex; align-items: center; min-width: 0; }
/* جیاکەرەوە: تیرۆکەی چەپ (‹) بە CSS — لە ڕاست بۆ چەپ دەخوێنرێتەوە */
.lk-crumb li + li::before { content: ""; width: .45rem; height: .45rem; margin: 0 .55rem; border-left: 2px solid var(--lk-muted); border-bottom: 2px solid var(--lk-muted); transform: rotate(45deg); opacity: .6; flex: none; }
.lk-crumb a { color: var(--lk-text) !important; text-decoration: none; padding: .2rem .65rem; border-radius: 8px; transition: background .2s, color .2s; }
.lk-crumb a:hover { background: var(--lk-accent-soft); color: var(--lk-accent-text) !important; text-decoration: none; }
.lk-crumb a i { color: var(--lk-accent); margin-inline-start: .2rem; }
.lk-crumb li[aria-current] span { color: var(--lk-muted); padding: .2rem .4rem; max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 767px) { .lk-crumb { font-size: .8rem; padding: .5rem .7rem; } .lk-crumb li[aria-current] span { max-width: 12rem; } }
@media print { .lk-crumb { display: none; } }
