/* دليل الاستخدام (/guide عربي و/en/guide إنجليزي) — فوق app.css (الألوان والهيدر والأزرار والفوتر من هناك).
   الصور والفيديوهات على nabd-cdn.gply.top/guide/ وتتملى أبعادها وقت البناء (build.mjs ← data-g) فما فيش اهتزاز */
.guide { --toc-w: 250px; --gap: clamp(28px, 4vw, 56px); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
code { font: 500 .92em/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; direction: ltr; unicode-bidi: isolate; }
.gdoc a:not(.btn), .lead a { color: var(--p-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- البطل ---------- */
.ghero { padding: clamp(36px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); background: radial-gradient(60% 80% at 85% 0%, var(--p-soft), transparent 70%), var(--bg); border-bottom: 1px solid var(--line); }
html[dir="ltr"] .ghero { background: radial-gradient(60% 80% at 15% 0%, var(--p-soft), transparent 70%), var(--bg); }
.ghero__in { display: grid; grid-template-columns: 1fr auto; gap: clamp(28px, 5vw, 72px); align-items: center; }
.ghero h1 { font-size: clamp(30px, 4.6vw, 52px); }
.ghero__btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.quick { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; }
.quick a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding-inline: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.quick a:hover { border-color: var(--p); color: var(--ink); }
.quick b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--p); color: var(--on-p); font-size: 13px; }
.ghero__vid { margin: 0; width: min(300px, 70vw); }
.ghero__vid figcaption { text-align: center; margin-top: 12px; color: var(--ink-3); font-size: 14px; }

/* إطار جوال للفيديوهات العمودية */
.phone video, .phone img { display: block; width: 100%; height: auto; border-radius: 22px; border: 8px solid #10131a; background: #10131a; box-shadow: var(--sh-lg); }

/* ---------- الهيكل: فهرس ثابت + المحتوى ---------- */
.gbody { display: grid; grid-template-columns: var(--toc-w) minmax(0, 1fr); gap: var(--gap); align-items: start; padding-top: var(--gap); padding-bottom: var(--gap); }
.toc { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; }
.toc__box { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 6px 8px 10px; }
.toc summary { cursor: pointer; list-style: none; padding: 10px 10px 8px; font-weight: 700; font-family: var(--head); font-size: 15px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; counter-reset: t; margin: 0; padding: 0; }
.toc li { counter-increment: t; }
.toc li a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.toc li a::before { content: counter(t); flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); font-size: 12px; font-weight: 700; }
html[lang="ar"] .toc li a::before { content: counter(t, arabic-indic); }
.toc li a:hover { background: var(--surface-2); color: var(--ink); }
.toc li a.is-on { background: var(--p-soft); color: var(--p-ink); font-weight: 600; }
.toc li a.is-on::before { background: var(--p); color: var(--on-p); }

.gdoc { min-width: 0; }
.gsec { scroll-margin-top: 88px; padding-bottom: var(--gap); margin-bottom: var(--gap); border-bottom: 1px solid var(--line); }
.gsec:last-child { border-bottom: 0; margin-bottom: 0; }
.gsec__n { color: var(--p); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.gsec h2 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 14px; }
.gsec > p { color: var(--ink-2); max-width: 72ch; font-size: 16.5px; }
.gsec h3 { font-size: 18px; }
.gsec h4 { font-family: var(--head); font-size: 15px; font-weight: 600; margin: 18px 0 8px; color: var(--ink); }
.gsec h4:first-child { margin-top: 0; }
.benefit { margin-top: 10px; color: var(--ink-2); }
.benefit b:first-child { color: var(--ok); }

/* ما تحتاجه */
.need { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.need__i { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.need__i svg { grid-row: span 2; color: var(--p); margin-top: 4px; }
.need__i b { font-weight: 600; }
.need__i span { color: var(--ink-2); font-size: 15px; }

/* تنبيهات */
.tip { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; padding: 16px 18px; border-radius: var(--r); background: var(--p-soft); border: 1px solid color-mix(in srgb, var(--p) 22%, transparent); }
.tip > svg { color: var(--p); margin-top: 3px; }
.tip p { color: var(--ink-2); }
.tip--warn { background: color-mix(in srgb, #f59e0b 12%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 35%, transparent); }
.tip--warn > svg { color: #b45309; }
@media (prefers-color-scheme: dark) { .tip--warn > svg { color: #fbbf24; } }

/* الخطوات المرقّمة بخط رأسي */
.gsteps { list-style: none; counter-reset: s; margin: 22px 0 0; padding: 0; }
.gsteps > li { counter-increment: s; position: relative; padding-inline-start: 52px; padding-bottom: 28px; }
.gsteps > li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: -2px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--p); color: var(--on-p); font: 700 15px/1 var(--head); box-shadow: 0 0 0 5px var(--bg); }
html[lang="ar"] .gsteps > li::before { content: counter(s, arabic-indic); }
.gsteps > li::after { content: ''; position: absolute; inset-inline-start: 16px; top: 36px; bottom: 4px; width: 2px; background: var(--line); }
.gsteps > li:last-child { padding-bottom: 0; }
.gsteps > li:last-child::after { display: none; }
.gsteps h3 { margin-bottom: 6px; }
.gsteps p { color: var(--ink-2); }
.gsteps p + p { margin-top: 10px; }

/* لقطات الشاشة */
.shot { margin: 16px 0 0; }
.shot img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--sh); cursor: zoom-in; }
.shot img:focus-visible, .tcard__img:focus-within { outline: 3px solid var(--p); outline-offset: 3px; }
.shot figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-3); }
.shot--panel { max-width: 380px; }
.shot--panel img { max-height: 720px; object-fit: cover; object-position: top; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); gap: 18px; align-items: start; }
.pair .shot { margin-top: 16px; }
.pair--top { margin-top: 18px; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
.pair--top .feat { margin-top: 16px; }
.pair--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* صندوق «لماذا / الفرق» */
.why { margin-top: 24px; padding: 20px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.why h3 { margin-bottom: 10px; }
.why ul:not(.checks) { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.why .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
.feat { margin: 18px 0 0; padding-inline-start: 20px; display: grid; gap: 12px; color: var(--ink-2); }
.feat b { color: var(--ink); }

/* ---------- القوالب ---------- */
.ptabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); width: fit-content; max-width: 100%; }
.ptabs button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 600 15px/1 var(--body); cursor: pointer; }
.ptabs button:hover { color: var(--ink); background: var(--surface-2); }
.ptabs button[aria-selected="true"] { background: var(--p); color: var(--on-p); }
.ptabs button:focus-visible { outline: 3px solid var(--p); outline-offset: 2px; }
.pp { margin-top: 20px; }
.pp__media { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; align-items: center; }
.vid { margin: 0; }
.vid--desk video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; border: 1px solid var(--line); background: #10131a; box-shadow: var(--sh-lg); }
.vid--mob video { aspect-ratio: 390 / 844; }
.pp__body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; margin-top: 26px; }
.pp__body p { color: var(--ink-2); margin-top: 8px; }
.pp__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px !important; }
.looks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.looks li { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.looks b { display: block; font-weight: 600; }
.looks span { color: var(--ink-3); font-size: 14px; line-height: 1.6; }
.mini { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; color: var(--ink-2); font-size: 15px; }

/* ---------- تبويبات اللوحة ---------- */
.tcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.tcard { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tcard__img { position: relative; margin: 0; height: 250px; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.tcard__img img { width: 100%; height: auto; cursor: zoom-in; }
.tcard__img::after { content: ''; position: absolute; inset: auto 0 0; height: 56px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.tcard h3 { margin-bottom: 6px; }
.tcard h3 small { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.tcard p { color: var(--ink-2); font-size: 15px; }

/* جدول التنسيق */
.shot--wide { margin-top: 18px; }
.tablewrap { overflow-x: auto; margin-top: 20px; border: 1px solid var(--line); border-radius: var(--r); }
.gtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.gtable th, .gtable td { padding: 12px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.gtable th { background: var(--surface-2); font-weight: 600; }
.gtable td:first-child { font-weight: 600; white-space: nowrap; }
.gtable td { color: var(--ink-2); }
.gtable tr:last-child td { border-bottom: 0; }

/* الأسئلة والنهاية */
.gsec .faq { margin-top: 20px; }
.gend { margin-top: 32px; padding: 26px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.gend p { color: var(--ink-2); margin-top: 6px; }
.gend__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px !important; }

/* لقطة لم تُجهَّز بعد (اختيارية) تختفي بدل إطار فاضي */
figure:has(> img[data-g]:not([src])), figure:has(> video[data-g]:not([src])) { display: none; }
.tcard:has(.tcard__img img:not([src])) { grid-template-columns: minmax(0, 1fr); }
.pp__media:not(:has(video[src])) { display: none; }
.ghero__in:not(:has(video[src])) { grid-template-columns: minmax(0, 1fr); }
/* دليل ووردبريس (2026-10-18): لقطة اللوحة بعرض الشاشة مكان فيديو الجوال */
.ghero__vid--wp { width: min(560px, 44vw); margin: 0; }
.ghero__vid--wp img { border-radius: 14px; }
.ghero__in:has(.ghero__vid--wp img[src]) { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 960px) { .ghero__in:has(.ghero__vid--wp img[src]) { grid-template-columns: minmax(0, 1fr); } .ghero__vid--wp { width: 100%; } }

/* ---------- الشاشات الأصغر ---------- */
@media (max-width: 1100px) {
  .tcards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .gbody { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; }
  .ghero__in { grid-template-columns: minmax(0, 1fr); }
  .ghero__vid { justify-self: center; }
  .pp__body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .need, .pair, .pair--top, .pair--wide { grid-template-columns: minmax(0, 1fr); }
  .shot--panel { max-width: none; }
  .pp__media { grid-template-columns: minmax(0, 1fr); }
  .vid--mob { width: min(230px, 70%); justify-self: center; }
  .why .checks { grid-template-columns: minmax(0, 1fr); }
  .tcard { grid-template-columns: minmax(0, 1fr); }
  .tcard__img { height: 220px; }
  .ptabs { border-radius: var(--r); }
  .ptabs button { flex: 1 1 auto; padding: 0 12px; }
  .gtable td:first-child { white-space: normal; }
  .gsteps > li { padding-inline-start: 46px; }
}
.shot--wide img { max-height: 900px; object-fit: cover; object-position: top; }
.pair--gap { margin-top: 18px; }

/* ---------- فصول الشرح التفصيلي (/guide/<slug>) ---------- */
.ghero--chapter { padding-block: clamp(28px, 4vw, 52px) clamp(24px, 3vw, 36px); }
.ghero--chapter h1 { font-size: clamp(28px, 4vw, 46px); margin-top: 4px; }
.ghero--chapter .lead { max-width: 70ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--p-ink); }
.crumbs b { color: var(--ink); font-weight: 600; }
.toc__chapters { margin-top: 14px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.toc__chapters p { padding: 0 10px 6px; font: 700 14px/1.4 var(--head); color: var(--ink-3); }
.toc__chapters ul { list-style: none; margin: 0; padding: 0; }
.toc__chapters a { display: block; padding: 6px 10px; border-radius: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.toc__chapters a:hover { background: var(--surface-2); color: var(--ink); }
.toc__chapters a[aria-current] { background: var(--p-soft); color: var(--p-ink); font-weight: 600; }
.chapnav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.chapnav a { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none !important; }
.chapnav a:hover { border-color: var(--p); }
.chapnav small { color: var(--ink-3); font-size: 13px; }
.chapnav b { color: var(--ink); font-weight: 600; }
.chapnav__next { text-align: end; }
.gdoc .chapnav a { color: inherit; }

/* شرح الإعدادات: اسم الإعداد ← خياراته ← ماذا يفعل */
.fields { margin: 18px 0 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.fields > div { display: grid; grid-template-columns: minmax(150px, 30%) minmax(0, 1fr); gap: 6px 20px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.fields > div:last-child { border-bottom: 0; }
.fields dt { font-weight: 600; color: var(--ink); }
.fields dt small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.fields dd { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.fields dd p + p { margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips span { display: inline-flex; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.chips span b { color: var(--ink); font-weight: 600; margin-inline-end: 4px; }
.ui { display: inline; padding: 1px 7px; border-radius: 6px; background: var(--p-soft); color: var(--p-ink); font-weight: 600; font-size: .94em; white-space: nowrap; }
.path { font-weight: 600; color: var(--ink); }

/* معرض خيارات بوصف قصير (التخطيطات، أنواع البطاقات…) */
.cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 16px; }
.cat > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.cat b { display: block; font-weight: 600; }
.cat code { font-size: 12px; margin-inline-start: 4px; }
.cat span { display: block; color: var(--ink-3); font-size: 14px; line-height: 1.6; margin-top: 2px; }
.gdoc h3.sub { margin-top: 28px; font-size: 19px; }
.gdoc h3.sub + p { margin-top: 6px; color: var(--ink-2); }
.gdoc .gsec > p + p { margin-top: 12px; }
.shot--side { float: inline-end; width: min(320px, 45%); margin: 4px 0 14px; margin-inline-start: 22px; }
.gsec::after { content: ''; display: table; clear: both; }

/* بطاقات الفصول في الدليل الرئيسي */
.chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.chapters a { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none !important; color: inherit !important; }
.chapters a:hover { border-color: var(--p); box-shadow: var(--sh); }
.chapters svg { grid-row: span 2; color: var(--p); margin-top: 3px; }
.chapters b { font-weight: 600; color: var(--ink); }
.chapters span { color: var(--ink-3); font-size: 14.5px; line-height: 1.6; }
.tcard__more { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 14.5px; }

@media (max-width: 640px) {
  .fields > div { grid-template-columns: minmax(0, 1fr); }
  .chapnav, .chapters { grid-template-columns: minmax(0, 1fr); }
  .shot--side { float: none; width: auto; margin-inline-start: 0; }
}
@media (max-width: 960px) { .toc__chapters { display: none; } }

/* أمثلة جاهزة للنسخ (فصل متجر التطبيقات…) */
.codebox { position: relative; margin-top: 16px; }
pre.code { margin: 0; max-height: 520px; overflow: auto; padding: 56px 18px 18px; border-radius: var(--r); background: #0f1218; color: #d7dde8; border: 1px solid var(--line); font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
pre.code code { background: none; border: 0; padding: 0; font: inherit; color: inherit; }
.codebox__copy { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; }
html[dir="rtl"] .codebox__copy { inset-inline-end: auto; left: 10px; }
.gdoc code, .fields dt, .gtable td { overflow-wrap: anywhere; } /* روابط طويلة (Redirect URI، روابط المتجر) ما تكسرش عرض الجوال */

/* ===== مدونة نبض (2026-10-13) ===== */
.pmeta { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.pcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.pcard { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.pcard__img { display: block; height: 220px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.pcard__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.pcard__txt { padding: 18px 20px 20px; }
.pcard h2 { font-size: 20px; line-height: 1.5; margin: 0 0 8px; }
.pcard h2 a { color: inherit; text-decoration: none; }
.pcard h2 a:hover { color: var(--accent); }
.pcard p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.ctabox { margin: 40px 0 24px; padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.ctabox h2 { margin: 0 0 8px; font-size: 22px; }
.ctabox p { margin: 0 0 12px; }
.ctabox p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.gdoc .cmp { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: 15px; }
.gdoc .cmp th, .gdoc .cmp td { border: 1px solid var(--line); padding: 9px 10px; text-align: start; vertical-align: top; }
.gdoc .cmp th { background: var(--surface-2); }
.gdoc .cmp td.good { color: #0a7a3c; font-weight: 600; }
.gdoc .cmp td.bad { color: #b42318; }
@media (max-width: 760px) { .pcards { grid-template-columns: minmax(0, 1fr); } .pcard__img { height: 180px; } }
