/* =========================================================
   أخبار الوظائف — نظام التصميم الجديد (هوية 2026)
   الألوان مستخرجة بدقة من الشعارين:
   نهاري: خلفية #FDFDFD · أزرق #4299FE→#81C2FC · كحلي #0B2243
   ليلي:  خلفية #051230 · أزرق #3382F6→#6AB3FC · أبيض #F9F9FB
   الخط: Tajawal (نفس خط الموقع السابق وبنفس الأحجام)
   ========================================================= */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f4f7fc;
    --header-bg: #fdfdfd;
    --text: #21324f;
    --text-strong: #0b2243;
    --text-muted: #566175;
    --border: #e2e8f2;
    --primary: #3382f6;
    --primary-2: #4299fe;
    --primary-3: #81c2fc;
    --primary-soft: #e8f1fe;
    --link: #2a6fd4;
    --success: #0f6c33;
    --success-bg: #d6f5e3;
    --success-bd: #4ade80;
    --danger: #b91c1c;
    --danger-bg: #fde3e3;
    --danger-bd: #f48989;
    --warn: #9a3412;
    --warn-bg: #ffe8d1;
    --warn-bd: #fb923c;
    --neutral: #334155;
    --neutral-bg: #e4e9f0;
    --neutral-bd: #94a3b8;
    --logo-chip-bg: #ffffff;
    --shadow: 0 1px 3px rgba(11, 34, 67, .07), 0 1px 2px rgba(11, 34, 67, .05);
    --shadow-lg: 0 10px 30px rgba(11, 34, 67, .12);
    --footer-bg: #e9edf4;
    --footer-text: #2b3852;
    --footer-head: #0f1a2e;
    --footer-link: #22314d;
    --footer-muted: #42506b;
    --footer-border: rgba(20, 33, 58, .16);
    --footer-btn-bg: rgba(20, 33, 58, .06);
    --radius: 16px;
    color-scheme: light;
}

/* الوضع الليلي = وضع القراءة الرمادي:
   صفحة رمادية فاتحة (#e4e4e7) وكروت وصندوق خبر أبيض،
   والهوية الكحلية الغامقة (لون الشعار) في الهيدر والفوتر فقط */
[data-theme="dark"] {
    --bg: #e4e4e7;
    --surface: #ffffff;
    --surface-2: #f2f2f4;
    --header-bg: #051230;
    --text: #222b3f;
    --text-strong: #0f1a2e;
    --text-muted: #4d5566;
    --border: #cbccd2;
    --primary: #3382f6;
    --primary-2: #4299fe;
    --primary-3: #81c2fc;
    --primary-soft: #e8f1fe;
    --link: #2a6fd4;
    --success: #0f6c33;
    --success-bg: #d9efe2;
    --success-bd: #6fc890;
    --danger: #a61b1b;
    --danger-bg: #f7dcdc;
    --danger-bd: #e39090;
    --warn: #8f3410;
    --warn-bg: #f6e3cd;
    --warn-bd: #e0a468;
    --neutral: #3a4657;
    --neutral-bg: #e6e8ec;
    --neutral-bd: #aab0ba;
    --logo-chip-bg: #ffffff;
    --footer-bg: #051230;
    --footer-text: #c6d3ec;
    --footer-head: #f5f8fe;
    --footer-link: #c6d3ec;
    --footer-muted: #93a5c7;
    --footer-border: rgba(147, 178, 229, .14);
    --footer-btn-bg: rgba(147, 178, 229, .10);
    --shadow: 0 1px 3px rgba(15, 26, 46, .08);
    --shadow-lg: 0 10px 28px rgba(15, 26, 46, .16);
    color-scheme: light;
}

/* الهيدر الكحلي في الوضع الرمادي: نصوص وأزرار فاتحة عليه */
[data-theme="dark"] .site-header .nav-link { color: #d4dcec; }
[data-theme="dark"] .site-header .nav-link:hover { background: rgba(106, 179, 252, .16); color: #81c2fc; }
[data-theme="dark"] .site-header .nav-link.is-active { background: var(--primary); color: #fff; }
[data-theme="dark"] .site-header .brand-name,
[data-theme="dark"] .drawer-head .brand-name { color: #f5f8fe; }
[data-theme="dark"] .site-header .icon-btn,
[data-theme="dark"] .drawer-head .icon-btn {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
    color: #dbe4f5;
}
[data-theme="dark"] .site-header .icon-btn:hover,
[data-theme="dark"] .drawer-head .icon-btn:hover { border-color: #6ab3fc; color: #6ab3fc; }

/* ---------- الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* خط احتياطي مضبوط الأبعاد ليطابق مساحة Tajawal قبل تحميله،
   فلا يقفز النص عند وصول الخط الحقيقي (يقلّل Cumulative Layout Shift) */
@font-face {
    font-family: 'Tajawal Fallback';
    src: local('Segoe UI'), local('Tahoma'), local('Arial');
    size-adjust: 96%;
    ascent-override: 96%;
    descent-override: 26%;
    line-gap-override: 0%;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Tajawal', 'Tajawal Fallback', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
    transition: background-color .25s ease, color .25s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
h1, h2, h3, h4 { color: var(--text-strong); font-weight: 500; line-height: 1.6; }
::selection { background: var(--primary); color: #fff; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.container-x { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- أيقونات SVG ---------- */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.22em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--fill { fill: currentColor; stroke: none; }

/* ---------- الهيدر ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 10px rgba(5, 18, 48, .06);
    transition: background-color .25s ease;
}

.header-row { display: flex; align-items: center; gap: 10px; height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 44px; height: 44px; display: block; }
.brand-mark--dark { display: none; }
[data-theme="dark"] .brand-mark--light { display: none; }
[data-theme="dark"] .brand-mark--dark { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 17px; font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.brand-domain { font-size: 10px; letter-spacing: .18em; color: #145bb5; font-weight: 700; }
[data-theme="dark"] .brand-domain { color: #6ab3fc; }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 44px = الحد الأدنى الموصى به لمنطقة اللمس على الجوال */
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s, color .2s, transform .15s, background-color .2s;
    padding: 0;
    font-size: 16px;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.icon-btn .ico { width: 19px; height: 19px; }

/* زر الثيم: تظهر الشمس في الليلي والقمر في النهاري */
.theme-ico-sun { display: none; }
[data-theme="dark"] .theme-ico-sun { display: block; }
[data-theme="dark"] .theme-ico-moon { display: none; }

/* قائمة سطح المكتب */
.nav-desktop { display: none; }
@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
        align-items: center;
        gap: 2px;
        flex-wrap: nowrap;
        padding: 0 0 10px;
    }
    .header-burger { display: none; }
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    transition: background-color .2s, color .2s;
    white-space: nowrap;
}
.nav-link .ico { width: 15px; height: 15px; color: var(--primary); }
.nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.nav-link.is-active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-link.is-active .ico { color: #fff; }

/* قائمة «المزيد» المنسدلة في سطح المكتب */
.nav-more { position: relative; }
.nav-more-btn { border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.nav-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 70;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav-more:hover .nav-more-menu,
.nav-more:focus-within .nav-more-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-more:hover .nav-more-btn .ico:last-child,
.nav-more:focus-within .nav-more-btn .ico:last-child { transform: rotate(180deg); }
.nav-more-btn .ico:last-child { transition: transform .18s ease; }
.nav-more-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    transition: background-color .2s, color .2s;
    white-space: nowrap;
}
.nav-more-link .ico { width: 15px; height: 15px; color: var(--primary); }
.nav-more-link:hover { background: var(--primary-soft); color: var(--primary); }
.nav-more-link.is-active { background: var(--primary); color: #fff; }
.nav-more-link.is-active .ico { color: #fff; }

/* ---------- قائمة الجوال (درج جانبي) ---------- */
.scrim {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 25, .55);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(320px, 88vw);
    background: var(--surface);
    z-index: 100;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2, .7, .3, 1);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}
[dir="rtl"] .drawer { transform: translateX(100%); }
.drawer.open { transform: translateX(0); }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
}
.drawer-nav { padding: 10px; }
.drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    transition: background-color .2s, color .2s;
}
.drawer-link:hover, .drawer-link.is-active { background: var(--primary-soft); color: var(--primary); }
.drawer-link .ico { color: var(--primary); }
.drawer-sep { border: 0; border-top: 1px solid var(--border); margin: 8px 12px; }
.drawer-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--border); }
.drawer-social { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.drawer-social a { color: var(--text-muted); transition: color .2s, transform .15s; font-size: 20px; }
.drawer-social a:hover { color: var(--primary); transform: translateY(-2px); }
.store-badges { display: flex; flex-direction: column; gap: 8px; }
.store-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-strong);
    font-size: 13px;
    transition: border-color .2s, transform .15s;
}
.store-badge:hover { border-color: var(--primary); transform: translateY(-1px); }
.store-badge .ico { width: 18px; height: 18px; }

/* ---------- شارات حالة الوظائف (أعلى الصفحات) ---------- */
.chips {
    display: flex;
    gap: 8px;
    padding: 14px 2px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .chips { justify-content: center; flex-wrap: wrap; overflow: visible; } }

/* كل شريحة تحمل لونها الدلالي عبر متغيرات محلية:
   --c اللون الصريح · --c-bg خلفيته الفاتحة · --c-bd حدّه الوسيط */
.chip {
    --c: var(--primary);
    --c-bg: var(--primary-soft);
    --c-bd: var(--primary-3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: all .2s ease;
}
.chip--now      { --c: var(--success); --c-bg: var(--success-bg); --c-bd: var(--success-bd); }
.chip--soon     { --c: var(--neutral); --c-bg: var(--neutral-bg); --c-bd: var(--neutral-bd); }
.chip--soon-end { --c: var(--warn);    --c-bg: var(--warn-bg);    --c-bd: var(--warn-bd); }
.chip--end      { --c: var(--danger);  --c-bg: var(--danger-bg);  --c-bd: var(--danger-bd); }

.chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--c);
    box-shadow: 0 0 0 3px var(--c-bg);
    flex: none;
}
.chip:hover {
    border-color: var(--c-bd);
    background: var(--c-bg);
    color: var(--c);
    transform: translateY(-1px);
}
.chip.is-active {
    background: var(--c);
    border-color: var(--c);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px -4px var(--c);
}
.chip.is-active .dot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .30); }

/* نبضة حيّة على نقطة «متاح الآن» — الحلقة الثابتة تبقى وتتوسع حلقة ثانية وتتلاشى */
@keyframes chip-pulse {
    0%   { box-shadow: 0 0 0 3px var(--c-bg), 0 0 0 0 var(--c-bd); }
    70%  { box-shadow: 0 0 0 3px var(--c-bg), 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 3px var(--c-bg), 0 0 0 0 transparent; }
}
.chip--now .dot { animation: chip-pulse 2.2s ease-out infinite; }
.chip--now.is-active .dot { animation: none; }
@media (prefers-reduced-motion: reduce) { .chip--now .dot { animation: none; } }

/* ---------- عناوين الأقسام ---------- */
.page-head { text-align: center; padding: 18px 10px 6px; }
.page-title { font-size: 1.5rem; margin: 0 0 4px; }         /* نفس مقاس text-2xl السابق */
.page-sub { font-size: 13px; color: var(--text-muted); margin: 0; }
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    margin: 30px 2px 14px;
    color: var(--text-strong);
    font-weight: 500;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section-title .ico { color: var(--primary); }

/* حالة «لا توجد نتائج» — تمنع ظهور الصفحة فارغة وكأنها تحت الإنشاء */
.empty-state {
    margin: 8px 0 18px;
    padding: 26px 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 14px;
    line-height: 2;
    color: var(--text-muted);
}
.empty-state a { color: var(--link); font-weight: 700; }
.empty-state a:hover { text-decoration: underline; }

/* ---------- شبكة الكروت ---------- */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 8px 0 4px;
}
@media (min-width: 640px)  { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(3, 1fr); gap: 16px; } }

.job-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 14px 10px;
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    position: relative;
}
.job-card:hover { transform: translateY(-3px); border-color: var(--primary-3); box-shadow: var(--shadow-lg); }

/* الصف العلوي: التصنيف يمينًا، عمر الخبر في المنتصف، والحالة في الطرف الآخر */
.job-badges { display: flex; align-items: center; gap: 6px; min-width: 0; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    flex: none;
}
.badge .ico { width: 11px; height: 11px; }
.badge--cat { background: var(--primary-soft); color: var(--link); text-overflow: ellipsis; display: inline-block; flex: 0 1 auto; min-width: 0; }
.badge--cat:hover { background: var(--primary); color: #fff; }
.badge--now  { background: var(--success-bg); color: var(--success); }
.badge--soon { background: var(--neutral-bg); color: var(--neutral); }
.badge--soon-end { background: var(--warn-bg); color: var(--warn); }
.badge--end  { background: var(--danger-bg); color: var(--danger); }

.job-time {
    margin-inline: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    flex: none;
}
.job-time .ico { width: 11px; height: 11px; }

/* نقطة «متاح الآن» النابضة */
.live-dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; position: relative; flex: none; }
.live-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    background: currentColor;
    opacity: .35;
    animation: live-ping 2.2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes live-ping {
    0%       { transform: scale(.45); opacity: .35; }
    75%, 100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; opacity: 0; } }

.job-main { display: flex; gap: 12px; margin-top: 6px; align-items: center; flex: 1 1 auto; min-width: 0; }
.org-logo-link { flex: 0 0 auto; display: block; }
.org-logo {
    width: 86px;
    height: 86px;
    flex: none;
    border-radius: 999px;
    object-fit: contain;
    background: var(--logo-chip-bg);
    border: 1px solid var(--border);
    padding: 4px;
    font-size: 0;
}
.job-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.job-title a { color: var(--text-strong); transition: color .2s; }
.job-title a:hover { color: var(--primary); }
/* رابط يغطي الكرت كاملًا للنقر المريح مع بقاء الروابط الداخلية تعمل */
.job-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.job-badges a, .org-logo-link { position: relative; z-index: 2; }

/* تذييل التواريخ: خانتان بتسمية واضحة بدل الصناديق الملوّنة */
.job-dates {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.date-cell { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 0; padding-inline: 6px; }
.date-cell + .date-cell { border-inline-start: 1px solid var(--border); }
.date-label { font-size: 11px; font-weight: 500; color: var(--text-muted); line-height: 1.3; }
.date-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
}
.date-value .ico { width: 12px; height: 12px; }
.date-value--start { color: var(--success); }
.date-value--end   { color: var(--danger); }

/* بطاقات بلا تواريخ تقديم: خانة تاريخ النشر بنفس بنية التذييل لموازنة الارتفاع */
.job-dates--single { grid-template-columns: 1fr; }
.date-value--pub { color: var(--text); }


/* ---------- صفحة الخبر ---------- */
.article-wrap { max-width: 960px; margin-inline: auto; }

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 14px 2px 0;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { opacity: .5; }

/* ترويسة الخبر داخل الصندوق: الشعار + العنوان + بيانات الكاتب والتصنيف */
.article-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
/* عند وجود شريط التواريخ تحتها يُلغى الفاصل المزدوج */
.article-head.has-dates { border-bottom: 0; margin-bottom: 0; padding-bottom: 12px; }
.article-logo-link { flex: none; display: block; }
.article-org-logo {
    width: 100px;
    height: 100px;
    border-radius: 999px;
    object-fit: contain;
    background: var(--logo-chip-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 5px;
    display: block;
    font-size: 0;
    transition: transform .2s;
}
.article-org-logo:hover { transform: scale(1.04); }
.article-head-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.article-head .article-meta { justify-content: center; margin-bottom: 0; }

/* شريط التواريخ: حزام بعرض الصندوق بنفس ستايل الكرت */
.job-dates--article {
    margin: 0 0 16px;
    padding: 10px 4px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .article-head { flex-direction: column; gap: 12px; }
    .article-head-info { align-items: center; gap: 10px; }
    .article-head .article-title { font-size: 1.15rem; text-align: center; }
    .article-head .article-title::after { margin-inline: auto; }
    .article-head .article-meta { justify-content: center; }

    /* عند وجود 3 شرائح فأكثر: شبكة 2×2 متوازنة بدل التفاف متعرج */
    .article-head .article-meta:has(> .meta-chip:nth-child(3)) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }
    .article-head .article-meta:has(> .meta-chip:nth-child(3)) .meta-chip {
        justify-content: center;
        min-width: 0;
    }
}

.article-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.8;
    font-weight: 700;
    color: var(--text-strong);
    text-align: start;
}
.article-title::after {
    content: "";
    display: block;
    width: 58px;
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary-2), var(--primary-3));
    margin-top: 8px;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 18px;
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.meta-chip .ico { width: 13px; height: 13px; color: var(--primary); flex: none; }
/* النص الطويل داخل الشريحة يُقتص بثلاث نقاط بدل كسر الشكل */
.meta-chip .chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.meta-chip:hover { border-color: var(--primary); color: var(--primary); }

.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 22px;
    margin: 16px 0 26px;
}
@media (max-width: 640px) { .article-card { padding: 16px; border-radius: var(--radius); } }

.article-body { direction: rtl; text-align: right; color: var(--text); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 1.3rem; line-height: 1.9; }
.article-body p {
    margin: 0 0 1rem;
    font-size: 1.3rem;               /* نفس خط نص الخبر — موحّد بين الأخبار الوظيفية والعامة */
    line-height: 1.9;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.article-body a { color: var(--link); }
.article-body a:hover { text-decoration: underline; }
.article-body img { border-radius: 12px; margin-inline: auto; }
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.article-body td, .article-body th { border: 1px solid var(--border); padding: 8px 10px; }

/* عند القفز من جدول المحتويات: إبقاء العنوان ظاهرًا تحت الهيدر الثابت */
.article-body h2[id], .article-body h3[id] { scroll-margin-top: 80px; }

/* جدول المحتويات للمقالات الطويلة */
.toc-box {
    margin: 0 0 18px;
    padding: 12px 16px;
    background: var(--primary-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.toc-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}
.toc-title .ico { width: 13px; height: 13px; }
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.toc-item a { font-size: 14px; color: var(--link); }
.toc-item a:hover { text-decoration: underline; }
.toc-item--sub { padding-inline-start: 16px; }

.article-actions { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 6px; }
@media (min-width: 640px) { .article-actions { flex-direction: row; } .article-actions > a { flex: 1; } }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 500;
    transition: transform .15s, box-shadow .2s, filter .2s;
    text-align: center;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn--primary { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 6px 18px rgba(51, 130, 246, .35); }
.btn--dark { background: linear-gradient(135deg, #1e4272, #0b2243); color: #fff; box-shadow: 0 6px 18px rgba(11, 34, 67, .3); }
.btn--dark:hover { color: #fff; }

/* ---------- كرت الخبر العام (سلايدر الرئيسية + صفحة القسم) ----------
   طابع موحّد مهما اختلفت ألوان البنرات: العنوان داخل الصورة فوق طبقة
   تدرج كحلية من هوية الموقع، تعمل في الوضعين الفاتح والداكن لأنها تعلو
   الصورة نفسها — CSS فقط، بلا صور إضافية ولا JS */
.gn-card {
    position: relative;
    background: linear-gradient(160deg, #1e4272, #0b2243 60%, #051230);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: transform .18s ease, box-shadow .18s ease;
}
.gn-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg, var(--shadow)); }
.gn-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}
.gn-card:hover .gn-card-img { transform: scale(1.045); }
.gn-card-noimg {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #81c2fc;
    font-size: 2.2rem;
}
/* طبقة التظليل تغطي الصورة كاملة بلون الهوية — درجتها لكل ثيم عبر المتغيرين */
:root {
    --gn-scrim-top: rgba(11, 34, 67, .30);
    --gn-scrim-bottom: rgba(11, 34, 67, .90);
}
[data-theme="dark"] {
    --gn-scrim-top: rgba(5, 18, 48, .36);
    --gn-scrim-bottom: rgba(5, 18, 48, .93);
}
.gn-card-body {
    position: absolute;
    inset: 0;
    display: flex;
    /* عمودي مع الدفع للأسفل: العنوان ثم تاريخ النشر تحته.
       التاريخ كان hidden — وإظهاره إشارة حداثة يقرؤها الزائر والمراجع معًا. */
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
    background: linear-gradient(to top, var(--gn-scrim-bottom) 0%, var(--gn-scrim-top) 100%);
    pointer-events: none;
}
.gn-card-date { font-size: .75rem; font-weight: 500; color: rgba(255, 255, 255, .8); }
.gn-card-title {
    font-size: .92rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    text-align: start;
}
@media (max-width: 640px) {
    .gn-card-body { padding: 9px; }
    .gn-card-title { font-size: .8rem; line-height: 1.5; }
}

/* بنر الخبر العام (1350×450): مُصغّر ومتوسّط داخل الصندوق ويتقلص تلقائيًا على الجوال */
.article-banner {
    display: block;
    width: 100%;
    max-width: 680px;
    height: auto;
    margin: 0 auto 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* صندوق مصادر الخبر العام */
.gn-sources { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--border); }
.gn-sources-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-strong);
}
.gn-sources-title .ico { width: 17px; height: 17px; color: var(--primary); }
.gn-sources-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 10px;
}
/* السماح للخانة بالانكماش دون عرض الاسم الطويل حتى يعمل الاقتصاص بدل تجاوز الشاشة */
.gn-sources-list > li { min-width: 0; }
.gn-source-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: .9rem;
    font-weight: 500;
    transition: border-color .2s, color .2s, transform .15s, box-shadow .2s;
}
.gn-source-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.gn-source-num {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-2), var(--primary));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
}
.gn-source-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gn-source-ext { flex: none; width: 14px; height: 14px; color: var(--text-muted); }
.gn-source-link:hover .gn-source-ext { color: var(--primary); }
@media (max-width: 640px) { .gn-sources-list { grid-template-columns: 1fr; } }

/* ---------- سطر التقديم الآمن أسفل الخبر ----------
   شريط واحد منخفض الارتفاع بنبرة إرشادية هادئة — لا ألوان خطر صارخة
   توحي للزائر بوجود مشكلة، والتفاصيل الكاملة خلف رابط «اعرف المزيد» */
.safety-line {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 16px 0 2px;
    padding: 10px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--warn-bd);
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-muted);
}
.safety-line .ico { flex: none; width: 16px; height: 16px; margin-top: .28em; color: var(--warn); }
.safety-line a { color: var(--link); font-weight: 700; white-space: nowrap; }
.safety-line a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 640px) { .safety-line { font-size: 12.5px; padding: 9px 11px; } }

.share-box { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--border); text-align: center; }
.share-box .share-title { font-size: 14px; color: var(--text-muted); margin: 0 0 12px; font-weight: 400; }
.share-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    color: #fff;
    transition: transform .15s, filter .2s;
}
.share-btn:hover { transform: translateY(-3px) scale(1.05); filter: brightness(1.1); }
.share-btn .ico { width: 20px; height: 20px; }
.share-btn--x { background: #10141a; }
[data-theme="dark"] .share-btn--x { background: #2e3946; }
.share-btn--wa { background: #25d366; }
.share-btn--tg { background: #2aabee; }
.share-btn--mail { background: #64748b; }
.share-btn--copy { background: var(--primary); }

/* ---------- الترقيم ---------- */
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; padding: 26px 0 10px; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    transition: border-color .2s, color .2s, transform .15s;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.page-link.is-current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.page-link.is-disabled { opacity: .4; pointer-events: none; }
.page-dots { color: var(--text-muted); padding: 0 2px; }

/* ---------- البحث ---------- */
.search-hero { max-width: 620px; margin: 10px auto 30px; }
.search-form {
    display: flex;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    box-shadow: var(--shadow);
    transition: border-color .2s, box-shadow .2s;
}
.search-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-strong);
    font-family: inherit;
    font-size: 15px;
    padding: 8px 10px;
}
.search-input:focus { outline: none; }
.search-input::placeholder { color: var(--text-muted); }
.search-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary-2), var(--primary));
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: 11px;
    transition: transform .15s, filter .2s;
}
.search-submit:hover { transform: translateY(-1px); filter: brightness(1.07); }

.empty-state { text-align: center; color: var(--text-muted); padding: 40px 10px; font-size: 14px; }
.empty-state .ico { width: 40px; height: 40px; margin-bottom: 10px; color: var(--border); }

/* ---------- الصفحات النصية (خصوصية/شروط/من نحن/اتصل) ---------- */
.prose-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 30px;
    direction: rtl;
    text-align: right;
}
@media (max-width: 640px) { .prose-card { padding: 18px; } }
.prose-card h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
.prose-card h2:first-child { margin-top: 0; }
.prose-card h3 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.prose-card p, .prose-card li { font-size: 15px; line-height: 1.9; color: var(--text); }
.prose-card ul { padding-inline-start: 22px; }
.prose-card a { color: var(--link); }
.prose-card a:hover { text-decoration: underline; }
.prose-card .note { font-size: 12.5px; color: var(--text-muted); }

.contact-cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
@media (min-width: 640px) { .contact-cards { grid-template-columns: repeat(2, 1fr); } }
.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text-strong);
    transition: border-color .2s, transform .15s;
}
.contact-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.contact-card .ico { width: 22px; height: 22px; color: var(--primary); }
.contact-card small { display: block; color: var(--text-muted); font-size: 12px; }

/* ---------- الفوتر (يتلوّن مع كل وضع عبر متغيرات الثيم) ---------- */
.site-footer {
    margin-top: 46px;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 3px solid var(--primary);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 34px 0 24px;
}
@media (min-width: 768px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

.footer-brand img { width: 130px; border-radius: 18px; margin-bottom: 12px; }
.footer-logo--dark { display: none; }
[data-theme="dark"] .footer-logo--light { display: none; }
[data-theme="dark"] .footer-logo--dark { display: block; }
.footer-brand p { font-size: 13px; line-height: 1.9; color: var(--footer-muted); margin: 0; max-width: 320px; direction: rtl; text-align: justify; }

.footer-col .footer-h {
    color: var(--footer-head);
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-col .footer-h::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--primary); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-col a { color: var(--footer-link); font-size: 13px; font-weight: 500; transition: color .2s, padding .2s; }
.footer-col a:hover { color: var(--primary); padding-inline-start: 4px; }

/* إخلاء المسؤولية: نص مقروء واضح في كل صفحة — متطلب مراجعة الشبكات الإعلانية */
.footer-disclaimer {
    margin: 0;
    padding: 14px 0 2px;
    border-top: 1px solid var(--footer-border);
    font-size: 13px;
    line-height: 1.9;
    color: var(--footer-text);
    text-align: center;
}
.footer-disclaimer strong { color: var(--footer-head); }
.footer-disclaimer a { color: var(--footer-link); text-decoration: underline; text-underline-offset: 2px; }
.footer-disclaimer a:hover { color: var(--primary); }

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px 0 22px;
    border-top: 1px solid var(--footer-border);
    font-size: 13px;
    color: var(--footer-muted);
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }
.footer-bottom a { color: var(--footer-link); text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom a:hover { color: var(--primary); }

.dmca-badge { display: inline-flex; align-items: center; opacity: .85; transition: opacity .2s, transform .15s; }
.dmca-badge:hover { opacity: 1; transform: translateY(-1px); }
.dmca-badge img { display: block; border-radius: 4px; }

.social-row { display: flex; gap: 8px; }
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--footer-btn-bg);
    border: 1px solid var(--footer-border);
    color: var(--footer-link);
    transition: all .2s ease;
}
.social-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); }
.social-btn .ico { width: 18px; height: 18px; }

/* ---------- بنر الانضمام لقناة وقروب الواتساب (أسفل كل خبر) ---------- */
/* بلا تدرّج ولا إطار سميك ولا زر دائري: كان الشكل السابق يُقرأ كوحدة إعلانية،
   وهو ملاصق لأزرار التقديم — التباس مزدوج تمنعه سياسة Ad formatting. */
.join-sep { border: 0; border-top: 1px solid var(--border); margin-block: 32px 0; }
.join-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-block: 20px 6px;
    padding: 14px 16px;
    border-radius: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color .2s ease;
}
.join-banner:hover { border-color: #16a34a; }
.join-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(22, 163, 74, .12);
    color: #16a34a;
}
.join-icon .ico { width: 22px; height: 22px; }
.join-text { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
.join-text strong { display: block; color: var(--text-strong); font-size: 14px; font-weight: 700; }
.join-text small { display: block; color: var(--text-muted); font-size: 13px; font-weight: 500; }
.join-cta {
    flex: none;
    color: #16a34a;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}
@media (max-width: 480px) { .join-cta { display: none; } }

/* ---------- الوضع الليلي: صناديق الأخبار وبطاقة الخبر بخلفية فاتحة قريبة من الأبيض ---------- */
/* ---------- متفرقات ---------- */
.back-to-top { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; box-shadow: var(--shadow-lg); }
.back-to-top.show { opacity: 1; pointer-events: auto; }
/* إخلاء ركن إعلان anchor السفلي على الجوال — الزر كان يشغل نفس الزاوية بالضبط،
   وحاوية anchor تُرسم بـ z-index هائل فتلاصقه وتصنع نقرًا عرضيًا. */
@media (max-width: 768px) {
    .back-to-top { bottom: 96px; }
}

.skeleton-note { text-align: center; font-size: 12px; color: var(--text-muted); }

/* إعلانات أدسنس التلقائية: لا تكسر عرض الصفحة.
   بلا overflow:hidden — كان يقصّ إطار الإعلان، وعلاج التجاوز الأفقي
   يكون على الحاوية الأب لا بقصّ الإعلان نفسه. */
.adsbygoogle { max-width: 100%; }

/* حاوية إعلانات Auto ads المحقونة داخل الصفحة: مسافة فصل عن المحتوى */
.google-auto-placed { margin-block: 24px; }

