/* =========================================================================
   مطبخ الألعاب — التصميم الأساسي
   لايت أساسي + دارك اختياري · RTL · بريميوم عصري خفيف
   ========================================================================= */

/* ---------- 1) المتغيرات: الوضع الفاتح (الأساسي) ---------- */
:root {
  --brand:       #7c3aed;
  --brand-2:     #a855f7;
  --brand-ink:   #4c1d95;
  --accent:      #f59e0b;

  --bg:          #f6f7fb;
  --surface:     #ffffff;
  --surface-2:   #fbfbfe;
  --line:        #e6e8f0;
  --line-soft:   #eef0f7;

  --ink:         #14161f;
  --ink-2:       #3f4453;
  --ink-3:       #6b7185;
  --ink-inv:     #ffffff;

  --ok:          #10b981;
  --warn:        #f59e0b;
  --bad:         #ef4444;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(18,20,32,.05), 0 1px 3px rgba(18,20,32,.04);
  --sh-2: 0 2px 6px rgba(18,20,32,.06), 0 8px 20px rgba(18,20,32,.06);
  --sh-3: 0 10px 30px rgba(18,20,32,.10);

  --wrap: 1180px;
  --gap: 18px;
  --hdr-h: 62px;

  --font: "Segoe UI", "Noto Kufi Arabic", "Cairo", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --tr: .18s cubic-bezier(.4,0,.2,1);
}

/* ---------- 2) المتغيرات: الوضع الليلي ---------- */
[data-theme="dark"] {
  --brand:       #a78bfa;
  --brand-2:     #c4b5fd;
  --brand-ink:   #ddd6fe;
  --accent:      #fbbf24;

  --bg:          #0c0e16;
  --surface:     #141824;
  --surface-2:   #1a1f2e;
  --line:        #262c3d;
  --line-soft:   #1f2432;

  --ink:         #eef0f6;
  --ink-2:       #c3c8d6;
  --ink-3:       #8d94a8;
  --ink-inv:     #0c0e16;

  --sh-1: 0 1px 2px rgba(0,0,0,.3);
  --sh-2: 0 2px 8px rgba(0,0,0,.35), 0 10px 24px rgba(0,0,0,.3);
  --sh-3: 0 14px 36px rgba(0,0,0,.45);
}

/* ---------- 3) إعادة تعيين ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  /* يمنع أي تمرير أفقي عرضي بدون إنشاء حاوية تمرير جديدة */
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  direction: rtl;
  text-align: right;
  /* ملاحظة: مانستخدمش overflow-x: hidden هنا.
     تحديد overflow-x بقيمة غير visible بيخلي المتصفح يحوّل overflow-y
     لـauto تلقائيًا، فالـbody يبقى حاوية تمرير مستقلة — وده بيسبب شريط
     تمرير مزدوج ومشاكل مع العناصر اللاصقة. منع التمرير الأفقي بيتولاه
     `overflow-x: clip` على html، وclip مابينشئش حاوية تمرير. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--tr), color var(--tr);
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--brand-2); }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.7rem); }
h3 { font-size: clamp(1.08rem, .98rem + .5vw, 1.25rem); }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-inline-start: 1.4em; }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* منع تحديد ونسخ المحتوى (حسب طلب المستخدم) — الحقول تبقى قابلة للكتابة */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* تجاوز إلى المحتوى */
.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { inset-inline-start: 0; color: #fff; }

/* ---------- 4) تخطيط عام ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }

#main { display: block; min-height: 50vh; }

.pg { padding-block: 22px 40px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* ---------- 5) الهيدر ---------- */
/* الهيدر.
   مهم جدًا: الـblur مرسوم على ::before مش على .hdr نفسها.
   السبب: أي عنصر فيه backdrop-filter (أو filter أو transform) بينشئ
   containing block لأبنائه اللي position:fixed — وده كان بيحصر القائمة
   الجوّالة داخل ارتفاع الهيدر (63px) فماكانتش تفتح. */
.hdr {
  position: sticky; top: 0; z-index: 100;
  background: transparent;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.hdr::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  pointer-events: none;
}
@supports not (backdrop-filter: blur(1px)) {
  .hdr::before { background: var(--surface); }
}

.hdr__in {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--hdr-h);
}

/* الشعار — لازم يقدر يتقلّص عشان مايوسّعش الهيدر على الشاشات الصغيرة */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
  flex: 0 1 auto; min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent);
}
.brand__mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__txt b {
  font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__txt i {
  font-style: normal; font-size: .68rem; color: var(--ink-3); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* على الشاشات الضيقة نخفي سطر الوصف بدل ما يوسّع الهيدر */
@media (max-width: 560px) {
  .brand__txt i { display: none; }
}

/* التنقل */
.nav { margin-inline-start: auto; }
.nav__list {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 0;
}
.nav__list li { position: relative; }
.nav__list a {
  display: block; padding: 8px 13px;
  border-radius: var(--r-pill);
  color: var(--ink-2); font-weight: 650; font-size: .92rem;
  white-space: nowrap;
  transition: background var(--tr), color var(--tr);
}
.nav__list a:hover { background: var(--line-soft); color: var(--ink); }
.nav__list .current-menu-item > a,
.nav__list .current_page_item > a,
.nav__list .current-cat > a {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}

/* قوائم فرعية */
.nav__list .sub-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0;
  min-width: 190px; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh-2);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--tr), transform var(--tr), visibility var(--tr);
}
.nav__list li:hover > .sub-menu,
.nav__list li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__list .sub-menu a { font-size: .88rem; border-radius: var(--r-sm); }

/* أدوات الهيدر */
.hdr__act { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-inline-start: auto; }

.hdr__search { position: relative; display: none; }
@media (min-width: 900px) { .hdr__search { display: block; } }
.hdr__search input {
  width: 168px; padding: 8px 36px 8px 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-pill); font-size: .88rem;
  transition: width var(--tr), border-color var(--tr), background var(--tr);
}
.hdr__search input::placeholder { color: var(--ink-3); }
.hdr__search input:focus { width: 210px; border-color: var(--brand); background: var(--surface); outline: none; }
.hdr__search button {
  position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; color: var(--ink-3);
}
.hdr__search button:hover { color: var(--brand); }
.hdr__search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.icobtn {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2);
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}
.icobtn:hover { background: var(--line-soft); color: var(--brand); border-color: var(--brand); }
.icobtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

/* زر القائمة (موبايل) */
.hdr__burger {
  display: grid; place-content: center; gap: 4px;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line);
}
.hdr__burger span {
  display: block; width: 17px; height: 2px; border-radius: 2px;
  background: var(--ink-2); transition: transform var(--tr), opacity var(--tr);
}
.hdr__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hdr__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 900px) { .hdr__burger { display: none; } }

/* التنقل على الموبايل */
@media (max-width: 899px) {
  /* لوحة منسدلة جانبية.
     ملاحظة: inset-inline-start بيتحوّل تلقائيًا لـright في RTL،
     فمنعملش override للاتجاه — وإلا اللوحة ترجع للناحية الغلط
     وتظهر نصها فوق الشعار. الإخفاء بـtranslate موجب (لبره اليمين). */
  /* اللوحة تبدأ من تحت الهيدر.
     السبب: .nav ابن .hdr، فالـz-index بتاعها نسبةً لـstacking context
     الهيدر — مستحيل تبقى تحت الشعار وزر القائمة. فبدل ما نتعارك مع
     الترتيب، نخلي اللوحة تنزل من تحت الهيدر: الهيدر يفضل كامل وشغال،
     وزر القائمة يقدر يقفلها. */
  .nav {
    position: fixed;
    inset-block-start: var(--hdr-h);
    inset-block-end: 0;
    inset-inline-start: 0;
    width: min(82vw, 320px); z-index: 90;
    background: var(--surface);
    border-inline-end: 1px solid var(--line);
    box-shadow: var(--sh-3);
    padding: 14px 14px 20px;
    transform: translateX(101%);
    /* visibility بتتأخر للنهاية وقت الإخفاء بس، وبتشتغل فورًا وقت الفتح. */
    transition: transform .24s cubic-bezier(.4,0,.2,1), visibility 0s linear .24s;
    visibility: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
  }
  .nav.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .24s cubic-bezier(.4,0,.2,1), visibility 0s;
  }
  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__list a { padding: 11px 14px; border-radius: var(--r-sm); font-size: .96rem; }
  .nav__list .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 0 0 0 12px; margin-top: 2px;
    background: transparent;
  }
  /* طبقة التعتيم: تعتيم نظيف بدون blur، وتبدأ من تحت الهيدر
     عشان الهيدر يفضل واضح وقابل للنقر.
     الـblur كان بيعمل ضباب مزعج على المحتوى ويبطّأ الرسم على الموبايل. */
  .nav__scrim {
    position: fixed;
    inset-block-start: var(--hdr-h);
    inset-block-end: 0;
    inset-inline: 0;
    z-index: 80;
    background: rgba(8, 10, 18, .55);
  }
}

/* ---------- 6) عناوين الأقسام ---------- */
.sec { margin-block: 0 30px; }
.sec__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.sec__t {
  display: flex; align-items: center; gap: 9px;
  margin: 0; font-size: clamp(1.15rem, 1rem + .7vw, 1.45rem);
}
.sec__t::before {
  content: ""; width: 4px; height: 1.05em; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  flex: 0 0 4px;
}
.sec__more {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .86rem; font-weight: 700; color: var(--brand);
  padding: 6px 12px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  transition: background var(--tr);
  white-space: nowrap;
}
.sec__more:hover { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.sec__more svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 7) شبكة البطاقات ---------- */
.grid {
  display: grid;
  grid-auto-flow: row;
  align-items: stretch;
  gap: var(--gap);
  /* 236px يضمن 3 أعمدة داخل العمود الرئيسي على الديسكتوب (~790px) */
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* البطاقة */
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
}

.card__media {
  position: relative; display: block;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.card:hover .card__media img { transform: scale(1.05); }

.card__ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--ink-3); }
.card__ph svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .5; }

.card__tag {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  padding: 4px 11px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--brand) 92%, transparent);
  color: #fff; font-size: .7rem; font-weight: 750;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.card__body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 14px 15px 12px; }
.card__t { margin: 0 0 7px; font-size: 1rem; line-height: 1.45; font-weight: 750; }
.card__t a { color: var(--ink); }
.card__t a:hover { color: var(--brand); }
.card__ex { margin: 0 0 12px; font-size: .855rem; line-height: 1.65; color: var(--ink-3); }

.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: auto;
  padding-top: 11px; border-top: 1px solid var(--line-soft);
  font-size: .76rem; color: var(--ink-3);
}
.card__more { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 700; }
.card__more svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 8) مواضع الإعلانات ---------- */
.adbox {
  display: grid; place-items: center;
  width: 100%; margin-block: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: .78rem; font-weight: 600;
  overflow: hidden;
}
.adbox--top,
.adbox--after_intro,
.adbox--feed,
.adbox--article_end { min-height: 96px; }
@media (min-width: 768px) {
  .adbox--top,
  .adbox--after_intro,
  .adbox--feed,
  .adbox--article_end { min-height: 116px; }
}
.adbox--in_content { min-height: 260px; }
.adbox--sidebar { min-height: 258px; margin-block: 0 18px; }
.adbox > span { opacity: .55; letter-spacing: .02em; }

/* ---------- 9) الشريط الجانبي والودجت ---------- */
.side { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 999px) { .side { margin-top: 8px; } }

.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh-1);
}
.widget__t {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; padding-bottom: 10px;
  font-size: .98rem; font-weight: 750;
  border-bottom: 1px solid var(--line-soft);
}
.widget__t::before {
  content: ""; width: 3px; height: 1em; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); flex: 0 0 3px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: .89rem; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--ink-2); }
.widget li a:hover { color: var(--brand); }

/* ---------- 10) الهيرو / المقدمة ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%,
      color-mix(in srgb, var(--brand) 18%, transparent) 0%,
      transparent 58%),
    radial-gradient(100% 120% at 0% 100%,
      color-mix(in srgb, var(--brand-2) 14%, transparent) 0%,
      transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 22px;
  margin-bottom: 22px;
  box-shadow: var(--sh-1);
}
@media (min-width: 900px) { .hero { padding: 34px 32px; } }

/* شبكة الهيرو: نص + مداخل الأقسام */
.hero__in { display: grid; gap: 22px; align-items: center; }
@media (min-width: 860px) {
  .hero__in { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; }
}

.hero h1 { margin: 0 0 10px; }
.hero__lead { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.75; }

.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 12px; padding: 5px 13px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand); font-size: .76rem; font-weight: 750;
}
.hero__badge .ic { width: .95em; height: .95em; }

/* مداخل الأقسام داخل الهيرو — عمودان ثابتان عشان الأسماء تبان كاملة */
.hero__grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 400px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
}
.hcell {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink-2);
  box-shadow: var(--sh-1);
  transition: transform var(--tr), border-color var(--tr), color var(--tr), box-shadow var(--tr);
  min-width: 0;
}
.hcell:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--ink);
  box-shadow: var(--sh-2);
}
.hcell__ico {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 18%, transparent),
    color-mix(in srgb, var(--brand-2) 14%, transparent));
  color: var(--brand);
}
.hcell__ico .ic { width: 18px; height: 18px; }
.hcell__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1 1 auto; }
.hcell__txt b { font-size: .9rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hcell__txt span { font-size: .7rem; color: var(--ink-3); }

/* شرائح الأقسام (احتياطي) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: .85rem; font-weight: 680;
  box-shadow: var(--sh-1);
  transition: transform var(--tr), border-color var(--tr), color var(--tr);
}
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--brand); color: var(--brand);
}

/* ---------- 11) المقال المفرد ---------- */
.entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 18px 24px;
  box-shadow: var(--sh-1);
}
@media (min-width: 768px) { .entry { padding: 28px 30px 32px; } }

.entry__t { margin: 0 0 12px; }

.pmeta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .8rem; color: var(--ink-3);
}
.pmeta__i { display: inline-flex; align-items: center; gap: 5px; }
.pmeta__i svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 14px; }
.pmeta__cat a { color: var(--brand); font-weight: 650; }

.entry__hero {
  margin: 0 0 20px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
}
.entry__hero img { width: 100%; height: auto; }

/* محتوى المقال */
.prose { font-size: 1.005rem; line-height: 1.85; color: var(--ink-2); }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); margin-top: 1.7em; }
.prose h2 {
  display: flex; align-items: center; gap: 9px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.prose h2::before {
  content: ""; width: 4px; height: .95em; border-radius: 3px; flex: 0 0 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.prose a { font-weight: 620; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose img { border-radius: var(--r); margin-block: 1.3em; box-shadow: var(--sh-1); }
.prose ul, .prose ol { padding-inline-start: 1.5em; }
.prose li { margin-bottom: .45em; }
.prose blockquote {
  margin: 1.4em 0; padding: 14px 18px;
  border-inline-start: 4px solid var(--brand);
  background: var(--surface-2);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--ink-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  padding: 2px 7px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .88em; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  direction: ltr; display: inline-block;
}
.prose pre {
  padding: 14px 16px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  overflow-x: auto; direction: ltr; text-align: left;
}
.prose pre code { padding: 0; background: none; border: 0; }
.prose table {
  width: 100%; border-collapse: collapse; margin-block: 1.4em;
  font-size: .92rem; display: block; overflow-x: auto;
}
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: right; }
.prose th { background: var(--surface-2); font-weight: 750; color: var(--ink); }

/* ---------- 12) مقالات مرتبطة ---------- */
.rel { margin-top: 30px; }

/* ---------- 13) التعليقات ---------- */
.cmts {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  box-shadow: var(--sh-1);
}
@media (min-width: 768px) { .cmts { padding: 24px 26px; } }

.cmts__t {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 1.1rem;
}
.cmts__t svg { width: 19px; height: 19px; fill: none; stroke: var(--brand); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.cmt-list { list-style: none; margin: 0 0 22px; padding: 0; }
/* الردود المتداخلة: إزاحة واضحة + خط ربط بلون الهوية */
.cmt-list .children {
  list-style: none; margin: 12px 0 0;
  padding-inline-start: 26px;
  border-inline-start: 2px solid color-mix(in srgb, var(--brand) 30%, var(--line));
}
@media (max-width: 520px) {
  .cmt-list .children { padding-inline-start: 14px; }
}
/* الرد بخلفية أفتح شوية عشان يتفرق عن التعليق الأصلي */
.cmt-list .children .cmt__box { background: var(--surface); }

.cmt { margin-bottom: 14px; }
.cmt__box {
  display: flex; gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.cmt__main { flex: 1 1 auto; min-width: 0; }
.cmt__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 5px; }
.cmt__name { font-weight: 750; font-size: .93rem; color: var(--ink); }
.cmt__date { font-size: .74rem; color: var(--ink-3); }
.cmt__badge {
  padding: 2px 8px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--brand) 13%, transparent);
  color: var(--brand); font-size: .68rem; font-weight: 750;
}
.cmt__body { font-size: .92rem; line-height: 1.7; color: var(--ink-2); }
.cmt__body p:last-child { margin-bottom: 0; }
.cmt__acts { margin-top: 7px; font-size: .78rem; }
.cmt__acts a { color: var(--ink-3); font-weight: 650; }
.cmt__acts a:hover { color: var(--brand); }
.cmt__wait {
  margin-top: 7px; font-size: .76rem; font-weight: 650;
  color: var(--warn);
}

/* الأفاتار الحرفي */
.gk-ava {
  display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gk-ava-bg, var(--brand));
  color: #fff; font-weight: 800; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.14);
  user-select: none;
}

/* نموذج التعليق */
.cform { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.cform__t { margin: 0 0 6px; font-size: 1rem; }
.cform__note { margin: 0 0 14px; font-size: .82rem; color: var(--ink-3); }
.cform .row { display: grid; gap: 12px; margin-bottom: 12px; }
@media (min-width: 620px) { .cform .row--2 { grid-template-columns: 1fr 1fr; } }

.fld { display: flex; flex-direction: column; gap: 5px; }
.fld label { font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.fld input, .fld textarea {
  width: 100%; padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .93rem;
  transition: border-color var(--tr), background var(--tr);
}
.fld input:focus, .fld textarea:focus {
  outline: none; border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.fld textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.fld--hp { position: absolute; inset-inline-start: -9999px; opacity: 0; }

/* ---------- 14) الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: var(--r-pill);
  font-size: .92rem; font-weight: 720;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr);
  border: 1px solid transparent;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }

.btn--main {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 32%, transparent);
}
.btn--main:hover { color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 42%, transparent); }

.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); box-shadow: var(--sh-1); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 15) الترقيم ---------- */
.pager { display: flex; justify-content: center; margin-top: 28px; }
.pager .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pager .page-numbers {
  display: grid; place-items: center;
  min-width: 38px; height: 38px; padding-inline: 10px;
  border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: .88rem; font-weight: 700;
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}
.pager .page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.pager .page-numbers.current {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
}

/* ---------- 16) الفوتر ---------- */
.ftr {
  margin-top: 40px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.ftr__in {
  display: grid; gap: 22px;
  padding-block: 28px;
}
@media (min-width: 780px) {
  .ftr__in { grid-template-columns: 1.2fr 1fr; align-items: start; }
}
.ftr__brand { display: flex; align-items: flex-start; gap: 12px; }
.ftr__brand b { display: block; font-size: 1.02rem; font-weight: 800; color: var(--ink); }
.ftr__brand p { margin: 3px 0 0; font-size: .84rem; color: var(--ink-3); max-width: 46ch; }

.ftr__list {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  list-style: none; margin: 0; padding: 0;
}
.ftr__list a { font-size: .86rem; color: var(--ink-2); font-weight: 640; }
.ftr__list a:hover { color: var(--brand); }

.ftr__bar {
  border-top: 1px solid var(--line-soft);
  padding-block: 14px;
  font-size: .8rem; color: var(--ink-3);
  text-align: center;
}
.ftr__bar p { margin: 0; }
.ftr__bar b { color: var(--ink-2); }

/* ---------- 17) حالات خاصة (بحث / 404 / لا نتائج) ---------- */
.empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 44px 22px;
  text-align: center;
  box-shadow: var(--sh-1);
}
.empty__ico {
  display: grid; place-items: center;
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  color: var(--brand);
}
.empty__ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty h1, .empty h2 { margin: 0 0 8px; }
.empty p { margin: 0 auto 18px; color: var(--ink-3); max-width: 46ch; font-size: .92rem; }

.bigsearch { max-width: 420px; margin: 0 auto; position: relative; }
.bigsearch input {
  width: 100%; padding: 12px 44px 12px 16px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-pill); font-size: .94rem;
}
.bigsearch input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.bigsearch button {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; color: var(--ink-3);
}
.bigsearch button:hover { color: var(--brand); }
.bigsearch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* رأس الأرشيف */
.ahead {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: var(--sh-1);
}
.ahead h1 { margin: 0 0 6px; }
.ahead p { margin: 0; color: var(--ink-3); font-size: .9rem; }
.ahead__count {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 4px 12px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand); font-size: .78rem; font-weight: 700;
}

/* ---------- 18) تفضيلات الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .card:hover { transform: none; }
  .card:hover .card__media img { transform: none; }
}

/* ---------- 19) الطباعة ---------- */
@media print {
  .hdr, .ftr, .adbox, .cmts, .side, .rel, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .entry { border: 0; box-shadow: none; padding: 0; }
}

/* ---------- 20) لمسات تجاوب أخيرة ---------- */
@media (max-width: 400px) {
  :root { --gap: 14px; }
  .grid { grid-template-columns: 1fr; }
  .entry { padding: 16px 14px 20px; }
  .cmts { padding: 16px 14px; }
  .hero { padding: 18px 15px; }
}

/* ---------- 21) أيقونات inline ---------- */
.ic {
  width: 1em; height: 1em; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.chip .ic { width: 1.05em; height: 1.05em; color: var(--brand); }
.chip:hover .ic { color: inherit; }

/* ---------- 22) شبكة أقسام الرئيسية (بطاقات مداخل) ---------- */
.tiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  margin-bottom: 26px;
}
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  color: var(--ink-2); text-align: center;
  transition: transform var(--tr), border-color var(--tr), box-shadow var(--tr);
}
.tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: var(--sh-2);
  color: var(--ink);
}
.tile__ico {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 16%, transparent),
    color-mix(in srgb, var(--brand-2) 12%, transparent));
  color: var(--brand);
}
.tile__ico .ic { width: 22px; height: 22px; }
.tile b { font-size: .95rem; font-weight: 750; }
.tile span { font-size: .74rem; color: var(--ink-3); }

/* ---------- 23) مسار التنقل (Breadcrumb) ---------- */
.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px;
  margin-bottom: 14px;
  font-size: .78rem; color: var(--ink-3);
}
.crumb a { color: var(--ink-3); font-weight: 620; }
.crumb a:hover { color: var(--brand); }
.crumb__sep { opacity: .45; }
.crumb__cur { color: var(--ink-2); font-weight: 700; }

/* ---------- 24) بطاقة معلومات المراجعة / التحميل ---------- */
.finfo {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  overflow: hidden;
}
.finfo__head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 15px;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border-bottom: 1px solid var(--line);
  font-size: .88rem; font-weight: 750; color: var(--ink);
}
.finfo__head .ic { width: 17px; height: 17px; color: var(--brand); }

.finfo__grid {
  display: grid; gap: 0;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 560px) { .finfo__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .finfo__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.finfo__row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .85rem;
  min-width: 0;
}
.finfo__row:last-child { border-bottom: 0; }
.finfo__k { color: var(--ink-3); font-weight: 620; flex: 0 0 auto; }
.finfo__v { color: var(--ink); font-weight: 700; text-align: end; min-width: 0; overflow-wrap: anywhere; }

/* زر التحميل / الرابط الرسمي */
.dlbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 15px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.dlbar__note { font-size: .78rem; color: var(--ink-3); flex: 1 1 180px; min-width: 0; }

/* ---------- 25) الأسئلة الشائعة ---------- */
.faq { margin-top: 28px; }
.faq__t {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 14px; font-size: 1.15rem;
}
.faq__t .ic { width: 19px; height: 19px; color: var(--brand); }

.qa {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  margin-bottom: 10px;
  overflow: hidden;
}
.qa[open] { border-color: color-mix(in srgb, var(--brand) 36%, var(--line)); }
.qa > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px;
  cursor: pointer;
  font-size: .95rem; font-weight: 720; color: var(--ink);
  list-style: none;
  transition: background var(--tr);
}
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.qa__mark {
  display: grid; place-items: center;
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
  transition: transform var(--tr);
}
.qa__mark svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.qa[open] .qa__mark { transform: rotate(45deg); }
.qa__body {
  padding: 0 15px 14px;
  font-size: .9rem; line-height: 1.75; color: var(--ink-2);
}
.qa__body p:last-child { margin-bottom: 0; }

/* ---------- 26) صندوق المشاركة والمعلومات السفلية ---------- */
.entry__tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.entry__tags .tg {
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .78rem; font-weight: 650; color: var(--ink-2);
}
.entry__tags .tg:hover { border-color: var(--brand); color: var(--brand); }

/* التنقل بين المقالات */
.pnav {
  display: grid; gap: 12px;
  margin-top: 22px;
}
@media (min-width: 640px) { .pnav { grid-template-columns: 1fr 1fr; } }
.pnav a {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 15px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  color: var(--ink-2);
  transition: border-color var(--tr), transform var(--tr);
  min-width: 0;
}
.pnav a:hover { border-color: var(--brand); transform: translateY(-2px); }
.pnav svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pnav__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.pnav__lbl { font-size: .72rem; color: var(--ink-3); font-weight: 650; }
.pnav__ttl { font-size: .88rem; font-weight: 720; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pnav .nx { justify-content: flex-end; text-align: end; }

/* ---------- 27) جدول المحتويات ---------- */
.toc {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
}
.toc > summary {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 15px; cursor: pointer;
  font-size: .9rem; font-weight: 750; color: var(--ink);
  list-style: none;
}
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary .ic { width: 17px; height: 17px; color: var(--brand); }
.toc ol {
  margin: 0; padding: 0 15px 14px 15px;
  padding-inline-start: 34px;
  font-size: .87rem;
}
.toc li { margin-bottom: .4em; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--brand); }

/* ---------- 28) تعليق الصورة البارزة ---------- */
.entry__hero { margin: 0 0 20px; }
.entry__hero figcaption {
  padding: 9px 12px;
  font-size: .78rem; color: var(--ink-3);
  text-align: center;
  background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
}

/* ---------- 29) تفاصيل نموذج التعليق ---------- */
.fld .req { color: var(--bad); font-weight: 800; }
.fld__hint { font-size: .74rem; color: var(--ink-3); }

.cmts__closed {
  margin: 0; padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .88rem; color: var(--ink-3);
  text-align: center;
}

/* نموذج ووردبريس الافتراضي داخل حاويتنا */
.cform .comment-form { margin: 0; }
.cform .comment-form > p { margin: 0 0 12px; }
.cform .comment-form-comment { margin-bottom: 12px; }
.cform .form-submit { margin: 4px 0 0; }
.cform .logged-in-as {
  font-size: .82rem; color: var(--ink-3); margin-bottom: 12px;
}
.cform .logged-in-as a { font-weight: 650; }

/* رابط إلغاء الرد */
#cancel-comment-reply-link {
  display: inline-block; margin-inline-start: 10px;
  font-size: .8rem; font-weight: 650; color: var(--bad);
}

/* حالة الرد: النموذج داخل التعليق */
.cmt .cform {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line);
}

/* ---------- 30) صندوق تسجيل الدخول ---------- */
.authbox {
  max-width: 460px; margin-inline: auto;
  padding: 30px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.authbox__ico {
  display: grid; place-items: center;
  width: 58px; height: 58px; margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 16%, transparent),
    color-mix(in srgb, var(--brand-2) 12%, transparent));
  color: var(--brand);
}
.authbox__ico .ic { width: 26px; height: 26px; }
.authbox h2 { margin: 0 0 8px; font-size: 1.25rem; }
.authbox > p { margin: 0 0 20px; font-size: .9rem; color: var(--ink-3); }

.authbox__btn { display: flex; justify-content: center; min-height: 44px; }

.authbox__msg { margin: 12px 0 0; font-size: .85rem; color: var(--ink-3); min-height: 1.2em; }
.authbox__msg.is-err { color: var(--bad); font-weight: 650; }

.authbox__legal { margin: 18px 0 0; font-size: .76rem; color: var(--ink-3); }

/* ---------- 31) صفحة الحساب ---------- */
.acct {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  box-shadow: var(--sh-1);
}
@media (min-width: 700px) { .acct { padding: 28px 26px; } }

.acct__head {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.acct__pic,
.gk-ava--img {
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line);
  flex: 0 0 auto;
}
.acct__id { min-width: 0; }
.acct__id h2 { margin: 0 0 3px; font-size: 1.15rem; }
.acct__id p { margin: 0 0 6px; font-size: .84rem; color: var(--ink-3); overflow-wrap: anywhere; }
.acct__tag {
  display: inline-block; padding: 3px 11px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--brand) 13%, transparent);
  color: var(--brand); font-size: .72rem; font-weight: 750;
}

.acct__rows {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 20px;
}

.acct__sub { margin: 0 0 12px; font-size: 1rem; }

.acct__list { list-style: none; margin: 0 0 20px; padding: 0; }
.acct__list li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .88rem;
}
.acct__list li:last-child { border-bottom: 0; }
.acct__list a { font-weight: 700; display: block; margin-bottom: 2px; }
.acct__list span { display: block; font-size: .8rem; color: var(--ink-3); }

.acct__acts {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- 32) استثناء مكوّنات الشورت كود من تنسيق المقال ----------
   الشورت كودز (زي صندوق الحساب) بتتنفّذ جوه .prose، فبترث تنسيق
   عناوين المقال. نرجّعها لتنسيقها الخاص. */
.prose .authbox h2,
.prose .acct h2,
.prose .acct h3,
.prose .empty h2 {
  display: block;
  padding-bottom: 0;
  border-bottom: 0;
  margin-top: 0;
}
.prose .authbox h2::before,
.prose .acct h2::before,
.prose .acct h3::before,
.prose .empty h2::before { content: none; }

.prose .authbox,
.prose .acct { text-align: initial; }
.prose .authbox { text-align: center; }

/* ---------- 33) التنبيهات ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 16px; margin-bottom: 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .9rem;
}
.alert .ic { width: 19px; height: 19px; margin-top: 2px; flex: 0 0 19px; }
.alert b { display: block; margin-bottom: 2px; color: var(--ink); }
.alert p { margin: 0; color: var(--ink-2); font-size: .86rem; }

.alert--ok {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: color-mix(in srgb, var(--ok) 9%, var(--surface));
}
.alert--ok .ic { color: var(--ok); }

.alert--bad {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
  background: color-mix(in srgb, var(--bad) 8%, var(--surface));
}
.alert--bad .ic { color: var(--bad); }

/* ---------- 34) حقل الاختيار ---------- */
.fld select {
  width: 100%; padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .93rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: 16px calc(50% + 2px), 21px calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  /* السهم مرسوم عند الحد الأيسر، فالمسافة لازم تكون على inline-end
     (= يسار في RTL) عشان النص مايركبش على السهم. */
  padding-inline-end: 36px;
}
.fld select:focus {
  outline: none; border-color: var(--brand); background-color: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}

/* ---------- 35) صفحات المحتوى القانوني ---------- */
.prose .lastup {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 22px; padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .78rem; color: var(--ink-3); font-weight: 620;
}
.prose .lastup .ic { width: .95em; height: .95em; }

/* قائمة تنقّل داخل الصفحة */
.prose .jump {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 24px; padding: 0; list-style: none;
}
.prose .jump li { margin: 0; }
.prose .jump a {
  display: inline-block; padding: 6px 13px;
  border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 650; color: var(--ink-2);
  text-decoration: none;
}
.prose .jump a:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 36) الإعلان الحقيقي بعد التفعيل ----------
   الحجم الأدنى محفوظ من قواعد .adbox فوق عشان مايحصلش انزياح
   محتوى (CLS) وقت تحميل الوحدة. */
.adbox--live {
  border: 0;
  background: transparent;
  padding: 0;
  overflow: hidden;
}
.adbox--live .adsbygoogle { display: block; width: 100%; }

/* ---------- 37) شريط تقدّم القراءة ---------- */
.rprog {
  position: sticky;
  /* يقعد لازق تحت الهيدر مباشرة */
  top: var(--hdr-h);
  z-index: 55;
  height: 3px;
  background: transparent;
  pointer-events: none;
}
.rprog__bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-end-start-radius: 3px;
  border-end-end-radius: 3px;
  transition: width .1s linear;
  will-change: width;
}

/* ---------- 38) زر العودة لأعلى ---------- */
.totop {
  position: fixed;
  inset-block-end: 18px;
  inset-inline-start: 18px;
  z-index: 70;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand);
  box-shadow: var(--sh-2);
  opacity: 0;
  /* مهم: الزر الشفاف لازم مايستقبلش نقرات. */
  pointer-events: none;
  transform: translateY(10px) scale(.9);
  transition: opacity .2s, transform .2s, border-color var(--tr);
}
/* خاصية hidden لوحدها مش كفاية: أي `display` في أنماط القالب
   بيتغلّب على display:none اللي جاي من أنماط المتصفح، فالزر كان
   بيفضل موجود ويستقبل نقرات وهو مخفي. */
.totop[hidden] { display: none; }

.totop.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.totop:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}
.totop svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
@media (min-width: 900px) {
  .totop { inset-block-end: 24px; inset-inline-start: 24px; width: 46px; height: 46px; }
}

/* ---------- 39) وقت القراءة في البطاقة ---------- */
.card__meta {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0;
}
.card__dot { opacity: .45; }
.card__read { white-space: nowrap; }

/* ---------- 40) تفضيل تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  .rprog__bar { transition: none; }
  .totop { transition: opacity .001ms; transform: none; }
  .totop.is-on { transform: none; }
}

/* ---------- 41) أزرار المشاركة ---------- */
.share {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.share__t {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 13px;
  font-size: .98rem; font-weight: 750;
}
.share__t .ic { width: 17px; height: 17px; color: var(--brand); }

.share__row {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.sbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .85rem; font-weight: 680;
  cursor: pointer;
  transition: transform var(--tr), border-color var(--tr), color var(--tr), background var(--tr);
}
.sbtn:hover {
  transform: translateY(-2px);
  color: var(--ink);
}
.sbtn:active { transform: translateY(0); }
.sbtn svg {
  width: 16px; height: 16px; flex: 0 0 16px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* شعارات الشبكات أشكال مصمّتة — لازم fill مش stroke.
   المحدِّد مركّب عشان يتغلّب على .sbtn svg بدون !important */
.sbtn svg.sbtn__brand {
  fill: currentColor;
  stroke: none;
}

/* ألوان كل شبكة عند المرور — تعريف بصري سريع بدون شعارات مسجّلة */
.sbtn--whatsapp:hover { border-color: #25d366; color: #1da851; background: color-mix(in srgb, #25d366 10%, var(--surface)); }
.sbtn--x:hover        { border-color: var(--ink); color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, var(--surface)); }
.sbtn--telegram:hover { border-color: #2aabee; color: #1c8fd0; background: color-mix(in srgb, #2aabee 10%, var(--surface)); }
.sbtn--facebook:hover { border-color: #1877f2; color: #1264d3; background: color-mix(in srgb, #1877f2 10%, var(--surface)); }

.sbtn--copy:hover,
.sbtn--native:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
}

/* حالة النسخ الناجح */
.sbtn--copy.is-done {
  border-color: var(--ok);
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}
/* حالة تعذّر النسخ — لازم المستخدم يعرف إن الأمر فشل */
.sbtn--copy.is-fail {
  border-color: var(--warn);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
}

/* زر النظام الأصلي مخفي لحد ما الـJS يتأكد من الدعم */
.sbtn[hidden] { display: none; }

/* على الهواتف: شعارات فقط للشبكات، والنص يفضل لأزرار الإجراءات */
@media (max-width: 520px) {
  .sbtn { padding: 10px 13px; font-size: .8rem; }
  .sbtn--whatsapp span,
  .sbtn--x span,
  .sbtn--telegram span,
  .sbtn--facebook span { display: none; }
}

/* ---------- 42) الأكثر قراءة ---------- */
.widget--pop .widget__t {
  display: flex; align-items: center; gap: 7px;
}
/* أيقونة اللهب شكل مصمّت: fill صريح لأن .ic مابيحددش fill ولا stroke،
   والافتراضي في SVG أسود مش لون النص */
.widget--pop .widget__t .ic {
  width: 17px; height: 17px; flex: 0 0 17px;
  fill: var(--brand);
  stroke: none;
}

.poplist {
  list-style: none;
  margin: 0; padding: 0;
  display: grid; gap: 2px;
}
.poplist__i {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.poplist__i:last-child { border-bottom: 0; padding-bottom: 0; }
.poplist__i:first-child { padding-top: 2px; }

.poplist__n {
  flex: 0 0 24px;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: .72rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
/* أول ثلاثة بلون الهوية — تمييز بصري بسيط بلا زخرفة */
.poplist__i:nth-child(-n+3) .poplist__n {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  color: var(--brand);
}

.poplist__b { min-width: 0; display: grid; gap: 3px; }

.poplist__l {
  display: block;
  font-size: .86rem; font-weight: 640; line-height: 1.5;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--tr);
}
.poplist__l:hover { color: var(--brand); }

.poplist__m {
  font-size: .74rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.poplist__dot { margin: 0 5px; opacity: .55; }

/* ---------- 43) البحث: تبريز الكلمة والاقتراحات ---------- */
.ahead__q { color: var(--brand); }

.hl {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
  font-weight: 750;
}

.empty__sugg {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  width: 100%;
  max-width: 460px;
}
.empty__sugg h3 {
  margin: 0 0 10px;
  font-size: .88rem; font-weight: 750;
  color: var(--ink-2);
}
.empty__sugg ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
}
.empty__sugg a {
  display: block;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .85rem; font-weight: 620;
  text-decoration: none;
  transition: border-color var(--tr), color var(--tr), transform var(--tr);
}
.empty__sugg a:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  color: var(--brand);
  transform: translateY(-1px);
}
