/*
Theme Name: TaqniPro
Theme URI: https://taqnipro.com
Author: TaqniPro
Description: قالب احترافي للمواقع التقنية العربية — شروحات ومقارنات ومراجعات
Version: 2.0
Text Domain: taqnipro
*/

@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700&display=swap');

/* ============================================================
   VARIABLES — غيّر الألوان هنا لتغيير شكل الموقع كله
   ============================================================ */
:root {
  /* ألوان أساسية */
  --ink:        #1a1612;   /* الخلفية الداكنة */
  --ink2:       #2e2820;   /* الداكنة الثانوية */
  --ink3:       #3d342a;   /* الداكنة الثالثة */
  --paper:      #f5f0e8;   /* خلفية الصفحة */
  --paper2:     #ede8de;   /* خلفية ثانوية */
  --paper3:     #e0d9cc;   /* حدود وفواصل */
  --white:      #ffffff;

  /* ألوان التمييز */
  --gold:       #c9a84c;   /* الذهبي الرئيسي */
  --gold2:      #a8863a;   /* الذهبي الغامق */
  --gold-bg:    #c9a84c18; /* خلفية ذهبية شفافة */
  --teal:       #1d6b5e;   /* الأخضر المائي */
  --teal-bg:    #1d6b5e14;
  --rust:       #b84c2a;   /* البرتقالي الداكن */
  --rust-bg:    #b84c2a12;
  --purple:     #7c5af0;
  --purple-bg:  #7c5af012;

  /* نصوص */
  --text:       #1a1612;
  --text2:      #5a5248;
  --text3:      #9a9088;

  /* قيم عامة */
  --r:          10px;      /* نصف قطر الحواف */
  --r-lg:       14px;
  --shadow:     0 4px 24px rgba(26,22,18,.08);
  --shadow-lg:  0 8px 40px rgba(26,22,18,.12);
  --font:       'Readex Pro', sans-serif;
  --header-h:   64px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  direction: rtl;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); }
ul { list-style: none; }

/* ============================================================
   FOCUS — إمكانية الوصول
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

/* الشعار */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}
.logo-mark {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--ink);
  flex-shrink: 0;
}
.logo-text { font-size: 17px; font-weight: 600; color: #fff; white-space: nowrap; }
.logo-text span { color: var(--gold); font-weight: 300; }

/* القائمة */
#site-navigation { margin-right: 28px; }
#site-navigation ul {
  display: flex; gap: 2px;
}
#site-navigation ul li a {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  padding: 7px 13px;
  border-radius: 7px;
  transition: color .15s, background .15s;
  font-weight: 400;
  display: block;
  white-space: nowrap;
}
#site-navigation ul li a:hover { color: #fff; background: rgba(255,255,255,.08); }
#site-navigation ul li.current-menu-item a { color: var(--gold); background: var(--gold-bg); }

/* بحث */
.nav-search-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 8px;
  border-radius: 7px;
  transition: color .15s, background .15s;
  display: flex; align-items: center;
  flex-shrink: 0;
}
.nav-search-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-search-btn svg { width: 18px; height: 18px; }

/* زر الاشتراك */
.nav-cta {
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-cta:hover { background: var(--gold2); color: #fff; }

/* أيقونة الهامبرغر */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle span + span { margin-top: 5px; }

/* قائمة الموبايل */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 200;
  flex-direction: column;
  padding: 24px 24px 40px;
  overflow-y: auto;
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mobile-nav-overlay.open { display: flex; }
.mobile-nav-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.mobile-nav-close {
  background: rgba(255,255,255,.08);
  border: none;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 8px;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.mobile-nav-overlay ul { display: flex; flex-direction: column; }
.mobile-nav-overlay ul li a {
  display: block;
  font-size: 19px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: color .15s;
}
.mobile-nav-overlay ul li a:hover,
.mobile-nav-overlay ul li.current-menu-item a { color: var(--gold); }
.mobile-nav-cta {
  margin-top: 28px;
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 15px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  width: 100%;
  display: block;
  text-decoration: none;
}

/* بحث overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(26,22,18,.85);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}
.search-overlay.open { display: flex; }
.search-overlay-inner {
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
}
.search-overlay form {
  display: flex;
  gap: 10px;
}
.search-overlay input {
  flex: 1;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--text);
  direction: rtl;
  outline: none;
}
.search-overlay button[type="submit"] {
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: 12px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.search-overlay-close {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  cursor: pointer;
}

/* شريط القراءة */
.reading-bar {
  position: fixed;
  top: var(--header-h);
  right: 0;
  height: 3px;
  background: var(--gold);
  width: 0%;
  z-index: 99;
  transition: width .06s linear;
  pointer-events: none;
}

/* ============================================================
   HERO
   ============================================================ */
.hero-wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 500px;
}
.hero-left {
  background: var(--ink2);
  padding: 56px 48px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.hero-left::before {
  content: '';
  position: absolute;
  top: -80px; left: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.06), transparent 70%);
  pointer-events: none;
}
.hero-left::after {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.04);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-bg);
  border: 1px solid rgba(201,168,76,.3);
  color: var(--gold);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 99px;
  width: fit-content;
  margin-bottom: 24px;
  letter-spacing: .05em;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}
.hero-left h1 {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
}
.hero-left h1 em {
  font-style: normal;
  color: var(--gold);
  font-weight: 300;
  font-size: 36px;
  display: block;
  margin-top: 4px;
}
.hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,.5);
  line-height: 1.9;
  max-width: 420px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-nums {
  display: flex;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 8px;
}
.hero-num-item .n {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
}
.hero-num-item .l {
  font-size: 11px;
  color: rgba(255,255,255,.35);
  margin-top: 5px;
  font-weight: 300;
}

/* اليمين في الهيرو */
.hero-right {
  background: var(--paper2);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--paper3);
}
.featured-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--rust);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.featured-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid var(--paper3);
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, box-shadow .2s;
}
.featured-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
}
.fc-thumb {
  height: 160px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 14px;
  background: var(--paper2);
}
.fc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.featured-card:hover .fc-thumb img { transform: scale(1.04); }

.fc-cat {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--teal);
  font-weight: 500;
  background: var(--teal-bg);
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 14px;
}
.fc-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 12px;
  flex: 1;
}
.fc-title a:hover { color: var(--teal); }
.fc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--paper3);
  font-size: 12px;
  color: var(--text2);
}
.fc-av-wrap { display: flex; align-items: center; gap: 7px; }
.fc-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--gold); font-weight: 700;
  flex-shrink: 0;
}
.mini-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-card {
  background: var(--white);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--paper3);
  transition: border-color .2s, transform .2s;
  display: block;
}
.mini-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.mc-thumb {
  height: 100px;
  overflow: hidden;
  border-radius: 7px;
  margin-bottom: 10px;
  background: var(--paper2);
}
.mc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.mini-card:hover .mc-thumb img { transform: scale(1.05); }
.mc-cat { font-size: 10px; color: var(--rust); font-weight: 700; letter-spacing: .06em; margin-bottom: 7px; }
.mc-title { font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.55; }
.mc-views { font-size: 11px; color: var(--text3); margin-top: 8px; }

/* المقالات المشابهة — متجاوبة */
.related-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr; }
  .related-grid .post-card { flex-direction: row; }
  .related-grid .post-thumb { width: 88px; min-height: 80px; flex-shrink: 0; border-radius: 0; height: auto; }
  .related-grid .post-excerpt { display: none; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-gold {
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 12px 24px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-gold:hover { background: var(--gold2); color: #fff; }
.btn-gold:active { transform: scale(.98); }

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-outline:hover { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.05); }

.btn-teal {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity .15s;
}
.btn-teal:hover { opacity: .85; }

/* ============================================================
   CONTENT WRAPPER
   ============================================================ */
.content-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 52px 28px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--paper3);
}
.section-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.section-title-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
}
.section-link {
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.section-link:hover { color: var(--ink); }

/* ============================================================
   POSTS GRID
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}
.post-card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--paper3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--paper2);
}
.post-thumb {
  height: 170px;
  overflow: hidden;
  background: var(--paper2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-thumb img { transform: scale(1.05); }
.post-thumb-placeholder { font-size: 44px; }
.post-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 9px;
}
.post-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-title a { color: inherit; }
.post-title a:hover { color: var(--teal); }
.post-excerpt {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text3);
  padding-top: 12px;
  border-top: 1px solid var(--paper3);
  margin-top: auto;
}
.post-read-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   SINGLE POST HERO
   ============================================================ */
.single-hero {
  background: var(--ink2);
  padding: 48px 28px 36px;
}
.single-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
}
.post-breadcrumb {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.post-breadcrumb a { color: var(--gold); }
.post-breadcrumb a:hover { color: #fff; }
.post-breadcrumb .sep { color: rgba(255,255,255,.2); }
.single-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-bg);
  border: 1px solid rgba(201,168,76,.3);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 99px;
  margin-bottom: 18px;
  letter-spacing: .04em;
}
.single-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -1px;
  margin-bottom: 20px;
  max-width: 760px;
}
.single-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-wrap: wrap;
}
.single-meta .author-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink); font-weight: 700;
  flex-shrink: 0;
}
.single-meta .sep { color: rgba(255,255,255,.15); }

/* ============================================================
   SINGLE POST LAYOUT
   ============================================================ */
.single-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 28px 64px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 44px;
  align-items: start;
}
.single-main { min-width: 0; }

/* الصورة المميزة */
.post-featured-img {
  margin-bottom: 36px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--paper3);
}
.post-featured-img img { width: 100%; height: auto; display: block; }

/* ============================================================
   ARTICLE CONTENT
   ============================================================ */
article.post-content {
  line-height: 1.95;
  font-size: 15px;
  color: var(--text);
}
article.post-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 16px;
  letter-spacing: -.5px;
  padding-right: 16px;
  border-right: 4px solid var(--gold);
}
article.post-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text);
}
article.post-content h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 10px;
}
article.post-content p { margin-bottom: 20px; }
article.post-content ul,
article.post-content ol {
  padding-right: 24px;
  margin-bottom: 20px;
  list-style: disc;
}
article.post-content ol { list-style: decimal; }
article.post-content li { margin-bottom: 8px; }
article.post-content a {
  color: var(--teal);
  border-bottom: 1px solid rgba(29,107,94,.25);
  transition: border-color .15s;
}
article.post-content a:hover { border-color: var(--teal); }
article.post-content img {
  border-radius: var(--r);
  margin: 28px 0;
  max-width: 100%;
}
article.post-content blockquote {
  border-right: 4px solid var(--gold);
  background: var(--paper2);
  padding: 18px 22px;
  border-radius: 0 var(--r) var(--r) 0;
  margin: 28px 0;
  font-size: 16px;
  color: var(--text2);
  font-style: italic;
  line-height: 1.8;
}
article.post-content blockquote p { margin-bottom: 0; }
article.post-content code {
  background: var(--ink);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}
article.post-content pre {
  background: var(--ink);
  color: #e8e0d8;
  padding: 22px 24px;
  border-radius: var(--r);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 13px;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
article.post-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
article.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
}
article.post-content th {
  background: var(--ink2);
  color: #fff;
  padding: 13px 16px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}
article.post-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--paper3);
  font-size: 13px;
}
article.post-content tr:hover td { background: var(--paper); }
article.post-content hr {
  border: none;
  border-top: 1px solid var(--paper3);
  margin: 36px 0;
}

/* صندوق ملاحظة */
.notice-box {
  background: var(--gold-bg);
  border: 1px solid rgba(201,168,76,.3);
  border-radius: var(--r);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
  color: var(--text2);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notice-box.info { background: var(--teal-bg); border-color: rgba(29,107,94,.25); }
.notice-box.warning { background: var(--rust-bg); border-color: rgba(184,76,42,.25); }

/* جدول المحتويات */
.toc-box {
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc-box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toc-box ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}
.toc-box ol li {
  counter-increment: toc;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  font-size: 13px;
  align-items: baseline;
}
.toc-box ol li::before {
  content: counter(toc);
  background: var(--ink);
  color: var(--gold);
  width: 20px; height: 20px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.toc-box ol li a { color: var(--text2); border-bottom: none; transition: color .15s; }
.toc-box ol li a:hover { color: var(--teal); }

/* وسوم المقال */
.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--paper3);
  align-items: center;
}
.post-tags-label {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}
.tag-link {
  font-size: 12px;
  padding: 5px 13px;
  border-radius: 99px;
  border: 1px solid var(--paper3);
  color: var(--text2);
  background: var(--white);
  transition: border-color .15s, color .15s;
}
.tag-link:hover { border-color: var(--teal); color: var(--teal); }

/* أزرار المشاركة */
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--paper2);
  border-radius: var(--r);
  border: 1px solid var(--paper3);
}
.share-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-left: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.share-btn:hover { opacity: .85; }
.share-btn:active { transform: scale(.97); }
.share-btn.twitter  { background: #000; color: #fff; }
.share-btn.whatsapp { background: #25d366; color: #fff; }
.share-btn.telegram { background: #229ed9; color: #fff; }
.share-btn.copy     { background: var(--ink); color: var(--gold); font-family: var(--font); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--paper3);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow: hidden;
}
.sidebar-widget.dark {
  background: var(--ink2);
  border-color: transparent;
}
.widget-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--paper3);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}
.sidebar-widget.dark .widget-title {
  color: #fff;
  border-color: rgba(255,255,255,.1);
}
.widget-title::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}
.sidebar-post {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--paper3);
}
.sidebar-post:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-post-thumb {
  width: 66px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--paper2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.sidebar-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-post-info { flex: 1; min-width: 0; }
.sidebar-post-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-post-title a:hover { color: var(--teal); }
.sidebar-post-meta { font-size: 11px; color: var(--text3); margin-top: 5px; }

/* قائمة التصنيفات في السايدبار */
.cats-list { list-style: none; }
.cats-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--paper3);
  font-size: 13px;
}
.cats-list li:last-child { border-bottom: none; }
.cats-list li a { color: var(--text2); transition: color .15s; }
.cats-list li a:hover { color: var(--teal); }
.cats-list .count {
  font-size: 11px;
  background: var(--paper2);
  padding: 2px 9px;
  border-radius: 99px;
  color: var(--text3);
  flex-shrink: 0;
}

/* نشرة في السايدبار */
.sidebar-newsletter p {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  line-height: 1.75;
  margin-bottom: 14px;
}
.sidebar-email-input {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
  transition: border-color .15s;
  direction: rtl;
}
.sidebar-email-input::placeholder { color: rgba(255,255,255,.3); }
.sidebar-email-input:focus { border-color: var(--gold); }

/* ============================================================
   CATEGORIES PAGE
   ============================================================ */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 48px;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--paper3);
  border-radius: var(--r-lg);
  padding: 24px 16px 20px;
  text-align: center;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.cat-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.cat-strip {
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 3px;
}
.cat-icon { font-size: 34px; margin-bottom: 10px; display: block; }
.cat-name { font-size: 14px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.cat-count { font-size: 11px; color: var(--text3); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 40px 0;
  flex-wrap: wrap;
}
.page-numbers {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--paper3);
  color: var(--text2);
  transition: all .15s;
  background: var(--white);
}
.page-numbers:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-numbers.dots { background: transparent; border-color: transparent; }

/* ============================================================
   PAGE TEMPLATE
   ============================================================ */
.page-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 28px 72px;
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-form-wrap {
  max-width: 560px;
  margin-bottom: 36px;
}
.search-input-group {
  display: flex;
  gap: 10px;
}
.search-input-group input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--paper3);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  background: var(--white);
  color: var(--text);
  outline: none;
  direction: rtl;
  transition: border-color .15s;
}
.search-input-group input:focus { border-color: var(--gold); }
.search-results-count {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 24px;
}

/* ============================================================
   404
   ============================================================ */
.error-wrap {
  text-align: center;
  padding: 80px 28px;
  max-width: 600px;
  margin: 0 auto;
}
.error-code {
  font-size: 80px;
  font-weight: 700;
  color: var(--paper3);
  line-height: 1;
  margin-bottom: 8px;
}
.error-icon { font-size: 52px; margin-bottom: 20px; }
.error-title { font-size: 26px; font-weight: 700; margin-bottom: 12px; }
.error-desc { color: var(--text2); font-size: 15px; margin-bottom: 32px; line-height: 1.8; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   NEWSLETTER SECTION
   ============================================================ */
.newsletter-section {
  background: var(--ink2);
  padding: 52px 28px;
  text-align: center;
}
.newsletter-inner {
  max-width: 540px;
  margin: 0 auto;
}
.newsletter-section h2 {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -.5px;
}
.newsletter-section p {
  font-size: 14px;
  color: rgba(255,255,255,.5);
  line-height: 1.8;
  margin-bottom: 28px;
}
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 13px 18px;
  font-family: var(--font);
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: border-color .15s;
  direction: rtl;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.3); }
.newsletter-form input:focus { border-color: var(--gold); }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer { background: var(--ink); }
.footer-top {
  padding: 52px 28px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.footer-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 48px;
}
.footer-brand .site-logo { margin-bottom: 16px; }
.footer-brand p {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 260px;
}
.social-links { display: flex; gap: 8px; }
.social-link {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.07);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  font-weight: 700;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.social-link:hover { background: var(--gold); color: var(--ink); }
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
  letter-spacing: .04em;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  transition: color .15s;
}
.footer-col ul li a:hover { color: var(--gold); }
.footer-newsletter-form { margin-top: 4px; }
.footer-newsletter-form p {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  line-height: 1.75;
  margin-bottom: 16px;
}
.footer-email-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-email-input {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 11px 14px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  direction: rtl;
}
.footer-email-input::placeholder { color: rgba(255,255,255,.25); }
.footer-email-input:focus { border-color: var(--gold); }

.footer-bottom {
  padding: 18px 28px;
}
.footer-bottom-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 12px; color: rgba(255,255,255,.2); }
.footer-bottom-links { display: flex; gap: 18px; }
.footer-bottom-links a {
  font-size: 12px;
  color: rgba(255,255,255,.3);
  transition: color .15s;
}
.footer-bottom-links a:hover { color: var(--gold); }

/* ============================================================
   COMPARE TABLE
   ============================================================ */
.compare-box {
  background: var(--white);
  border: 1px solid var(--paper3);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 32px;
}
.compare-box-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--paper3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.compare-box-head h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.compare-box-head p { font-size: 12px; color: var(--text2); }
.compare-badge {
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th {
  padding: 12px 18px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  background: var(--paper2);
}
.compare-table td {
  padding: 12px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--paper3);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--paper); }
.win { color: var(--teal); font-weight: 600; }
.lose { color: var(--text3); }

/* Responsive table wrapper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r);
}
.table-scroll table { min-width: 480px; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-gold   { color: var(--gold); }
.text-teal   { color: var(--teal); }
.text-rust   { color: var(--rust); }
.text-muted  { color: var(--text3); }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-gold   { background: var(--gold-bg); color: var(--gold2); border: 1px solid rgba(201,168,76,.25); }
.badge-teal   { background: var(--teal-bg); color: var(--teal); }
.badge-rust   { background: var(--rust-bg); color: var(--rust); }

/* ============================================================
   TABLET ≤ 960px
   ============================================================ */
@media (max-width: 960px) {
  /* Nav: show hamburger, hide desktop links */
  .nav-toggle { display: block; }
  #site-navigation, .nav-cta, .nav-search-btn { display: none; }

  /* Hero: single column */
  .hero-wrap { grid-template-columns: 1fr; }
  .hero-left { padding: 40px 28px 32px; }
  .hero-left h1 { font-size: 32px; }
  .hero-left h1 em { font-size: 28px; }
  .hero-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 22px;
  }
  .hero-right > div:first-child { grid-column: span 2; }

  /* Posts: 2 cols */
  .posts-grid { grid-template-columns: repeat(2, 1fr); }

  /* Single: full width, sidebar below */
  .single-wrap {
    grid-template-columns: 1fr;
    padding: 36px 28px 56px;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .sidebar .sidebar-widget.dark { grid-column: span 2; }

  /* Categories: 3 cols */
  .cats-grid { grid-template-columns: repeat(3, 1fr); }

  /* Footer: 2 cols */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: span 2; }
}

/* ============================================================
   MOBILE ≤ 640px
   ============================================================ */
@media (max-width: 640px) {
  :root { --header-h: 58px; }

  /* Nav */
  .nav-inner { padding: 0 16px; }

  /* Hero */
  .hero-left { padding: 28px 18px 24px; }
  .hero-left h1 { font-size: 26px; }
  .hero-left h1 em { font-size: 22px; }
  .hero-desc { display: none; }
  .hero-nums { gap: 20px; flex-wrap: wrap; }
  .hero-nums .hero-num-item .n { font-size: 22px; }
  .hero-right { grid-template-columns: 1fr; padding: 18px; }
  .hero-right > div:first-child { grid-column: span 1; }
  .mini-cards { grid-template-columns: 1fr 1fr; }
  .mc-thumb { height: 80px; }

  /* Posts: horizontal card */
  .posts-grid { grid-template-columns: 1fr; gap: 10px; }
  .post-card { flex-direction: row; }
  .post-thumb {
    width: 88px; height: auto; min-height: 80px;
    flex-shrink: 0; border-radius: 0;
  }
  .post-thumb img { height: 100%; }
  .post-thumb-placeholder { font-size: 28px; }
  .post-body { padding: 12px 14px; }
  .post-title { font-size: 13px; -webkit-line-clamp: 2; }
  .post-excerpt { display: none; }

  /* Categories: 2 cols — مربعات متساوية */
  .cats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { aspect-ratio: 1; padding: 12px 8px; }
  .cat-icon { font-size: 26px; margin-bottom: 8px; }
  .cat-name { font-size: 13px; }
  .cat-count { font-size: 10px; }

  /* Content */
  .content-wrap { padding: 32px 16px; }
  .section-title-text { font-size: 19px; }

  /* Single post hero */
  .single-hero { padding: 28px 16px 24px; }
  .single-title { font-size: 23px; }
  .single-meta { gap: 10px; font-size: 11px; }
  .single-wrap { padding: 28px 16px 48px; }

  /* Article */
  article.post-content { font-size: 14px; }
  article.post-content h2 { font-size: 19px; }
  article.post-content h3 { font-size: 17px; }

  /* Sidebar */
  .sidebar { grid-template-columns: 1fr; }
  .sidebar .sidebar-widget.dark { grid-column: span 1; }

  /* Share bar */
  .share-bar { padding: 14px 16px; }
  .share-bar-label { width: 100%; }

  /* Newsletter section */
  .newsletter-form { flex-direction: column; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand { grid-column: span 1; }
  .footer-brand p { max-width: 100%; }
  .footer-top { padding: 36px 16px; }
  .footer-bottom { padding: 14px 16px; }
  .footer-bottom-inner { flex-direction: column; text-align: center; gap: 8px; }
  .footer-bottom-links { justify-content: center; flex-wrap: wrap; }

  /* Page */
  .page-wrap { padding: 28px 16px 48px; }

  /* Pagination */
  .page-numbers { min-width: 36px; height: 36px; font-size: 13px; }

  /* TOC */
  .toc-box { padding: 16px 18px; }

  /* Table scroll hint */
  .table-scroll::after {
    content: 'اسحب للجانب لرؤية المزيد ←';
    display: block;
    font-size: 11px;
    color: var(--text3);
    text-align: center;
    padding: 8px;
  }
}

/* ============================================================
   TOUCH DEVICES
   ============================================================ */
@media (hover: none) {
  .post-card:active   { opacity: .9; }
  .cat-card:active    { opacity: .9; }
  .btn-gold:active    { transform: scale(.97); }
  .btn-outline:active { transform: scale(.97); }
  .share-btn:active   { transform: scale(.96); }
}
