/* مناريا — مدونة | ورقة أنماط مشتركة (نفس لغة الصفحة الرئيسية) */

/* ========== 1) التوكنز ========== */
:root {
  --teal: #0F766E;
  --teal-dark: #115E59;
  --teal-soft: #E6F4F1;
  --navy: #16283C;
  --gold: #D9A62E;
  --gold-soft: #FBF3DF;
  --cream: #FBF8F2;
  --green: #4C9F70;
  --green-soft: #EAF5EF;
  --gray: #5B6B7C;
  --line: #E4E1D8;
  --white: #FFFFFF;
  --font-ar: 'Alexandria', 'Inter', system-ui, sans-serif;
  --font-num: 'Inter', 'Alexandria', system-ui, sans-serif;
  --shadow-sm: 0 2px 8px rgba(22, 40, 60, 0.06);
  --shadow-md: 0 10px 30px rgba(22, 40, 60, 0.10);
  --shadow-lg: 0 24px 60px rgba(22, 40, 60, 0.14);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --nav-h: 76px;
  --container: 1200px;
}

/* ========== 2) أساسيات ========== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ar);
  background: var(--cream);
  color: var(--navy);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

/* ========== 3) الناف بار ========== */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(251, 248, 242, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container); margin-inline: auto; padding-inline: 24px;
  height: 100%; display: flex; align-items: center; gap: 28px;
}
.logo { font-size: 22px; font-weight: 800; color: var(--teal); letter-spacing: -0.3px; }
.logo .dot { color: var(--gold); }
.logo .en { font-family: var(--font-num); font-size: 12px; font-weight: 600; color: var(--gray); display: block; line-height: 1; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 9px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--navy);
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: var(--teal-soft); color: var(--teal-dark); }
.nav-links a.is-active { background: var(--teal-soft); color: var(--teal-dark); font-weight: 800; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: var(--font-ar);
}
.btn-primary { background: var(--teal); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
/* قاعدة .nav-links a تغلب .btn-primary بالأولوية — أعد النص الأبيض للزر داخل التنقل (تباين 2.73 → 5.47) */
.nav-links a.btn-primary { color: var(--white); }
.nav-links a.btn-primary:hover { color: var(--white); }
.btn-ghost { background: var(--white); color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-dark); }
.nav-cta { padding: 10px 20px; font-size: 14px; }

/* ========== 4) ترويسة المدونة (Hero خفيف) ========== */
.blog-hero {
  padding: calc(var(--nav-h) + 64px) 0 48px;
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(15, 118, 110, 0.07), transparent 70%),
    var(--cream);
}
.blog-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal-soft); color: var(--teal-dark);
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  margin-bottom: 18px;
}
.blog-hero h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; letter-spacing: -0.5px; line-height: 1.35; }
.blog-hero .sub { color: var(--gray); font-size: clamp(16px, 2vw, 19px); max-width: 640px; margin: 16px auto 0; }

/* ========== 5) فلتر التصنيفات ========== */
.blog-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 8px 0 40px; }
.filter-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 9px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  background: var(--white); color: var(--navy); border: 1.5px solid var(--line);
  cursor: pointer; font-family: var(--font-ar); transition: all 0.2s;
}
.filter-chip:hover { border-color: var(--teal); color: var(--teal-dark); }
.filter-chip.is-active { background: var(--teal); border-color: var(--teal); color: var(--white); font-weight: 800; box-shadow: var(--shadow-sm); }

/* ========== 6) بطاقات المقالات ========== */
.posts-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  padding-bottom: 72px;
}
.post-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative; overflow: hidden;
}
.post-card::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--green));
  opacity: 0; transition: opacity 0.25s;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: transparent; }
.post-card:hover::before { opacity: 1; }
.post-cat {
  align-self: flex-start;
  background: var(--teal-soft); color: var(--teal-dark);
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}
.post-cat.cat-gold { background: var(--gold-soft); color: #8A6510; }
.post-cat.cat-green { background: var(--green-soft); color: #2E6B47; }
.post-card h2 { font-size: 20px; font-weight: 800; line-height: 1.55; letter-spacing: -0.2px; }
.post-card h2 a:hover { color: var(--teal-dark); }
.post-card .excerpt { color: var(--gray); font-size: 15px; line-height: 1.8; flex: 1; }
.post-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; color: var(--gray); font-weight: 600;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.post-meta .num { font-family: var(--font-num); }
.post-meta .read-link { margin-inline-start: auto; color: var(--teal); font-weight: 800; font-size: 14px; }
.post-card.is-hidden { display: none; }

/* ========== 7) صفحة المقال ========== */
.post-wrap { max-width: 760px; margin-inline: auto; padding: calc(var(--nav-h) + 44px) 24px 72px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gray); font-weight: 600; margin-bottom: 28px; flex-wrap: wrap; }
.breadcrumb a { color: var(--teal); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--gray); }
.post-head h1 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; line-height: 1.5; letter-spacing: -0.3px; margin: 16px 0 18px; }
.post-head .post-meta { border: none; padding: 0; }

.post-body { margin-top: 36px; font-size: 17px; line-height: 1.95; }
.post-body > p { margin: 0 0 22px; }
.post-body .post-lead { font-size: 19.5px; font-weight: 600; color: var(--navy); line-height: 1.9; }
.post-body h2 {
  font-size: 24px; font-weight: 800; margin: 44px 0 16px; letter-spacing: -0.2px;
  padding-inline-start: 14px; border-inline-start: 4px solid var(--teal); line-height: 1.5;
}
.post-body h3 { font-size: 19.5px; font-weight: 800; margin: 32px 0 12px; }
.post-body ul, .post-body ol { margin: 0 0 22px; padding-inline-start: 8px; }
.post-body li { margin-bottom: 12px; padding-inline-start: 26px; position: relative; }
.post-body ul li::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 13px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--teal);
}
.post-body ol { counter-reset: item; }
.post-body ol li::before {
  counter-increment: item; content: counter(item);
  position: absolute; inset-inline-start: 0; top: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal-dark);
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num);
}
.post-body strong { font-weight: 800; }
.post-body a { color: var(--teal-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.post-callout {
  background: var(--teal-soft); border-inline-start: 4px solid var(--teal);
  border-radius: var(--radius-md); padding: 20px 24px; margin: 30px 0;
  font-weight: 600; line-height: 1.9;
}
.post-callout.gold { background: var(--gold-soft); border-color: var(--gold); }
.post-callout .callout-title { display: block; font-weight: 800; color: var(--teal-dark); margin-bottom: 6px; }
.post-callout.gold .callout-title { color: #8A6510; }

.post-sources { margin: 44px 0 0; padding: 22px 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); }
.post-sources h3 { margin: 0 0 12px; font-size: 16px; }
.post-sources li { font-size: 14px; color: var(--gray); margin-bottom: 8px; padding-inline-start: 20px; position: relative; }
.post-sources li::before { content: ''; position: absolute; inset-inline-start: 0; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.post-sources a { color: var(--teal-dark); font-size: 14px; }

.post-faq { margin: 44px 0 0; }
.post-faq > h2 { border: none; padding: 0; }
.faq-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden; }
.faq-item summary {
  padding: 18px 22px; font-weight: 800; font-size: 16.5px; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-chevron { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--teal-soft); display: flex; align-items: center; justify-content: center; transition: transform 0.25s, background 0.25s; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); background: var(--teal); }
.faq-item[open] .faq-chevron svg path { stroke: var(--white); }
.faq-a { padding: 0 22px 20px; color: var(--gray); font-size: 15.5px; line-height: 1.9; }

.post-cta-box {
  margin-top: 52px; background: var(--navy); color: var(--white);
  border-radius: var(--radius-lg); padding: 40px 36px; text-align: center;
  position: relative; overflow: hidden;
}
.post-cta-box::before {
  content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.5), transparent 70%);
  top: -140px; inset-inline-end: -100px;
}
.post-cta-box h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; position: relative; }
.post-cta-box p { color: rgba(255, 255, 255, 0.75); margin-bottom: 24px; position: relative; }
.post-cta-box .btn { position: relative; }

/* مقالات ذات صلة */
.related { max-width: var(--container); margin: 0 auto; padding: 0 24px 72px; }
.related h2 { font-size: 24px; font-weight: 800; margin-bottom: 24px; }
.related .posts-grid { padding-bottom: 0; }

/* ========== 8) CTA ختامي (صفحة المدونة) ========== */
.blog-cta { background: var(--navy); color: var(--white); padding: 72px 0; text-align: center; position: relative; overflow: hidden; }
.blog-cta::before {
  content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.4), transparent 70%);
  top: -200px; inset-inline-start: 50%; transform: translateX(50%);
}
.blog-cta h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; margin-bottom: 14px; position: relative; }
.blog-cta p { color: rgba(255, 255, 255, 0.75); max-width: 560px; margin: 0 auto 28px; position: relative; }
.blog-cta .btn { position: relative; }

/* ========== 9) الفوتر ========== */
.footer { background: #101D2B; color: rgba(255, 255, 255, 0.75); padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer .logo { color: var(--white); }
.footer .logo .en { color: #9DB3C8; } /* تباين 3.11 → 7.9 على الكحلي الداكن */
.footer h3 { color: var(--white); font-size: 15.5px; font-weight: 800; margin-bottom: 18px; }
.footer ul li { margin-bottom: 11px; }
.footer ul a { font-size: 14.5px; transition: color 0.2s; }
.footer ul a:hover { color: var(--white); }
.footer-desc { font-size: 14.5px; line-height: 1.9; max-width: 300px; margin-top: 14px; }
.soon { font-size: 12px; background: rgba(255, 255, 255, 0.1); padding: 2px 10px; border-radius: 999px; margin-inline-start: 6px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 20px 0; text-align: center; font-size: 13.5px; color: rgba(255, 255, 255, 0.5); }

/* ========== 10) أزرار التواصل العائمة (إنستجرام + واتساب) ========== */
/* موضع فيزيائي يمين الأسفل في RTL وLTR معًا — لا نستخدم inset-inline-start هنا */
.contact-floats { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 12px; }
.contact-float { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 8px 24px rgba(22, 40, 60, 0.18); transition: transform 0.25s ease, box-shadow 0.25s ease; text-decoration: none; }
.contact-float svg { width: 30px; height: 30px; }
.contact-float:hover { transform: translateY(-3px); }
.wa-float { background: #25D366; }
.ig-float { background: radial-gradient(circle at 30% 107%, #FEDA75 0%, #FA7E1E 30%, #D62976 55%, #962FBF 78%, #4F5BD5 100%); }
@media (max-width: 480px) { .contact-float { width: 50px; height: 50px; } .contact-floats { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); } }

/* ========== 11) تجاوب ========== */
@media (max-width: 980px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .nav-links a:not(.btn) { display: none; }
}
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .post-cta-box { padding: 32px 24px; }
  .post-wrap { padding-top: calc(var(--nav-h) + 28px); }
}

/* ========== 12) ترقيات جولة تطوير المدونة (بعد تحليل المنافسين) ========== */
/* شريط إحصاءات «مركز المعرفة» — نمط Smart Clinic بأسلوبنا */
.blog-stats { display: flex; justify-content: center; gap: 40px; margin-top: 34px; flex-wrap: wrap; }
.blog-stat { text-align: center; }
.blog-stat .num { display: block; font-family: var(--font-num); font-size: 30px; font-weight: 800; color: var(--teal); line-height: 1.2; }
.blog-stat .lbl { font-size: 13.5px; color: var(--gray); font-weight: 600; }

/* شارة الجمهور — نمط ينمو (للممارسين/للأسرة) بروح «لمن صُممت؟» */
.post-aud {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--gray);
  padding: 5px 13px; border-radius: 999px; border: 1.5px dashed var(--line);
}
.post-head .post-aud { margin-inline-start: 8px; }

/* لافتة الـLead Magnet (نموذج IEP) */
.lm-banner {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--navy); color: var(--white);
  border-radius: var(--radius-lg); padding: 32px 36px; margin-bottom: 40px;
  position: relative; overflow: hidden;
}
.lm-banner::before {
  content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 166, 46, 0.28), transparent 70%);
  top: -120px; inset-inline-start: -60px;
}
.lm-icon {
  flex-shrink: 0; width: 60px; height: 60px; border-radius: 16px;
  background: rgba(217, 166, 46, 0.18); display: flex; align-items: center; justify-content: center;
  position: relative;
}
.lm-body { flex: 1; min-width: 260px; position: relative; }
.lm-badge { display: inline-block; background: var(--gold); color: var(--navy); font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.lm-body h2 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.lm-body p { color: rgba(255,255,255,0.72); font-size: 14.5px; margin: 0; }
.lm-banner .btn { position: relative; background: var(--gold); color: var(--navy); font-weight: 800; }
.lm-banner .btn:hover { background: #E4B945; transform: translateY(-2px); }

/* جدول محتويات المقال — نمط أدلة Smart Clinic */
.post-toc {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px 26px; margin-top: 32px;
}
.post-toc .toc-title { font-weight: 800; font-size: 15px; color: var(--teal-dark); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.post-toc ol { padding-inline-start: 4px; }
.post-toc li { margin-bottom: 9px; font-size: 14.5px; font-weight: 600; }
.post-toc li::before { display: none; }
.post-toc a { color: var(--navy); text-decoration: none; padding-inline-start: 20px; position: relative; display: inline-block; }
.post-toc a::before { content: ''; position: absolute; inset-inline-start: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); opacity: 0.5; }
.post-toc a:hover { color: var(--teal-dark); }
.post-toc a:hover::before { opacity: 1; }

/* مربع الإعداد والمراجعة — E-E-A-T بصدق */
.post-review {
  margin-top: 36px; padding: 18px 24px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  font-size: 13.5px; color: var(--gray); line-height: 1.9;
  display: flex; align-items: flex-start; gap: 14px;
}
.post-review svg { flex-shrink: 0; margin-top: 4px; }
.post-review strong { color: var(--navy); }

@media (max-width: 640px) {
  .lm-banner { padding: 26px 22px; gap: 16px; }
  .blog-stats { gap: 24px; }
}

/* صف شارات التصنيف + الجمهور في البطاقة */
.card-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* إزاحة التمرير لأهداف الروابط الداخلية تحت الناف الثابت */
.post-body h2[id], .post-faq h2 { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ========== 13) إتاحة الوصول ========== */
/* مؤشر تركيز واضح للوحة المفاتيح */
a:focus-visible, button:focus-visible, summary:focus-visible, .filter-chip:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* تقليل الحركة لمن يفضّل ذلك */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
