/*
Theme Name: News Custom Theme
Theme URI: 
Author: Developer
Description: Custom WordPress Theme matching the provided news design for Desktop and Mobile. Full Code.
Version: 2.1
Text Domain: newstheme
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
    --primary-color: #e64b22;
    --dark-blue: #193360; 
    --yellow-color: #f7b718; 
    --text-color: #333333;
    --body-bg: #f9f9f9;
    --border-color: #eeeeee;
    --header-bg: #ffffff; 
    --card-bg: #ffffff;
    --font-family: 'Cairo', sans-serif;
}

body.dark-mode {
    --text-color: #f1f1f1;
    --body-bg: #121212;
    --border-color: #333333;
    --header-bg: #1e1e1e;
    --card-bg: #1e1e1e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    direction: rtl;
    text-align: right;
    background-color: var(--body-bg);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 15px; }

/* ==================== Header ==================== */
.site-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); 
    position: relative;
    z-index: 100;
    transition: background-color 0.3s, border-color 0.3s;
}

.header-container { display: flex; justify-content: space-between; align-items: center; height: 80px; padding: 0 15px; }
.header-logo { display: flex; align-items: center; max-height: 100%; }
.header-logo a.custom-logo-link { display: flex; max-height: 60px; }
.header-logo img.custom-logo { width: auto; height: auto; max-height: 100%; max-width: 180px; display: block; object-fit: contain; }
.header-logo h1 { font-size: 24px; font-weight: 900; }
.header-logo h1 a { color: var(--text-color); }

.header-nav ul { display: flex; gap: 20px; }
.header-nav ul li a { color: var(--text-color); font-weight: 800; font-size: 19px; padding: 10px 8px; }
.header-nav ul li a:hover { color: var(--primary-color); }

.header-actions { display: flex; align-items: center; gap: 15px; }
.special-buttons { display: flex; gap: 10px; }

.btn-live { background-color: var(--dark-blue); color: #fff; font-weight: 800; font-size: 15px; padding: 8px 15px; border-radius: 4px; display: flex; align-items: center; gap: 8px; }
.btn-trending { background-color: #000; color: #fff; font-weight: 800; font-size: 15px; padding: 8px 15px; border-radius: 4px; display: flex; align-items: center; gap: 8px; }
body.dark-mode .btn-trending { background-color: #333; }

.header-controls { display: flex; align-items: center; gap: 12px; }
.search-toggle { background: transparent; border: none; color: var(--text-color); font-size: 18px; cursor: pointer; }
.darkmode-toggle { width: 50px; height: 26px; background-color: #ccc; border-radius: 15px; display: flex; align-items: center; justify-content: space-around; position: relative; cursor: pointer; color: #fff; }
body.dark-mode .darkmode-toggle { background-color: var(--primary-color); }
.darkmode-toggle i { font-size: 12px; }
.header-divider { width: 1px; height: 30px; background-color: var(--border-color); display: inline-block; }

.mobile-nav-dropdown { display: none; background-color: var(--header-bg); border-bottom: 1px solid var(--border-color); padding: 10px 15px; width: 100%; }
.mobile-nav-dropdown.active { display: block; }
.mobile-nav-dropdown ul { display: flex; flex-direction: column; }
.mobile-nav-dropdown ul li a { display: block; padding: 12px 5px; color: var(--text-color); font-weight: 800; font-size: 16px; border-bottom: 1px solid var(--border-color); }
.mobile-menu-btn { display: none; }

/* ==================== HERO GRID SECTION ==================== */
.hero-grid-section { padding: 40px 0; background-color: var(--body-bg); transition: background-color 0.3s; }
.top-news-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.grid-item { position: relative; display: block; height: 350px; overflow: hidden; background-color: #000; border-radius: 0; }
.grid-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.grid-item:hover img { transform: scale(1.05); }
.grid-item .overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%); display: flex; align-items: flex-end; height: 60%; }
.large-item .overlay { height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 50%); justify-content: flex-end; align-items: flex-end; }
.large-item .title { font-size: 32px; font-weight: 900; color: #fff; line-height: 1.4; text-align: right; width: 100%; }
.small-item .title { font-size: 18px; font-weight: 800; color: #fff; line-height: 1.4; text-align: right; width: 100%; }
.category-tag { position: absolute; top: 15px; right: 15px; background-color: var(--yellow-color); color: #000; padding: 3px 12px; font-size: 14px; font-weight: 800; z-index: 10; }

/* ==================== BOTTOM BREAKING BANNER ==================== */
.breaking-banner { display: flex; background-color: #1c1815; color: #fff; margin-top: 10px; padding: 25px; border-radius: 0; }
.banner-content { flex: 1; padding: 15px 40px 15px 15px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; position: relative; }
.red-line-decor { position: absolute; right: 15px; top: 20px; bottom: 20px; width: 1px; background-color: #d10a0a; }
@keyframes radar-pulse { 0% { box-shadow: 0 0 0 0 rgba(209, 10, 10, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(209, 10, 10, 0); } 100% { box-shadow: 0 0 0 0 rgba(209, 10, 10, 0); } }
.red-line-decor::before, .red-line-decor::after { content: ''; position: absolute; right: -4px; width: 9px; height: 9px; background-color: #d10a0a; border-radius: 50%; }
.red-line-decor::before { top: 0; animation: radar-pulse 1.5s infinite; }
.red-line-decor::after { bottom: 0; }
.banner-title { font-size: 26px; font-weight: 800; line-height: 1.5; margin-bottom: 25px; max-width: 95%; }
.banner-btn { background-color: var(--yellow-color); color: #000; font-size: 20px; font-weight: 900; padding: 8px 45px; display: inline-block; transition: opacity 0.3s; }
.banner-btn:hover { opacity: 0.8; }
.banner-image { width: 40%; }
.banner-image img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }

/* ==================== Regions Section ==================== */
.regions-section { padding: 40px 0; background-color: var(--body-bg); transition: background-color 0.3s; }
.regions-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; }
.region-card-wrapper { position: relative; display: block; margin-top: 15px; transition: transform 0.3s ease; }
.region-card-wrapper:hover { transform: translateY(-3px); }
.region-card-wrapper::before { content: ''; position: absolute; top: -12px; left: 8%; right: 8%; height: 20px; background-color: var(--border-color); border-radius: 5px 5px 0 0; z-index: 1; border: 1px solid rgba(255,255,255,0.1); }
.region-card-wrapper::after { content: ''; position: absolute; top: -6px; left: 4%; right: 4%; height: 20px; background-color: #888; border-radius: 5px 5px 0 0; z-index: 2; border: 1px solid rgba(255,255,255,0.1); opacity: 0.5; }
.region-card { position: relative; z-index: 3; border-radius: 4px; overflow: hidden; height: 110px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); background-color: var(--card-bg); }
.region-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.region-card-wrapper:hover .region-card img { transform: scale(1.05); }
.region-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 70%; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%); z-index: 1; }
.region-title { position: absolute; bottom: 8px; right: 15px; z-index: 2; color: #fff; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }

/* ==================== Single Page & Archive & Static Page ==================== */
.page-wrap { display: flex; gap: 30px; margin: 40px auto; align-items: flex-start; }
.main-content { flex: 7; background-color: var(--card-bg); padding: 30px; border-radius: 0; border: 1px solid var(--border-color); transition: background-color 0.3s, border-color 0.3s; }
.sidebar { flex: 3; display: flex; flex-direction: column; gap: 30px; }

/* Post Content */
.post-header { margin-bottom: 20px; }
.post-title { font-size: 32px; font-weight: 900; margin-bottom: 10px; line-height: 1.5; }
.post-meta { color: #888; font-size: 14px; margin-bottom: 25px; display: flex; gap: 15px; align-items: center; }
.post-thumbnail { margin-bottom: 30px; }
.post-thumbnail img { width: 100%; height: auto; border-radius: 0; display: block; }
.post-body { font-size: 18px; line-height: 1.9; font-weight: 600; }
.post-body p { margin-bottom: 20px; }

/* Widgets */
.widget { background-color: var(--card-bg); padding: 25px; border-radius: 0; border: 1px solid var(--border-color); transition: background-color 0.3s, border-color 0.3s; }
.widget-title { font-size: 22px; font-weight: 900; border-bottom: 3px solid var(--primary-color); padding-bottom: 10px; margin-bottom: 20px; display: inline-block; }
.widget-item { display: flex; gap: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.widget-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.widget-item img { width: 90px; height: 90px; object-fit: cover; border-radius: 0; }
.widget-item-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.widget-item-title { font-size: 16px; font-weight: 800; line-height: 1.4; color: var(--text-color); }
.widget-item-title:hover { color: var(--primary-color); }

/* Related Posts */
.related-posts { margin-top: 50px; border-top: 1px solid var(--border-color); padding-top: 30px; }
.related-title { font-size: 24px; font-weight: 900; margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.related-item img { width: 100%; height: 160px; object-fit: cover; border-radius: 0; margin-bottom: 10px; }
.related-item-title { font-size: 16px; font-weight: 800; line-height: 1.4; color: var(--text-color); }
.related-item-title:hover { color: var(--primary-color); }

/* Archive / Category Page */
.archive-header { margin: 40px 0 30px; padding-bottom: 15px; border-bottom: 3px solid var(--primary-color); }
.archive-title { font-size: 32px; font-weight: 900; }
.archive-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.archive-item { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 0; overflow: hidden; transition: transform 0.3s, background-color 0.3s; }
.archive-item:hover { transform: translateY(-5px); }
.archive-item img { width: 100%; height: 220px; object-fit: cover; }
.archive-content { padding: 20px; }
.archive-item-title { font-size: 18px; font-weight: 800; line-height: 1.5; color: var(--text-color); }
.archive-item-title:hover { color: var(--primary-color); }

/* ==================== Footer ==================== */
.site-footer { background-color: #211f1e; color: #ccc; padding: 40px 0; margin-top: 50px; border-top: 5px solid var(--primary-color); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-logo { font-size: 24px; font-weight: 800; color: #fff; }
.footer-logo span { color: var(--primary-color); }
.footer-links ul { display: flex; gap: 20px; }
.footer-copy { width: 100%; text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #333; font-size: 14px; }

/* ==================== Mobile Adjustments ==================== */
@media (max-width: 1024px) {
    .header-nav { display: none; }
    .page-wrap { flex-direction: column; }
    .main-content, .sidebar { flex: unset; width: 100%; }
    .archive-grid { grid-template-columns: repeat(2, 1fr); }
    .regions-grid { grid-template-columns: repeat(3, 1fr); }
    .top-news-grid { grid-template-columns: 1fr; }
    .grid-item { height: 250px; }
    .breaking-banner { flex-direction: column; padding: 15px; }
    .banner-image { width: 100%; height: 250px; margin-top: 15px; }
    .banner-content { padding: 15px 30px 15px 10px; }
}

@media (max-width: 768px) {
    .header-container { 
        height: 60px; 
        padding: 0 15px; 
        display: flex; 
        justify-content: space-between; 
        align-items: center;
        position: relative;
    }
    
    .header-logo { 
        position: absolute; 
        left: 50%; 
        transform: translateX(-50%); 
        margin: 0;
    }
    
    .header-logo img.custom-logo { max-height: 40px; }
    
    .header-actions { 
        width: 100%; 
        display: flex; 
        justify-content: space-between; 
        flex-direction: row-reverse; 
    }
    
    .header-controls { 
        width: 100%; 
        display: flex; 
        justify-content: space-between; 
        flex-direction: row-reverse; 
    }

    .btn-live, .btn-trending, .header-divider { display: none; }
    
    .mobile-menu-btn { 
        display: block; 
        background: transparent; 
        border: none; 
        color: var(--text-color); 
        font-size: 22px; 
        cursor: pointer; 
    }

    .related-grid { grid-template-columns: 1fr; }
    .archive-grid { grid-template-columns: 1fr; }
    .regions-grid { grid-template-columns: repeat(2, 1fr); }
    .banner-title { font-size: 20px; }
}