/* ============================================================
   v52 — طبقة تصميم ب5 (التطوير الثالث، قرارات 119–124، 2026-11-12)
   منقولة من النموذج المعتمد _build/b5/proto/assets/v3.css، وتُحمَّل آخر
   ملفات القالب (بعد main.css وrtl.css) كما كانت في النموذج تماماً.
   المرجع الحاكم: اتفاقات-ب5-التصميم.md
   - العلامة ج (الأرباع الأربعة) تضيء ربعاً ربعاً، والرقم 25/50/75/100 فقط
   - الصور بلا بطاقة، ونص كل خبر مربوط بصورته ومفصول عن جاره
   - خلفيات الأقسام كما في الحالي (الأعلى داكن، الأخبار كحلي، والشبكة الخفيفة ثابتة)
   - ألوان النص الأوضح ومتغيّرات الخطوط في main.css، والخطوط نفسها في fonts.css
   ============================================================ */
:root {
  --b5-line: rgba(255,255,255,.08);
  --b5-ease: cubic-bezier(.16, 1, .3, 1);
}
::selection { background: #0BDA51; color: #080C18; }
html { scrollbar-color: #1F2C48 #080C18; }
:focus-visible { outline: 2px solid #0BDA51; outline-offset: 3px; border-radius: 4px; }

/* --- الخط العربي للقراءة --- */
[dir="rtl"] body { font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif; font-weight: 700; letter-spacing: 0; }

/* --- الرأس --- */
.primary-nav .menu a { font-size: .875rem; font-weight: 500; letter-spacing: 0; text-transform: none; border-bottom: 0; background: none !important; }
.primary-nav .menu a:hover, .primary-nav .menu .current-menu-item > a { color: var(--clr-white); box-shadow: inset 0 -2px 0 #0BDA51; border-radius: 0; }
.lang-switcher { color: #fff; border-color: #2A3756; padding: 6px 14px; }

/* --- العلامة ج: أربعة أرباع = 4 × 90 دقيقة --- */
.brand-mark.s360-mark { width: 38px; height: 38px; }
.s360-mark .q { transition: opacity .45s var(--b5-ease); }
.is-reading .s360-mark .q { opacity: .2; }
.is-reading .s360-mark .q.on { opacity: 1; }
/* صافرة النهاية: النقطة تنبض مرة واحدة عند 100% */
.s360-mark.done circle { animation: b5-whistle .6s var(--b5-ease); transform-origin: 18px 18px; }
@keyframes b5-whistle { 50% { transform: scale(1.5); } }
/* الرقم بجانب الاسم: يظهر 25% مع أول ربع، ثم 50 ← 75 ← 100 (لا عدّ متواصل).
   يتبدّل كلوحة النتائج: الرقم الجديد يصعد من أسفل نافذة مقصوصة */
.s360-step {
  display: inline-block; overflow: hidden; height: 1.1em; line-height: 1.1;
  margin-inline-start: .55rem; font: 700 .8125rem/1.1 Inter, sans-serif; color: #0BDA51;
  font-variant-numeric: tabular-nums; vertical-align: middle;
}
.s360-step b { display: block; font-weight: 700; }
.s360-step.flip b { animation: b5-roll .45s var(--b5-ease); }
@keyframes b5-roll { from { transform: translateY(110%); } to { transform: none; } }

/* --- الحركة (قرار 121) --- */
/* ظهور المحتوى عند النزول: أقصر وأخف (كان 28px و0.6 ث بتتابع) */
.js-ready .reveal { transform: translateY(8px); transition: opacity .3s ease-out, transform .3s ease-out; transition-delay: 0s !important; }
/* انتقال الصورة من الخبر إلى المقال (المتصفحات الداعمة فقط، والباقي انتقال عادي) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.article-image img { view-transition-name: s360-photo; }
::view-transition-group(s360-photo) { animation-duration: .45s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
/* الوصول إلى المصادر: وميض قصير يدل على المكان */
.source-jump { color: inherit; text-decoration: underline; text-decoration-color: rgba(11,218,81,.5); text-underline-offset: 4px; }
.source-jump:hover { color: #0BDA51; }
.article-sources { border-radius: 14px; transition: box-shadow .3s; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.article-sources.flash { animation: b5-flash 1.4s ease-out; }
@keyframes b5-flash { 0%, 30% { box-shadow: 0 0 0 2px #0BDA51, 0 0 0 10px rgba(11,218,81,.12); } 100% { box-shadow: 0 0 0 2px transparent, 0 0 0 10px transparent; } }

/* --- الرئيسية: الخبر الرائد --- */
@media (min-width: 861px) { .lead-hero-grid { grid-template-columns: 1.25fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); } }
.lead-hero-media { border-radius: 14px; border: 0; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.lead-hero-media picture { display: block; width: 100%; height: 100%; } /* v54.2: غلاف صورة الهاتف الأصغر */
/* لا كشف لصورة الخبر الرائد: هي أكبر عنصر في الصفحة (LCP)، وإخفاؤها لحظة التحميل يؤخّر السرعة */
[dir="rtl"] .lead-hero-title { font-size: clamp(1.8rem, 3.3vw, 2.7rem); line-height: 1.45; }
.lead-hero-title { text-wrap: balance; }
.lead-hero-excerpt { font-size: 1.125rem; line-height: 1.9; color: var(--clr-text); max-width: 46ch; }
.btn-primary { border-radius: 10px; }

/* --- الأخبار: الصورة بلا بطاقة، والنص وحدة واحدة مع صورته --- */
.eyebrow { display: none; }
[dir="rtl"] .section h2, .section-row h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.text-link { text-transform: none; letter-spacing: 0; font-weight: 600; }
[dir="rtl"] .text-link::after { content: '←'; }

/* المسافة بين الأخبار (أفقياً) أكبر بثلاث مرات من المسافة بين الصورة ونصها،
   فتقرأ العين كل عمود خبراً واحداً. والأسطر متحاذية عبر الصف (subgrid):
   الوسم والتاريخ ثم العنوان ثم الملخص على نفس الارتفاع في الأخبار المتجاورة. */
.post-grid { column-gap: clamp(1.75rem, 3.2vw, 3rem); row-gap: 3rem; }
.post-card {
  background: none; border: 0; border-radius: 0; overflow: visible;
  display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0;
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--b5-line);
  transition: border-color .3s;
}
.post-card-body { display: contents; }
.post-card-media { border-radius: 12px; }
/* المرور بالماوس فقط (v53): في اللمس يعلق التأثير بعد الضغط ويظهر عند «رجوع» */
@media (hover: hover) and (pointer: fine) {
  .post-card:hover { transform: none; border-bottom-color: rgba(11,218,81,.55); }
  .post-card:hover .post-card-media img { transform: scale(1.035); }
  .post-card:hover .post-card-body h3 { color: #0BDA51; }
}
.post-card .meta-line { margin: 1rem 0 .55rem; align-self: start; }
.post-card-body h3 {
  font-size: 1.15rem; line-height: 1.55; font-weight: 600; margin: 0 0 .5rem; transition: color .2s;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
[dir="rtl"] .post-card-body h3 { font-size: 1.2rem; line-height: 1.7; }
.post-card-body p {
  color: var(--clr-text-sm); font-size: .9375rem; line-height: 1.75; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.meta-line { text-transform: none; letter-spacing: 0; font-size: .8125rem; font-weight: 500; align-items: center; }
.tag-chip { background: none !important; border: 0 !important; padding: 0 !important; font-weight: 600; }

/* --- المقال --- */
.article-hero { padding-block: calc(var(--header-h) + 2.5rem) 2rem; }
.article-hero .container-narrow, .article-flow, .single-article .container-narrow { width: min(720px, 100% - 2.5rem); }
.article-hero .meta-line { justify-content: flex-start; }
.article-hero h1 { text-align: start; margin-inline: 0; font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.35; text-wrap: balance; }
[dir="rtl"] .article-hero h1 { line-height: 1.5; }
.article-byline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--b5-line); }
.byline-author { color: var(--clr-text); }
.article-figure { width: min(1080px, 100% - 2.5rem); }
.article-image { border-radius: 14px; overflow: hidden; }
.article-image-note { font-size: .8125rem; color: var(--clr-text-sm); margin-top: .75rem; }
.article-content { font-size: 1.1875rem; line-height: 1.95; color: var(--clr-text); }
[dir="rtl"] .article-content { font-size: 1.1875rem; line-height: 2.05; }
.article-content p { margin-bottom: 1.5rem; }
.article-content p, .article-content li, [dir="rtl"] .article-content p, [dir="rtl"] .article-content li { font-size: inherit; line-height: inherit; }
.article-content strong { color: var(--clr-white); font-weight: 600; }
.article-content h2 { margin-top: 3.25rem; margin-bottom: 1rem; font-size: clamp(1.45rem, 2.4vw, 1.75rem); }
.article-content h2::before { content: ''; display: block; width: 36px; height: 3px; border-radius: 2px; background: #0BDA51; margin-bottom: 1rem; }
.article-content a { color: #0BDA51; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.tldr-card { background: #0D1527; border: 1px solid #1A2540; border-radius: 14px; padding: 1.5rem 1.75rem; }
.tldr-label { letter-spacing: 0; font-size: .9375rem; }
.tldr-card li { font-size: 1.0625rem; line-height: 1.85; color: var(--clr-white); margin-bottom: .85rem; }
.source-box { border: 1px solid #1A2540; border-inline-start-width: 1px; background: transparent; border-radius: 14px; }
.share-btn { background: transparent; }

/* --- العناوين الإنجليزية: IBM Plex Sans بحروف عادية (قرار 124).
   حروفها اللاتينية من ملفات IBM Plex Sans Arabic نفسها (العائلة واحدة).
   Bebas يبقى للاسم في الشعار ولعناوين الذيل القصيرة فقط. --- */
html[lang^="en"]:not([dir="rtl"]) :is(h1, h2, h3, h4, .lead-hero-title, .page-hero-title):not(.footer-grid h3) {
  font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
  text-transform: none; font-weight: 700; letter-spacing: -0.005em; text-wrap: balance;
}
html[lang^="en"]:not([dir="rtl"]) .lead-hero-title { font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.2; }
html[lang^="en"]:not([dir="rtl"]) .page-hero-title { font-size: clamp(2rem, 3.6vw, 2.75rem); line-height: 1.2; }
html[lang^="en"]:not([dir="rtl"]) .page-hero-title .subtitle { font-weight: 400; letter-spacing: 0; }
html[lang^="en"]:not([dir="rtl"]) .article-hero h1 { font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1.22; }
html[lang^="en"]:not([dir="rtl"]) .page-hero h1 { font-size: clamp(2rem, 3.6vw, 2.75rem); line-height: 1.2; }
html[lang^="en"]:not([dir="rtl"]) .section h2, html[lang^="en"]:not([dir="rtl"]) .section-row h2 { font-size: clamp(1.45rem, 2.2vw, 1.75rem); line-height: 1.25; }
html[lang^="en"]:not([dir="rtl"]) .post-card-body h3 { font-size: 1.1rem; line-height: 1.42; font-weight: 650; }
html[lang^="en"]:not([dir="rtl"]) .article-content h2 { font-size: clamp(1.35rem, 2vw, 1.55rem); line-height: 1.3; }
html[lang^="en"]:not([dir="rtl"]) .article-sources h2, html[lang^="en"]:not([dir="rtl"]) .source-timeline h2 { font-size: 1.3rem; }
html[lang^="en"]:not([dir="rtl"]) .page-content h2 { font-size: clamp(1.35rem, 2vw, 1.6rem); line-height: 1.3; }
html[lang^="en"]:not([dir="rtl"]) .page-content h3 { font-size: 1.15rem; line-height: 1.35; }

/* --- نموذج التواصل: قائمة «الموضوع» كانت بيضاء (القالب ينسّق الحقول النصية فقط) ---
   v53: WPForms يثبّت الارتفاع 43px ويجعل الحشو العمودي صفراً، فالحشو العمودي هنا كان يقص «اختر الموضوع».
   وقاعدته «div.wpforms-container-full select:not([multiple]) > option» أقوى من قاعدتنا،
   فكانت الخيارات أبيض على أبيض (موجودة وغير مرئية) في كروم الكمبيوتر. */
.contact-form-card .wpforms-field select {
  background-color: rgba(255,255,255,0.04) !important; color: #fff !important;
  border: 1px solid var(--clr-border) !important; border-radius: 12px !important;
  height: 43px !important; line-height: 41px !important;
  padding-block: 0 !important; padding-inline: 1rem 2.5rem !important;
  width: 100% !important; max-width: 100% !important;
  font-family: inherit !important; font-size: .9375rem !important; color-scheme: dark; box-shadow: none !important;
  --wpforms-field-border-color-spare: rgba(255,255,255,.55); /* لون سهم القائمة (كان داكناً لا يُرى) */
}
.contact-form-card .wpforms-field select:focus { outline: none !important; border-color: #0BDA51 !important; }
.contact-form-card .wpforms-field select > option,
.contact-form-card .wpforms-field select:not([multiple]) > option { background: #0F1629 !important; color: #fff !important; line-height: normal !important; }
.contact-form-card .wpforms-field select > option.placeholder,
.contact-form-card .wpforms-field select > option[disabled] { color: #8C9DAA !important; }

/* --- v53 (قرار 126): زر «نسخ» بجانب بريد التواصل --- */
.contact-copy {
  margin-inline-start: .6rem; padding: .3rem .8rem; min-height: 32px; vertical-align: middle;
  font-family: inherit; font-size: .8125rem; font-weight: 600; line-height: 1; color: var(--clr-text);
  background: transparent; border: 1px solid #2A3756; border-radius: 8px; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.contact-copy:hover, .contact-copy:focus-visible { border-color: #0BDA51; color: #0BDA51; }
.contact-copy.copied { border-color: #0BDA51; color: #0BDA51; }
.contact-copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- v53: قائمة الهاتف — كانت تعلق بعد النزول في الصفحة ---
   الرأس يأخذ «blur» عند النزول، و«backdrop-filter» يحبس القائمة الثابتة داخله (ارتفاعها 76px بدل الشاشة كلها)
   بينما تمرير الصفحة مقفل، فيبدو الموقع متجمداً. عند فتح القائمة يُرفع الـ blur ويصير الرأس داكناً مصمتاً. */
html.menu-open .site-header { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: #080C18; }
/* والشعار وزر القائمة يبقيان فوق القائمة المفتوحة، والزر يصير «×» لإغلاقها (كانت تغطيهما فلا تُغلق إلا باختيار صفحة) */
@media (max-width: 768px) {
  .header-inner > .brand, .header-inner > .menu-toggle, .header-inner > .lang-switcher { position: relative; z-index: 1001; }
  .menu-toggle span { transform-origin: center; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* --- v53: عنوان الخبر الرائد على الكمبيوتر يتبع عرض عموده لا عرض الشاشة ---
   كان المقاس بوحدة vw، فيكبر الخط مع الشاشة بينما العمود ثابت (1240px)، فيزيد عدد الأسطر كلما كبُرت النافذة.
   الآن المقاس نسبة من عرض عمود النص نفسه (cqi)، فيبقى عدد الأسطر ثابتاً تقريباً. الهاتف كما هو. */
@media (min-width: 861px) {
  .lead-hero-body { container-type: inline-size; }
  [dir="rtl"] .lead-hero-title { font-size: clamp(1.6rem, 8cqi, 2.7rem); }
  html[lang^="en"]:not([dir="rtl"]) .lead-hero-title { font-size: clamp(1.6rem, 7.3cqi, 2.5rem); }
}

/* --- v54 (قرار 128): الرأس والذيل بعرض النافذة كلها، وحوافهما متطابقة؛ المحتوى وحده في الوسط بعرض 1240px.
   (ألغي تقييد الرأس في v53.) الحشو الجانبي نفسه في الاثنين: 1.5rem، و0.875rem تحت 860px. --- */
.site-footer > .container { width: 100%; max-width: none; padding-inline: 1.5rem; }
@media (max-width: 860px) { .site-footer > .container { padding-inline: .875rem; } }

/* --- v54: عمود الشعار في الذيل ثلاثة أسطر مثل باقي الأعمدة (العنوان + رابطان)، وأسطره على نفس خطوطها:
   الشعار بارتفاع العنوان، والجملتان بمقاس الروابط ومسافتها. --- */
/* لا عمود أضيق من نصه: «السياسة التحريرية والتصحيحات» كانت تنكسر سطرين عند ~1080px فتخرج عن المحاذاة */
@media (min-width: 1025px) { .footer-grid { grid-template-columns: minmax(max-content, 2fr) repeat(3, minmax(max-content, 1fr)); } }
@media (min-width: 769px) { /* الأعمدة متجاورة؛ في الهاتف تتراص فلا حاجة للمحاذاة */
  .site-footer .footer-grid .brand { height: 40px; }
  .footer-grid h3 { height: 40px; display: flex; align-items: center; margin-bottom: 1rem; }
}
.footer-grid .footer-tagline { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0 0; font-size: .9375rem; line-height: 1.65; color: var(--clr-text); }
.footer-tagline span { display: block; }
.footer-grid li { font-size: .9375rem; line-height: 1.65; }

/* --- v54: زر المحادثة الثابت كان يغطي آخر سطر في الذيل («لكرة القدم الحديثة»).
   مساحة أسفل الذيل بقدر الزر، فيبقى النص فوقه عند نهاية الصفحة. --- */
.site-footer { padding-bottom: 5.5rem; }

/* كل حركة تتوقف أو تخف عند «تقليل الحركة» */
@media (prefers-reduced-motion: reduce) {
  .s360-mark.done circle, .s360-step.flip b, .article-sources.flash { animation: none; }
  .article-sources.flash { box-shadow: 0 0 0 2px #0BDA51; }
  .post-card-media img, .s360-mark .q { transition: none; }
}
@media (max-width: 860px) {
  .article-content, [dir="rtl"] .article-content { font-size: 1.0938rem; }
  .post-grid { row-gap: 2.25rem; }
  .lang-switcher { padding: 4px 9px; }
  .header-inner { padding-inline: .875rem; gap: .875rem; }
  .brand-mark.s360-mark { width: 32px; height: 32px; }
  .s360-step { font-size: .75rem; margin-inline-start: .35rem; }
}
