/* ahdath-compat.css — طبقة توافق ثيم «الأحداث السعودية» فوق بناء Tailwind القديم (ahdath.css).
   1) قواعد CSS الحرجة المضمّنة في __inc/public_header.php وnews.php القديمين (لم تكن في style.css).
   2) متغيرات زامن التي تستهلكها article-tools.css (معرّفة في main.css غير المحمَّل هنا) بألوان أحداث.
   3) تنسيق مكوّنات زامن المحقونة في المتن (read-also · إعلانات) بمظهر الموقع القديم.
   غير مطبَّق في @layer عمداً كي يغلب طبقات Tailwind (D3). */

:root {
  --color-bg-card: #ffffff;
  --color-border: #e5e7eb;
  --color-breaking: #dc2626;
  --color-primary: #064e3b;
  --color-text: #1f2937;
  --color-text-secondary: #4b5563;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-md: 1.0625rem;
  --font-size-sm: 0.8125rem;
  --font-size-xs: 0.75rem;
  --radius-lg: 12px;
  --spacing-lg: 24px;
  --spacing-md: 16px;
  --transition-fast: 150ms ease;
}

/* ── يُلغي ما يفرضه CSS زامن الحرج المضمَّن في <head> (خلفية/خط/حاوية) ── */
html { line-height: 1.5; }
body { margin: 0; line-height: inherit; font-size: 16px; font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f9fafb; color: inherit; }
.container { width: 100%; max-width: none; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px)  { .container { max-width: 640px; } }
@media (min-width: 768px)  { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
.skip-link { position: absolute; top: -40px; right: 0; background: #064e3b; color: #fff; padding: 8px; z-index: 100; }
.skip-link:focus { top: 0; }

/* ── CSS الحرج للهيدر القديم ── */
.gradient-top-bar { background: linear-gradient(90deg, #022c22 0%, #064e3b 50%, #022c22 100%); height: 10px; width: 100%; display: block; }
.site-logo-img { width: 160px; height: 60px; object-fit: contain; aspect-ratio: 160/60; }
@media (max-width: 767px) { .site-logo-img { width: 100px; height: 40px; aspect-ratio: 100/40; } }
.social-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; transition: all .2s; }
.social-btn svg { width: 16px; height: 16px; }
#mobile-menu { transition: all .3s ease; }
#search-box { transition: all .2s ease; }

/* ── CSS صفحة الخبر القديمة ── */
.hero-image-container { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: .75rem .75rem 0 0; background: #f3f4f6; }
.hero-image-container img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.related-image-container { position: relative; width: 100%; height: 8rem; overflow: hidden; border-radius: .375rem; background: #f3f4f6; }
.related-image-container img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.content-body { font-family: 'Tajawal', sans-serif; }
.content-body p { margin-bottom: 1.8rem; }
.content-body img { max-width: 100%; height: auto !important; width: auto !important; display: block; margin: 2.5rem auto; border-radius: .5rem; }
.content-body blockquote { border-right: 4px solid #d4af37; padding: 1.5rem 1rem; background: #fdfdfd; color: #1f2937; border-radius: .5rem; margin: 2.5rem 0; font-style: italic; }
.content-body a { color: #064e3b; text-decoration: underline; text-underline-offset: 3px; }
.content-body h2, .content-body h3 { color: #064e3b; font-weight: 800; margin: 2rem 0 1rem; line-height: 1.5; }
.content-body h2 { font-size: 1.5rem; } .content-body h3 { font-size: 1.25rem; }
.content-body ul { list-style: disc; padding-right: 1.5rem; margin-bottom: 1.5rem; }
.content-body ol { list-style: decimal; padding-right: 1.5rem; margin-bottom: 1.5rem; }
.content-body iframe { max-width: 100%; }
.content-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 1rem; }
.content-body td, .content-body th { border: 1px solid #e5e7eb; padding: .5rem .75rem; }

/* ── «اقرأ أيضاً» المحقون من زامن بمظهر الصندوق الكهرماني القديم ── */
.read-also { margin: 1.5rem 0; padding: 1rem; background: #fffbeb; border-right: 4px solid #064e3b; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.read-also__header { color: #064e3b; font-weight: 700; font-size: .875rem; margin-bottom: .75rem; }
.read-also__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.read-also__item { display: flex; align-items: center; gap: .75rem; }
.read-also__item img { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; margin: 0 !important; flex-shrink: 0; }
.read-also__item a { color: #1f2937; font-weight: 700; font-size: .9rem; line-height: 1.6; text-decoration: none; }
.read-also__item a:hover { color: #064e3b; }

/* ── حاويات الإعلانات (من news.php القديم) ── */
.ad-slot, .ad-container { display: flex; align-items: center; justify-content: center; margin: 1.5rem 0; }

/* ── إصلاحات preflight لجزئيات زامن (أدوات القراءة · التفاعلات · المتابعة) ── */
.reader-tools button, .reader-pop button, .article-reactions button, .article-follow a { font-family: inherit; }
.reader-tools ul, .reader-pop ul, .article-reactions ul { list-style: none; margin: 0; padding: 0; }
.reader-tools, .article-reactions, .article-follow { margin-top: 1rem; margin-bottom: 1rem; }
.reader-tools svg, .reader-pop svg, .article-reactions svg, .article-follow svg { display: inline-block; }

/* ── الصفحات الثابتة (من page.php القديم) ── */
.content-body--page h2 { font-size: 1.6rem; font-weight: 800; color: #064e3b; margin-top: 3rem; margin-bottom: 1.2rem; border-right: 4px solid #d4af37; padding-right: 1rem; }
.content-body--page h3 { font-size: 1.3rem; font-weight: 700; color: #1f2937; margin-top: 2.5rem; margin-bottom: 1rem; }
.content-body--page ul { list-style-type: disc; list-style-position: inside; margin-bottom: 1.8rem; color: #374151; background: #f9fafb; padding: 1.5rem; border-radius: .5rem; }
.content-body--page li { margin-bottom: .5rem; }
