/*
Theme Name: Mkawlat26 Edu — محاسبة المقاولات التعليمية
Theme URI: https://www.mkawlat26.com/
Author: فريق عمل موقع محاسب مقاولات محترف
Author URI: https://www.mkawlat26.com/
Description: قالب ووردبرس تعليمي عربي (RTL) لموقع «محاسبة المقاولات» — دروس محاسبية، فهرس محتويات تلقائي، شريط تقدم القراءة، صندوق الكتاب، تصنيفات، وبحث. ألوان كحلية هادئة وخطوط عربية واضحة، متجاوب مع الجوال، وسيو جاهز.
Version: 1.1.21
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mkawlat26-edu
Tags: education, rtl, right-to-left, blog, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, sticky-post, education
*/

/* ============================================================
   1) المتغيرات والأساسيات
   ============================================================ */
:root {
  --navy: #0a1e3c;
  --navy-2: #12294d;
  --navy-3: #1b3a66;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --teal: #0d9488;
  --teal-light: #ccfbf1;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(10, 30, 60, 0.08);
  --font-head: "Cairo", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Tajawal", "Cairo", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html { direction: rtl; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  line-height: 1.5;
  color: var(--navy);
  margin: 0 0 0.6em;
  font-weight: 800;
}
h1 { font-size: clamp(1.6rem, 4.5vw, 2rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

/* حالة التركيز بلوحة المفاتيح — وصولية أساسية. */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

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

ul, ol { padding-inline-start: 1.4em; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95em;
  background: var(--surface);
}
table th, table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: right;
}
table th { background: var(--navy); color: #fff; font-family: var(--font-head); }
table tr:nth-child(even) td { background: #f8fafc; }

blockquote {
  border-inline-start: 4px solid var(--teal);
  background: #f0fdfa;
  margin: 1.2em 0;
  padding: 12px 18px;
  border-radius: 0 8px 8px 0;
}

code {
  background: #eef2f7;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  direction: ltr;
  unicode-bidi: embed;
}
pre {
  background: var(--navy);
  color: #e2e8f0;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
pre code { background: transparent; color: inherit; padding: 0; }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 20px;
}

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -60px; right: 16px; z-index: 999;
  background: var(--navy); color: #fff; padding: 8px 16px; border-radius: 8px;
  transition: top 0.2s;
}
.skip-link:focus { top: 10px; color: #fff; text-decoration: none; }

/* الأزرار */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.4;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35); }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-book { background: var(--amber); color: #1e293b; box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4); }
.btn-book:hover { background: var(--amber-dark); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.7); }
.btn-ghost:hover { border-color: #fff; color: #fff; }
.btn-outline { background: var(--surface); color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

/* زر تحميل الملفات داخل المقالات (يُضاف تلقائياً لروابط التحميل الخارجية) */
a.btn-download {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--amber); color: #1e293b;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
  margin: 8px 0; text-decoration: none;
}
a.btn-download:hover { background: var(--amber-dark); color: #fff; }
a.btn-download svg { flex: 0 0 auto; width: 20px; height: 20px; }
a.btn-download span { white-space: normal; }
@media (max-width: 600px) {
  a.btn-download { display: flex; justify-content: center; width: 100%; box-sizing: border-box; }
}

/* ============================================================
   2) الشريط العلوي والترويسة
   ============================================================ */
.topbar {
  background: var(--navy);
  color: #cbd5e1;
  font-size: 0.85rem;
}
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap;
}
.topbar a { color: #fff; font-weight: 700; }
.topbar .topbar-phone { direction: ltr; unicode-bidi: embed; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(10, 30, 60, 0.05);
}
.site-header .container {
  display: flex; align-items: center; gap: 24px;
  padding-top: 12px; padding-bottom: 12px;
}
.site-branding { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.site-branding a { color: var(--navy); }
.site-branding a:hover { text-decoration: none; }
.custom-logo { max-height: 52px; width: auto; }
.site-title {
  font-family: var(--font-head);
  font-size: 1.35rem; font-weight: 900; line-height: 1.3; margin: 0;
}
.site-title a { color: var(--navy); }
.site-title a:hover { color: var(--blue); }
.site-title .site-title-accent { color: var(--teal); }
.site-description { margin: 0; font-size: 0.82rem; color: var(--muted); }

/* قائمة التنقل — درج جانبي ينزلق من اليمين (v1.1.21).
   القائمة الأفقية كانت تلتف على 3 صفوف مع 11 عنصراً فبدت سيئة،
   فأصبح الدرج هو القائمة الوحيدة على كل المقاسات (كمبيوتر وجوال). */
.menu-toggle {
  display: block; margin-inline-start: auto;
  background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 14px; font-family: var(--font-head); font-weight: 700; font-size: 1rem; line-height: 1.4;
  cursor: pointer; white-space: nowrap;
}
.menu-toggle:hover { background: var(--navy-2); }
.main-navigation {
  display: block; position: fixed; top: 0; bottom: 0; right: 0; margin: 0;
  width: min(320px, 85vw); height: 100vh; height: 100dvh; z-index: 1000;
  background: var(--navy); color: #fff; padding: 20px;
  overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,.35);
  transform: translateX(105%); visibility: hidden;
  transition: transform .3s ease, visibility .3s;
}
.main-navigation.toggled { transform: translateX(0); visibility: visible; }
.main-navigation ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0;
}
.main-navigation a {
  display: block; padding: 12px 14px; border-radius: 8px;
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; line-height: 1.6;
  overflow-wrap: break-word; text-decoration: none;
}
.main-navigation a:hover { background: rgba(255,255,255,.12); color: var(--amber); text-decoration: none; }
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a { background: var(--amber); color: var(--navy); }
.nav-close {
  display: block; margin: 0 0 12px; margin-inline-start: auto;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem; line-height: 1;
}
.nav-close:hover { border-color: var(--amber); color: var(--amber); }
.nav-search { display: none; }
.main-navigation.toggled .nav-search { display: block; margin: 16px 0 4px; }
.nav-search .search-form { display: flex; }
.nav-search .search-field {
  flex: 1; min-width: 0; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.35); border-radius: 0 8px 8px 0;
  background: rgba(255,255,255,.08); color: #fff; padding: 10px 12px;
  font-family: var(--font-body); font-size: 0.9rem;
}
.nav-search .search-field::placeholder { color: rgba(255,255,255,.6); }
.nav-search .search-submit {
  background: var(--amber); color: var(--navy); border: 0; border-radius: 8px 0 0 8px;
  padding: 10px 14px; font-family: var(--font-head); font-weight: 700; cursor: pointer;
}
.nav-overlay {
  position: fixed; inset: 0; z-index: 99;
  /* z-index 99 عمداً: الترويسة (z-index 100) تخلق سياق تكديس يحبس
     الدرج بداخلها، فلو كانت الطبقة المعتمة فوقها (999) لاعترضت كل
     نقرة على روابط الدرج وأغلقته دون انتقال — وهو العطل المُبلَّغ عنه. */
  background: rgba(4,12,32,.55);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
}
.nav-overlay.visible { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }
.header-search { flex-shrink: 0; }
.header-search form { display: flex; }
.header-search input[type="search"] {
  border: 1px solid var(--border); border-radius: 0 999px 999px 0;
  padding: 8px 14px; font-family: var(--font-body); font-size: 0.9rem; width: 150px;
}
.header-search button {
  border: 0; background: var(--navy); color: #fff; cursor: pointer;
  padding: 8px 14px; border-radius: 999px 0 0 999px; font-family: var(--font-head); font-weight: 700;
}

/* ============================================================
   3) قسم البطل (Hero) — الصفحة الرئيسية
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
  color: #fff;
  padding: 64px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset-inline-end: -120px; top: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.35), transparent 65%);
}
.hero .container {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center;
  position: relative; z-index: 1;
}
.hero-eyebrow {
  display: inline-block; background: rgba(13, 148, 136, 0.25); color: #99f6e4;
  border: 1px solid rgba(13, 148, 136, 0.5);
  padding: 5px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 700;
  margin-bottom: 16px;
}
.hero h1 { color: #fff; font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.4; margin-bottom: 14px; }
.hero h1 .hero-accent { color: #5eead4; }
.hero p.hero-lead { color: #dbeafe; font-size: 1.15rem; max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-meta { margin-top: 22px; font-size: 0.9rem; color: #94a3b8; display: flex; gap: 20px; flex-wrap: wrap; }
.hero-meta strong { color: #fff; }

/* غلاف الكتاب (CSS) */
.book-cover-wrap { display: flex; justify-content: center; }
.book-cover {
  width: min(250px, 100%); aspect-ratio: 5 / 7; border-radius: 8px 4px 4px 8px;
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--navy);
  box-shadow: 12px 14px 30px rgba(0, 0, 0, 0.45), inset 6px 0 0 rgba(10, 30, 60, 0.15);
  padding: 26px 22px; text-align: center;
  display: flex; flex-direction: column; justify-content: space-between;
  transform: rotate(-2deg);
  position: relative;
}
.book-cover::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 8px;
  background: var(--teal); border-radius: 0 4px 4px 0;
}
.book-cover .book-cover-kicker { font-size: 0.75rem; letter-spacing: 1px; color: var(--teal); font-weight: 700; }
.book-cover .book-cover-title { font-family: var(--font-head); font-weight: 900; font-size: 1.35rem; line-height: 1.6; }
.book-cover .book-cover-sub { font-size: 0.9rem; color: var(--muted); }
.book-cover .book-cover-price { font-family: var(--font-head); font-weight: 900; font-size: 1.6rem; color: var(--amber-dark); }
.book-cover .book-cover-price small { font-size: 0.85rem; color: var(--muted); }
.book-cover-img { width: min(250px, 100%); height: auto; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; box-shadow: 12px 14px 30px rgba(0,0,0,0.45); transform: rotate(-2deg); }

/* ============================================================
   4) التخطيط العام والأقسام
   ============================================================ */
.site-main { padding: 40px 0 56px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}
.layout-no-sidebar { grid-template-columns: minmax(0, 1fr); }

.section { margin: 0 0 48px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 10px; margin-bottom: 24px;
}
.section-head h2 { margin: 0; font-size: 1.5rem; }
.section-head h2::before {
  content: ""; display: inline-block; width: 10px; height: 22px;
  background: var(--teal); border-radius: 3px; margin-inline-end: 10px; vertical-align: -3px;
}
.section-head a { font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }

/* ابدأ من هنا */
.start-here {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 48px;
}
.start-here ol { margin: 0; padding-inline-start: 1.6em; }
.start-here li { margin-bottom: 10px; }
.start-here li::marker { font-family: var(--font-head); font-weight: 800; color: var(--teal); }
.start-here .start-here-note { color: var(--muted); font-size: 0.95rem; }

/* ============================================================
   5) بطاقات المقالات
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 10px rgba(10, 30, 60, 0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #dbeafe; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; padding: 16px; text-align: center;
}
.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card-cat {
  font-size: 0.8rem; font-weight: 700; color: var(--teal);
  font-family: var(--font-head); margin-bottom: 6px;
}
.post-card-cat a { color: var(--teal); }
.post-card-title { font-size: 1.12rem; line-height: 1.6; margin-bottom: 8px; }
.post-card-title a { color: var(--navy); }
.post-card-title a:hover { color: var(--blue); }
.post-card-excerpt { color: var(--muted); font-size: 0.93rem; flex: 1; }
.post-card-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.82rem; margin-top: 14px;
  border-top: 1px solid var(--border); padding-top: 12px;
}
.post-card-meta .reading-time { color: var(--teal); font-weight: 700; }

/* قائمة المقالات (أرشيف/بحث) */
.post-list-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(10,30,60,0.04);
}
.post-list-item h2 { font-size: 1.3rem; margin-bottom: 6px; }
.post-list-item h2 a { color: var(--navy); }
.post-list-item h2 a:hover { color: var(--blue); }

/* أقسام التصنيفات في الرئيسية */
.category-section { margin-bottom: 40px; }
.category-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.category-card {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 24px; display: block;
}
.category-card:hover { text-decoration: none; background: var(--navy-2); }
.category-card-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) - 4px); margin-bottom: 14px; }
.category-card h3 { color: #fff; margin-bottom: 6px; }
.category-card p { color: #cbd5e1; font-size: 0.92rem; margin: 0; }
.category-card .category-count { color: #5eead4; font-weight: 700; font-size: 0.85rem; }

/* ============================================================
   6) الشريط الجانبي والودجت
   ============================================================ */
.site-sidebar .widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(10, 30, 60, 0.04);
}
.site-sidebar .widget-title {
  font-size: 1.1rem; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
}
.site-sidebar ul { list-style: none; margin: 0; padding: 0; }
.site-sidebar ul li { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.site-sidebar ul li:last-child { border-bottom: 0; }
.site-sidebar .widget_search input[type="search"] {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-family: var(--font-body); font-size: 0.95rem;
}
.site-sidebar .widget_search button {
  width: 100%; margin-top: 10px; background: var(--navy); color: #fff; border: 0;
  border-radius: 10px; padding: 10px; font-family: var(--font-head); font-weight: 700; cursor: pointer;
}
/* صندوق الكتاب في الشريط الجانبي */
.book-widget { text-align: center; background: linear-gradient(160deg, var(--navy), var(--navy-3)); color: #fff; border: 0; }
.book-widget .widget-title { color: #fff; border-bottom-color: rgba(255,255,255,0.3); }
.book-widget p { color: #dbeafe; font-size: 0.93rem; }
.book-widget .book-price { font-family: var(--font-head); font-size: 1.5rem; font-weight: 900; color: var(--amber); margin: 6px 0 14px; }
.book-widget .book-cover-wrap { margin: 8px 0 16px; }

/* ============================================================
   7) التذييل
   ============================================================ */
.site-footer { background: var(--navy); color: #cbd5e1; margin-top: 8px; }
.site-footer .footer-widgets {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  padding: 48px 0 32px;
}
.site-footer h3 { color: #fff; font-size: 1.1rem; margin-bottom: 14px; }
.site-footer a { color: #dbeafe; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { padding: 5px 0; }
.site-footer .footer-contact { line-height: 2.1; }
.site-footer .footer-contact .phone { direction: ltr; unicode-bidi: embed; font-weight: 700; color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 18px 0; font-size: 0.88rem; text-align: center; color: #94a3b8;
}
.footer-bottom a { color: #e2e8f0; }

/* ترقيم الصفحات */
.pagination { margin: 32px 0 0; text-align: center; }
.pagination .page-numbers {
  display: inline-block; padding: 8px 15px; margin: 0 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--navy); font-family: var(--font-head); font-weight: 700;
}
.pagination .page-numbers:hover { text-decoration: none; border-color: var(--blue); color: var(--blue); }
.pagination .page-numbers.current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ============================================================
   8) صفحة المقال (single)
   ============================================================ */
/* شريط تقدم القراءة */
.reading-progress {
  position: fixed; top: 0; right: 0; left: 0; height: 4px; z-index: 200;
  background: transparent;
}
.reading-progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 0.1s linear;
}

.breadcrumbs {
  font-size: 0.88rem; color: var(--muted); margin-bottom: 18px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .separator { margin: 0 6px; color: var(--border); }

.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow); }
.article-header { margin-bottom: 8px; }
.article-cat { font-family: var(--font-head); font-weight: 700; color: var(--teal); font-size: 0.9rem; }
.article-title { font-size: clamp(1.6rem, 4.5vw, 2rem); line-height: 1.5; margin: 8px 0 14px; }
.article-meta {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  color: var(--muted); font-size: 0.9rem; padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.article-meta .avatar { border-radius: 50%; }
.article-meta .reading-time { color: var(--teal); font-weight: 700; }
.article-thumb { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.article-thumb img { width: 100%; }
.article-thumb figcaption { font-size: 0.85rem; color: var(--muted); padding: 8px 4px 0; text-align: center; }

.article-content { font-size: var(--article-font-size, 1.05rem); overflow-wrap: break-word; }
.article-content h2 {
  margin-top: 1.6em; padding-bottom: 8px;
  border-bottom: 2px solid #eef2f7;
}
.article-content h2[id], .article-content h3[id] { scroll-margin-top: 90px; }
.article-content h3 { margin-top: 1.4em; color: var(--navy-3); }
.article-content ul li, .article-content ol li { margin-bottom: 6px; }
.article-content img { border-radius: 10px; margin: 1em auto; }
.article-content .wp-caption { max-width: 100%; }
.article-content .wp-caption-text { font-size: 0.85rem; color: var(--muted); text-align: center; }
.article-content .aligncenter { margin-inline: auto; }
.article-content .alignleft { float: left; margin: 0 1em 1em 0; }
.article-content .alignright { float: right; margin: 0 0 1em 1em; }
.article-content table { display: block; overflow-x: auto; max-width: 100%; }

/* فهرس المحتويات */
.toc {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 0 0 28px;
}
.toc-title { font-family: var(--font-head); font-weight: 800; color: var(--navy); font-size: 1.1rem; margin-bottom: 10px; }
.toc ol, .toc ul { margin: 0; padding-inline-start: 1.3em; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--navy-3); }
.toc a:hover { color: var(--teal); }
.toc .toc-level-3 { font-size: 0.92rem; padding-inline-start: 1.2em; }

/* صندوق الكتاب بعد المقدمة */
.book-box {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: #fff; border-radius: var(--radius); padding: 24px; margin: 28px 0;
  box-shadow: var(--shadow);
}
.book-box .book-box-cover {
  width: 120px; height: 168px; border-radius: 6px;
  background: linear-gradient(160deg, #f8fafc, #cbd5e1);
  color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 10px; font-family: var(--font-head); font-weight: 900; font-size: 0.85rem; line-height: 1.6;
  box-shadow: 6px 8px 16px rgba(0,0,0,0.35);
}
.book-box h3 { color: #fff; margin-bottom: 6px; }
.book-box p { color: #dbeafe; font-size: 0.95rem; margin-bottom: 12px; }
.book-box .book-price { font-family: var(--font-head); font-weight: 900; font-size: 1.3rem; color: var(--amber); }
.book-box .btn { margin-top: 10px; }

/* وسوم المقال */
.article-tags { margin: 28px 0 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.article-tags a {
  background: #eef2ff; color: var(--blue); border-radius: 999px;
  padding: 5px 14px; font-size: 0.85rem; font-weight: 700;
}
.article-tags a:hover { background: var(--blue); color: #fff; text-decoration: none; }

/* صندوق الكاتب */
.author-box {
  display: flex; gap: 18px; align-items: flex-start;
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin: 28px 0;
}
.author-box .avatar { border-radius: 50%; flex-shrink: 0; }
.author-box h3 { margin-bottom: 4px; font-size: 1.1rem; }
.author-box p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* مقالات ذات صلة */
.related-posts { margin-top: 40px; }
.related-posts .posts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* التنقل بين المقالات */
.post-navigation { display: flex; justify-content: space-between; gap: 16px; margin: 32px 0 0; }
.post-navigation a {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 18px; color: var(--navy); font-family: var(--font-head); font-weight: 700; flex: 1;
}
.post-navigation a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.post-navigation .nav-next { text-align: left; }

/* ============================================================
   9) التعليقات
   ============================================================ */
.comments-area { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; margin-top: 32px; }
.comments-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .comment { border-bottom: 1px solid var(--border); padding: 16px 0; }
.comment-list .children { list-style: none; padding-inline-start: 32px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; }
.comment-author .avatar { border-radius: 50%; }
.comment-meta { font-size: 0.82rem; color: var(--muted); margin: 4px 0 8px; }
.comment-reply-link { font-size: 0.85rem; font-weight: 700; }
.comment-form label { display: block; font-weight: 700; margin-bottom: 4px; font-family: var(--font-head); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-family: var(--font-body); font-size: 0.95rem; margin-bottom: 14px;
}
.comment-form input[type="submit"] {
  background: var(--navy); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 28px; font-family: var(--font-head); font-weight: 700; cursor: pointer;
}
.comment-form input[type="submit"]:hover { background: var(--blue); }

/* ============================================================
   10) الأرشيف والبحث وصفحة 404
   ============================================================ */
.archive-header {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 32px; margin-bottom: 28px;
}
.archive-header h1 { color: #fff; margin-bottom: 6px; }
.archive-header p { color: #cbd5e1; margin: 0; }
.archive-header .archive-count { color: #5eead4; font-weight: 700; }

.search-form-inline { display: flex; gap: 10px; max-width: 520px; margin: 20px 0 0; }
.search-form-inline input[type="search"] {
  flex: 1; border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 18px; font-family: var(--font-body); font-size: 1rem;
}
.search-form-inline button {
  background: var(--blue); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 26px; font-family: var(--font-head); font-weight: 700; cursor: pointer;
}
.not-found { text-align: center; padding: 48px 20px; }
.not-found .error-code { font-family: var(--font-head); font-size: 6rem; font-weight: 900; color: var(--navy); line-height: 1; }
.not-found h1 { margin-top: 8px; }

/* ============================================================
   11) التجاوب مع الجوال
   ============================================================ */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-posts .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .footer-widgets { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .hero .container { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .hero-actions, .hero-meta { justify-content: center; }
  .menu-toggle { display: block; margin-inline-start: auto; }
  .site-header .container { flex-wrap: wrap; }
  .header-search { display: none; }
  .article { padding: 22px 20px; }
  .book-box { grid-template-columns: 1fr; text-align: center; }
  .book-box .book-box-cover { margin-inline: auto; }
  .author-box { flex-direction: column; }
  .book-page-layout { grid-template-columns: 1fr; text-align: center; }
  .book-page-layout .book-cover, .book-page-layout .book-cover-img { margin-inline: auto; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .posts-grid, .related-posts .posts-grid, .category-cards { grid-template-columns: 1fr; }
  .site-footer .footer-widgets { grid-template-columns: 1fr; }
  .post-navigation { flex-direction: column; }
  .hero { padding: 44px 0 52px; }
  .topbar .topbar-tagline { display: none; }
  .footer-bottom { padding-bottom: 76px; }
  .cookie-bar { flex-direction: column; gap: 8px; text-align: center; }
  .share-buttons { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   12) الطباعة
   ============================================================ */
@media print {
  .site-header, .site-footer, .site-sidebar, .reading-progress, .comments-area, .related-posts, .toc, .cookie-bar, .whatsapp-float, .share-buttons, .font-size-controls { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .article { border: 0; box-shadow: none; padding: 0; }
}

/* ============================================================
   13) إعلانات AdSense — فصل بصري واضح عن المحتوى
   (لا نوافذ منبثقة، لا إعلانات لاصقة، لا إعلان ملاصق لأي زر)
   ============================================================ */
.ad-slot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 12px 14px 14px;
  margin-bottom: 24px;
  text-align: center;
  overflow: hidden;
}
.ad-slot .ad-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.ad-slot ins.adsbygoogle { display: block; margin-inline: auto; }
/* إعلان الترويسة: بعرض المحتوى، وبمسافة واضحة عن القائمة أعلاه والمحتوى أسفله */
.ad-slot-header {
  max-width: 1180px;
  width: calc(100% - 40px);
  margin: 24px auto;
}
/* إعلان بين المقالات: يمتد على عرض الشبكة كاملاً */
.posts-grid .ad-slot-between {
  grid-column: 1 / -1;
  margin-bottom: 0;
}
/* إعلان داخل المقال وقبل الأسئلة الشائعة */
.ad-slot-in-article,
.ad-slot-faq {
  margin: 28px 0;
}
/* إعلان الشريط الجانبي */
.ad-slot-sidebar { margin-bottom: 24px; }

/* روابط الصفحات المهمة في التذييل */
.footer-policy-links {
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.footer-policy-links a { color: #e2e8f0; margin: 0 4px; }
.footer-policy-sep { color: #64748b; margin: 0 6px; }

/* ============================================================
   14) نموذج اتصل بنا
   ============================================================ */
.contact-form { max-width: 640px; }
.contact-form label {
  display: block; font-weight: 700; font-family: var(--font-head); margin-bottom: 4px;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-family: var(--font-body); font-size: 0.95rem; margin-bottom: 16px;
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form input[type="submit"] {
  background: var(--navy); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 30px; font-family: var(--font-head); font-weight: 700; cursor: pointer;
}
.contact-form input[type="submit"]:hover { background: var(--blue); }
.contact-notice {
  border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-weight: 700;
}
.contact-notice-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.contact-notice-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.contact-info-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 24px; line-height: 2.1;
}
.contact-info-box .phone { direction: ltr; unicode-bidi: embed; font-weight: 700; }

/* ============================================================
   15) روابط التواصل الاجتماعي وزر واتساب العائم
   ============================================================ */
.social-links { display: inline-flex; align-items: center; gap: 8px; }
.social-links a {
  display: inline-flex; width: 34px; height: 34px; border-radius: 50%;
  align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
  transition: transform .15s, opacity .15s;
}
.social-links a:hover { transform: translateY(-2px); opacity: .9; text-decoration: none; }
.social-links svg { width: 18px; height: 18px; display: block; }
.social-youtube { background: #f00; }
.social-facebook { background: #1877f2; }
.social-tiktok { background: #010101; border: 1px solid rgba(255, 255, 255, .4); }
.topbar .social-links { margin-inline-start: 12px; }
.site-footer .social-links { margin-top: 14px; }

/* زر واتساب العائم — ثابت أسفل اليسار في كل الصفحات (الموقع RTL).
   لا يوجد زر «عودة للأعلى» في القالب فلا تعارض في الموضع. */
.whatsapp-float {
  position: fixed; bottom: 20px; left: 20px; z-index: 998;
  width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35); transition: transform .15s;
}
.whatsapp-float:hover { transform: scale(1.08); color: #fff; text-decoration: none; }
.whatsapp-float svg { width: 30px; height: 30px; display: block; }
@media (max-width: 600px) {
  .whatsapp-float { width: 52px; height: 52px; bottom: 16px; left: 16px; }
}
@media print {
  .whatsapp-float { display: none !important; }
}

/* ============================================================
   16) نموذج البحث العام (ترويسة الأرشيف وصفحة البحث و404)
   ============================================================ */
.search-form { display: flex; gap: 10px; max-width: 520px; }
.search-form label { flex: 1; }
.search-form input[type="search"] {
  width: 100%; border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 18px; font-family: var(--font-body); font-size: 1rem; background: var(--surface);
}
.search-form input[type="submit"] {
  background: var(--blue); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 26px; font-family: var(--font-head); font-weight: 700; cursor: pointer;
}
.search-form input[type="submit"]:hover { background: var(--blue-dark); }

/* ============================================================
   17) صندوق الفيديو داخل المقال (متجاوب 16:9)
   ============================================================ */
.video-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin: 28px 0; box-shadow: var(--shadow);
}
.video-box-title {
  font-family: var(--font-head); font-weight: 800; color: var(--navy);
  font-size: 1.15rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--teal);
}
.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-box .btn { margin-top: 16px; }
/* روابط فيديو مباشرة داخل المحتوى (oEmbed تلقائي من ووردبرس) */
.article-content iframe[src*="youtube.com"],
.article-content iframe[src*="youtu.be"],
.article-content iframe[src*="vimeo.com"] {
  width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px;
}

/* ============================================================
   18) تبويبات التصنيفات في الرئيسية
   ============================================================ */
.cat-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
  margin-bottom: 24px; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.cat-tab {
  flex-shrink: 0; background: var(--surface); border: 2px solid var(--border);
  color: var(--navy); border-radius: 999px; padding: 9px 20px;
  font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.cat-tab:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.cat-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-tabs-js .cat-panel { display: none; }
.cat-tabs-js .cat-panel.active { display: block; }

/* ============================================================
   19) أزرار مشاركة المقال
   ============================================================ */
.share-buttons {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: center; margin: 24px 0;
}
.share-label { grid-column: 1 / -1; font-family: var(--font-head); font-weight: 700; color: var(--navy); }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px;
  border-radius: 999px; color: #fff; font-weight: 700; font-size: 0.9rem;
  min-width: 0; white-space: nowrap;
}
.share-btn:hover { opacity: .85; color: #fff; text-decoration: none; }
.share-btn svg { width: 16px; height: 16px; display: block; }
.share-whatsapp { background: #25d366; }
.share-facebook { background: #1877f2; }
.share-x { background: #000; }

/* ============================================================
   20) أزرار حجم الخط في المقال
   ============================================================ */
.font-size-controls {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 0 0 20px; font-size: 0.9rem;
}
.font-size-controls .font-size-label { font-family: var(--font-head); font-weight: 700; color: var(--navy); }
.font-size-controls button {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-family: var(--font-head); font-weight: 700; cursor: pointer; color: var(--navy);
}
.font-size-controls button:hover { border-color: var(--blue); color: var(--blue); }

/* ============================================================
   21) شريط موافقة ملفات تعريف الارتباط
   ============================================================ */
.cookie-bar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 998;
  background: var(--navy); color: #fff; padding: 12px 20px;
  display: flex; gap: 16px; align-items: center; justify-content: center;
  font-size: 0.9rem; box-shadow: 0 -2px 12px rgba(0, 0, 0, .25);
}
.cookie-bar[hidden] { display: none !important; }
.cookie-bar p { margin: 0; }
.cookie-bar a { color: #bfdbfe; }
.cookie-bar button {
  flex-shrink: 0; background: var(--amber); color: var(--navy); border: 0;
  border-radius: 999px; padding: 8px 22px; font-family: var(--font-head);
  font-weight: 800; cursor: pointer;
}
.cookie-bar button:hover { opacity: .9; }
/* عند ظهور شريط الكوكيز يرتفع زر واتساب حتى لا يحجبه */
body.has-cookie-bar .whatsapp-float { bottom: 84px; }
@media (max-width: 600px) {
  body.has-cookie-bar .whatsapp-float { bottom: 124px; }
}

/* ============================================================
   22) صفحة الكتاب
   ============================================================ */
.book-page-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start;
}
.book-page-price { font-family: var(--font-head); font-size: 1.7rem; font-weight: 900; color: var(--navy); margin: 10px 0 18px; }
.book-page-price span { color: var(--amber); }
.book-page-contents { margin: 0 0 24px; padding-inline-start: 20px; }
.book-page-contents li { padding: 4px 0; }
.book-page-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.book-page-contact { line-height: 2.1; margin-bottom: 24px; }
.book-page-contact .phone { direction: ltr; unicode-bidi: embed; font-weight: 700; }

/* رابط أرشيف الكاتب في صندوق «نبذة عن الكاتب» */
.author-box h3 a { color: var(--navy); }
.author-box h3 a:hover { color: var(--blue); }
.author-box .author-archive-link {
  display: inline-block; margin-top: 10px; font-family: var(--font-head);
  font-weight: 700; font-size: 0.9rem;
}

/* ============================================================
   23) إضافات v1.1.0 — ملاحظات محمد 2026-11-24
   ============================================================ */

/* غلاف الكتاب: الصورة المربعة تظهر كاملة + طفو هادئ + قفزة عند الضغط */
.book-cover-img { object-fit: contain; background: #081226; }
.book-box img.book-box-cover { object-fit: contain; background: #081226; padding: 0; }
.book-cover-wrap, .book-page-cover { cursor: pointer; animation: bookFloat 6s ease-in-out infinite; }
@keyframes bookFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.book-cover-wrap.book-pop, .book-page-cover.book-pop { animation: bookPop .6s ease; }
@keyframes bookPop { 0% { transform: scale(1) rotate(0deg); } 30% { transform: scale(1.07) rotate(1.5deg); } 60% { transform: scale(.97) rotate(-1deg); } 100% { transform: scale(1) rotate(0deg); } }

/* محتويات الكتاب: شبكة عمودين بدل القائمة العمودية */
.book-page-contents { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; }
@media (max-width: 600px) { .book-page-contents { grid-template-columns: 1fr; } }

/* شريط آخر الأخبار */
.news-ticker { background: var(--navy-3); color: #fff; display: flex; align-items: center; gap: 12px; overflow: hidden; border-bottom: 3px solid var(--amber); }
.news-ticker-label { flex-shrink: 0; display: flex; align-items: center; gap: 8px; background: var(--amber); color: var(--navy); font-family: var(--font-head); font-weight: 800; padding: 8px 16px; }
.news-ticker-dot { width: 9px; height: 9px; border-radius: 50%; background: #dc2626; animation: tickerPulse 1.4s ease-in-out infinite; }
@keyframes tickerPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }
.news-ticker-viewport { overflow: hidden; flex: 1; }
.news-ticker-track { display: flex; gap: 40px; width: max-content; list-style: none; margin: 0; padding: 8px 0; animation: tickerScroll 45s linear infinite; }
.news-ticker-track li { display: flex; align-items: center; gap: 40px; }
.news-ticker-track li::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }
.news-ticker-track a { color: #dbeafe; white-space: nowrap; }
.news-ticker-track a:hover { color: #fff; }
.news-ticker:hover .news-ticker-track { animation-play-state: paused; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ظهور تدريجي للبطاقات عند التمرير */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* أزرار المشاركة: ألوان العلامات + تأثيرات */
.share-buttons a { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.share-buttons a:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 18px rgba(0, 0, 0, .18); }
.share-buttons a:active { transform: scale(.95); }
.share-buttons a.share-whatsapp { background: #25d366; color: #fff; }
.share-buttons a.share-facebook { background: #1877f2; color: #fff; }
.share-buttons a.share-x { background: #111; color: #fff; }
.share-buttons a.share-telegram { background: #229ed9; color: #fff; }
.share-buttons a.share-copy { background: var(--teal); color: #fff; }
.share-buttons a.share-copy.copied { background: var(--navy); }

/* صندوقا المتابعة والقائمة البريدية */
.follow-widget .btn { display: block; width: 100%; text-align: center; margin-top: 8px; }
.btn-facebook { background: #1877f2; color: #fff; }
.btn-youtube { background: #f00; color: #fff; }
.subscribe-widget input[type="email"] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; font-family: inherit; box-sizing: border-box; }
.subscribe-widget button { background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-family: var(--font-head); font-weight: 800; cursor: pointer; width: 100%; }
.subscribe-count { font-weight: 700; color: var(--teal); }
.subscribe-notice-ok { color: #15803d; font-weight: 700; }
.subscribe-notice-error { color: #b91c1c; font-weight: 700; }

/* شريط واتساب الأخير في التذييل + عدّاد الزوار */
.footer-cta { background: var(--navy-3); text-align: center; padding: 28px 20px; }
.footer-cta p { color: #dbeafe; margin: 12px 0 0; }
.footer-whatsapp-btn { background: #25d366; color: #fff; font-size: 1.1rem; padding: 14px 28px; }
.footer-whatsapp-btn:hover { color: #fff; }
.visitors-count { display: inline-flex; align-items: center; gap: 6px; }
.visitors-count svg { vertical-align: -3px; }
.footer-bottom .container { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center; }

/* شريط الكوكيز النحيف */
.cookie-bar { padding: 8px 16px; font-size: .85rem; gap: 12px; }
.cookie-bar button { padding: 6px 18px; }

/* القائمة الجانبية: قواعد الدرج في قسم «قائمة التنقل» أعلاه وتسري على كل
   المقاسات (v1.1.21) — لا قاعدة عرض خاصة بالقائمة هنا بعد الآن. */

/* الشريط الجانبي في أسفل المحتوى على الجوال */
@media (max-width: 860px) {
  .site-sidebar { order: 99; border-top: 2px solid var(--border); padding-top: 24px; margin-top: 8px; }
  .footer-bottom { padding-bottom: 56px; }
}

/* صورة البطاقة الافتراضية تملأ الإطار + أفاتار الكاتب */
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-avatar-logo { border-radius: 50%; object-fit: contain; background: #fff; border: 2px solid var(--border); }

/* صفحة الكتاب: إحصاءات + آراء + طرق دفع */
.book-page-stats { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0 20px; }
.book-page-stats span { background: #eef2ff; border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
.book-page-stats strong { color: var(--navy); font-size: 1.05rem; }
.book-testimonials blockquote { background: #f8fafc; border-inline-start: 4px solid var(--amber); border-radius: 8px; padding: 14px 18px; margin: 12px 0; }
.book-testimonials cite { display: block; margin-top: 6px; font-weight: 700; color: var(--navy); font-style: normal; }
.book-payment ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.book-payment li { background: #ecfdf5; border-radius: 8px; padding: 10px 14px; }

/* صفحة البرنامج + الأرشيف + إعادة التوجيه */
.program-hero { background: linear-gradient(135deg, var(--navy), var(--navy-3)); color: #fff; border-radius: var(--radius); padding: 32px; margin-bottom: 28px; }
.program-hero h1 { color: #fff; }
.program-hero p { color: #dbeafe; }
.program-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px 0; }
.program-detail { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.program-detail h3 { font-size: 1rem; margin-bottom: 4px; }
.program-screenshots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.program-screenshots img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.archive-months { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 28px; }
.archive-months a { background: #eef2ff; border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
.archive-cat-section { margin-bottom: 36px; }
.redirect-box { text-align: center; padding: 32px 20px; }
.redirect-count { font-size: 2.2rem; font-weight: 900; color: var(--navy); }
.redirect-progress { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 16px auto; max-width: 420px; }
.redirect-progress-bar { height: 100%; background: var(--amber); width: 0; transition: width 1s linear; }

/* تمرير ناعم + احترام تقليل الحركة */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  .news-ticker-track, .book-cover-wrap, .book-page-cover, .reveal { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* حماية المحتوى من النسخ (v1.1.9) — تطبق على واجهة الزوار كلها.
   حقول النماذج مستثناة ليبقى الكتابة واللصق فيها ممكناً. */
body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }

/* أزرار المشاركة على الجوال (v1.1.9): زرّان في كل صف.
   هذه القاعدة في نهاية الملف لأن قاعدة سطح المكتب (repeat 5) تأتي بعد
   كتلة max-width:600px الأولى فتلغيها إن بقيت هناك وحدها. */
@media (max-width: 600px) {
  .share-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* إصلاح التجاوز الأفقي على الجوال الضيق (v1.1.16).
   السبب: الترويسة كانت بعرض ثابت لا ينكمش (.site-branding flex-shrink: 0
   وعنوان 1.35rem)، فتجاوزت عرض 320 بكسل وقُصّ العنوان وظهر شريط تمرير أفقي.
   الإصلاح: السماح للترويسة بالانكماش ولفّ العنوان وتصغيره وإخفاء الوصف،
   مع شبكة أمان تمنع أي تمرير أفقي (overflow-x: clip لا يكسر الترويسة اللاصقة
   لأنه لا ينشئ حاوية تمرير، خلافاً لـ hidden). */
@media (max-width: 600px) {
  .site-header .container { gap: 12px; padding-inline: 14px; }
  .site-branding { flex-shrink: 1; min-width: 0; gap: 8px; }
  .site-branding > div { min-width: 0; }
  .site-title { font-size: 1.05rem; overflow-wrap: break-word; }
  .site-description { display: none; }
  .custom-logo { max-height: 40px; }
  .menu-toggle { padding: 8px 10px; }
  .article-content { overflow-wrap: break-word; }
}
@media (max-width: 400px) {
  .site-title { font-size: 0.98rem; }
  .topbar .container { padding-inline: 14px; }
}
html, body { overflow-x: clip; }

/* إصلاح صفحة الكتاب على الجوال (v1.1.17).
   السبب: قاعدة سطح المكتب (.book-page-layout بعمودين 250px + 1fr) تأتي في
   القسم 22 بعد كتلة max-width:860px في القسم 11، فتلغي قاعدة التكديس
   (نفس مشكلة أزرار المشاركة التي أُصلحت بنقل القاعدة لنهاية الملف).
   النتيجة كانت: الغلاف والنص جنب بعض على شاشة ضيقة، فيُقصّ السعر
   والإحصاءات من الطرف. هذه القاعدة في نهاية الملف فتتفوق عليها. */
@media (max-width: 860px) {
  .book-page-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .book-page-layout .book-page-cover { margin-inline: auto; }
  .book-page-layout .book-cover-img { margin-inline: auto; }
  .book-page-price { font-size: 1.45rem; }
  .book-page-stats { justify-content: center; }
  .book-page-actions { justify-content: center; }
  .book-page-contents { text-align: start; }
}

/* إصلاحات الجوال + إخفاء عمود التصنيفات (v1.1.18).
   1) أزرار المشاركة: الزر الخامس (نسخ الرابط) كان وحيداً في صفه على الجوال
   فيبدو غير مكتمل — يمتد بعرض الصف كاملاً، مع تكبير مساحة اللمس قليلاً.
   2) عمود التصنيفات في الشريط الجانبي طويل جداً (108 تصنيفات) — يُخفى
   نهائياً من الجوال والكمبيوتر، والتصنيفات تظهر في صفحة الأرشيف بدلاً منه.
   3) قسم «ابدأ من هنا» في الرئيسية كان يُقصّ أفقياً على الجوال: شبكة
   التخطيط (.layout) بعمود 1fr تسمح بمحتوى أدنى عريض فيدفع العمود خارج
   الشاشة — تثبيت الحد الأدنى بصفر (minmax(0,1fr)) يمنع التجاوز، مع تصغير
   حشوة القسم وعنوانه على الشاشات الضيقة. */
.site-sidebar .widget_categories { display: none; }
@media (max-width: 600px) {
  .share-buttons { gap: 10px; }
  .share-buttons .share-btn:last-child { grid-column: 1 / -1; }
  .share-btn { padding: 12px 10px; font-size: 0.95rem; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .content-area, .site-sidebar { min-width: 0; }
  .start-here { padding: 20px 16px; }
  .start-here h2 { font-size: 1.35rem; }
}

/* إخفاء ودجت التصنيفات الكتلي (v1.1.19).
   قائمة التصنيفات في الشريط الجانبي ليست الودجت الكلاسيكي (widget_categories)
   بل كتلة تصنيفات (wp-block-categories-list) داخل مجموعة — قاعدة v1.1.18
   لم تطابقها فبقيت ظاهرة في الرئيسية. :has() يخفي الودجت كاملاً
   (العنوان + القائمة) مهما تغيّر رقم الكتلة. */
.site-sidebar .widget_block:has(.wp-block-categories-list) { display: none; }
