/*
Theme Name: The Brown Land Custom Theme
Theme URI: http://fasttecs.com/
Author: Eng. Ehab Ahmed
Description: قالب مخصص مبني من الصفر لمنصة الأخبار والبث المباشر بألوان الهوية الرسمية.
Version: 1.3.0
Text Domain: blnews-custom
*/

/* 1. التظبيط الأساسي الافتراضي (إنجليزي - LTR بروح الهوية) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Cairo', sans-serif;
    direction: ltr;
    text-align: left;
    background-color: #ffffff;
    color: #42311E; /* البني الداكن الأساسي */
}

.container {
    width: 95%;
    max-width: 1250px;
    margin: 0 auto;
}

/* 2. استايل الهيدر بالبيج الكريمي الفخم */
.site-header {
    background-color: #FFEFD4; /* اللون البيج الفاتح الرسمي */
    padding: 12px 0;
    border-bottom: 1px solid rgba(66, 49, 30, 0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* حاوية اللوجو المدمج المطور */
.logo-combo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 15px;
}

/* قشط الأيقونة الدائرية النضيفة */
.logo-icon-wrapper {
    width: 65px;
    height: 65px;
    overflow: hidden;
    position: relative;
    border-radius: 50%;
    background-color: #FFEFD4;
}

.brand-icon-img {
    height: 105%;
    width: auto;
    position: absolute;
    left: -5px;
    top: -2px;
    object-fit: contain;
}

/* تنسيق نصوص البراند بجانب الأيقونة */
.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-main {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #42311E;
    letter-spacing: 0.5px;
    line-height: 1.1;
    text-transform: uppercase;
}

.logo-main .highlight {
    color: #F89E1B; /* البرتقالي الرسمي */
}

.logo-sub {
    font-family: 'Poppins', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #42311E;
    letter-spacing: 1.5px;
    margin-top: 2px;
    opacity: 0.8;
    text-transform: uppercase;
}

.logo-slogan {
    font-family: 'Poppins', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #F89E1B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* 3. شريط التنقل الاحترافي باللون الرمادي الداكن (مطابق للـ Mockup) */
.main-navigation {
    background-color: #332A21; /* الرمادي الداكن المائل للبني بروح الماكيت */
    border-bottom: 4px solid #F89E1B; /* خط برتقالي سفلي لربط الهوية */
    padding: 0;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    padding-left: 0;
    margin: 0;
}

.nav-menu li a {
    display: block;
    padding: 16px 22px;
    color: #FFEFD4; /* كلام كريمي فاتح ناصع على الخلفية الغامقة */
    text-decoration: none;
    font-family: 'Poppins', 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

/* زرار الهوم أو القسم النشط واخد برتقالي كامل صريح */
.nav-menu li.current-menu-item a, 
.nav-menu li:first-child a {
    background-color: #F89E1B;
    color: #ffffff;
}

/* الهوفر على الأزرار */
.nav-menu li a:hover {
    background-color: #42311E;
    color: #F89E1B;
}

/* 4. دعم الجزء العربي والقوائم المنسدلة */
.nav-menu li a[href*="arabic"], 
.nav-menu li a:contains("عربي"),
.arabic-text {
    font-family: 'Cairo', sans-serif !important;
}

.nav-menu li {
    position: relative;
}

/* استايل القائمة المنسدلة متناسق مع الخلفية الجديدة */
.nav-menu ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #42311E;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
    list-style: none;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    border-top: 3px solid #F89E1B;
}

.nav-menu li:hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
}

.nav-menu ul.sub-menu li a {
    color: #FFEFD4;
    padding: 12px 18px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 239, 212, 0.05);
    background: none !important;
}

.nav-menu ul.sub-menu li a:hover {
    background-color: #F89E1B !important;
    color: #ffffff;
}

/* 5. استايل شبكة الأخبار العالمية (News Grid) والمحاذاة الميزان */
.news-grid-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* توازن الـ Grid بين اليمين والشمال */
    gap: 25px;
    margin-top: 35px;
}

/* الخبر الرئيسي الكبير (رقم 1) */
.main-featured-post {
    position: relative;
    height: 480px; /* الارتفاع الثابت لضبط المحاذاة */
    background-color: #42311E; /* لون احتياطي فخم لو الصورة مش مرفوعة */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    display: flex;
    align-items: flex-end; /* العناوين تفضل مريحة تحت */
    padding: 25px;
    padding-top: 75px; /* مسافة أمان علوية عشان اسم القسم */
    color: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* ماسك الظل الاحترافي لتوضيح النصوص */
.main-featured-post::before, .small-news-post::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(33, 26, 20, 0.95) 0%, rgba(0,0,0,0.1) 70%);
    z-index: 1;
}

.main-featured-post .post-info, .small-news-post .post-info-small {
    position: relative;
    z-index: 2;
}

.main-featured-post h2 a, .small-news-post h3 a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s;
}

.main-featured-post h2 a:hover, .small-news-post h3 a:hover {
    color: #F89E1B;
}

.main-featured-post h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 15px;
    line-height: 1.3;
}

/* شبكة الأخبار الصغيرة (4 قطع) مضبوطة الارتفاع بالملي */
.sub-news-grid {
    height: 480px; /* تطابق الارتفاع تماماً مع كارت رقم 1 */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
}

.small-news-post {
    position: relative;
    height: 100%; /* تملأ نصف الارتفاع المتاح بدقة مع حساب الـ gap */
    background-color: #42311E;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    display: flex;
    align-items: flex-end; /* العناوين تفضل تحت */
    padding: 15px;
    padding-top: 65px; /* مسافة أمان علوية عشان اسم القسم */
    color: #ffffff;
    overflow: hidden;
}

.small-news-post h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 10px;
}

/* 6. البادجات البرتقالية الرسمية - طائرة أقصى اليسار فوق الصور بالملي */
.category-badge, 
.category-badge-small {
    position: absolute !important;
    top: 15px !important;    /* مسافة خفيفة وموزونة من فوق */
    left: 15px !important;   /* أقصى اليسار بالملي */
    right: auto !important;  /* إلغاء أي توجيه عكسي لليمين */
    bottom: auto !important; /* إلغاء التموضع السفلي القديم */
    z-index: 5 !important;   /* فوق الصورة والماسك النظيف */
    background-color: #F89E1B;
    padding: 5px 12px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block;
}

/* تنظيف وتثبيت ألوان روابط بادجات الأقسام باللون الأبيض الناصع */
.category-badge a, 
.category-badge-small a {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* 7. تنسيق التوزيعة الكبرى (Main Layout & Sidebar) */
.main-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 35px;
    margin-top: 40px;
}

/* استايل السايدبار الجانبي المطور */
.site-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: #ffffff;
    border: 1px solid #F5EDE3;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(66, 49, 30, 0.02);
}

.widget-title {
    font-family: 'Poppins', 'Cairo', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #42311E;
    border-bottom: 3px solid #F89E1B;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* صندوق البث المباشر */
.live-stream-box {
    background-color: #42311E;
    color: #ffffff;
    padding: 25px;
    border-radius: 6px;
    text-align: center;
    position: relative;
}

.live-badge {
    background-color: #ff3b30;
    color: #fff;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    position: absolute;
    top: 12px;
    left: 12px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* تنسيق روابط ومقالات السايدبار (Most Read) بروح الهوية */
.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget ul li {
    padding: 10px 0;
    border-bottom: 1px dashed #eaddcd;
}

.sidebar-widget ul li:last-child {
    border-bottom: none;
}

.sidebar-widget ul li a {
    color: #42311E; /* البني الداكن الرسمي بديل الأزرق */
    text-decoration: none;
    font-family: 'Poppins', 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

/* حركة الهوفر في السايدبار */
.sidebar-widget ul li a:hover {
    color: #F89E1B; /* يقلب برتقالي عند الوقوف عليه */
}

/* 8. تنسيق زرار الـ PWA في الهيدر */
.header-actions {
    display: flex;
    align-items: center;
}

.pwa-install-btn {
    background-color: #F89E1B;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(248, 158, 27, 0.25);
}

.pwa-install-btn:hover {
    background-color: #42311E;
    box-shadow: none;
}

/* 9. استايل الفوتر الفخم */
.site-footer {
    background-color: #42311E;
    color: #FFEFD4;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    font-size: 14px;
    direction: ltr;
    border-top: 4px solid #F89E1B;
}

/* 10. تحديث التوافق مع الشاشات الصغيرة (Mobile Responsive) */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .logo-combo-link {
        flex-direction: column;
        gap: 8px;
    }
    .logo-text-wrapper {
        align-items: center;
    }
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-menu li a {
        padding: 12px 15px;
        font-size: 14px;
    }
    .news-grid-container {
        grid-template-columns: 1fr;
    }
    .sub-news-grid {
        grid-template-columns: 1fr;
        height: auto; /* إلغاء الارتفاع الثابت على الموبايل لتجنب التداخل */
    }
    .main-featured-post {
        height: 350px;
    }
    .small-news-post {
        height: 250px;
    }
}

/* شريط الأخبار العاجلة */
.news-ticker {
    background-color: #332A21; /* نفس لون الـ Nav */
    color: #FFEFD4;
    padding: 10px 0;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid #F89E1B;
}

.news-ticker .container {
    display: flex;
    align-items: center;
}

.ticker-label {
    background-color: #F89E1B; /* اللون البرتقالي للهوية */
    color: #ffffff;
    padding: 5px 15px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-right: 20px;
    border-radius: 4px;
    white-space: nowrap;
}

.ticker-content {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-content ul {
    list-style: none;
    display: inline-block;
    padding-left: 100%; /* يبدأ من بره الشاشة */
    animation: marquee 25s linear infinite;
}

.ticker-content ul li {
    display: inline-block;
    margin-right: 50px;
    font-size: 14px;
    font-family: 'Poppins', 'Cairo', sans-serif;
}

.ticker-content ul li a {
    color: #FFEFD4;
    text-decoration: none;
    font-weight: 500;
}

.ticker-content ul li a:hover {
    color: #F89E1B;
}

/* إيقاف الشريط عند الوقوف بالماوس */
.ticker-content:hover ul {
    animation-play-state: paused;
}

/* حركة الشريط */
@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* تعديل للموبايل */
@media (max-width: 768px) {
    .ticker-label { font-size: 10px; padding: 3px 8px; }
    .ticker-content ul li { font-size: 13px; }
}