/* ===================================================================
   Nashiri Theme — resources/styles/main.css
   Modern, accessible frontend styles built on custom design tokens
   =================================================================== */

/* ── 1. Design Tokens & CSS Variables ───────────────────────────── */
:root {
  /* جهة تلاشي أرضية عناوين المقال — تنقلب مع اتجاه الكتابة. */
  --heading-fade: left;

  /* Tokens محددة حسب خطة تنفيذ قالب Nashiri */
  --brand-primary: #1a6fb5;
  --brand-accent:  #e8423c;
  --surface-dark:  #0f1923;
  --surface-base:  #f5f7fa;
  --ink-primary:   #1c2530;
  --ink-muted:     #6b7a8d;

  /* متغيرات واجهة مكملة */
  --surface-card:  #ffffff;
  --surface-hover: #edf2f7;
  /*
   * الحدود شفّافة لا صلبة.
   *
   * لونٌ صلب (#e2e8f0) يرسم خطّاً رمادياً حادّاً حول كل صندوق مهما كان
   * ما خلفه — وهو بالضبط ما يجعل القالب يبدو لوحةَ تحكّم افتراضية.
   * والشفّاف يمتزج بما تحته فيقرأ حافّةً لا خطّاً.
   *
   * القيمة مقيسة من قالب ميد بادي: rgba(15,23,42,0.07).
   */
  --border-subtle: rgba(15, 25, 35, 0.07);
  --border-strong: rgba(15, 25, 35, 0.14);

  --font-heading:  'Cairo', sans-serif;
  --font-body:     'Tajawal', sans-serif;
  --font-main:     'Cairo', sans-serif;
  --font-mono:     monospace;
  --font-size-base: 16px;
  --nsh-heading-scale: 1.15;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /*
   * الظلال أوسع وأنعم.
   *
   * ظلٌّ بانتشار 3 بكسل لا يكاد يُرى، فلا يبقى للصندوق إلا حدّه الحادّ —
   * وهما معاً يُنتجان مظهر «الصندوق المرسوم» لا «الورقة المرتفعة».
   * الانتشار الواسع هو ما يصنع العمق، والحدّ الخفيف يحسم الحافّة وحدها.
   *
   * مقيسة من ميد بادي: 0 2px 12px و0 4px 20px.
   */
  --shadow-sm: 0 2px 12px rgba(15, 25, 35, 0.06);
  --shadow-md: 0 4px 20px rgba(15, 25, 35, 0.07);
  --shadow-lg: 0 12px 34px rgba(15, 25, 35, 0.10);

  --container-max: 1200px;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.25s ease;
}

[dir="ltr"] {
  --heading-fade: right;
}

/* ── 2. Reset & Global Typography ───────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink-primary);
  background-color: var(--surface-base);
  text-align: start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

:root:not([dir="ltr"]) body,
body.rtl {
  direction: rtl;
}

[dir="ltr"] body,
body:not(.rtl) {
  direction: ltr;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--ink-primary);
  margin-top: 0;
  line-height: 1.35;
  font-weight: 700;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--brand-accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── الأكواد والخط الهيكلي (المرحلة 22) ─────────────────────────── */
pre, code, kbd, samp {
  font-family: var(--font-mono, monospace);
  font-size: 0.9em;
}

pre {
  background: var(--surface-dark);
  color: #e2e8f0;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  /*
   * الكتلة الوحيدة في القالب باتجاه صريح، وهو مقصود: الشيفرة تُقرأ من
   * اليسار دائماً مهما كانت لغة الصفحة. وبما أن `direction: ltr` هنا،
   * فـ`left` هي `start` نفسها — أي أنها ليست استثناءً من المنطقية بل
   * تطبيقٌ لها في سياق مقلوب.
   */
  direction: ltr;
  text-align: left;
}

code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.nsh-nav, .nsh-btn, .button, .nsh-badge, .nsh-tag, .nsh-tab-nav {
  font-family: var(--font-main, var(--font-heading));
}

/* ── الوصولية: تخطٍ إلى المحتوى ──────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -9999px;
  inset-inline-end: 20px;
  background: var(--brand-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 99999;
  font-weight: 700;
}

.skip-link:focus {
  top: 20px;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ── 3. الحاوية والتخطيط العام ───────────────────────────────────── */
.nsh-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.site-main {
  flex: 1;
  padding-top: 30px;
  padding-bottom: 50px;
}

.nsh-layout {
  display: grid;
  gap: 32px;
  margin-top: 24px;
  margin-bottom: 40px;
}

.nsh-layout--full {
  grid-template-columns: 1fr;
}

.nsh-layout--with-sidebar.nsh-layout--sidebar-right {
  grid-template-columns: 1fr 340px;
}

.nsh-layout--with-sidebar.nsh-layout--sidebar-left {
  grid-template-columns: 340px 1fr;
}

@media (max-width: 960px) {
  .nsh-layout--with-sidebar.nsh-layout--sidebar-right,
  .nsh-layout--with-sidebar.nsh-layout--sidebar-left {
    grid-template-columns: 1fr;
  }
}

/* ── 4. الترويسة والتنقل (Header) ────────────────────────────────── */
/*
 * الهيدر والفوتر نفسهما في «§ صدفة الموقع» أسفل هذا الملف داخل
 * @layer nsh-shell. ما بقي هنا هو أصناف الترميز القديم التي لا يولّدها
 * منشئ التخطيط (site-header__inner وأخواتها) ويحتاجها قالبٌ فرعي مخصَّص.
 */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.site-header__brand {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-primary);
  letter-spacing: -0.5px;
}

.site-header__brand:hover {
  color: var(--brand-accent);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink-primary);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  color: var(--brand-primary);
  background-color: var(--surface-base);
}

/* ── 5. شبكة وبطاقات المقالات (Cards & Grid) ─────────────────────── */
.nsh-grid--posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

@media (max-width: 640px) {
  .nsh-grid--posts {
    grid-template-columns: 1fr;
  }
}

.nsh-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.nsh-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-primary);
}

.nsh-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--surface-hover);
  overflow: hidden;
}

.nsh-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
}

.nsh-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.nsh-card:hover .nsh-card__img {
  transform: scale(1.04);
}

.nsh-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
}

.nsh-card__placeholder .dashicons {
  font-size: 40px;
  width: 40px;
  height: 40px;
}

.nsh-card__cat {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  background-color: var(--brand-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 2;
}

.nsh-card__cat:hover {
  background-color: var(--brand-accent);
  color: #fff;
}

.nsh-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nsh-card__meta {
  font-size: 13px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.nsh-card__title {
  font-size: 18px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.nsh-card__title a {
  color: var(--ink-primary);
}

.nsh-card__title a:hover {
  color: var(--brand-primary);
}

.nsh-card__excerpt {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-top: auto;
}

.nsh-card__excerpt p {
  margin: 0;
}

/* ── 6. صفحة المقال المفرد ونظام البطاقات المستقلة ─────────────────── */
.nsh-card-section {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}

.nsh-article {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .nsh-article {
    padding: 24px 20px;
  }
}

.nsh-article__header {
  margin-bottom: 28px;
}

.nsh-article__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.nsh-article__category {
  background-color: rgba(26, 111, 181, 0.1);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.nsh-article__category:hover {
  background-color: var(--brand-primary);
  color: #fff;
}

.nsh-article__title {
  font-size: 32px;
  line-height: 1.35;
  margin-bottom: 16px;
  color: var(--ink-primary);
}

@media (max-width: 768px) {
  .nsh-article__title {
    font-size: 24px;
  }
}

.nsh-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  color: var(--ink-muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.nsh-article__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nsh-article__author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--brand-primary) 50%, transparent);
}

.nsh-article__meta-item .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  color: var(--brand-primary);
}

.nsh-article__meta-item a {
  color: var(--ink-muted);
}

.nsh-article__meta-item a:hover {
  color: var(--brand-primary);
}

.nsh-article__featured {
  margin: 0 0 32px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nsh-article__img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.nsh-article__caption {
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 8px;
}

.nsh-article__content {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-primary);
}

.nsh-article__content p {
  margin-bottom: 1.6em;
}

.nsh-article__content h2,
.nsh-article__content h3,
.nsh-article__content h4 {
  margin-top: 1.8em;
  margin-bottom: 0.8em;
}

.nsh-article__content blockquote {
  border-inline-start: 4px solid var(--brand-primary);
  padding: 16px 24px;
  margin: 28px 0;
  background-color: var(--surface-base);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-style: italic;
}

.nsh-article__footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nsh-article__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nsh-article__tags-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-muted);
}

.nsh-tag {
  background-color: var(--surface-base);
  border: 1px solid var(--border-subtle);
  color: var(--ink-muted);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 100px;
}

.nsh-tag:hover {
  background-color: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

/* ── 7. الصفحة الثابتة (Page) ────────────────────────────────────── */
.nsh-page {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}

.nsh-page__header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-subtle);
}

.nsh-page__title {
  font-size: 28px;
  margin: 0;
}

.nsh-page__featured {
  margin: 0 0 28px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nsh-page__content {
  font-size: 16px;
  line-height: 1.8;
}

/* ── 8. ترويسات الأرشيف والبحث ───────────────────────────────────── */
.nsh-archive-header,
.nsh-search-header {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.nsh-archive-header__title,
.nsh-search-header__title {
  font-size: 24px;
  margin: 0;
  color: var(--ink-primary);
}

.nsh-archive-header__desc {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 10px;
}

/* ── 9. صفحة الخطأ 404 ───────────────────────────────────────────── */
.nsh-error-404 {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  max-width: 680px;
  margin: 40px auto;
  box-shadow: var(--shadow-md);
}

.nsh-error-404__code {
  font-family: var(--font-heading);
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand-primary);
  margin-bottom: 16px;
  letter-spacing: -2px;
}

.nsh-error-404__title {
  font-size: 24px;
  margin-bottom: 14px;
}

.nsh-error-404__desc {
  font-size: 15px;
  color: var(--ink-muted);
  max-width: 480px;
  margin: 0 auto 28px;
}

.nsh-error-404__search {
  max-width: 420px;
  margin: 0 auto 28px;
}

.nsh-error-404__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ── 10. الشريط الجانبي والودجات (Sidebar & Widgets) ─────────────── */
.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.site-sidebar .widget {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.widget__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 18px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand-primary);
  position: relative;
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.widget ul li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ── 11. التعليقات (Comments) ────────────────────────────────────── */
.nsh-comments-area {
  margin-top: 24px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .nsh-comments-area {
    padding: 22px 18px;
  }
}

.nsh-comments-title {
  font-size: 22px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-subtle);
}

.nsh-comment-list {
  list-style: none;
  margin: 0 0 32px 0;
  padding: 0;
}

.nsh-comment-list .comment {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-meta img.avatar {
  border-radius: 50%;
}

.comment-author .fn {
  font-weight: 700;
  color: var(--ink-primary);
}

.comment-metadata a {
  font-size: 13px;
  color: var(--ink-muted);
}

.comment-content {
  font-size: 15px;
  line-height: 1.6;
}

.reply a {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-primary);
}

/* نموذج إضافة التعليق */
.nsh-comment-form p {
  margin-bottom: 16px;
}

.nsh-comment-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.nsh-comment-form input[type="text"],
.nsh-comment-form input[type="email"],
.nsh-comment-form input[type="url"],
.nsh-comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  background-color: var(--surface-base);
  outline: none;
  transition: border-color var(--transition-fast);
}

.nsh-comment-form input:focus,
.nsh-comment-form textarea:focus {
  border-color: var(--brand-primary);
  background-color: #fff;
}

/* ── 12. التنقل والترقيم (Pagination) ────────────────────────────── */
.nsh-pagination {
  margin-top: 36px;
  display: flex;
  justify-content: center;
}

.nsh-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.nsh-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.nsh-pagination .page-numbers:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.nsh-pagination .page-numbers.current {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ── 13. أزرار وأدوات عامة ────────────────────────────────────────── */
.nsh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
}

.nsh-btn--primary {
  background-color: var(--brand-primary);
  color: #fff;
}

.nsh-btn--primary:hover {
  background-color: var(--brand-accent);
  color: #fff;
}

/* ── 14. التذييل (Footer) ────────────────────────────────────────── */
.site-footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer__copyright {
  margin: 0;
  font-size: 14px;
  color: #94a3b8;
}

.site-footer__nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav a {
  color: #94a3b8;
  font-size: 14px;
}

.site-footer__nav a:hover {
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   15. أنماط الودجات (Widgets Styles)
   ═══════════════════════════════════════════════════════════════════ */

/* ── 15a. قائمة مقالات (PostsListWidget) ────────────────────────── */
.nsh-posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nsh-posts-list__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.nsh-posts-list__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.nsh-posts-list__thumb {
  display: block;
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--surface-base);
}

.nsh-posts-list__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.nsh-posts-list__item:hover .nsh-posts-list__img {
  transform: scale(1.05);
}

.nsh-posts-list__body {
  flex: 1;
  min-width: 0;
}

.nsh-posts-list__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 4px 0;
}

.nsh-posts-list__title a {
  color: var(--ink-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nsh-posts-list__title a:hover {
  color: var(--brand-primary);
}

.nsh-posts-list__date {
  font-size: 12px;
  color: var(--ink-muted);
  display: block;
}

.nsh-posts-list__excerpt {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nsh-posts-list__excerpt p {
  margin: 0;
}

/* ── 15b. قائمة تصنيفات (CategoriesListWidget) ──────────────────── */
.nsh-categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nsh-categories-list__item {
  border-bottom: 1px solid var(--border-subtle);
}

.nsh-categories-list__item:last-child {
  border-bottom: none;
}

.nsh-categories-list__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast), padding-right var(--transition-fast);
}

.nsh-categories-list__link:hover {
  background-color: var(--surface-base);
  color: var(--brand-primary);
  padding-inline-start: 18px;
}

.nsh-categories-list__count {
  background-color: rgba(26, 111, 181, 0.1);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ── 15c. متابعة اجتماعية (SocialFollowWidget) ───────────────────── */
.nsh-social-follow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nsh-social-follow__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: var(--nsh-social-color, var(--brand-primary));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  min-width: 0;
}

.nsh-social-follow__btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  color: #fff;
}

.nsh-social-follow__icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nsh-social-follow__icon svg {
  fill: currentColor;
}

/* أيقونة فقط */
.nsh-social-follow--icon-only .nsh-social-follow__btn {
  padding: 8px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

/* نص فقط */
.nsh-social-follow--text-only .nsh-social-follow__btn {
  background-color: transparent;
  color: var(--nsh-social-color, var(--brand-primary));
  border: 1.5px solid var(--nsh-social-color, var(--brand-primary));
}

.nsh-social-follow--text-only .nsh-social-follow__btn:hover {
  background-color: var(--nsh-social-color, var(--brand-primary));
  color: #fff;
  opacity: 1;
}

/* ── 15d. إعلان مخصص (AdvertWidget) ─────────────────────────────── */
.nsh-widget-advert {
  overflow: hidden;
}

.nsh-advert-wrap {
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: var(--surface-base);
}

.nsh-advert-wrap img,
.nsh-advert-wrap iframe,
.nsh-advert-wrap ins {
  display: block;
  max-width: 100%;
}

/* ── 15e. عنوان الودجت المشترك ──────────────────────────────────── */
.nsh-widget-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 18px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nsh-widget-title span {
  position: relative;
}

.nsh-widget-title span::after {
  content: '';
  position: absolute;
  bottom: -14px;
  inset-inline-start: 0;
  width: 40px;
  height: 2px;
  background-color: var(--brand-accent);
  border-radius: 2px;
}

/* مناطق الودجت في الصفحة الرئيسية */
.nsh-home-widget {
  width: 100%;
  /* التباعد على الغلاف لا على محتوى ودجت بعينها: قبل ذلك كانت
     ودجت الشبكة وحدها تترك مسافة (بـ margin داخلي) وبقية الأنواع تلتصق. */
  margin-block-end: 32px;
}

/* آخر ودجت داخل المنطقة لا تحتاج هامشاً — المنطقة نفسها تفصل عمّا بعدها */
.nsh-home-widget:last-child {
  margin-block-end: 0;
}

/* أقسام الرئيسية: كل منطقة ودجات section مستقل، فبلا هذا تلتصق حدودها */
.nsh-home-section + .nsh-home-section {
  margin-block-start: 32px;
}

/* ═══════════════════════════════════════════════════════════════════
   16. القائمة الجانبية للموبايل (Mobile Nav Drawer)
   ═══════════════════════════════════════════════════════════════════ */
.nsh-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.nsh-hamburger:hover {
  background-color: var(--surface-hover);
}

.nsh-hamburger__bar {
  width: 22px;
  height: 2px;
  background-color: var(--ink-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

@media (max-width: 768px) {
  .nsh-hamburger {
    display: flex;
  }
  .site-nav {
    display: none;
  }
}

.nsh-nav-drawer[hidden] {
  display: none;
}

.nsh-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.nsh-nav-drawer__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(15, 25, 35, 0.55);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.nsh-nav-drawer__panel {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  height: 100%;
  width: min(320px, 84vw);
  background-color: var(--surface-card);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  /*
   * الإخفاء بإزاحة منطقية لا بـtranslateX: الأخيرة لا تتبع اتجاه
   * الصفحة، فكانت تلزمها قاعدة `[dir="rtl"]` تعكس الإشارة — وقاعدة
   * كهذه تُنسى عند أي تعديل لاحق فينزلق الدرج من الجهة الخاطئة.
   * `translate` بقيمة منطقية عبر الهامش يعمل في الاتجاهين بقاعدة واحدة.
   */
  margin-inline-end: -100%;
  transition: margin-inline-end var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.nsh-nav-drawer--open .nsh-nav-drawer__overlay {
  opacity: 1;
}

.nsh-nav-drawer--open .nsh-nav-drawer__panel {
  margin-inline-end: 0;
}

.nsh-nav-drawer__close {
  align-self: flex-start;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-base);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-primary);
}

.nsh-nav-drawer__close:hover {
  color: var(--brand-accent);
}

.nsh-nav-drawer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nsh-nav-drawer__nav a {
  display: block;
  padding: 12px 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 44px;
}

.nsh-nav-drawer__nav a:hover {
  color: var(--brand-primary);
}

.nsh-hamburger:focus-visible,
.nsh-nav-drawer__close:focus-visible,
.nsh-nav-drawer__nav a:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

body.nsh-nav-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   17. الهيدر اللاصق الذكي (Smart Sticky Header)
   ═══════════════════════════════════════════════════════════════════ */
/*
 * الإخفاء عند التمرير لأسفل. الانتقال نفسه معرَّف في @layer nsh-shell
 * ويشمل transform: قاعدة خارج الطبقة تغلب ما بداخلها دائماً، فتعريفه
 * هنا ثانيةً كان يلغي انتقال خلفية الهيدر بلا أن يظهر ذلك في أي مكان.
 */
.site-header--hidden {
  transform: translateY(-100%);
}

/* ═══════════════════════════════════════════════════════════════════
   18. الوضع الليلي (Dark Mode) — إعادة تعريف الـ tokens فقط
   ═══════════════════════════════════════════════════════════════════ */
:root[data-theme="dark"] {
  --surface-base:  var(--surface-dark);
  --surface-card:  #182430;
  --surface-hover: #22303e;
  --ink-primary:   #eef2f6;
  --ink-muted:     #93a3b5;
  /* بيضاء شفّافة لا رمادية صلبة: على سطح داكن يقرأ الرمادي الصلب
     خطّاً مرسوماً، والأبيض الشفّاف يقرأ انعكاس ضوء على حافّة. */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .nsh-card__cat {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .nsh-article__content blockquote {
  background-color: #1e2b38;
}

.nsh-dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-primary);
  flex-shrink: 0;
}

.nsh-dark-toggle:hover {
  background-color: var(--surface-hover);
}

.nsh-dark-toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

[data-nsh-dark-icon-off] { display: none; }
:root[data-theme="dark"] [data-nsh-dark-icon-on] { display: none; }
:root[data-theme="dark"] [data-nsh-dark-icon-off] { display: inline-block; }

/* ═══════════════════════════════════════════════════════════════════
   19. شريط تقدّم القراءة (Reading Progress)
   ═══════════════════════════════════════════════════════════════════ */
.nsh-reading-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 3px;
  background-color: var(--border-subtle);
  z-index: 1100;
}

.nsh-reading-progress__bar {
  height: 100%;
  width: 0%;
  background-color: var(--brand-primary);
  transition: width 0.1s linear;
}

/* ═══════════════════════════════════════════════════════════════════
   20. مسار التنقّل (Breadcrumbs)
   ═══════════════════════════════════════════════════════════════════ */
/*
 * مسار التنقّل.
 *
 * يقع **خارج** بطاقة المقال على خلفية الصفحة، فكان يبدو نصّاً سائباً
 * معلَّقاً فوقها لا جزءاً من التصميم. الحلّ شريطٌ له هويته: خلفية خفيفة
 * وحدّ وحشوة تجعله يقرأ كعنصر مقصود، بعرض البطاقة نفسه.
 */
.nsh-breadcrumbs {
  margin-block: 0 16px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-card) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
}

.nsh-breadcrumbs__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.nsh-breadcrumbs__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/*
 * الفاصل يتبع اتجاه القراءة لا شكلاً ثابتاً: `‹` تشير يساراً وهو اتجاه
 * تدفّق العربية، و`›` تشير يميناً للإنجليزية. قيمةٌ واحدة تظهر مقلوبة
 * في أحد الاتجاهين.
 */
.nsh-breadcrumbs__item + .nsh-breadcrumbs__item::before {
  content: '‹';
  color: var(--border-strong);
  font-weight: 700;
}

[dir="ltr"] .nsh-breadcrumbs__item + .nsh-breadcrumbs__item::before {
  content: '›';
}

.nsh-breadcrumbs__item a {
  color: var(--ink-muted);
}

.nsh-breadcrumbs__item a:hover {
  color: var(--brand-primary);
}

/*
 * العنصر الحالي يُقصّ بحدّ أقصى: عنوان مقال إخباري يتجاوز سبعين محرفاً
 * أحياناً، فيلتفّ المسار سطرين أو ثلاثة ويصير كتلةً لا شريطاً.
 *
 * و`min-width: 0` لازمة: عنصر flex لا ينكمش دونها مهما بلغ `max-width`
 * فيفيض الشريط عن حاويته على الجوال.
 */
.nsh-breadcrumbs__item--current {
  color: var(--ink-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: min(420px, 45vw);
}

@media (max-width: 600px) {
  .nsh-breadcrumbs { padding: 8px 12px; }
  .nsh-breadcrumbs__list { font-size: 12px; }
}

:root[data-theme="dark"] .nsh-breadcrumbs {
  background: color-mix(in srgb, var(--surface-card) 60%, transparent);
}

/* ═══════════════════════════════════════════════════════════════════
   21. مقالات ذات صلة (Related Articles) — بطاقة مصغّرة
   ═══════════════════════════════════════════════════════════════════ */
/*
 * قسم «مقالات ذات صلة».
 *
 * كانت هنا قواعد باسم `.nsh-related-articles` لا يستعملها أي قالب —
 * والقسم الفعلي اسمه `.nsh-related-posts` فكان بلا تنسيق: عنوانه بحجم
 * افتراضي وبلا فاصل عن المقال فوقه.
 */
.nsh-related-posts {
  padding: 28px 32px;
}

.nsh-related-posts__header {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.nsh-related-posts__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 800;
  color: var(--ink-primary);
}

.nsh-related-posts__title .dashicons {
  color: var(--brand-primary);
  font-size: 22px;
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .nsh-related-posts {
    padding: 22px 18px;
  }
}

/*
 * `auto-fill` بحدّ أدنى 220 بكسل يملأ الصفّ بما يتّسع، فأربع بطاقات
 * تنزل على أربعة أعمدة في الشاشة العريضة وعمودين في اللوحية وواحد في
 * الجوال — بلا قاعدة لكل عدد.
 */
.nsh-grid--compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.nsh-grid--compact .nsh-card__body {
  padding: 14px;
}

.nsh-grid--compact .nsh-card__title {
  font-size: 15px;
  margin-bottom: 6px;
}

.nsh-grid--compact .nsh-card__excerpt {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   22. أوضاع رأس المقال الإضافية (Article Header Variants)
   قيمة الإعداد article.header_style تُضيف نفس اسم النمط كـ class على <article>
   ═══════════════════════════════════════════════════════════════════ */

/* تراكب فوق الصورة */
.nsh-article--overlay .nsh-article__featured {
  position: relative;
  margin-bottom: 0;
}

.nsh-article--overlay .nsh-article__img {
  max-height: 480px;
}

.nsh-article--overlay .nsh-article__header {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 32px 40px;
  margin-bottom: 0;
  background: linear-gradient(to top, rgba(15, 25, 35, 0.92), rgba(15, 25, 35, 0));
  color: #fff;
}

.nsh-article--overlay .nsh-article__title,
.nsh-article--overlay .nsh-article__meta,
.nsh-article--overlay .nsh-article__meta-item a {
  color: #fff;
}

.nsh-article--overlay .nsh-article__meta {
  border-bottom-color: rgba(255, 255, 255, 0.25);
}

.nsh-article--overlay .nsh-article__content {
  padding: 36px 40px 0;
}

/* سينمائي — مساحة صورة كبيرة، عنوان تحتها مباشرة بحجم أكبر */
.nsh-article--cinematic .nsh-article__featured {
  margin: -36px -40px 32px;
  border-radius: 0;
}

.nsh-article--cinematic .nsh-article__img {
  max-height: 640px;
}

.nsh-article--cinematic .nsh-article__title {
  font-size: 40px;
}

@media (max-width: 768px) {
  .nsh-article--cinematic .nsh-article__featured {
    margin: -24px -20px 24px;
  }
  .nsh-article--cinematic .nsh-article__title {
    font-size: 26px;
  }
}

/* مقسوم نصفين — صورة وعنوان جنباً إلى جنب */
.nsh-article--split .nsh-article__header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.nsh-article--split .nsh-article__featured {
  order: 2;
  margin: 0;
}

.nsh-article--split .nsh-article__img {
  max-height: none;
  aspect-ratio: 4 / 3;
}

@media (max-width: 768px) {
  .nsh-article--split .nsh-article__header {
    grid-template-columns: 1fr;
  }
}

/* ── نمط مدمج بالقراءة (inside) — المرحلة 21 ──────────────────────── */
.nsh-article--inside {
  max-width: 840px;
  margin-inline: auto;
}

.nsh-article--inside .nsh-article__header {
  margin-bottom: 24px;
}

.nsh-article--inside .nsh-article__title {
  font-size: 34px;
  line-height: 1.35;
}

.nsh-article--inside .nsh-article__featured {
  margin: 0 0 28px;
  border-radius: var(--radius-md);
}

.nsh-article--inside .nsh-article__img {
  max-height: 440px;
  width: 100%;
  object-fit: cover;
}

/* ── تخطيط الميتا العمودي ────────────────────────────────────────── */
.nsh-article__meta--vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* ── بطاقة معلومات الكاتب المستقلة (Standalone Author Bio Card) ─────── */
.nsh-author-bio {
  padding: 28px 32px;
}

.nsh-author-bio__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
  background: rgba(26, 111, 181, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.nsh-author-bio__badge .dashicons {
  font-size: 15px;
  width: 15px;
  height: 15px;
}

.nsh-author-bio__inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.nsh-author-bio__avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--surface-card), 0 0 0 5px rgba(26, 111, 181, 0.18);
  transition: transform 0.25s ease;
}

.nsh-author-bio__avatar:hover {
  transform: scale(1.05);
}

.nsh-author-bio__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nsh-author-bio__info {
  flex: 1;
  min-width: 0;
}

.nsh-author-bio__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.nsh-author-bio__name {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.nsh-author-bio__name a {
  color: var(--ink-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nsh-author-bio__name a:hover {
  color: var(--brand-primary);
}

.nsh-author-bio__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-base);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.nsh-author-bio__desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-muted);
}

.nsh-author-bio__desc p {
  margin: 0 0 8px 0;
}

.nsh-author-bio__desc p:last-child {
  margin-bottom: 0;
}

.nsh-author-bio__site {
  margin-top: 12px;
}

.nsh-author-bio__site a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
}

.nsh-author-bio__site a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .nsh-author-bio {
    padding: 22px 18px;
  }
  .nsh-author-bio__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .nsh-author-bio__header {
    justify-content: center;
  }
}

/* ── التخطيط المحاصر (Boxed Layout) ────────────────────────────── */
body.nsh-boxed-layout {
  background-color: #dbe2ea;
}

body.nsh-boxed-layout .site-header__inner,
body.nsh-boxed-layout .nsh-container,
body.nsh-boxed-layout .site-footer__inner {
  max-width: 1260px;
  margin-inline: auto;
}

body.nsh-boxed-layout .nsh-article,
body.nsh-boxed-layout .nsh-page {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── توحيد نسب صور البطاقات (Uniform Card Images) — المرحلة 26 ──── */
.nsh-uniform-card-images .nsh-card__thumb,
.nsh-uniform-card-images .nsh-card__img,
.nsh-uniform-card-images .nsh-article__img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

/* ── تخطيط الأعمدة والشريط الجانبي (Sidebar Layout & Sticky) — المرحلة 27 ── */
.nsh-layout {
  display: flex;
  gap: 32px;
  width: 100%;
}

.nsh-layout--full .nsh-main {
  width: 100%;
  max-width: 100%;
}

.nsh-layout--with-sidebar {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  align-items: start;
}

.nsh-layout--sidebar-left {
  grid-template-columns: 340px 1fr;
}

.nsh-main {
  min-width: 0;
}

.site-sidebar,
.nsh-sidebar {
  min-width: 0;
}

.site-sidebar--sticky,
.nsh-sidebar--sticky {
  position: sticky;
  top: 90px;
  align-self: start;
}

.site-sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

@media (max-width: 1024px) {
  .nsh-layout--with-sidebar,
  .nsh-layout--sidebar-left {
    grid-template-columns: 1fr;
  }

  .site-sidebar--sticky,
  .nsh-sidebar--sticky {
    position: static;
  }
}

/* ── عنوان المقال الفرعي (Article Subtitle) — المرحلة 34 ──────────── */
.nsh-article__subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-top: -6px;
  margin-bottom: 18px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   22. أنماط رأس المقال الستة (Post Header Modes) — تجربة بصرية متفوقة
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. نمط CINEMATIC (سينمائي غامر 75vh) ────────────────────────── */
.nsh-article__hero-cinematic {
  position: relative;
  min-height: clamp(400px, 72vh, 800px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 32px;
  background: #080811;
}

.nsh-article__hero-cinematic-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.8);
  transition: transform 10s ease;
}

.nsh-article__hero-cinematic:hover .nsh-article__hero-cinematic-bg {
  transform: scale(1.04);
}

.nsh-article__hero-cinematic-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.6) 45%,
    rgba(0, 0, 0, 0.15) 80%,
    rgba(0, 0, 0, 0.04) 100%
  );
}

.nsh-article__hero-cinematic-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 3vw, 2.5rem);
  color: #fff;
}

.nsh-article__hero-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.nsh-article__hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff !important;
  background: var(--brand-primary);
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s ease;
}

.nsh-article__hero-cat:hover {
  opacity: 0.9;
}

.nsh-article__hero-title {
  color: #ffffff !important;
  font-size: clamp(1.6rem, 3.8vw, 2.75rem);
  font-weight: 900;
  line-height: 1.3;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.nsh-article__hero-subtitle {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.15rem;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  margin: 0 0 18px;
  line-height: 1.6;
}

.nsh-article__meta--hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
}

.nsh-article__meta--hero a {
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
}

.nsh-article__meta--hero .dashicons {
  color: var(--brand-accent, #f59e0b);
  font-size: 17px;
  width: 17px;
  height: 17px;
  vertical-align: -2px;
}

/* ── 2. نمط OVERLAY (هيرو متدرج 55vh) ────────────────────────────── */
.nsh-article__hero-overlay {
  position: relative;
  width: 100%;
  min-height: clamp(350px, 55vh, 580px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  background: #080811;
}

.nsh-article__hero-overlay-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.85);
  transition: transform 8s ease;
}

.nsh-article__hero-overlay:hover .nsh-article__hero-overlay-bg {
  transform: scale(1.03);
}

.nsh-article__hero-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.35) 35%,
    rgba(0, 0, 0, 0.8) 75%,
    rgba(0, 0, 0, 0.96) 100%
  );
}

.nsh-article__hero-overlay-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
  color: #fff;
}

/* ── 3. نمط SPLIT (مقسوم تحريري 50% / 50%) ───────────────────────── */
.nsh-article__header--split {
  margin-bottom: 32px;
}

.nsh-article__split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: center;
  background: var(--surface-base);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nsh-article__split-media {
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  position: relative;
}

.nsh-article__split-img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.nsh-article__split-media:hover .nsh-article__split-img {
  transform: scale(1.03);
}

.nsh-article__split-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .nsh-article__split-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}

/* ── 4. نمط ABOVE (صحفي The Guardian — العنوان قبل الصورة) ────────── */
.nsh-article__header--above {
  padding-bottom: 20px;
  border-bottom: 3px solid var(--brand-primary);
  margin-bottom: 24px;
}

.nsh-article__above-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.nsh-article__above-breadcrumbs a {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
}

.nsh-article__above-sep {
  color: var(--border-subtle);
}

.nsh-article__featured--above {
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.nsh-article__caption--glass {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  margin: 0;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.65);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.85rem;
  text-align: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── 5. نمط INSIDE ───────────────────────────────────────────────── */
.nsh-article--inside .nsh-article__header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

/* ── شريط المشاركة العلوية (Top Social Share) ────────────────────── */
.nsh-article__share-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin: 20px 0 24px;
}

.nsh-article__share-top-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink-primary);
}

.nsh-article__share-top-label .dashicons {
  color: var(--brand-primary);
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.nsh-article__share-top-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/*
 * أزرار الشريط العلوي: دوائر بلون كل شبكة.
 *
 * كانت `color: #fff` بلا خلفية إطلاقاً — أي أيقونات بيضاء على أبيض،
 * لا تكاد تُرى. واللون يأتي من `--nsh-share-color` نفسه الذي تستعمله
 * الأزرار السفلية، فمصدر واحد للألوان لا قائمتان تفترقان.
 */
.nsh-article__share-top-links .nsh-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--nsh-share-color, var(--brand-primary));
  color: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

.nsh-article__share-top-links .nsh-share-btn .dashicons {
  font-size: 17px;
  width: 17px;
  height: 17px;
}

.nsh-article__share-top-links .nsh-share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* ══ المشاركة أسفل المقال ══════════════════════════════════════════
 *
 * كانت بلا أي قاعدة: كل أنماط `.nsh-share-btn` محصورة داخل
 * `.nsh-article__share-top-links`، فالكتلة السفلية تظهر روابط نصّية
 * متلاصقة بلا أزرار ولا ألوان — خارج تنسيق القالب تماماً.
 * ══════════════════════════════════════════════════════════════════ */

/* ── بطاقة مشاركة المقال المستقلة (Standalone Share Card) ──────────── */
.nsh-share-card {
  padding: 20px 32px;
}

.nsh-share-card__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.nsh-share-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-primary);
}

.nsh-share-card__title .dashicons {
  color: var(--brand-primary);
  font-size: 20px;
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .nsh-share-card {
    padding: 18px 16px;
  }
  .nsh-share-card__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .nsh-share-card .nsh-share-buttons {
    width: 100%;
  }
}

.nsh-article__share {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-block: 28px 8px;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--border-subtle);
}

.nsh-article__share-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-primary);
}

.nsh-share-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/*
 * الأزرار السفلية بنصّها لا أيقونةً وحدها كالعلوية: القارئ هنا أنهى
 * المقال وهو أكثر ميلاً للمشاركة، والنصّ يرفع النقر عن أيقونة مجرّدة.
 */
.nsh-share-buttons .nsh-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.nsh-share-buttons .nsh-share-btn .dashicons {
  font-size: 17px;
  width: 17px;
  height: 17px;
}

.nsh-share-buttons .nsh-share-btn:hover,
.nsh-share-buttons .nsh-share-btn:focus-visible {
  /* لون كل شبكة يظهر عند التفاعل لا في السكون: أربعة أزرار ملوّنة
     دائماً تسحب العين من المحتوى الذي جاء القارئ لأجله. */
  background: var(--nsh-share-color, var(--brand-primary));
  border-color: var(--nsh-share-color, var(--brand-primary));
  color: #fff;
  transform: translateY(-2px);
  outline: none;
}

.nsh-share-btn--whatsapp { --nsh-share-color: #25d366; }
.nsh-share-btn--twitter  { --nsh-share-color: #000000; }
.nsh-share-btn--facebook { --nsh-share-color: #1877f2; }
.nsh-share-btn--telegram { --nsh-share-color: #229ed9; }
.nsh-share-btn--copy     { --nsh-share-color: var(--brand-primary); }

/* تأكيد النسخ: يُضبط من main.js على الزر بعد نجاح النسخ */
.nsh-share-btn--copied {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
}

@media (max-width: 600px) {
  .nsh-article__share { gap: 10px }
  .nsh-share-buttons { width: 100%; }
  .nsh-share-buttons .nsh-share-btn { flex: 1 1 auto; justify-content: center; }
}

/* ── تحسينات خطوط وعناصر محتوى المقال (Article Typography) ───────── */
.entry-content {
  line-height: 1.85;
  font-size: 1.125rem;
}

/*
 * عناوين أقسام المقال: شريط لوني + أرضية متلاشية.
 *
 * الشريط وحده لا يكفي في نصٍّ عربي طويل — العين تمرّ عليه. الأرضية
 * المتلاشية تمنح العنوان كتلةً تُلتقط في المسح السريع بلا أن تصير
 * صندوقاً يقطع تدفّق القراءة.
 *
 * اللون من `color-mix` لا من rgba مكتوبة: لون العلامة متغيّر يضبطه
 * المالك، وأي قيمة مثبّتة هنا تنفصل عنه أول ما يغيّره.
 */
.entry-content h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--ink-primary);
  margin: 36px 0 16px;
  padding: 0.5em 0.85em;
  padding-inline-start: 14px;
  border-inline-start: 4px solid var(--brand-primary);
  border-start-end-radius: 8px;
  border-end-end-radius: 8px;
  line-height: 1.4;
}

@supports (background: color-mix(in srgb, red 5%, transparent)) {
  .entry-content h2 {
    background: linear-gradient(
      to var(--heading-fade, left),
      color-mix(in srgb, var(--brand-primary) 7%, transparent) 0%,
      transparent 72%
    );
  }

  .entry-content h3 {
    background: linear-gradient(
      to var(--heading-fade, left),
      color-mix(in srgb, var(--brand-primary) 4%, transparent) 0%,
      transparent 55%
    );
  }
}


.entry-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin: 28px 0 14px;
  padding: 0.35em 0.7em;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--brand-accent, #3b82f6);
  border-start-end-radius: 6px;
  border-end-end-radius: 6px;
  line-height: 1.4;
}

.entry-content blockquote {
  position: relative;
  margin: 28px 0;
  padding: 18px 24px;
  background: var(--surface-base);
  border-inline-start: 4px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  font-size: 1.08rem;
  line-height: 1.8;
  font-style: italic;
  color: var(--ink-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}

.entry-content th {
  background: var(--surface-base);
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  text-align: start;
  font-weight: 700;
}

.entry-content td {
  padding: 10px 16px;
  border: 1px solid var(--border-subtle);
}

/* ── الأسئلة الشائعة (FAQ Accordion) — المرحلة 34 ────────────────── */
.nsh-article-faq {
  margin: 36px 0 24px;
  padding: 24px;
  background-color: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.nsh-article-faq__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink-primary);
}

.nsh-article-faq__title .dashicons {
  color: var(--brand-primary);
  font-size: 22px;
  width: 22px;
  height: 22px;
}

.nsh-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nsh-accordion__item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-nsh-admin-dark="1"] .nsh-accordion__item,
body.nsh-dark .nsh-accordion__item {
  background-color: var(--surface-dark);
}

.nsh-accordion__item[open] {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nsh-accordion__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--ink-primary);
}

.nsh-accordion__question::-webkit-details-marker {
  display: none;
}

.nsh-accordion__icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nsh-accordion__item[open] .nsh-accordion__icon {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.nsh-accordion__answer {
  padding: 0 18px 16px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-primary);
  border-top: 1px dashed var(--border-subtle);
  margin-top: 4px;
  padding-top: 12px;
}

/* ── قائمة المصادر والمراجع (Citations / Sources) — المرحلة 34 ───── */
.nsh-article-sources {
  margin: 24px 0;
  padding: 16px 20px;
  background-color: var(--surface-base);
  border-inline-start: 4px solid var(--brand-primary);
  border-radius: var(--radius-sm);
}

.nsh-article-sources__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink-primary);
}

.nsh-article-sources__title .dashicons {
  color: var(--brand-primary);
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.nsh-article-sources__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nsh-article-sources__item a {
  color: var(--brand-primary);
  text-decoration: underline;
  font-size: 0.9rem;
  word-break: break-all;
}

.nsh-article-sources__item a:hover {
  color: var(--brand-accent);
}

/* ── تخصيص التصنيفات والأرشيف (Term Meta Styles) — المرحلة 35 ────── */
.nsh-cat-icon {
  font-size: 14px;
  width: 14px;
  height: 14px;
  margin-inline-end: 4px;
  vertical-align: -1px;
}

.nsh-archive-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-md);
  padding: 48px 32px;
  margin-bottom: 32px;
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.nsh-archive-hero__inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.nsh-archive-hero__icon {
  font-size: 40px;
  width: 40px;
  height: 40px;
  color: var(--brand-accent, #ffc107);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.nsh-archive-hero__title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.02em;
}

.nsh-archive-hero__subtitle {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.nsh-archive-hero__desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
}

.nsh-archive-header__icon {
  font-size: 28px;
  width: 28px;
  height: 28px;
  vertical-align: -3px;
  margin-inline-end: 8px;
  color: var(--brand-primary);
}

.nsh-archive-header__subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-top: 4px;
  margin-bottom: 8px;
}

/* ── أنماط شبكة الأرشيف المخصصة ── */
.nsh-grid--list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nsh-grid--list .nsh-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 640px) {
  .nsh-grid--list .nsh-card {
    grid-template-columns: 1fr;
  }
}

.nsh-grid--compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.nsh-grid--compact .nsh-card__excerpt {
  display: none;
}

/* ── أزرار التصنيفات الفرعية في الأرشيف (Subcategories Navigation) ── */
.nsh-subcategories-nav {
  margin: 0 0 28px;
}

.nsh-subcategories-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nsh-subcategory-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nsh-subcategory-pill:hover,
.nsh-subcategory-pill--active {
  background: var(--sub-color, var(--brand-primary));
  border-color: var(--sub-color, var(--brand-primary));
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.nsh-subcategory-pill .dashicons {
  font-size: 15px;
  width: 15px;
  height: 15px;
}

.nsh-subcategory-pill__count {
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.07);
  font-weight: 700;
}

.nsh-subcategory-pill:hover .nsh-subcategory-pill__count,
.nsh-subcategory-pill--active .nsh-subcategory-pill__count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   23. الودجات المتقدمة (Advanced Widgets) — CSS + بنية HTML متوقعة
   ملاحظة لفريق PHP: هذه البنية موثّقة لتُبنى بها ودجات المرحلة 5.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 23a. السلايدر الرئيسي (nsh-slider) ──────────────────────────
HTML المتوقع:
<div class="nsh-slider nsh-slider--overlay|nsh-slider--magazine|nsh-slider--carousel"
     data-nsh-slider data-autoplay="5000" role="region" aria-roledescription="carousel" aria-label="...">
  <div class="nsh-slider__track">
    <div class="nsh-slider__slide" aria-hidden="false" aria-roledescription="slide" aria-label="1 من 5">
      <a class="nsh-slider__link" href="...">
        <img class="nsh-slider__img" src="..." alt="...">
        <div class="nsh-slider__caption">
          <span class="nsh-slider__cat">تصنيف</span>
          <h3 class="nsh-slider__title">العنوان</h3>
        </div>
      </a>
    </div>
    <!-- ...المزيد من nsh-slider__slide -->
  </div>
  <button class="nsh-slider__arrow nsh-slider__arrow--prev" data-nsh-slider-prev aria-label="السابق">‹</button>
  <button class="nsh-slider__arrow nsh-slider__arrow--next" data-nsh-slider-next aria-label="التالي">›</button>
  <div class="nsh-slider__dots" role="tablist" data-nsh-slider-dots></div>
</div>
──────────────────────────────────────────────────────────────── */
.nsh-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--surface-hover);
}

.nsh-slider__track {
  display: flex;
  transition: transform var(--transition-normal);
  height: 100%;
}

.nsh-slider__slide {
  flex: 0 0 100%;
  position: relative;
  aspect-ratio: 16 / 7;
  max-height: 520px; /* السلايدر بلا حاوية (full-bleed) — بلا هذا الحد تتضخم الصورة بلا نهاية مع اتساع الشاشة */
}

@media (max-width: 768px) {
  .nsh-slider__slide {
    max-height: 360px;
  }
}

@media (max-width: 480px) {
  .nsh-slider__slide {
    max-height: 280px;
  }
}

.nsh-slider__link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.nsh-slider__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nsh-slider__caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 28px 36px;
  color: #fff;
}

.nsh-slider__cat {
  display: inline-block;
  background-color: var(--brand-primary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.nsh-slider__title {
  font-size: 26px;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* نمط overlay: تراكب متدرج أسفل الصورة */
.nsh-slider--overlay .nsh-slider__caption {
  background: linear-gradient(to top, rgba(15, 25, 35, 0.9), rgba(15, 25, 35, 0));
}

/* نمط magazine: شبكة — الشريحة النشطة كبيرة + قائمة عناوين جانبية */
.nsh-slider--magazine .nsh-slider__slide {
  aspect-ratio: 16 / 8;
}

/* نمط carousel: بطاقات متعددة ظاهرة معاً بعرض أقل من الحاوية */
.nsh-slider--carousel .nsh-slider__track {
  gap: 16px;
}

.nsh-slider--carousel .nsh-slider__slide {
  flex: 0 0 calc(33.333% - 11px);
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (max-width: 768px) {
  .nsh-slider--carousel .nsh-slider__slide {
    flex: 0 0 85%;
  }
}

.nsh-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--ink-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background-color var(--transition-fast);
}

.nsh-slider__arrow:hover {
  background-color: #fff;
  color: var(--brand-primary);
}

.nsh-slider__arrow--prev { inset-inline-start: 16px; }
.nsh-slider__arrow--next { inset-inline-end: 16px; }

.nsh-slider__dots {
  position: absolute;
  bottom: 14px;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 5;
}

.nsh-slider__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
}

.nsh-slider__dot--active {
  background-color: #fff;
  width: 24px;
  border-radius: 100px;
}

.nsh-slider__arrow:focus-visible,
.nsh-slider__dot:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ── 23b. كتلة أخبار متعددة الأشكال (nsh-news-block) ──────────────
HTML المتوقع:
<div class="nsh-news-block nsh-news-block--grid|list|classic|feature">
  <h2 class="nsh-news-block__title">عنوان الكتلة</h2>
  <div class="nsh-news-block__items">
    <article class="nsh-news-block__item">
      <a class="nsh-news-block__thumb" href="..."><img src="..." alt=""></a>
      <div class="nsh-news-block__body">
        <span class="nsh-news-block__cat">تصنيف</span>
        <h3 class="nsh-news-block__item-title"><a href="...">العنوان</a></h3>
        <time class="nsh-news-block__date">...</time>
      </div>
    </article>
  </div>
</div>
──────────────────────────────────────────────────────────────── */
.nsh-news-block__title {
  font-size: 19px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-primary);
}

.nsh-news-block__item {
  display: flex;
  gap: 12px;
}

.nsh-news-block__thumb {
  flex-shrink: 0;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--surface-hover);
}

.nsh-news-block__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nsh-news-block__cat {
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
}

.nsh-news-block__item-title {
  font-size: 15px;
  margin: 4px 0;
}

.nsh-news-block__item-title a {
  color: var(--ink-primary);
}

.nsh-news-block__date {
  font-size: 12px;
  color: var(--ink-muted);
}

/* شبكة */
.nsh-news-block--grid .nsh-news-block__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.nsh-news-block--grid .nsh-news-block__item {
  flex-direction: column;
}

.nsh-news-block--grid .nsh-news-block__thumb {
  width: 100%;
}

/* قائمة */
.nsh-news-block--list .nsh-news-block__items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nsh-news-block--list .nsh-news-block__thumb {
  width: 90px;
}

/* كلاسيك — نص فقط بلا صور */
.nsh-news-block--classic .nsh-news-block__items {
  display: flex;
  flex-direction: column;
}

.nsh-news-block--classic .nsh-news-block__item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.nsh-news-block--classic .nsh-news-block__thumb {
  display: none;
}

/* بلوك بارز — عنصر أول كبير + بقية العناصر كقائمة صغيرة بجانبه */
.nsh-news-block--feature .nsh-news-block__items {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.nsh-news-block--feature .nsh-news-block__item:first-child {
  flex-direction: column;
}

.nsh-news-block--feature .nsh-news-block__item:first-child .nsh-news-block__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.nsh-news-block--feature .nsh-news-block__item:first-child .nsh-news-block__item-title {
  font-size: 20px;
}

.nsh-news-block--feature .nsh-news-block__item:not(:first-child) {
  grid-column: 2;
}

@media (max-width: 640px) {
  .nsh-news-block--feature .nsh-news-block__items {
    grid-template-columns: 1fr;
  }
  .nsh-news-block--feature .nsh-news-block__item:not(:first-child) {
    grid-column: 1;
  }
}

/* ── 23c. تبويبات (nsh-tabs) ────────────────────────────────────
HTML المتوقع:
<div class="nsh-tabs" data-nsh-tabs>
  <div class="nsh-tabs__list" role="tablist" aria-label="...">
    <button class="nsh-tabs__tab nsh-tabs__tab--active" role="tab" id="tab-latest" aria-selected="true" aria-controls="panel-latest">الأحدث</button>
    <button class="nsh-tabs__tab" role="tab" id="tab-popular" aria-selected="false" aria-controls="panel-popular" tabindex="-1">الأكثر قراءة</button>
    <button class="nsh-tabs__tab" role="tab" id="tab-commented" aria-selected="false" aria-controls="panel-commented" tabindex="-1">الأكثر تعليقاً</button>
  </div>
  <div class="nsh-tabs__panel" role="tabpanel" id="panel-latest" aria-labelledby="tab-latest">...قائمة مقالات...</div>
  <div class="nsh-tabs__panel" role="tabpanel" id="panel-popular" aria-labelledby="tab-popular" hidden>...</div>
  <div class="nsh-tabs__panel" role="tabpanel" id="panel-commented" aria-labelledby="tab-commented" hidden>...</div>
</div>
──────────────────────────────────────────────────────────────── */
.nsh-tabs__list {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 18px;
}

.nsh-tabs__tab {
  padding: 10px 18px;
  min-height: 44px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  margin-bottom: -2px;
}

.nsh-tabs__tab:hover {
  color: var(--brand-primary);
}

.nsh-tabs__tab--active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.nsh-tabs__tab:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.nsh-tabs__panel[hidden] {
  display: none;
}

/* ── 23d. بطاقات مقالات مميزة (nsh-featured-cards) ────────────────
HTML المتوقع:
<div class="nsh-featured-cards">
  <article class="nsh-featured-card">
    <a class="nsh-featured-card__thumb" href="..."><img src="..." alt=""></a>
    <div class="nsh-featured-card__body">
      <span class="nsh-featured-card__cat">تصنيف</span>
      <h3 class="nsh-featured-card__title"><a href="...">العنوان</a></h3>
      <p class="nsh-featured-card__excerpt">...</p>
    </div>
  </article>
</div>
──────────────────────────────────────────────────────────────── */
.nsh-featured-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.nsh-featured-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.nsh-featured-card__thumb {
  display: block;
  aspect-ratio: 4 / 3;
}

.nsh-featured-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nsh-featured-card__body {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 22px;
  background: linear-gradient(to top, rgba(15, 25, 35, 0.92), rgba(15, 25, 35, 0.1));
  color: #fff;
}

.nsh-featured-card__cat {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-accent);
}

.nsh-featured-card__title {
  font-size: 20px;
  margin: 8px 0;
}

.nsh-featured-card__title a {
  color: #fff;
}

.nsh-featured-card__excerpt {
  font-size: 13px;
  color: #cbd5e1;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   24. تفاصيل وصولية إضافية (تُكمل ما هو موجود، لا تكرره)
   ═══════════════════════════════════════════════════════════════════ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   25. نظام الشبكة الموضعية (GridSystem — المرحلة 19)
   ═══════════════════════════════════════════════════════════════════ */

/* صف الشبكة — يوزع الخلايا أفقياً */
.nsh-grid-row {
  display: grid;
  gap: var(--gap, 20px);
  margin-block: 16px;
}

.nsh-grid-row--cols-1 { grid-template-columns: 1fr; }
.nsh-grid-row--cols-2 { grid-template-columns: repeat(2, 1fr); }
.nsh-grid-row--cols-3 { grid-template-columns: repeat(3, 1fr); }
.nsh-grid-row--cols-4 { grid-template-columns: repeat(4, 1fr); }
.nsh-grid-row--cols-5 { grid-template-columns: repeat(5, 1fr); }
.nsh-grid-row--cols-6 { grid-template-columns: repeat(6, 1fr); }

/* خلية الشبكة */
.nsh-grid-cell {
  min-width: 0;
}

.nsh-grid-cell__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-primary);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── قائمة التصنيفات ────────────────────────────────────────────── */
.nsh-grid-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nsh-grid-category-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--ink-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: color 0.15s ease;
}

.nsh-grid-category-list li a:hover {
  color: var(--brand-primary);
}

.nsh-grid-category-list__count {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ── سحابة الوسوم ───────────────────────────────────────────────── */
.nsh-grid-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nsh-grid-tag-cloud__tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12.5px;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, transparent);
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nsh-grid-tag-cloud__tag:hover {
  background: var(--brand-primary);
  color: #fff;
}

/* ── قائمة المقالات ─────────────────────────────────────────────── */
.nsh-grid-post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nsh-grid-post-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.nsh-grid-post-item__thumb {
  flex-shrink: 0;
  display: block;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
}

.nsh-grid-post-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nsh-grid-post-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nsh-grid-post-item__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.nsh-grid-post-item__title:hover {
  color: var(--brand-primary);
}

.nsh-grid-post-item__date {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ── شريط الأخبار العاجلة (خلية grid) ──────────────────────────── */
.nsh-grid-breaking {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  overflow: hidden;
}

.nsh-grid-breaking__label {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(255,255,255,.15);
  padding: 3px 10px;
  border-radius: 4px;
}

.nsh-grid-breaking__items {
  display: flex;
  gap: 24px;
  overflow: hidden;
}

.nsh-grid-breaking__item {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  opacity: .9;
  transition: opacity 0.15s ease;
}

.nsh-grid-breaking__item:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nsh-grid-row--cols-3,
  .nsh-grid-row--cols-4,
  .nsh-grid-row--cols-5,
  .nsh-grid-row--cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .nsh-grid-row--cols-2,
  .nsh-grid-row--cols-3,
  .nsh-grid-row--cols-4,
  .nsh-grid-row--cols-5,
  .nsh-grid-row--cols-6 {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════
   § الإعلانات
   ------------------------------------------------------------------
   خيار «الإخفاء على الجوال/الكمبيوتر» في اللوحة كان يطبع هذه الفئات
   منذ البداية بلا أي قاعدة تخفيها — فكان الخيار بلا أثر إطلاقاً.
   ══════════════════════════════════════════════════════════════════ */

.nsh-ad-wrapper { max-width: 100%; overflow: hidden; }

@media (max-width: 782px) {
  .nsh-ad--hide-mobile { display: none !important; }
}

@media (min-width: 783px) {
  .nsh-ad--hide-desktop { display: none !important; }
}

/* وضع القراءة يخفي كل الإعلانات */
body.reading-mode .nsh-ad-wrapper,
body.reading-mode .nsh-ad-legacy { display: none !important; }

/* ── حاجب الإعلانات: رسالة أو طبقة حجب ── */

.nsh-adb {
  position: fixed;
  inset-inline-end: 20px;
  bottom: 20px;
  z-index: 9999;
  max-width: 360px;
}

.nsh-adb__box {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface-dark);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  line-height: 1.8;
}

.nsh-adb__title { margin: 0 0 8px; font-size: 16px; font-weight: 800; color: inherit; }
.nsh-adb__text p { margin: 0 0 8px; opacity: 0.92; }
.nsh-adb__text p:last-child { margin-bottom: 0; }

.nsh-adb__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.nsh-adb__btn {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nsh-adb__btn:hover { filter: brightness(1.1); }

.nsh-adb__btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/*
 * وضع الحجب: طبقة تُغطّي الصفحة كلها. القفل على <html> لا على <body>
 * لأن بعض القوالب تجعل body قابلاً للتمرير بذاته، فيُمرَّر المحتوى من
 * خلف الطبقة ويُقرأ كلّه.
 */
.nsh-adb--block {
  inset: 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.94);
}

.nsh-adb--block .nsh-adb__box { max-width: 460px; text-align: center; }
.nsh-adb--block .nsh-adb__actions { justify-content: center; }

.nsh-adb-locked,
.nsh-adb-locked body { overflow: hidden !important; }

@media (prefers-reduced-motion: no-preference) {
  .nsh-adb__box { animation: nsh-adb-in 0.3s ease-out; }
  @keyframes nsh-adb-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ── الإعلان اللاصق أسفل الشاشة ── */

.nsh-sticky-ad {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 6px 44px 6px 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.12);
}

.nsh-sticky-ad .nsh-ad-wrapper { margin: 0 !important; }

/*
 * زر الإغلاق ليس تحسيناً اختيارياً: إعلان ثابت لا يمكن إغلاقه يخالف سياسة
 * جوجل ويُصنَّف في تقارير تجربة الصفحة إعلاناً متطفّلاً — وقد يُعاقَب عليه
 * الموقع كله لا الإعلان وحده. لذلك مساحة لمس ٤٤ بكسل ولون واضح.
 */
.nsh-sticky-ad__close {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.nsh-sticky-ad__close:hover { background: rgba(15, 23, 42, 0.16); }

@media (prefers-color-scheme: dark) {
  .nsh-sticky-ad { background: rgba(15, 23, 42, 0.97); }
  .nsh-sticky-ad__close { background: rgba(255, 255, 255, 0.12); color: #f8fafc; }
}

body.reading-mode .nsh-sticky-ad { display: none !important; }

/* ══════════════════════════════════════════════════════════════════
   § تخطيط الهيدر والفوتر (منشئ الصفوف والمربعات)
   ══════════════════════════════════════════════════════════════════ */

/*
 * تخطيطان في الترميز، وأحدهما يُخفى بنقطة الكسر نفسها التي يفصل عندها
 * القالب — لا بجافاسكربت: التبديل بالسكربت يُظهر تخطيط الكمبيوتر للحظة
 * على الجوال عند كل تحميل صفحة.
 */
.nsh-layout--mobile  { display: block; }
.nsh-layout--desktop { display: none; }

@media (min-width: 783px) {
  .nsh-layout--mobile  { display: none; }
  .nsh-layout--desktop { display: block; }
}

/*
 * صفوف الهيدر والفوتر.
 *
 * كانت تقرأ `--nsh-surface-base` و`--nsh-ink-primary` — وهي أسماء
 * **لوحة التحكم** لا الواجهة. فلا وجود لها هنا، وتسقط على الاحتياطي:
 * خلفية بيضاء ونصّ داكن **مثبَّتان**. النتيجة أن الهيدر لا يعرف الوضع
 * الليلي إطلاقاً: يبقى أبيض على صفحة داكنة، أو يرث خلفيةً داكنة من
 * أبٍ ويبقى نصّه داكناً فلا يكاد يُقرأ.
 *
 * الأسماء الصحيحة في الواجهة بلا بادئة: `--surface-card` و`--ink-primary`،
 * وكلاهما يُعاد تعريفه في كتلة الوضع الليلي فيتبعه الهيدر تلقائياً.
 */
.nsh-layout__row {
  background: var(--surface-card);
  color: var(--ink-primary);
}

.nsh-layout__row[data-row-theme="dark"] {
  background: var(--surface-dark);
  color: #f8fafc;
}

.nsh-layout__row[data-row-theme="dark"] a { color: inherit; }

.nsh-layout__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(var(--container-max), 100%);
  margin-inline: auto;
  padding: 10px 20px;
}

/*
 * هندسة الخلايا الذكية للهيدر والفوتر:
 * 1. الخلية 1 و 2: محاذاة لبداية السطر (اليمين في RTL واليسار في LTR).
 * 2. الخلية 3 (الوسطى): المحور المرن الأساسي وموضع المنتصف، تتمدد
 *    وتوسّط كل ما بداخلها (شعار، قائمة، حقوق، سوشيال، إلخ).
 * 3. الخلية 4 و 5: محاذاة لنهاية السطر (اليسار في RTL واليمين في LTR).
 * 4. باقي الخلايا الفارغة تختفي حتى لا تشتت الفراغات.
 */
.nsh-layout__cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* ── الخلايا الأولى (1 و 2): بداية السطر ── */
.nsh-layout__cell[data-cell="1"],
.nsh-layout__cell[data-cell="2"] {
  justify-content: flex-start;
}

.nsh-layout__cell[data-cell="1"] .nsh-layout__nav > ul,
.nsh-layout__cell[data-cell="2"] .nsh-layout__nav > ul {
  justify-content: flex-start;
}

.nsh-layout__cell[data-cell="1"] .nsh-layout__logo,
.nsh-layout__cell[data-cell="2"] .nsh-layout__logo {
  margin-inline-end: auto;
}

/* ── الخلية الوسطى (3): المنتصف تماماً ── */
.nsh-layout__cell[data-cell="3"]:not(.nsh-layout__cell--empty) {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.nsh-layout__cell[data-cell="3"].nsh-layout__cell--empty {
  flex: 1 1 auto;
  display: block;
}

/* توسيط كل العناصر التي توضع في الخلية الوسطى (هيدر وفوتر) */
.nsh-layout__cell[data-cell="3"] .nsh-layout__logo {
  margin-inline: auto;
  justify-content: center;
}

.nsh-layout__cell[data-cell="3"] .nsh-layout__logo-img {
  margin-inline: auto;
}

.nsh-layout__cell[data-cell="3"] .nsh-layout__nav {
  width: 100%;
}

.nsh-layout__cell[data-cell="3"] .nsh-layout__nav > ul {
  justify-content: center;
  flex-wrap: wrap;
}

.nsh-layout__cell[data-cell="3"] .nsh-layout__social {
  justify-content: center;
  margin-inline: auto;
}

.nsh-layout__cell[data-cell="3"] .nsh-layout__copyright {
  text-align: center;
  width: 100%;
  margin-inline: auto;
}

.nsh-layout__cell[data-cell="3"] .nsh-layout__title,
.nsh-layout__cell[data-cell="3"] .nsh-layout__tagline,
.nsh-layout__cell[data-cell="3"] .nsh-layout__time {
  text-align: center;
  margin-inline: auto;
  display: block;
}

.nsh-layout__cell[data-cell="3"] .nsh-dark-toggle,
.nsh-layout__cell[data-cell="3"] .nsh-search-btn,
.nsh-layout__cell[data-cell="3"] .nsh-hamburger,
.nsh-layout__cell[data-cell="3"] form.search-form {
  margin-inline: auto;
}

/* ── الخلايا الأخيرة (4 و 5): نهاية السطر ── */
.nsh-layout__cell[data-cell="4"],
.nsh-layout__cell[data-cell="5"] {
  justify-content: flex-end;
}

.nsh-layout__cell[data-cell="4"] > *,
.nsh-layout__cell[data-cell="5"] > * {
  margin-inline-start: auto;
}

.nsh-layout__cell[data-cell="5"] {
  margin-inline-start: auto;
}

.nsh-layout__cell[data-cell="4"] .nsh-layout__nav > ul,
.nsh-layout__cell[data-cell="5"] .nsh-layout__nav > ul {
  justify-content: flex-end;
}

.nsh-layout__cell[data-cell="4"] .nsh-layout__social,
.nsh-layout__cell[data-cell="5"] .nsh-layout__social {
  justify-content: flex-end;
  margin-inline-start: auto;
}

.nsh-layout__cell[data-cell="4"] .nsh-layout__copyright,
.nsh-layout__cell[data-cell="5"] .nsh-layout__copyright {
  text-align: end;
  margin-inline-start: auto;
}

/* ── إخفاء الخلايا الفارغة ما عدا الخلية 3 كفاصل ── */
.nsh-layout__cell--empty:not([data-cell="3"]) {
  display: none;
}

.nsh-layout__spacer {
  flex: 1 1 auto;
  display: block;
}

.nsh-layout__logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  text-decoration: none;
}

.nsh-layout__logo-img {
  width: auto;
  height: auto;
  max-width: 170px;
  max-height: 55px;
  object-fit: contain;
  display: block;
  transition: opacity var(--transition-fast);
}

.nsh-layout__logo:hover .nsh-layout__logo-img {
  opacity: 0.88;
}

@media (max-width: 991px) {
  .nsh-layout__logo-img {
    max-width: 140px;
    max-height: 48px;
  }
}

@media (max-width: 782px) {
  .nsh-layout__logo-img {
    max-width: 115px;
    max-height: 40px;
  }
}

/* الشعار المزدوج: أيّهما يظهر تحدّده سمة الوضع لا الجافاسكربت */
.nsh-layout__logo-img--dark { display: none; }
[data-theme="dark"] .nsh-layout__logo-img--light { display: none; }
[data-theme="dark"] .nsh-layout__logo-img--dark  { display: block; }
/* إذا كان هناك شعار واحد فقط، يُعرض دائماً */
[data-theme="dark"] .nsh-layout__logo-img--single {
  display: block !important;
}

.nsh-layout__title {
  font-weight: 900;
  font-size: 1.25rem;
  text-decoration: none;
  color: inherit;
}

.nsh-layout__tagline { font-size: 0.85rem; opacity: 0.75; }
.nsh-layout__time    { font-variant-numeric: tabular-nums; font-size: 0.85rem; opacity: 0.85; }
.nsh-layout__copyright { font-size: 0.85rem; opacity: 0.85; }

.nsh-layout__social {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nsh-layout__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: inherit;
  background: color-mix(in srgb, var(--nsh-social-color, currentColor) 12%, transparent);
  transition: background 0.2s, color 0.2s;
}

.nsh-layout__social-link:hover {
  background: var(--nsh-social-color, currentColor);
  color: #fff;
}

@media (max-width: 782px) {
  .nsh-layout__inner { gap: 10px; padding: 8px 14px; }
  .nsh-layout__title { font-size: 1.05rem; }
}

/* ══════════════════════════════════════════════════════════════════
   § صدفة الموقع — الهيدر والفوتر
   ------------------------------------------------------------------
   مبنية على متغيرات ناشري في أعلى الملف وحدها، وبأسماء `nsh-shell-*`
   الخاصة بها. لا تشترك مع أي قالب آخر في اسم صنف ولا متغيّر: التشابه
   في الأسماء يجعل تعديلاً في أحدهما يبدو صالحاً للآخر وهو ليس كذلك.

   التقنيات: طبقة `@layer` تُبقي أولوية القواعد مضبوطة مهما أُضيف بعدها،
   والخصائص المنطقية (`inset-inline`, `padding-block`) تعمل في الاتجاهين
   بلا قاعدة RTL منفصلة، و`color-mix` يشتقّ الدرجات من لون العلامة نفسه
   فلا تُثبَّت ألوان تخالفه حين يغيّرها المالك.
   ══════════════════════════════════════════════════════════════════ */

@layer nsh-shell {

  :root {
    --nsh-shell-h: 68px;
    --nsh-shell-veil: color-mix(in srgb, var(--surface-card) 78%, transparent);
    --nsh-shell-veil-solid: color-mix(in srgb, var(--surface-card) 94%, transparent);
    --nsh-shell-line: color-mix(in srgb, var(--border-subtle) 85%, transparent);

    /*
     * سماكة الخيط اللوني الذي يتوّج الهيدر ويختم الفوتر.
     * ثلاثة بكسل لا واحد: الواحد يقرأه المتصفّح حدّاً، والثلاثة تقرأها
     * العين توقيعاً للعلامة — وهو أرخص عنصر تصميمي يفصل قالباً مصمَّماً
     * عن قالب افتراضي.
     */
    --nsh-shell-rule: 3px;

    /* سطح الفوتر: مشتقّ من لون العلامة لا رمادي محايد، فيبدو جزءاً من
       الهوية بدل شريط منفصل ألصق بالصفحة. */
    --nsh-shell-footer-bg: color-mix(in srgb, var(--brand-primary) 4%, var(--surface-base));
    --nsh-shell-footer-ink: var(--ink-primary);
  }

  [data-theme="dark"] {
    --nsh-shell-footer-bg: color-mix(in srgb, var(--brand-primary) 10%, var(--surface-dark));
  }

  /* ── الهيدر ───────────────────────────────────────────────────── */

  .site-header {
    position: relative;
    z-index: 1000;
    background: var(--nsh-shell-veil);
    border-block-end: 1px solid var(--nsh-shell-line);
    box-shadow: none;
    transition:
      background var(--transition-normal),
      box-shadow var(--transition-normal),
      border-color var(--transition-normal),
      transform var(--transition-normal);
  }

  /*
   * الزجاج المصنفر خلف الهيدر — مشروط بدعم المتصفح له.
   * بلا الشرط يسقط المتصفح غير الداعم على خلفية شبه شفافة يُقرأ النصّ
   * فوقها بصعوبة، وهو أسوأ من خلفية صلبة.
   */
  @supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .site-header {
      -webkit-backdrop-filter: saturate(170%) blur(16px);
      backdrop-filter: saturate(170%) blur(16px);
    }
  }

  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-header { background: var(--surface-card); }
  }

  /* عند التمرير: يصير الهيدر أكثر صلابة فينفصل بصرياً عن المحتوى */
  .site-header--solid {
    background: var(--nsh-shell-veil-solid);
    box-shadow: var(--shadow-md);
    border-block-end-color: transparent;
  }

  /* الالتصاق خيار المالك: الصنف يأتي من `header.sticky_enabled`. */
  .site-header--sticky {
    position: sticky;
    inset-block-start: 0;
  }

  /*
   * الخيط اللوني فوق الهيدر.
   *
   * عنصر زائف لا `border-top`: الحدّ يدخل في حساب `position: sticky`
   * فيترك خطاً شاحباً فوق الهيدر حين ينزلق، والزائف يتحرّك معه كتلةً
   * واحدة. وتدرّجٌ لا لون مصمت: خطّ ثلاثة بكسل بلون واحد يبدو حدّاً،
   * وبتدرّج يبدو توقيعاً.
   */
  .site-header::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    block-size: var(--nsh-shell-rule);
    background: linear-gradient(
      to var(--heading-fade, left),
      var(--brand-primary) 0%,
      var(--brand-accent, var(--brand-primary)) 55%,
      color-mix(in srgb, var(--brand-primary) 45%, transparent) 100%
    );
    z-index: 2;
  }

  /*
   * نظام الصفوف المستقلة للهيدر:
   * كل صف يمثل شريطاً مستقلاً وواضح المعالم (Top Bar / Main Bar / Nav Bar).
   * فاصل حدودي ناصع وأنيق يفصل بين الصفوف مع تباين لوني مدروس وحشوات
   * متوازنة تعطي كل صف شخصيته المستقلة كما في أشهر الصحف والمجلات.
   */
  .site-header .nsh-layout__row {
    position: relative;
    width: 100%;
    transition: background var(--transition-fast), border-color var(--transition-fast);
  }

  /* الصف الأول (شريط الشعار الرئيسي) */
  .site-header .nsh-layout__row:first-child .nsh-layout__inner {
    min-block-size: var(--nsh-shell-h, 68px);
    padding-block: 14px;
  }

  /* كل صف يتبع صفاً سابقاً (مثل شريط القوائم أو الأدوات): فاصل حدودي واضح وسطح مميز */
  .site-header .nsh-layout__row + .nsh-layout__row {
    border-block-start: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--surface-base) 60%, var(--surface-card));
  }

  .site-header .nsh-layout__row + .nsh-layout__row .nsh-layout__inner {
    min-block-size: 50px;
    padding-block: 8px;
  }

  /* إذا أضاف المالك صفاً ثالثاً */
  .site-header .nsh-layout__row + .nsh-layout__row + .nsh-layout__row {
    border-block-start: 1px solid var(--border-subtle);
    background: var(--surface-card);
  }

  .site-header .nsh-layout__row + .nsh-layout__row + .nsh-layout__row .nsh-layout__inner {
    min-block-size: 46px;
    padding-block: 6px;
  }

  /* الصف الداكن: تباين لوني قوي (مثل الشريط العلوي للأخبار أو الأدوات) */
  .site-header .nsh-layout__row[data-row-theme="dark"],
  .site-header .nsh-layout__row + .nsh-layout__row[data-row-theme="dark"] {
    background: var(--surface-dark);
    color: color-mix(in srgb, #ffffff 86%, var(--surface-dark));
    border-block-color: rgba(255, 255, 255, 0.08);
  }

  .site-header .nsh-layout__row[data-row-theme="dark"] .nsh-layout__inner {
    min-block-size: 38px;
    padding-block: 6px;
    font-size: 0.84rem;
  }

  :root[data-theme="dark"] .site-header .nsh-layout__row + .nsh-layout__row {
    background: color-mix(in srgb, #ffffff 4%, var(--surface-dark));
    border-block-start-color: rgba(255, 255, 255, 0.08);
  }

  /* ── روابط القوائم داخل الصدفة ────────────────────────────────── */

  .nsh-layout__nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .nsh-layout__nav li { position: relative; }

  .nsh-layout__nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.94rem;
    color: var(--ink-primary);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
  }

  /*
   * مؤشّر التبويب: خطّ ينمو من المنتصف تحت الرابط.
   *
   * `transform: scaleX` لا `width`: الأول يجري على المعالج الرسومي في
   * إطار واحد، والثاني يُعيد حساب التخطيط عند كل إطار فيرتجّ على الجوال.
   * والخطّ تحت الرابط لا خلفية مصمتة: القائمة العربية كلماتها متفاوتة
   * الطول، فالخلفيات المصمتة تصنع مستطيلات غير متساوية تشوّش الصفّ.
   */
  .nsh-layout__nav > ul > li > a::after {
    content: "";
    position: absolute;
    inset-block-end: 2px;
    inset-inline: 14px;
    block-size: 2.5px;
    border-radius: 2px;
    background: var(--brand-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition-normal);
  }

  .nsh-layout__nav > ul > li > a:hover::after,
  .nsh-layout__nav > ul > li > a:focus-visible::after,
  .nsh-layout__nav > ul > li.current-menu-item > a::after,
  .nsh-layout__nav > ul > li.current-menu-ancestor > a::after,
  .nsh-layout__nav > ul > li.current-menu-parent > a::after {
    transform: scaleX(1);
  }

  .nsh-layout__nav a:hover,
  .nsh-layout__nav a:focus-visible,
  .nsh-layout__nav .current-menu-item > a,
  .nsh-layout__nav .current-menu-ancestor > a,
  .nsh-layout__nav .current-menu-parent > a {
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  }

  .nsh-layout__nav > ul > li > a {
    position: relative;
    padding-block-end: 10px;
  }

  @media (prefers-reduced-motion: reduce) {
    .nsh-layout__nav > ul > li > a::after { transition: none; }
  }

  /*
   * القوائم المنسدلة: `visibility` مع `opacity` لا `display:none` —
   * الأخير يقطع الانتقال ويمنع قارئ الشاشة من متابعة التركيز داخلها.
   */
  .nsh-layout__nav .sub-menu {
    position: absolute;
    inset-block-start: calc(100% + 6px);
    inset-inline-start: 0;
    min-inline-size: 210px;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
      opacity var(--transition-normal),
      transform var(--transition-normal),
      visibility var(--transition-normal);
    z-index: 30;
  }

  .nsh-layout__nav li:hover > .sub-menu,
  .nsh-layout__nav li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nsh-layout__nav .sub-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
  }

  .nsh-layout__nav .sub-menu .sub-menu {
    inset-block-start: -6px;
    inset-inline-start: 100%;
  }

  /* ── الفوتر ───────────────────────────────────────────────────── */

  .site-footer {
    position: relative;
    margin-block-start: auto;
    background:
      radial-gradient(
        110% 70% at 100% 0%,
        color-mix(in srgb, var(--brand-primary) 26%, var(--surface-dark)) 0%,
        var(--surface-dark) 62%
      );
    color: color-mix(in srgb, #ffffff 76%, var(--surface-dark));
  }

  /* خيط علوي بلون العلامة يفصل الفوتر عن المحتوى بلا حدٍّ ثقيل */
  .site-footer::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-start: 0;
    block-size: 2px;
    background: linear-gradient(
      to inline-end,
      transparent,
      var(--brand-primary) 35%,
      var(--brand-accent) 65%,
      transparent
    );
  }

  .site-footer .nsh-layout__row { background: transparent; color: inherit; }
  .site-footer .nsh-layout__inner { padding-block: 28px; }

  /* صفٌّ بعد الأول: خطّ فاصل خفيف بدل حدٍّ كامل */
  .site-footer .nsh-layout__row + .nsh-layout__row .nsh-layout__inner {
    border-block-start: 1px solid color-mix(in srgb, #ffffff 10%, transparent);
    padding-block: 18px;
  }

  .site-footer a { color: inherit; text-decoration: none; }
  .site-footer a:hover { color: #ffffff; }

  .site-footer .nsh-layout__nav ul { flex-wrap: wrap; gap: 2px 10px; }

  .site-footer .nsh-layout__nav a {
    color: inherit;
    font-weight: 500;
    /*
     * الإزاحة عند التمرير تُوحي بالاتجاه ولا تُزيح ما حولها: الحشوة
     * المنطقية تعمل يميناً في العربية ويساراً في الإنجليزية بلا قاعدة ثانية.
     */
    transition: color var(--transition-fast), padding-inline-start var(--transition-normal);
  }

  .site-footer .nsh-layout__nav a:hover {
    color: #ffffff;
    background: transparent;
    padding-inline-start: 20px;
  }

  .site-footer .nsh-layout__social-link {
    background: color-mix(in srgb, #ffffff 9%, transparent);
    color: inherit;
  }

  .site-footer .nsh-layout__social-link:hover {
    background: var(--nsh-social-color, var(--brand-accent));
    color: #ffffff;
    transform: translateY(-2px);
  }

  .site-footer .nsh-layout__copyright { opacity: 0.72; }

  /* ── الوضع الليلي ─────────────────────────────────────────────── */

  :root[data-theme="dark"] .site-header {
    background: color-mix(in srgb, var(--surface-card) 72%, transparent);
    border-block-end-color: color-mix(in srgb, #ffffff 9%, transparent);
  }

  :root[data-theme="dark"] .site-header--solid {
    background: color-mix(in srgb, var(--surface-card) 92%, transparent);
  }

  :root[data-theme="dark"] .nsh-layout__nav .sub-menu {
    background: var(--surface-card);
    border-color: color-mix(in srgb, #ffffff 10%, transparent);
  }

  /* ── تقليل الحركة ─────────────────────────────────────────────── */

  @media (prefers-reduced-motion: reduce) {
    .site-header,
    .nsh-layout__nav a,
    .nsh-layout__nav .sub-menu,
    .site-footer .nsh-layout__social-link { transition: none; }
    .site-footer .nsh-layout__nav a:hover { padding-inline-start: 0; }
  }

  /* ── الجوال ───────────────────────────────────────────────────── */

  @media (max-width: 782px) {
    :root { --nsh-shell-h: 56px; }
    .site-footer .nsh-layout__inner { padding-block: 20px; }
    .site-footer .nsh-layout__nav ul { justify-content: center; }
  }
}

/* ══════════════════════════════════════════════════════════════════
   § صفحة الكاتب
   ══════════════════════════════════════════════════════════════════ */

.nsh-author-header {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px;
  margin-block: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.nsh-author-header__img {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  /* حلقة بلون العلامة بدل حدٍّ رمادي: الصورة هي بؤرة الصفحة */
  box-shadow: 0 0 0 4px var(--surface-card), 0 0 0 7px var(--brand-primary);
}

.nsh-author-header__body { flex: 1 1 320px; min-width: 0; }

.nsh-author-header__name {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--ink-primary);
}

.nsh-author-header__bio {
  margin: 0 0 14px;
  color: var(--ink-muted);
  line-height: 1.9;
  max-width: 70ch;
}

.nsh-author-header__stats {
  display: flex;
  align-items: center;
  gap: 12px 28px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.nsh-author-header__stats li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.nsh-author-header__stats strong {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--brand-primary);
}

.nsh-author-header__stats a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-primary);
  text-decoration: none;
}

.nsh-author-header__social {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nsh-author-header__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--ink-muted);
  background: color-mix(in srgb, var(--nsh-social-color, currentColor) 12%, transparent);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nsh-author-header__social a:hover {
  background: var(--nsh-social-color, var(--brand-primary));
  color: #fff;
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .nsh-author-header { padding: 20px; gap: 16px; justify-content: center; text-align: center; }
  .nsh-author-header__stats,
  .nsh-author-header__social { justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════
   § العدّاد الزمني والأكواد المختصرة والوسائط
   ══════════════════════════════════════════════════════════════════ */

.nsh-content-timer {
  text-align: center;
  padding: 32px 20px;
  margin-block: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}

.nsh-content-timer__title { margin: 0 0 16px; font-size: 1.05rem; color: var(--ink-muted); }

.nsh-content-timer__count {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  line-height: 1;
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
}

.nsh-content-timer__body { margin-top: 20px; }

.nsh-countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

.nsh-countdown__title { font-size: 0.85rem; color: var(--ink-muted); }
.nsh-countdown__value { font-weight: 800; color: var(--brand-primary); font-variant-numeric: tabular-nums; }
.nsh-countdown--done .nsh-countdown__value { color: var(--ink-muted); }

.nsh-event {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.nsh-event--coming { background: color-mix(in srgb, var(--brand-primary) 12%, transparent); color: var(--brand-primary); }
.nsh-event--live   { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
.nsh-event--ended  { background: var(--surface-hover); color: var(--ink-muted); }

.nsh-shortcode-posts { margin: 0; padding-inline-start: 20px; line-height: 2 }
.nsh-grabbed { margin-block: 16px }

/*
 * الفيديو المتجاوب.
 *
 * `aspect-ratio` لا حيلة الحشوة السفلية: الحيلة تُثبّت النسبة على
 * ١٦:٩ دائماً، وهذه تتبع أبعاد الإطار الفعلية حين يوفّرها المزوّد.
 */
.nsh-video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  margin-block: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-dark);
}

.nsh-video-embed iframe,
.nsh-video-embed object,
.nsh-video-embed embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.nsh-thumb--fallback { width: 100%; height: auto; display: block }


/* ══════════════════════════════════════════════════════════════
   زرّ العودة إلى أعلى الصفحة
   ──────────────────────────────────────────────────────────────
   `inset-inline-start` لا `left`: في RTL يجلس الزرّ يمين الشاشة
   ويسارها في LTR بلا قاعدة ثانية تُنسى عند التعديل.

   يبقى في الشجرة دائماً ويُخفى بالشفافية لا بـ`display`: الإخفاء
   بـ`display` يلغي الانتقال فيقفز الزرّ ظهوراً واختفاءً.
   ══════════════════════════════════════════════════════════════ */
.nsh-to-top {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-start: 24px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.nsh-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nsh-to-top:hover,
.nsh-to-top:focus-visible {
  background: var(--brand-accent, var(--brand-primary));
  transform: translateY(-3px);
}

.nsh-to-top .dashicons {
  font-size: 22px;
  width: 22px;
  height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .nsh-to-top { transition: opacity 0.25s ease, visibility 0.25s; }
  .nsh-to-top:hover,
  .nsh-to-top:focus-visible { transform: none; }
}

/* على الجوال يزاحم الزرّ أشرطة المتصفّح السفلية، فيرتفع قليلاً. */
@media (max-width: 782px) {
  .nsh-to-top {
    inset-block-end: 16px;
    inset-inline-start: 16px;
    width: 42px;
    height: 42px;
  }
}


/* ══════════════════════════════════════════════════════════════════
   § الفوتر — سطحٌ مستقل لا شريط ملحق
   ------------------------------------------------------------------
   لماذا كان يبدو افتراضياً: صفوفه ترث `--surface-card` نفسه الذي تلبسه
   البطاقات والمقال، وحشوها الرأسي عشرة بكسل كحشو صفوف الهيدر. فالنتيجة
   شريطٌ أبيض بارتفاع سطر، لا منطقة تُختم بها الصفحة.

   العلاج ثلاثة: سطحٌ مشتقّ من لون العلامة يفصله عمّا فوقه، وحشوٌ يجعله
   منطقةً (ثلاثة أضعاف الهيدر)، وخيطٌ لوني يختم الصفحة كما يفتتحها خيط
   الهيدر — فيُقرأ الاثنان زوجاً مقصوداً.
   ══════════════════════════════════════════════════════════════════ */

@layer nsh-shell {

  .site-footer {
    position: relative;
    margin-block-start: 56px;
    background: var(--nsh-shell-footer-bg);
    color: var(--nsh-shell-footer-ink);
    border-block-start: 1px solid var(--nsh-shell-line);
  }

  .site-footer::after {
    content: "";
    position: absolute;
    inset-block-end: 0;
    inset-inline: 0;
    block-size: var(--nsh-shell-rule);
    background: linear-gradient(
      to var(--heading-fade, left),
      var(--brand-primary) 0%,
      var(--brand-accent, var(--brand-primary)) 55%,
      color-mix(in srgb, var(--brand-primary) 45%, transparent) 100%
    );
  }

  /* الصفوف تتبع سطح الفوتر لا سطح البطاقات. */
  .site-footer .nsh-layout__row {
    background: transparent;
    color: inherit;
  }

  .site-footer .nsh-layout__row[data-row-theme="dark"] {
    background: var(--surface-dark);
    color: color-mix(in srgb, #ffffff 86%, var(--surface-dark));
  }

  .site-footer .nsh-layout__inner {
    padding-block: 30px;
    align-items: center;
  }

  /*
   * صفّ الحقوق: خيط شعري يفصله عمّا فوقه وحشو أقلّ.
   * `:last-child` لا صنف مخصّص: المالك يرتّب صفوفه في المنشئ، وأي صنف
   * نعلّقه على صفّ بعينه يضيع أول ما يُعيد الترتيب.
   */
  .site-footer .nsh-layout__row:not(:first-child) .nsh-layout__inner {
    padding-block: 16px;
  }

  .site-footer .nsh-layout__row:not(:first-child) {
    border-block-start: 1px solid var(--nsh-shell-line);
  }

  .site-footer .nsh-layout__copyright {
    font-size: 0.86rem;
    opacity: 0.72;
  }

  /* ── قائمة الفوتر: أهدأ من قائمة الهيدر بلا مؤشّر متحرّك ────────── */

  .site-footer .nsh-layout__nav > ul > li > a::after { content: none; }

  .site-footer .nsh-layout__nav a {
    padding-block: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: inherit;
    opacity: 0.8;
  }

  .site-footer .nsh-layout__nav a:hover,
  .site-footer .nsh-layout__nav a:focus-visible {
    opacity: 1;
    color: var(--brand-primary);
    background: transparent;
  }

  /* ── أيقونات التواصل ───────────────────────────────────────────── */

  .site-footer .nsh-layout__social { gap: 10px; }

  .site-footer .nsh-layout__social-link {
    inline-size: 38px;
    block-size: 38px;
    border: 1px solid var(--border-subtle);
    transition:
      background var(--transition-fast),
      color var(--transition-fast),
      transform var(--transition-fast),
      border-color var(--transition-fast);
  }

  .site-footer .nsh-layout__social-link:hover,
  .site-footer .nsh-layout__social-link:focus-visible {
    transform: translateY(-3px);
    border-color: var(--nsh-social-color, var(--brand-primary));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--nsh-social-color, var(--brand-primary)) 35%, transparent);
  }

  @media (prefers-reduced-motion: reduce) {
    .site-footer .nsh-layout__social-link:hover,
    .site-footer .nsh-layout__social-link:focus-visible { transform: none; }
  }

  /*
   * الجوال: الصفّ الأفقي يصير عموداً متمركزاً.
   * الخلايا الفارغة تُطوى هنا تحديداً — فاصلٌ مرن في عمودٍ يترك فجوات
   * لا معنى لها بين العناصر.
   */
  @media (max-width: 782px) {
    .site-footer .nsh-layout__inner {
      flex-direction: column;
      gap: 18px;
      padding-block: 26px;
      text-align: center;
    }

    .site-footer .nsh-layout__cell {
      justify-content: center;
      flex-wrap: wrap;
    }

    .site-footer .nsh-layout__cell--empty { display: none; }

    .site-footer .nsh-layout__nav ul {
      flex-wrap: wrap;
      justify-content: center;
    }
  }
}


/* ══════════════════════════════════════════════════════════════════
   § تخطيط بطاقات المقالات — خيارا «شبكة / قائمة» و«مضغوط / شبكة»
   ------------------------------------------------------------------
   الخياران كانا معروضين في اللوحة ومعقَّمين ومحفوظين، ولا سطر يقرؤهما.
   الأصناف تُعلَّق على `<body>` لا على كل شبكة: الشبكات مبثوثة في خمسة
   قوالب وودجات، وأي صنف يُعلَّق على واحدة يُنسى في التالية.
   ══════════════════════════════════════════════════════════════════ */

/* ── سطح المكتب: قائمة ───────────────────────────────────────────── */
@media (min-width: 783px) {
  .nsh-cards-d-list .nsh-grid--posts {
    grid-template-columns: 1fr;
  }

  .nsh-cards-d-list .nsh-grid--posts .nsh-card {
    flex-direction: row;
    align-items: stretch;
  }

  /* نسبة ثابتة للوسائط كي لا تتمدّد الصورة بطول النصّ. */
  .nsh-cards-d-list .nsh-grid--posts .nsh-card__media {
    flex: 0 0 34%;
    max-inline-size: 320px;
    aspect-ratio: 4 / 3;
  }

  .nsh-cards-d-list .nsh-grid--posts .nsh-card__body {
    padding: 22px 26px;
  }

  .nsh-cards-d-list .nsh-grid--posts .nsh-card__title {
    font-size: 21px;
  }
}

/* ── الجوال: مضغوط (صورة صغيرة بجانب العنوان) ───────────────────── */
@media (max-width: 782px) {
  .nsh-cards-m-compact .nsh-grid--posts .nsh-card {
    flex-direction: row;
    align-items: stretch;
  }

  .nsh-cards-m-compact .nsh-grid--posts .nsh-card__media {
    flex: 0 0 38%;
    aspect-ratio: 1 / 1;
  }

  .nsh-cards-m-compact .nsh-grid--posts .nsh-card__body {
    padding: 12px 14px;
  }

  .nsh-cards-m-compact .nsh-grid--posts .nsh-card__title {
    font-size: 15px;
    margin-bottom: 6px;
  }

  /* المقتطف يخنق البطاقة المضغوطة على شاشة ضيقة. */
  .nsh-cards-m-compact .nsh-grid--posts .nsh-card__excerpt {
    display: none;
  }
}


/* ══════════════════════════════════════════════════════════════════
   § شريط التصنيف المستقل — خيار «موضع شارة التصنيف = مع شريط المقال»
   ------------------------------------------------------------------
   يظهر وحده في النمطين السينمائي والتراكب: هناك يشغل الرأسُ الصورةَ
   كاملةً، فلا موضع للشارة فيه متى أخرجها المالك منها.
   ══════════════════════════════════════════════════════════════════ */

.nsh-article__catbar {
  margin-block: 0 18px;
}

.nsh-article__catbar .nsh-article__categories {
  margin-bottom: 0;
}


/* ── بند التصنيف داخل صفّ الميتا ──────────────────────────────────
   يتبع بقية بنود الصفّ في الحجم واللون، ويتميّز بلون التصنيف وحده
   حين يضبطه المالك — فيُقرأ بنداً في السطر لا شارةً أُقحمت فيه. */
.nsh-article__meta-category a {
  color: inherit;
  font-weight: 700;
}

.nsh-article__meta-category a:hover,
.nsh-article__meta-category a:focus-visible {
  color: var(--brand-primary);
  text-decoration: underline;
}

.nsh-article__meta--hero .nsh-article__meta-category a {
  color: inherit;
}

/* ══════════════════════════════════════════════════════════════════
   § نظام مناطق العرض الموضعية (Local Grid System) — المرحلة 19
   ══════════════════════════════════════════════════════════════════ */
.nsh-grid-row {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: var(--container-max, 1200px);
  margin-inline: auto;
  margin-block: 20px;
  padding-inline: 16px;
  box-sizing: border-box;
}

.nsh-grid-row--cols-1 { grid-template-columns: 1fr; }
.nsh-grid-row--cols-2 { grid-template-columns: repeat(2, 1fr); }
.nsh-grid-row--cols-3 { grid-template-columns: repeat(3, 1fr); }
.nsh-grid-row--cols-4 { grid-template-columns: repeat(4, 1fr); }
.nsh-grid-row--cols-5 { grid-template-columns: repeat(5, 1fr); }
.nsh-grid-row--cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 991px) {
  .nsh-grid-row--cols-4,
  .nsh-grid-row--cols-5,
  .nsh-grid-row--cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nsh-grid-row--cols-2,
  .nsh-grid-row--cols-3,
  .nsh-grid-row--cols-4,
  .nsh-grid-row--cols-5,
  .nsh-grid-row--cols-6 {
    grid-template-columns: 1fr;
  }
}

.nsh-grid-cell {
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--border-subtle, rgba(15, 25, 35, 0.07));
  border-radius: var(--radius-md, 10px);
  padding: 16px;
  box-shadow: var(--shadow-sm, 0 2px 12px rgba(15, 25, 35, 0.06));
}

.nsh-grid-cell__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-primary, #1a6fb5);
  color: var(--ink-primary, #1c2530);
}

.nsh-grid-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nsh-grid-category-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-primary, #1c2530);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 4px 0;
  transition: color 0.18s ease;
}

.nsh-grid-category-list li a:hover {
  color: var(--brand-primary, #1a6fb5);
}

.nsh-grid-category-list__count {
  font-size: 0.8rem;
  color: var(--ink-muted, #6b7a8d);
}

.nsh-grid-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nsh-grid-tag-cloud a {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface-base, #f5f7fa);
  border-radius: var(--radius-sm, 6px);
  color: var(--ink-primary, #1c2530);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.18s ease;
}

.nsh-grid-tag-cloud a:hover {
  background: var(--brand-primary, #1a6fb5);
  color: #ffffff;
}

.nsh-grid-post-item {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.nsh-grid-post-item:last-child {
  margin-bottom: 0;
}

.nsh-grid-post-item__thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm, 6px);
  object-fit: cover;
  flex-shrink: 0;
}

.nsh-grid-post-item__title {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

.nsh-grid-post-item__title a {
  color: var(--ink-primary, #1c2530);
  text-decoration: none;
}

.nsh-grid-post-item__title a:hover {
  color: var(--brand-primary, #1a6fb5);
}


/* ══════════════════════════════════════════════════════════════════
   § شريط الأخبار العاجلة (كان يُطبع من header.php بلا أي أنماط)
   ──────────────────────────────────────────────────────────────────
   الحركة بـCSS وحدها فيعمل الشريط بلا جافاسكربت؛ السكربت يضيف فقط
   زرّ الإيقاف ويحترم prefers-reduced-motion. الاتجاه منطقي: يتحرك
   من البداية إلى النهاية في RTL وLTR بقاعدة واحدة.
   ══════════════════════════════════════════════════════════════════ */
.nsh-breaking-news {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--container-max, 1200px);
  margin: 12px auto 0;
  padding: 6px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.92rem;
}

.nsh-breaking-news__badge {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--brand-accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.nsh-breaking-news__track {
  flex: 1 1 auto;
  display: flex;
  gap: 40px;
  white-space: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.nsh-breaking-news__item {
  display: inline-block;
  padding-inline-end: 40px;
  color: var(--ink-primary);
  text-decoration: none;
  animation: nsh-ticker 28s linear infinite;
  animation-play-state: var(--nsh-ticker-state, running);
}

.nsh-breaking-news__item:hover {
  color: var(--brand-primary);
}

.nsh-breaking-news:hover .nsh-breaking-news__item,
.nsh-breaking-news--paused .nsh-breaking-news__item {
  animation-play-state: paused;
}

.nsh-breaking-news__pause {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nsh-breaking-news__pause[aria-pressed="true"] {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

@keyframes nsh-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(var(--nsh-ticker-dir, 1) * 100%)); }
}

[dir="rtl"] .nsh-breaking-news__item { --nsh-ticker-dir: 1; }
[dir="ltr"] .nsh-breaking-news__item { --nsh-ticker-dir: -1; }

@media (prefers-reduced-motion: reduce) {
  .nsh-breaking-news__item { animation: none; }
  .nsh-breaking-news__track { flex-wrap: wrap; white-space: normal; mask-image: none; -webkit-mask-image: none; gap: 16px; }
  .nsh-breaking-news__pause { display: none; }
}

@media (max-width: 640px) {
  .nsh-breaking-news { border-radius: 0; margin-top: 0; font-size: 0.85rem; }
}

/* ══════════════════════════════════════════════════════════════════
   § لوحة البحث المنبثقة (زر البحث في منشئ الهيدر — data-nsh-search-toggle)
   ══════════════════════════════════════════════════════════════════ */
.nsh-search-panel {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 0;
  background: rgba(15, 25, 35, 0.6);
  backdrop-filter: blur(4px);
}

.nsh-search-panel[hidden] { display: none; }

.nsh-search-panel__box {
  width: min(680px, 100%);
  background: var(--surface-card);
  color: var(--ink-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

.nsh-search-panel__box .nsh-search-form__input { font-size: 1.1rem; }

.nsh-search-panel__close {
  float: inline-end;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
}

/* ══════════════════════════════════════════════════════════════════
   § تعليقات فيسبوك وبحث جوجل المخصص (حاويتان كانتا بلا أنماط)
   ══════════════════════════════════════════════════════════════════ */
.nsh-fb-comments { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.nsh-gcse-search { min-height: 44px; }
.nsh-gcse-search .gsc-control-cse { padding: 0; background: transparent; border: 0; }

/* ══════════════════════════════════════════════════════════════════
   § الإعلانات الكسولة — حجز المساحة قبل الحقن (يقرؤها ads.js)
   ══════════════════════════════════════════════════════════════════ */
.nsh-ad-wrapper--lazy:not(.nsh-ad-wrapper--loaded) { min-height: var(--nsh-ad-reserve, 0); }

/* ══════════════════════════════════════════════════════════════════
   § عناصر يبنيها main.js (قوائم فرعية في الدرج، فاصل التحميل التلقائي)
   ══════════════════════════════════════════════════════════════════ */
.nsh-nav-drawer__nav .menu-item-has-children { position: relative; }
.nsh-nav-drawer__nav .menu-item-has-children > .sub-menu { display: none; padding-inline-start: 14px; }
.nsh-nav-drawer__nav .menu-item-has-children.is-open > .sub-menu { display: block; }
.nsh-nav-drawer__sub-toggle {
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  width: 40px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}
.nsh-nav-drawer__nav .menu-item-has-children.is-open > .nsh-nav-drawer__sub-toggle .dashicons { transform: rotate(180deg); }
.nsh-autoload-separator { margin: 40px 0; border: 0; border-top: 2px dashed var(--border-subtle); }
.nsh-autoload-sentinel { height: 1px; }
.nsh-share-btn.is-copied { --nsh-share-color: #16a34a; }
.nsh-content-timer__fallback { font-size: 1rem; text-decoration: underline; color: var(--brand-primary); }
body.nsh-adb-open .nsh-adb--block ~ * { filter: blur(2px); }
