/*
Theme Name: Baida
Theme URI: https://mohammedbaida.com
Author: Mohammed Baida
Description: قالب عربي مخصص لموقع محمد بيضا — أنظمة المحتوى والاتصال المؤسسي العربي. اتجاه بصري: «هامش المحرر».
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietary
Text Domain: baida
*/

/* ===========================
   نظام التصميم — «هامش المحرر»
   حبر داكن، ورق هادئ، وأحمر قلم المحرر يظهر فقط في علامات التصحيح.
   =========================== */

:root {
  --ink: #1c1b1a;          /* الحبر: النص الأساسي */
  --ink-soft: #6e6a63;     /* رمادي معدني: نص ثانوي */
  --paper: #fcfbf8;        /* الورق */
  --paper-deep: #f4f2ec;   /* ورق أعمق: خلفيات الأقسام */
  --pen: #9e2b25;          /* قلم المحرر الأحمر */
  --rule: #e5e2db;         /* السطر الباهت */
  --footer: #232120;

  --font-display: 'Amiri', 'Noto Naskh Arabic', serif;
  --font-body: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;

  --measure: 42rem;        /* عرض سطر القراءة */
  --wide: 68rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.95;
  color: var(--ink);
  background: var(--paper);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: rgba(158, 43, 37, 0.14); }

/* ---------- وصلات الوصول ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1.2rem;
  z-index: 100;
}
.skip-link:focus { inset-inline-start: 0; }

/* ---------- الحاويات ---------- */
.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: 1.5rem; }
.prose { max-width: var(--measure); }

/* ---------- الترويسة ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.4rem;
  flex-wrap: wrap;
}
.site-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  text-decoration: none;
  line-height: 1.2;
}
.site-brand .brand-dot { color: var(--pen); }
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding-bottom: 0.3rem;
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--ink);
  border-bottom: 2px solid var(--pen);
}

/* ---------- علامات المحرر (التوقيع البصري) ---------- */
/* الشَّرطة الحمراء قبل عنوان القسم — علامة قلم في الهامش */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pen);
  margin-bottom: 1rem;
}
.kicker::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: var(--pen);
  display: inline-block;
}

/* خط قلم المحرر تحت العبارة المفتاحية — ضربة يد لا مسطرة */
.pen-mark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 9' preserveAspectRatio='none'%3E%3Cpath d='M2 6.5 Q 50 2.5, 100 5.5 T 198 4' fill='none' stroke='%239e2b25' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: 100% 0.42em;
  padding-bottom: 0.28em;
}

/* ---------- الواجهة (Hero) ---------- */
.hero { padding-block: 5.5rem 4.5rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.65;
  max-width: 52rem;
  margin-bottom: 1.8rem;
}
.hero .hero-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
}
.hero .hero-sub {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin-bottom: 2.6rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.85rem 1.9rem;
  border: 1.5px solid var(--ink);
  transition: background 0.18s ease, color 0.18s ease;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--pen); border-color: var(--pen); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { border-color: var(--pen); color: var(--pen); }

/* ---------- شريط الأرقام ---------- */
.figures {
  border-block: 1px solid var(--rule);
  background: var(--paper-deep);
}
.figures .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  padding-block: 2.6rem;
}
.figure-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.figure-label { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.8; }

/* ---------- الأقسام ---------- */
.section { padding-block: 4.5rem; }
.section + .section { border-top: 1px solid var(--rule); }
.section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.6;
  margin-bottom: 1.6rem;
}
.section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 2.4rem 0 0.9rem;
}
.section p + p { margin-top: 1.1rem; }
.prose p + p { margin-top: 1.1rem; }

/* المنهج: قائمة بعلامات قلم */
.method-list { list-style: none; max-width: var(--measure); margin-top: 1.4rem; }
.method-list li {
  padding-inline-start: 1.7rem;
  position: relative;
  margin-bottom: 1rem;
}
.method-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.85em;
  width: 0.9rem;
  height: 2px;
  background: var(--pen);
}

/* الركيزتان وبطاقات «متى تحتاج» */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 2.5rem;
  margin-top: 1rem;
}

/* ---------- نماذج العمل ---------- */
.case {
  border-top: 1px solid var(--rule);
  padding-block: 2.6rem;
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) 1fr;
  gap: 2rem;
}
.case:first-of-type { border-top: none; }
.case-side h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.6;
  margin: 0;
}
.case-body dt {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--pen);
  margin-top: 1.3rem;
}
.case-body dt:first-child { margin-top: 0; }
.case-body dd { margin: 0.25rem 0 0; max-width: var(--measure); }
@media (max-width: 44rem) { .case { grid-template-columns: 1fr; gap: 0.8rem; } }

/* ---------- رؤى ---------- */
.track { border-top: 1px solid var(--rule); padding-block: 2.2rem; }
.track:first-of-type { border-top: none; }
.track h3 { margin-top: 0; }
.track .coming {
  background: var(--paper-deep);
  border-inline-start: 3px solid var(--pen);
  padding: 1.1rem 1.4rem;
  margin-top: 1.1rem;
  max-width: var(--measure);
}
.track .coming .coming-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pen);
  display: block;
  margin-bottom: 0.3rem;
}

.post-card { border-top: 1px solid var(--rule); padding-block: 2rem; }
.post-card:first-of-type { border-top: none; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { color: var(--pen); }
.post-meta { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.4rem; }

/* ---------- الدعوة الختامية ---------- */
.cta {
  background: var(--footer);
  color: var(--paper);
  padding-block: 4.5rem;
}
.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.7;
  max-width: 46rem;
  margin-bottom: 2rem;
}
.cta .btn { border-color: var(--paper); color: var(--paper); }
.cta .btn:hover { background: var(--pen); border-color: var(--pen); }

/* ---------- تواصل ---------- */
.contact-list { list-style: none; margin-top: 2rem; }
.contact-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.contact-list .label { font-weight: 700; min-width: 9rem; }
.contact-list a { color: var(--pen); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- التذييل ---------- */
.site-footer {
  background: var(--footer);
  color: #b9b4ac;
  font-size: 0.9rem;
}
.site-footer .wrap {
  padding-block: 2.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-footer a { color: #e7e3db; text-decoration: none; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.footer-links { display: flex; gap: 1.4rem; list-style: none; flex-wrap: wrap; }

/* ---------- مقالات مفردة ---------- */
.single-article { padding-block: 4rem; }
.single-article h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.6;
  max-width: 48rem;
  margin-bottom: 0.8rem;
}
.single-article .entry-content { max-width: var(--measure); margin-top: 2rem; }
.single-article .entry-content h2,
.single-article .entry-content h3 {
  font-family: var(--font-display);
  margin: 2.2rem 0 0.8rem;
}
.single-article .entry-content p + p { margin-top: 1.1rem; }
.single-article .entry-content blockquote {
  border-inline-start: 3px solid var(--pen);
  padding-inline-start: 1.2rem;
  color: var(--ink-soft);
  margin-block: 1.4rem;
}

/* ---------- استجابة ---------- */
@media (max-width: 44rem) {
  .hero { padding-block: 3.5rem 3rem; }
  .section { padding-block: 3rem; }
}
