/*
Theme Name: Viral Dark Pro
Theme URI: https://name44.com
Author: A3tal Tech Team
Author URI: https://a3tal.com
Description: A high-performance, mobile-first viral news theme with dark mode and full customization.
Version: 1.0.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: viral-dark
Tags: news, viral, dark-mode, mobile-first, fast
*/

:root {
    /* --- Color Palette (نظام الألوان) --- */
    --color-bg-body: #121212;       /* الخلفية الرئيسية */
    --color-bg-card: #1E1E1E;       /* خلفية الكروت */
    --color-bg-header: #000000;     /* خلفية الهيدر */
    --color-primary: #E60000;       /* الأحمر الفيرال */
    --color-brand-red: #cc0000;     /* أحمر مخصص */
    --color-brand-blue: #0033cc;    /* أزرق مخصص */
    --color-accent: #FF3333;        /* أحمر فاتح للهافر */
    
    --color-text-main: #FFFFFF;     /* النص الأساسي */
    --color-text-meta: #A0A0A0;     /* النص الفرعي */
    --color-border: #333333;        /* لون الحدود */

    /* --- Typography --- */
    --font-main: 'Cairo', sans-serif;
    
    /* --- Spacing --- */
    --spacing-container: 15px;      
    --border-radius: 8px;           
}

/* --- Basic Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Layout Utility --- */
.container {
    width: 100%;
    padding-right: var(--spacing-container);
    padding-left: var(--spacing-container);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* --- Header Styles --- */

/* 1. Ticker (شريط العاجل) */
.breaking-news-bar {
    background-color: var(--color-primary);
    color: #fff;
    font-size: 0.9rem;
    overflow: hidden;
    height: 40px;
    line-height: 40px;
}
.ticker-flex {
    display: flex;
    align-items: center;
}
.ticker-label {
    background: rgba(0,0,0,0.2);
    padding: 0 15px;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 10px; 
}
.ticker-content {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
}
.ticker-track {
    display: inline-block;
    animation: ticker-scroll 20s linear infinite; 
}
.ticker-item {
    margin-left: 30px;
}
.ticker-item::after {
    content: "|";
    margin-right: 30px;
    opacity: 0.5;
}
@keyframes ticker-scroll {
    0% { transform: translateX(-100%); } 
    100% { transform: translateX(100%); }
}

/* 2. Main Header */
.site-header {
    background-color: var(--color-bg-header);
    border-bottom: 1px solid var(--color-border);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Branding */
.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 900;
}
.site-title a { color: #fff; }

/* Tools & Icons */
.header-tools {
    display: flex;
    gap: 15px;
    align-items: center;
}
.tool-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}
.menu-trigger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 30px;
}
.menu-icon-bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: 0.3s;
}

/* =======================================================
   ::: هام جداً: إخفاء قائمة الديسكتوب في الموبايل :::
   ======================================================= */
.desktop-navigation {
    display: none !important; /* إخفاء إجباري في الموبايل */
}

/* 3. Mobile Navigation Panel (القائمة المنسدلة) */
.mobile-nav-panel {
    background-color: var(--color-bg-card);
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-out;
    position: fixed;
    top: 96px; 
    left: 0;
    right: 0;
    z-index: 999;
    border-bottom: none; 
}
.mobile-nav-panel.active {
    height: auto;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-primary); 
}
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-navigation ul li a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: bold;
}
.mobile-search {
    padding: 15px;
}
.mobile-search input {
    width: 100%;
    padding: 10px;
    background: #333;
    border: none;
    color: #fff;
    border-radius: 4px;
}


/* --- Hero Section Styles --- */
.hero-section {
    padding: 20px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* تنسيق الكارت العام */
.post-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--color-bg-card);
}
.card-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.post-card:hover .card-image img {
    transform: scale(1.1); 
}

/* 1. Big Card */
.big-card {
    height: 400px;
}
.big-card .card-content {
    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.5) 60%, transparent 100%);
    z-index: 2;
}
.big-card .entry-title {
    font-size: 1.8rem;
    margin: 10px 0;
    font-weight: 900;
    line-height: 1.3;
}
.card-link {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 3;
}

/* 2. Side List */
.sub-featured {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 400px; 
}
.small-card {
    display: flex;
    flex: 1;
    background: transparent;
}
.small-card .card-image {
    width: 120px;
    border-radius: 8px;
    flex-shrink: 0;
}
.small-card .card-content {
    padding: 5px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.small-card .entry-title {
    font-size: 1rem;
    margin: 5px 0 0 0;
    font-weight: 700;
}

.cat-label {
    background-color: var(--color-primary);
    color: #fff;
    padding: 3px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    display: inline-block;
}
.cat-label.small {
    padding: 2px 8px;
    font-size: 0.7rem;
    background-color: rgba(255,255,255,0.1); 
}

/* --- Responsive (Desktop) --- */
@media (min-width: 992px) {
    .hero-grid {
        grid-template-columns: 1.8fr 1fr;
        height: 500px;
    }
    .big-card, .sub-featured {
        height: 500px;
    }
    .big-card .entry-title {
        font-size: 2.2rem;
    }

    /* =======================================================
       ::: NEW: Desktop Navigation (Menu Style) :::
       ======================================================= */
    
    /* 1. Hide Hamburger Menu on Desktop */
    #menu-toggle {
        display: none !important;
    }

    /* 2. Show Desktop Navigation (تفعيل القائمة هنا) */
    .desktop-navigation {
        display: block !important; /* إظهار إجباري في الديسكتوب */
        flex-grow: 1; 
        margin: 0 40px;
    }

    .desktop-navigation ul {
        display: flex;
        justify-content: center; 
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 25px; 
    }

    .desktop-navigation ul li {
        position: relative;
    }

    .desktop-navigation ul li a {
        text-decoration: none;
        color: #fff;
        font-weight: 700;
        font-size: 16px;
        padding: 10px 5px;
        display: block;
        transition: all 0.3s ease;
        position: relative;
    }

    /* --- The "Saaye" Effect (Gradient Line) --- */
    .desktop-navigation ul li a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 3px;
        bottom: 0;
        right: 0; 
        background: linear-gradient(90deg, var(--color-brand-red), var(--color-brand-blue)); 
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 2px;
        box-shadow: 0 0 10px rgba(204, 0, 0, 0.5); 
    }

    /* Hover State */
    .desktop-navigation ul li a:hover {
        color: var(--color-brand-blue); 
        text-shadow: 0 0 8px rgba(0, 51, 204, 0.6);
        transform: translateY(-2px);
    }

    .desktop-navigation ul li a:hover::after {
        width: 100%;
        left: 0;
    }

    /* Sub-menu handling */
    .desktop-navigation ul li ul {
        position: absolute;
        top: 100%;
        right: 0;
        background: #1a1a1a;
        width: 200px;
        flex-direction: column;
        gap: 0;
        border-top: 3px solid var(--color-brand-red);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        z-index: 1001;
    }
    
    .desktop-navigation ul li:hover ul {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .desktop-navigation ul li ul li a {
        padding: 12px 15px;
        border-bottom: 1px solid #333;
        font-size: 14px;
    }
    .desktop-navigation ul li ul li a::after {
        display: none; 
    }
    .desktop-navigation ul li ul li a:hover {
        background: #222;
        color: var(--color-brand-red);
        padding-right: 20px; 
    }
}
/* --- End Desktop Navigation --- */


/* --- Trending Section --- */
.trending-section {
    padding: 30px 0;
    background-color: #1a1a1a; 
    margin-top: 20px;
}

.section-heading {
    background: linear-gradient(90deg, var(--color-primary) 0%, #b30000 100%);
    padding: 10px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.2);
    display: flex;
    align-items: center;
}
.section-title {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.trending-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px;
}

.trend-card {
    height: 200px; 
    border: 1px solid #333;
}
.trend-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    z-index: 2;
}
.trend-card .entry-title {
    font-size: 0.9rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
}

@media (min-width: 768px) {
    .trending-grid {
        grid-template-columns: repeat(4, 1fr); 
    }
    .trend-card {
        height: 250px;
    }
    .trend-card .entry-title {
        font-size: 1.1rem;
    }
}
/* --- Latest News & Sidebar --- */
.latest-section {
    padding-bottom: 50px;
    margin-top: 30px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.post-list-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #222;
    align-items: flex-start;
}
.post-list-item:last-child {
    border-bottom: none;
}
.list-image {
    width: 120px;
    height: 120px; 
    flex-shrink: 0;
}
.list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.list-content .entry-title {
    font-size: 1.1rem;
    margin: 5px 0;
    line-height: 1.4;
}
.list-content .entry-title a {
    color: #fff;
}
.list-content .entry-title a:hover {
    color: var(--color-primary);
}
.list-content .excerpt {
    font-size: 0.9rem;
    color: #aaa;
    margin: 5px 0;
    display: none; 
}
.meta-text {
    font-size: 0.8rem;
    color: #666;
}

.widget-area {
    margin-top: 20px;
}
.sidebar-widget {
    background: var(--color-bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.widget-title {
    border-right: 3px solid var(--color-primary);
    padding-right: 10px;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.sticky-widget {
    position: sticky;
    top: 90px;
}

@media (min-width: 992px) {
    .content-grid {
        grid-template-columns: 2.5fr 1fr; 
    }
    .widget-area {
        margin-top: 0;
    }
    .list-image {
        width: 200px;
        height: 140px; 
    }
    .list-content .excerpt {
        display: block; 
    }
}
/* --- Single Post --- */

.main-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 30px;
    padding-bottom: 30px;
}

.breadcrumbs {
    font-size: 0.9rem;
    color: var(--color-text-meta);
    margin-bottom: 15px;
}
.breadcrumbs a { color: #fff; }
.breadcrumbs .sep { margin: 0 5px; color: #555; }
.breadcrumbs .current { color: var(--color-primary); }

.entry-title {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #fff;
}
.entry-meta {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--color-text-meta);
    display: flex;
    gap: 15px;
}
.entry-meta i { margin-left: 5px; }

.entry-thumbnail {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}
.entry-thumbnail img {
    width: 100%;
}

.entry-content {
    font-size: 1.1rem; 
    line-height: 1.8;
    color: #e0e0e0;
}
.entry-content p { margin-bottom: 20px; }
.entry-content h2, .entry-content h3 {
    color: #fff;
    margin-top: 30px;
    margin-bottom: 15px;
}
.entry-content a {
    color: var(--color-primary);
    border-bottom: 1px dotted var(--color-primary);
}
.entry-content blockquote {
    background: #1a1a1a;
    border-right: 4px solid var(--color-primary);
    margin: 20px 0;
    padding: 20px;
    font-style: italic;
}

.ad-spot {
    background: #222;
    padding: 20px;
    text-align: center;
    margin: 30px 0;
    border: 1px dashed #444;
    color: #777;
}

.entry-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
}
.tag-title { font-weight: bold; color: #fff; }
.cat-links a {
    display: inline-block;
    background: #333;
    padding: 5px 10px;
    margin-left: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.related-posts {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.related-item h4 {
    font-size: 1rem;
    margin-top: 10px;
    line-height: 1.4;
}
.related-item img {
    border-radius: 6px;
    width: 100%;
    height: 150px;
    object-fit: cover;
}

@media (min-width: 992px) {
    .main-content-grid {
        grid-template-columns: 2.5fr 1fr; 
    }
    .entry-title { font-size: 2.5rem; }
}
/* --- Pagination & Search --- */
.nav-links {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
}
.nav-links a {
    background: #333;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
}
.nav-links a:hover {
    background: var(--color-primary);
    color: #fff;
}

.error-404 input[type="search"] {
    width: 100%;
    padding: 15px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    border-radius: 50px; 
    text-align: center;
}

/* =========================================
   ::: FOOTER STYLES (الموجز) :::
   ========================================= */

.site-footer {
    background-color: #050505;
    color: #b0b0b0;
    padding: 60px 0 0 0;
    font-size: 0.95rem;
    border-top: 4px solid var(--color-primary); /* نفس أحمر الموقع */
    position: relative;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 50px;
}

/* اللوجو والشعار */
.footer-logo {
    margin-bottom: 20px;
}
.brand-name {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    display: block;
    line-height: 1;
}
.brand-slogan {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: bold;
    margin-top: 5px;
    display: block;
}
.footer-desc {
    line-height: 1.8;
    margin-bottom: 25px;
    color: #ccc;
}

/* الأيقونات */
.social-icons {
    display: flex;
    gap: 15px;
}
.social-btn {
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid #333;
}
.social-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

/* الروابط */
.footer-title {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 25px;
    border-right: 3px solid var(--color-primary);
    padding-right: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 12px;
}
.footer-links li a {
    color: #b0b0b0;
    transition: 0.3s;
    display: flex;
    align-items: center;
}
.footer-links li a::before {
    content: "\f139"; /* أيقونة سهم */
    font-family: "dashicons";
    margin-left: 8px;
    font-size: 14px;
    color: #444;
}
.footer-links li a:hover {
    color: #fff;
    padding-right: 5px;
}
.footer-links li a:hover::before {
    color: var(--color-primary);
}

/* التواصل */
.contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.contact-info span {
    color: var(--color-primary);
}

.cta-small {
    background: #121212;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px dashed #333;
    text-align: center;
}
.cta-btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 8px 25px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 10px;
}
.cta-btn:hover {
    background: #fff;
    color: #000;
}

/* حقوق النشر */
.site-info {
    background-color: #000;
    padding: 20px 0;
    border-top: 1px solid #1a1a1a;
    text-align: center;
    font-size: 0.85rem;
}
.site-info span { color: #fff; font-weight: bold; }

/* ميديا كويري للفوتر */
@media (min-width: 992px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1.2fr;
        text-align: right;
    }
}