/* ============================================================================
 *  CT — الخطوة 11: تصميم المقالة المفردة
 *  الوجهة: wp-content/themes/blocksy-child/assets/css/ct-tutor-11-article.css
 *
 *  النطاق: المقالة المفردة وحدها — body.single-post
 *  لا تصل أي قاعدة هنا إلى صفحات Elementor، لأن كل محدد
 *  مسبوق بـ .single-post ومستثنى منه .elementor صراحةً.
 *
 *  بلا !important إطلاقاً. فإن تسرّبت قاعدة إلى Elementor،
 *  فأنماطه أقوى تخصيصاً وتفوز تلقائياً.
 * ========================================================================== */

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

body.single-post {
  --a-ink:      #0f1f3d;
  --a-ink-2:    #344054;
  --a-ink-3:    #667085;
  --a-line:     #e4e7ec;
  --a-line-2:   #f2f4f7;
  --a-accent:   #0e6e5e;
  --a-accent-7: #0a574a;
  --a-accent-1: #f3f9f7;
  --a-font:     'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --a-measure:  68ch;
}

/* ---------------------------------------------------------------------------
 *  1 · مؤشر تقدم القراءة
 *  موجود في إعداداتك لكنه بلا تنسيق يُذكر.
 * ------------------------------------------------------------------------- */
body.single-post .ct-reading-progress-bar,
body.single-post [class*="reading-progress"] {
  height: 3px;
  background: linear-gradient(90deg, var(--a-accent), #16a085);
}

/* ---------------------------------------------------------------------------
 *  2 · ترويسة المقالة
 * ------------------------------------------------------------------------- */
body.single-post .hero-section:not(.elementor *) {
  padding-block: clamp(32px, 5vw, 64px) clamp(20px, 3vw, 34px);
}

body.single-post .entry-header:not(.elementor *) {
  text-align: start;
}

/* التصنيف فوق العنوان */
body.single-post .entry-header .ct-post-taxonomy {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-block-end: 14px;
}

body.single-post .entry-header .ct-post-taxonomy a {
  color: var(--a-accent);
  text-decoration: none;
}

body.single-post .entry-header .ct-post-taxonomy a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* العنوان — وزن أخف كلما كبر الحجم، قاعدة أساسية في الطباعة العربية */
body.single-post .entry-header .ct-post-title {
  font-family: var(--a-font);
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.015em;
  color: var(--a-ink);
  margin-block: 0 18px;
}

/* سطر البيانات */
body.single-post .entry-header .entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 14px;
  color: var(--a-ink-3);
  padding-block: 16px 0;
  border-block-start: 1px solid var(--a-line);
  margin-block-start: 20px;
}

body.single-post .entry-meta a {
  color: var(--a-ink-2);
  text-decoration: none;
  font-weight: 500;
}

body.single-post .entry-meta a:hover { color: var(--a-accent); }

body.single-post .entry-meta .ct-meta-element-author img {
  border-radius: 50%;
  border: 1px solid var(--a-line);
}

body.single-post .ct-separator { color: #cbd2dc; }

/* ---------------------------------------------------------------------------
 *  3 · الصورة البارزة
 *
 *  أوسع من عمود النص فتكسر رتابة العمود — أسلوب المنشورات الرقمية.
 * ------------------------------------------------------------------------- */
body.single-post .hero-section .ct-media-container,
body.single-post .entry-header + .ct-media-container {
  margin-block: 28px 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 26px rgba(15,31,61,.10);
}

body.single-post .ct-media-container img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------------------------------------------------------------------------
 *  4 · عمود القراءة
 * ------------------------------------------------------------------------- */
body.single-post .entry-content:not(.elementor *) {
  font-family: var(--a-font);
  font-size: 1.0625rem;
  line-height: 1.95;
  color: var(--a-ink-2);
  padding-block-start: 8px;
}

body.single-post .entry-content > p {
  max-width: var(--a-measure);
  margin-block: 0 1.15em;
  line-height: 1.95;
}

/* الفقرة الأولى مقدمة: أكبر وأخف — تفصل بين العنوان والمتن */
body.single-post .entry-content > p:first-of-type {
  font-size: 1.22rem;
  font-weight: 300;
  line-height: 1.85;
  color: #475467;
  margin-block-end: 1.5em;
}

/* ---------------------------------------------------------------------------
 *  5 · سلّم العناوين
 *  المسافة قبل العنوان أكبر من بعده، فيرتبط بصرياً بما تحته لا بما فوقه.
 * ------------------------------------------------------------------------- */
body.single-post .entry-content :is(h2, h3, h4, h5) {
  font-family: var(--a-font);
  color: var(--a-ink);
  line-height: 1.45;
}

body.single-post .entry-content h2 {
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -.01em;
  margin-block: 2.1em .65em;
}

body.single-post .entry-content h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 600;
  margin-block: 1.8em .55em;
}

body.single-post .entry-content h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-block: 1.5em .5em;
}

body.single-post .entry-content > :is(h2, h3, h4):first-child {
  margin-block-start: 0;
}

/* ---------------------------------------------------------------------------
 *  6 · القوائم
 * ------------------------------------------------------------------------- */
body.single-post .entry-content :is(ul, ol) {
  max-width: var(--a-measure);
  padding-inline-start: 1.5em;
  margin-block: 0 1.2em;
}

body.single-post .entry-content li {
  line-height: 1.95;
  margin-block-end: .55em;
  padding-inline-start: .2em;
}

body.single-post .entry-content ul > li::marker { color: var(--a-accent); }
body.single-post .entry-content ol > li::marker { color: var(--a-accent); font-weight: 600; }

/* ---------------------------------------------------------------------------
 *  7 · الاقتباس
 *  حد جانبي لا علامات تنصيص — أهدأ وأرقى.
 * ------------------------------------------------------------------------- */
body.single-post .entry-content blockquote {
  border: 0;
  border-inline-start: 3px solid var(--a-accent);
  background: var(--a-accent-1);
  border-radius: 0 14px 14px 0;
  padding: 1.25em 1.6em;
  margin-block: 1.9em;
  max-width: var(--a-measure);
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--a-ink-2);
}

[dir="rtl"] body.single-post .entry-content blockquote {
  border-radius: 14px 0 0 14px;
}

body.single-post .entry-content blockquote p:last-child { margin-block-end: 0; }

body.single-post .entry-content blockquote cite {
  display: block;
  margin-block-start: .8em;
  font-size: .88rem;
  font-style: normal;
  font-weight: 600;
  color: var(--a-accent-7);
}

/* ---------------------------------------------------------------------------
 *  8 · الصور داخل المتن
 * ------------------------------------------------------------------------- */
body.single-post .entry-content :is(img, figure) {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

body.single-post .entry-content figure { margin-block: 2em; }

body.single-post .entry-content figcaption {
  margin-block-start: .7em;
  font-size: .86rem;
  line-height: 1.75;
  color: var(--a-ink-3);
  text-align: center;
}

/* صورة بعرض أوسع من عمود النص */
body.single-post .entry-content .alignwide,
body.single-post .entry-content .alignfull {
  max-width: min(100%, 1040px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------------------
 *  9 · الروابط والفواصل
 * ------------------------------------------------------------------------- */
body.single-post .entry-content a:not([class]) {
  color: var(--a-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s;
}

body.single-post .entry-content a:not([class]):hover { color: var(--a-accent-7); }

body.single-post .entry-content hr {
  border: 0;
  height: 1px;
  background: var(--a-line);
  margin-block: 2.6em;
  max-width: var(--a-measure);
}

body.single-post .entry-content :is(strong, b) { font-weight: 600; color: var(--a-ink); }

body.single-post .entry-content code {
  background: var(--a-line-2);
  padding: .15em .45em;
  border-radius: 5px;
  font-size: .9em;
  direction: ltr;
  display: inline-block;
}

/* ---------------------------------------------------------------------------
 *  10 · الجداول
 * ------------------------------------------------------------------------- */
body.single-post .entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  margin-block: 1.8em;
}

body.single-post .entry-content :is(th, td) {
  padding: .75em 1em;
  border-block-end: 1px solid var(--a-line);
  text-align: start;
  line-height: 1.75;
}

body.single-post .entry-content th {
  background: var(--a-accent-1);
  font-weight: 600;
  color: var(--a-ink);
  border-block-end: 2px solid var(--a-accent);
}

/* ---------------------------------------------------------------------------
 *  11 · مسار التنقل
 * ------------------------------------------------------------------------- */
body.single-post .ct-breadcrumbs {
  font-size: 13.5px;
  color: var(--a-ink-3);
  margin-block-end: 18px;
}

body.single-post .ct-breadcrumbs a {
  color: var(--a-ink-3);
  text-decoration: none;
}

body.single-post .ct-breadcrumbs a:hover { color: var(--a-accent); }

/* ---------------------------------------------------------------------------
 *  12 · نهاية المقالة
 * ------------------------------------------------------------------------- */
body.single-post .ct-share-box,
body.single-post .ct-related-posts,
body.single-post .author-box {
  margin-block-start: 2.6em;
  padding-block-start: 1.8em;
  border-block-start: 1px solid var(--a-line);
}

body.single-post .ct-module-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--a-ink);
  margin-block-end: 1em;
}

/* ---------------------------------------------------------------------------
 *  13 · التعليقات
 * ------------------------------------------------------------------------- */
body.single-post .ct-comments-container {
  margin-block-start: 2.6em;
  padding-block-start: 1.8em;
  border-block-start: 1px solid var(--a-line);
}

body.single-post .ct-comments textarea,
body.single-post .ct-comments input[type="text"],
body.single-post .ct-comments input[type="email"] {
  border-radius: 10px;
  border: 1px solid var(--a-line);
  font-family: var(--a-font);
  font-size: .95rem;
  padding: .8em 1em;
  transition: border-color .2s, box-shadow .2s;
}

body.single-post .ct-comments :is(textarea, input):focus {
  border-color: var(--a-accent);
  box-shadow: 0 0 0 3px rgba(14,110,94,.12);
  outline: none;
}

/* ---------------------------------------------------------------------------
 *  14 · الجوال
 * ------------------------------------------------------------------------- */
@media (max-width: 767px) {
  body.single-post .entry-content { font-size: 1rem; line-height: 1.88; }
  body.single-post .entry-content > p:first-of-type { font-size: 1.1rem; }
  body.single-post .entry-content blockquote {
    padding: 1em 1.2em;
    font-size: 1.05rem;
  }
  body.single-post .ct-media-container { border-radius: 12px; }
}

/* ---------------------------------------------------------------------------
 *  15 · الطباعة على الورق
 * ------------------------------------------------------------------------- */
@media print {
  body.single-post .entry-content { font-size: 11.5pt; line-height: 1.7; color: #000; }
  body.single-post .entry-content > p { max-width: none; }
  body.single-post :is(.ct-share-box, .ct-related-posts, .ct-comments-container) { display: none; }
  body.single-post .entry-content :is(h2, h3, h4) { page-break-after: avoid; }
}

/* ---------------------------------------------------------------------------
 *  16 · تقليل الحركة لمن يفضّلها
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  body.single-post .entry-content a,
  body.single-post .ct-comments :is(textarea, input) { transition: none; }
}