/*
Theme Name: TechNews - تيك نيوز
Theme URI: https://example.com/technews
Author: Manus
Author URI: https://manus.im
Description: قالب ووردبريس احترافي للأخبار التقنية باللغة العربية، مبني على تصميم عصري وسريع.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: technews
Domain Path: /languages
*/

:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --accent: #0ea5e9;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
}

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo img {
    max-height: 50px;
    width: auto;
}

/* Main Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 12px 20px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Dropdown Menu */
.nav-menu ul {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 200px;
    list-style: none;
    margin: 10px 0 0 0;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-menu > li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu ul li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-menu ul li a:hover {
    background: var(--bg-body);
    color: var(--primary);
    padding-right: 25px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 6px;
    padding: 8px;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Search Box */
.search-box {
    background: var(--bg-body);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: white;
    border: 1px solid var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    color: var(--text-main);
    width: 150px;
    font-size: 0.95rem;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
    padding: 4px 8px;
    display: flex;
    align-items: center;
}

.search-btn:hover {
    color: var(--primary);
}

/* --- Hero Section (Featured) --- */
.featured-section {
    padding: 60px 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    height: 400px;
}

.main-article {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
}

.main-article::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.article-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    color: white;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.main-article h2 { font-size: 2rem; margin-bottom: 10px; }
.meta { font-size: 0.9rem; opacity: 0.8; display: flex; gap: 15px; }

.side-articles {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

.side-card:hover { transform: translateY(-3px); }
.side-card img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.side-card h4 { font-size: 1rem; margin-bottom: 5px; }
.side-card span { font-size: 0.8rem; color: var(--text-light); }

/* --- Filter Tabs --- */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-light);
    transition: 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Articles Grid --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.article-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.3s;
    border: 1px solid transparent;
}

.article-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.card-body { padding: 25px; }

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.4;
}

.card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- Sidebar Section --- */
.content-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 40px;
    padding-bottom: 60px;
}

.sidebar-widget {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-right: 4px solid var(--primary);
    padding-right: 10px;
}

.category-list li {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
}
.category-list li:last-child { border: none; }
.category-list a:hover { color: var(--primary); }

.newsletter-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: inherit;
}
.newsletter-form button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

/* --- Footer --- */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 50px 0 20px;
    text-align: center;
}

/* WordPress specific fixes */
.wp-block-image img {
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .search-input {
        width: 120px;
    }
}

@media (max-width: 900px) {
    .featured-grid { grid-template-columns: 1fr; height: auto; }
    .main-article { height: 300px; }
    .content-wrapper { grid-template-columns: 1fr; }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .main-nav.active {
        max-height: 500px;
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu > li > a {
        padding: 15px 20px;
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .nav-menu > li > a:hover,
    .nav-menu > li > a.active {
        border-right-color: var(--primary);
        border-bottom: none;
    }
    
    .nav-menu ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: var(--bg-body);
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu > li:hover > ul {
        max-height: 300px;
    }
    
    .nav-menu ul li a {
        padding: 12px 20px 12px 40px;
    }
    
    .search-box {
        padding: 8px 12px;
    }
    
    .search-input {
        width: 100px;
    }
}

@media (max-width: 768px) {
    .nav-wrapper {
        gap: 15px;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .search-input {
        width: 80px;
        font-size: 0.9rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-grid {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .nav-wrapper {
        gap: 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .search-box {
        display: none;
    }
    
    .featured-grid {
        gap: 15px;
    }
    
    .side-articles {
        gap: 15px;
    }
}
