/* --- 0. استدعاء ملف الخطوط ومتغيرات التحكم بحجم الخط --- */
@import url('fonts.css');

:root {
    --font-size-top-bar: 17px;   /* حجم خط شريط التاريخ العلوي */
    --font-size-logo: 28px;      /* حجم خط شعار الموقع */
    --font-size-dropdown: 14px;  /* حجم خط الأقسام الفرعية المنسدلة */
}

/* --- تنسيقات عامة للمحيط الهيكلي للهيدر --- */
#site-header-container {
    width: 100%;
    font-family: 'AlArabiya Custom', system-ui, -apple-system, sans-serif;
    direction: rtl;
}

#site-header-container .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- 1. الشريط الأسود العلوي الخاص بالتاريخ --- */
.top-black-bar {
    background-color: #1a1a1a;
    color: #e5e5e5;
    padding: 8px 0;
    font-size: var(--font-size-top-bar);
    border-bottom: 1px solid #333;
}

.top-black-bar .date-side {
    text-align: right;
}

/* --- 2. الهيدر الرئيسي (الشعار ومساحة الإعلان) --- */
.header-main-bar {
    background-color: #ffffff;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.main-site-logo a {
    text-decoration: none;
    color: #111;
}

.main-site-logo h1 {
    margin: 0;
    font-size: var(--font-size-logo);
    font-weight: 800;
}

.ad-728x90 img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- 3. بار الأقسام الرئيسي (Navbar) --- */
.categories-navbar {
    background-color: #f8f9fa;
    border-bottom: 2px solid #eaeaea;
    z-index: 999;
    width: 100%;
    transition: all 0.3s ease;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-links > li {
    position: relative;
}

/* روابط القائمة الرئيسية - الخصائص الأكيدة لمنع التداخل */
.nav-links > li > a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    
    /* الخصائص التي اعتمدتها مؤخراً لضمان القراءة الصحيحة */
    font-weight: 400 !important;
    font-size: 1.5rem !important;

    font-family: alarabiya, "AlArabiya Custom", "Helvetica Neue", sans-serif !important;
    
    transition: background-color 0.2s, color 0.2s;
}

.nav-links > li:hover > a {
    background-color: #e9ecef;
    color: #000;
}

/* --- 4. القائمة المنسدلة (Dropdown) للأقسام الفرعية --- */
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #eaeaea;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1000;
}

.dropdown li a {
    display: block;
    padding: 12px 15px;
    color: #444;
    text-decoration: none;
    font-size: var(--font-size-dropdown);
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
}

.dropdown li:last-child a {
    border-bottom: none;
}

.dropdown li a:hover {
    background-color: #f8f9fa;
    color: #000;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    .nav-links {
        flex-wrap: wrap;
    }
    .nav-links > li > a {
        padding: 10px 15px;
    }
}