/*
Theme Name: Gaming News
Description: A modern gaming news theme with clean design and optimized performance
Author: Gaming Developer
Version: 1.0
License: GPL v2 or later
Text Domain: gaming-news
*/

/* ========== RESET & BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== CSS VARIABLES ========== */
:root {
    --header-bg: #1a1a2e;
    --footer-bg: #0f0f23;
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --accent-color: #e74c3c;
    --hover-color: #c0392b;
    --border-color: #dee2e6;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* ========== GLOBAL STYLES ========== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--body-bg);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER STYLES ========== */
.site-header {
    background: var(--header-bg);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* ========== SITE IDENTITY ========== */
.site-identity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
    transition: var(--transition);
}

.site-logo-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.custom-logo {
    max-height: 60px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.site-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}

.site-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.site-name {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ========== NAVIGATION ========== */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: var(--transition);
    font-weight: 500;
}

.main-nav a:hover {
    background: var(--accent-color);
    color: white;
}

/* ========== MOBILE MENU ========== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 4px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--header-bg);
    z-index: 1000;
    transition: var(--transition);
    padding: 80px 20px 20px;
    overflow-y: auto;
}

.mobile-nav-menu.active {
    right: 0;
}

.mobile-nav-menu .nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-menu .nav-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav-menu .nav-menu a {
    display: block;
    padding: 15px 0;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.mobile-nav-menu .nav-menu a:hover {
    color: var(--accent-color);
    padding-left: 10px;
}

/* ========== SEARCH FORM ========== */
.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
}

.search-button {
    padding: 10px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.search-button:hover {
    background: var(--hover-color);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    padding: 40px 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.news-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    height: fit-content;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.news-card:hover img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 20px;
}

.news-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.news-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.news-card h3 a:hover {
    color: var(--accent-color);
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.news-card-category span {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========== RELATED ARTICLES ========== */
.related-articles {
    background: var(--body-bg);
    padding: 60px 0;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

.related-articles h3 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--accent-color);
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.related-articles h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-color));
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.related-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    transform: translateY(0);
}

.related-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.related-card:hover .related-card-image img {
    transform: scale(1.05);
}

.related-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
    pointer-events: none;
}

.related-card-content {
    padding: 20px;
    position: relative;
    z-index: 2;
}

.related-card h4 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8rem;
}

.related-card:hover h4 {
    color: var(--accent-color);
}

.related-card a {
    text-decoration: none;
    display: block;
    color: inherit;
}

/* Gaming theme enhancement */
.related-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.related-card:hover::before {
    opacity: 0.05;
}

/* ========== FOOTER ========== */
.site-footer {
    background: var(--footer-bg);
    color: white;
    padding: 20px 0;
    text-align: center;
}

.footer-nav ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    margin-bottom: 15px;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: var(--accent-color);
}

.footer-social {
    margin-bottom: 15px;
}

.social-link {
    color: white;
    font-size: 1.5rem;
    margin: 0 10px;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--accent-color);
}

.footer-copyright {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

/* ========== UTILITY CLASSES ========== */
.image-link {
    display: block;
    text-decoration: none;
}

.screen-reader-text {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ========== ADVERTISEMENTS ========== */
.advertisement {
    margin: 40px 0;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.advertisement::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(231, 76, 60, 0.1), transparent);
    transition: left 0.5s ease;
}

.advertisement:hover::before {
    left: 100%;
}

.ad-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.ad-content {
    position: relative;
    z-index: 2;
}

.demo-ad-content {
    max-width: 400px;
    margin: 0 auto;
}

.demo-ad-content h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.demo-ad-content h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.demo-ad-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.ad-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.ad-btn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Advertisement specific styles */
.homepage-top-ad {
    margin: 20px 0 40px 0;
    grid-column: 1 / -1;
}

.single-top-ad {
    margin: 20px 0 30px 0;
}

.single-middle-ad {
    margin: 30px 0;
}

.single-bottom-ad {
    margin: 30px 0;
}

.between-posts-ad {
    grid-column: 1 / -1;
    margin: 30px 0;
}

.sidebar-ad {
    margin: 20px 0;
}

/* Advertisement responsive design */
@media (max-width: 768px) {
    .advertisement {
        margin: 20px 0;
        padding: 15px;
    }
    
    .demo-ad-content h3 {
        font-size: 1.2rem;
    }
    
    .demo-ad-content h4 {
        font-size: 1rem;
    }
    
    .ad-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .advertisement {
        margin: 15px 0;
        padding: 12px;
    }
    
    .demo-ad-content {
        max-width: 100%;
    }
    
    .demo-ad-content h3 {
        font-size: 1.1rem;
    }
    
    .demo-ad-content p {
        font-size: 0.9rem;
    }
    
    .ad-btn {
        width: 100%;
        padding: 12px;
    }
}

/* ========== MEDIA QUERIES ========== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
        padding: 0 40px;
    }
    
    .news-grid,
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
    
    .news-card-content {
        padding: 25px;
    }
    
    .site-title {
        font-size: 2.2rem;
    }
    
    .related-articles h3 {
        font-size: 2.2rem;
    }
}

@media (max-width: 1199px) {
    .news-grid,
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .related-card-image {
        height: 180px;
    }
    
    .related-card h4 {
        font-size: 1rem;
    }
}

@media (max-width: 991px) {
    .container {
        padding: 0 20px;
    }
    
    .news-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .news-card-content {
        padding: 20px;
    }
    
    .related-articles h3 {
        font-size: 1.8rem;
    }
    
    .related-card-image {
        height: 160px;
    }
    
    .related-card-content {
        padding: 18px;
    }
    
    /* تحسين التباعد للتابلت */
    .main-content {
        padding: 25px 0;
    }
    
    .site-header {
        padding: 15px 0;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
        padding: 10px 0;
    }
    
    .site-title {
        font-size: 1.4rem;
        line-height: 1.2;
    }
    
    .site-icon {
        font-size: 1.2rem;
    }
    
    .custom-logo {
        max-height: 40px;
    }
    
    .main-nav {
        display: none;
    }
    
    .header-search {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
        align-items: center;
    }
    
    .news-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .related-articles h3 {
        font-size: 1.5rem;
    }
    
    .related-card-image {
        height: 150px;
    }
    
    .related-card-content {
        padding: 15px;
    }
    
    .related-card h4 {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    /* تحسين touch targets */
    .news-card {
        min-height: 44px;
    }
    
    .news-card a {
        display: block;
        min-height: 44px;
        padding: 10px;
    }
    
    /* تحسين التباعد للموبايل */
    .main-content {
        padding: 15px 0;
    }
    
    .site-header {
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .news-grid,
    .related-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .news-card-content {
        padding: 15px;
    }
    
    .main-content {
        padding: 10px 0;
    }
    
    .related-articles {
        padding: 30px 0;
    }
    
    .related-articles h3 {
        font-size: 1.3rem;
        margin-bottom: 25px;
    }
    
    .related-card-image {
        height: 180px;
    }
    
    .related-card-content {
        padding: 12px;
    }
    
    .related-card h4 {
        font-size: 0.9rem;
        line-height: 1.3;
        height: auto;
        -webkit-line-clamp: 3;
    }
    
    .site-title {
        font-size: 1.2rem;
        line-height: 1.1;
    }
    
    .site-icon {
        font-size: 1rem;
    }
    
    .custom-logo {
        max-height: 35px;
    }
    
    .footer-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    /* تحسين النصوص للشاشات الصغيرة */
    .news-card h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .news-card-meta {
        font-size: 0.85rem;
    }
    
    /* تحسين الأزرار للشاشات الصغيرة */
    .search-button {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    .search-input {
        min-height: 44px;
        font-size: 16px; /* منع zoom على iOS */
    }
    
    /* تحسين التباعد */
    .header-content {
        padding: 8px 0;
    }
    
    .site-header {
        padding: 8px 0;
    }
    
    /* منع horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* تحسين images للشاشات الصغيرة */
    .news-card img {
        max-width: 100%;
        height: auto;
    }
    
    /* تحسين صور المقالات للموبايل */
    .article-featured-image {
        margin: 20px 0;
        padding: 10px;
    }
    
    .article-featured-image img {
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .single-article img,
    .article-content img {
        margin: 15px auto;
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}

/* ========== CLEANUP STYLES ========== */
/* Hide any duplicate menus that might appear */
.nav-menu:not(.site-header .nav-menu):not(.mobile-nav-menu .nav-menu) {
    display: none !important;
}

/* Ensure mobile menu behavior */
body.mobile-menu-active {
    overflow: hidden;
}

/* ========== MOBILE OPTIMIZATIONS ========== */
/* منع zoom على iOS للـ inputs */
input[type="search"],
input[type="text"],
input[type="email"],
textarea {
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

/* تحسين touch targets */
button,
.btn,
a {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* تحسين scrolling على iOS */
.mobile-nav-menu {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* منع horizontal scroll */
html {
    overflow-x: hidden;
}

/* تحسين tap highlight */
* {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* تحسين font rendering على الموبايل */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* تحسين performance على الموبايل */
.news-card,
.related-card {
    transform: translateZ(0);
    will-change: transform;
}

/* تحسين images loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* Image loading optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Ensure images load properly */
.news-card-image img,
.related-card-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    background-color: #f0f0f0;
    min-height: 200px;
}

/* Article featured images - different styling */
.article-featured-image {
    margin: 40px 0;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.article-featured-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    background-color: #f0f0f0;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.news-card-image img {
    height: 200px;
}

.related-card-image img {
    height: 120px;
}

/* Image loading states */
.news-card-image {
    background-color: #f8f9fa;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f0f0f0"/><text x="50" y="50" text-anchor="middle" dy="0.3em" fill="%23999" font-family="Arial, sans-serif" font-size="12">🎮</text></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 40px 40px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-card-image {
    background-color: #f8f9fa;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f0f0f0"/><text x="50" y="50" text-anchor="middle" dy="0.3em" fill="%23999" font-family="Arial, sans-serif" font-size="14">🎮</text></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 40px 40px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced placeholder for missing images */
.related-card-image:empty::before {
    content: "🎮";
    display: block;
    font-size: 40px;
    color: #999;
    text-align: center;
    padding: 20px;
}

/* Fix for broken images */
img[src*="placeholder"] {
    opacity: 1 !important;
    display: block !important;
}

/* Fix for article images not showing */
.article-featured-image img,
.article-content img {
    opacity: 1 !important;
    display: block !important;
}

/* Add placeholder for missing article images */
.article-featured-image:empty::before {
    content: "🎮";
    display: block;
    font-size: 60px;
    color: #999;
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* Ensure images in content are displayed */
.single-article img,
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Image error handling */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Force show all images in articles */
.single-article .article-content img,
.single-article .article-featured-image img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Handle WordPress post thumbnails */
.wp-post-image {
    opacity: 1 !important;
    display: block !important;
}

@supports (image-rendering: -webkit-optimize-contrast) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Performance optimizations */
.news-card-image {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.news-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.news-card-image:hover::before {
    left: 100%;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========== ORIENTATION QUERIES ========== */
/* تحسين العرض الأفقي على الموبايل */
@media (orientation: landscape) and (max-width: 767px) {
    .site-header {
        padding: 5px 0;
    }
    
    .header-content {
        padding: 5px 0;
    }
    
    .main-content {
        padding: 10px 0;
    }
    
    .mobile-nav-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* تحسين العرض العمودي على التابلت */
@media (orientation: portrait) and (min-width: 768px) and (max-width: 1024px) {
    .news-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* ========== SPECIFIC DEVICE OPTIMIZATIONS ========== */
/* تحسين للشاشات الصغيرة جداً */
@media (max-width: 320px) {
    .container {
        padding: 0 8px;
    }
    
    .site-title {
        font-size: 1rem;
    }
    
    .news-card h3 {
        font-size: 1rem;
    }
    
    .news-card-content {
        padding: 10px;
    }
    
    .related-articles h3 {
        font-size: 1.2rem;
    }
    
    .related-card-image {
        height: 160px;
    }
    
    .related-card-content {
        padding: 10px;
    }
    
    .related-card h4 {
        font-size: 0.85rem;
        line-height: 1.2;
    }
}

/* تحسين للشاشات الكبيرة جداً */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .news-grid,
    .related-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .related-card-image {
        height: 220px;
    }
    
    .related-card-content {
        padding: 25px;
    }
    
    .related-card h4 {
        font-size: 1.2rem;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .mobile-menu-toggle,
    .mobile-nav-menu,
    .mobile-nav-overlay {
        display: none !important;
    }
    
    .news-card {
        break-inside: avoid;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .news-grid,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .related-articles {
        padding: 20px 0;
    }
    
    .related-card {
        break-inside: avoid;
    }
} 