/*
Theme Name: بوابة الدفاع العربي
Theme URI: https://example.com
Author: أنت
Author URI: https://example.com
Description: قالب مجلة/أخبار متخصص في الشؤون العسكرية والدفاعية - تصميم عصري وأنيق
Version: 1.0.0
License: GPL v2 or later
Text Domain: defense-portal
Domain Path: /languages
*/

:root {
    --primary: #1a1a1a;
    --brand-red: #c00;
    --gold-accent: #b08d57;
    --bg-body: #ffffff;
    --bg-alt: #f9f9f9;
    --border: #ececec;
    --text-dark: #222;
    --text-light: #666;
}

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

body {
    font-family: 'Noto Kufi Arabic', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

/* الطباعة */
@media print {
    body { font-size: 12pt; }
}

/* ====== الشريط العلوي ====== */
.top-bar {
    background: var(--primary);
    color: white;
    padding: 8px 5%;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.top-bar span:last-child {
    color: var(--gold-accent);
}

/* ====== الهيدر ====== */
header {
    padding: 20px 5%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 992px) {
    header {
        flex-direction: row;
        justify-content: space-between;
    }
}

.logo-box h1,
.logo-box .site-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    color: var(--primary);
    letter-spacing: -1px;
    white-space: nowrap;
}

.logo-box a {
    text-decoration: none;
    color: inherit;
}

.header-ads {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
    font-size: 0.8rem;
    color: #999;
}

/* ====== شريط التنقل ====== */
.nav-container {
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-inner {
    display: flex;
    align-items: center;
    padding: 0 5%;
}

/* شريط الموبايل (يظهر فقط في الشاشات الصغيرة) */
.mobile-nav-bar {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

/* القائمة الرئيسية */
nav {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    padding: 12px 0;
    transition: 0.3s ease;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

nav li {
    position: relative;
}

nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    transition: 0.2s;
    white-space: nowrap;
    padding: 5px 0;
    display: inline-block;
}

nav a:hover {
    color: var(--brand-red);
}

/* القوائم المنسدلة */
nav .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
    z-index: 100;
    display: block;
    padding: 10px 0;
}

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

nav .sub-menu li {
    padding: 0 15px;
}

nav .sub-menu a {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

nav .sub-menu li:last-child a {
    border-bottom: none;
}

/* أيقونة البرغر */
.burger-icon {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.burger-icon span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    transition: 0.3s;
}

/* ====== المحتوى الرئيسي ====== */
main {
    min-height: 60vh;
}

/* ====== الشبكة الرئيسية (Hero) ====== */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 5%;
}

@media (min-width: 992px) {
    .hero-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.main-feat {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    height: 350px;
}

@media (min-width: 992px) {
    .main-feat {
        height: 450px;
    }
}

.main-feat img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feat-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
    padding: 20px;
    color: white;
}

.feat-overlay h2 {
    font-size: 1.3rem;
    margin: 10px 0;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .feat-overlay h2 {
        font-size: 1.8rem;
    }
}

.feat-tag {
    background: var(--brand-red);
    padding: 3px 10px;
    font-size: 0.6rem;
    font-weight: bold;
    display: inline-block;
}

.feat-desc {
    font-size: 0.85rem;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .feat-desc {
        display: none;
    }
}

.sub-feat-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sub-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.sub-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
}

.sub-item h4 {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.sub-item-cat {
    color: var(--brand-red);
    font-size: 0.7rem;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

/* ====== الأقسام العامة ====== */
.section-wrapper {
    padding: 40px 5%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 25px;
}

.section-header h2 {
    background: var(--primary);
    color: white;
    margin: 0;
    padding: 5px 15px;
    font-size: 1rem;
}

.section-header .view-all {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.75rem;
}

/* ====== بطاقات الأسلحة ====== */
.arsenal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.spec-card {
    border: 1px solid var(--border);
    background: white;
    transition: 0.3s;
    border-top: 4px solid var(--gold-accent);
}

.spec-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.spec-info {
    padding: 15px;
}

.spec-tag {
    font-size: 0.7rem;
    color: var(--gold-accent);
    font-weight: bold;
    text-transform: uppercase;
}

.spec-table {
    width: 100%;
    font-size: 0.8rem;
    margin-top: 10px;
    border-collapse: collapse;
}

.spec-table td {
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

/* ====== القسم الداكن (مرئيات الدفاع) ====== */
.media-dark {
    background: #111;
    color: white;
    padding: 40px 5%;
}

.media-dark .section-header {
    border-color: #333;
}

.media-dark .section-header h2 {
    background: var(--brand-red);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.video-box {
    position: relative;
    cursor: pointer;
}

.video-box img {
    width: 100%;
    border-radius: 4px;
    opacity: 0.6;
    transition: 0.3s;
}

.video-box:hover img {
    opacity: 0.8;
}

.play-btn {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* ====== بطاقات التاريخ ====== */
.history-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .history-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.history-card {
    display: flex;
    gap: 20px;
    background: var(--bg-alt);
    padding: 15px;
    border-radius: 4px;
    align-items: center;
}

.history-year {
    font-size: 1.5rem;
    color: var(--gold-accent);
    font-weight: bold;
    min-width: 60px;
}

/* ====== التذييل ====== */
footer {
    background: var(--primary);
    color: #ccc;
    padding: 40px 5% 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    footer {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

footer h4 {
    color: white;
    margin-bottom: 15px;
    border-right: 3px solid var(--brand-red);
    padding-right: 10px;
    font-size: 1rem;
}

footer ul {
    list-style: none;
    padding: 0;
    font-size: 0.85rem;
}

footer li {
    margin-bottom: 8px;
}

footer a {
    color: #ccc;
    text-decoration: none;
    transition: 0.2s;
}

footer a:hover {
    color: white;
}

/* أيقونات التواصل */
.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icons a {
    display: inline-block;
    width: 36px;
    height: 36px;
    background: #333;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    color: white;
    transition: 0.3s;
}

.social-icons a:hover {
    background: var(--brand-red);
    transform: translateY(-3px);
}

/* النشرة البريدية */
.newsletter input {
    width: 100%;
    padding: 10px;
    border: none;
    margin-bottom: 10px;
    background: #333;
    color: white;
    border-radius: 3px;
    font-family: inherit;
}

.newsletter button {
    width: 100%;
    background: var(--brand-red);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 3px;
    transition: 0.3s;
}

.newsletter button:hover {
    background: #a00;
}

/* شريط الحقوق الفكرية */
.copyright-bar {
    background: #000;
    color: #666;
    text-align: center;
    padding: 20px 5%;
    font-size: 0.75rem;
    border-top: 1px solid #222;
}

/* ====== إعادة تصميم صفحة المقالة ====== */

/* 1. العرض العام للمقال */
.entry-content-wrapper {
    width: 80%;
    margin: 0 auto;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .entry-content-wrapper {
        width: 100%;
        padding: 0 20px;
    }
}

/* 2. عنوان المقال */
.entry-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.5em;
    border-bottom: 2px solid var(--gold-accent);
    padding-bottom: 0.5em;
}

/* 3. الصورة المميزة */
.post-thumbnail {
    margin: 20px 0;
    width: 100%;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* 4. معلومات المقال */
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 20px 0 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 5. المحتوى النصي */
.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.entry-content p {
    margin-bottom: 1.8em;
}

/* 6. العناوين داخل المحتوى */
.entry-content h2 {
    font-size: 1.8rem;
    margin: 2em 0 1em;
    background: linear-gradient(to right, transparent, var(--bg-alt));
    padding: 10px 15px;
    border-right: 4px solid var(--brand-red);
    color: var(--primary);
}

.entry-content h3 {
    font-size: 1.4rem;
    margin: 1.5em 0 1em;
    background: linear-gradient(to right, transparent, var(--bg-alt));
    padding: 8px 15px;
    border-right: 3px solid var(--gold-accent);
    color: var(--primary);
}

.entry-content h4 {
    font-size: 1.2rem;
    margin: 1.5em 0 1em;
    color: var(--primary);
    font-weight: 700;
}

/* 7. الاقتباسات */
.entry-content blockquote {
    margin: 2em 0;
    padding: 1.5em 2em;
    background: var(--bg-alt);
    border-right: 4px solid var(--gold-accent);
    font-style: italic;
    font-size: 1.1rem;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.entry-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: var(--gold-accent);
    opacity: 0.2;
    position: absolute;
    top: -10px;
    right: 10px;
}

/* 8. التصنيفات والوسوم */
.post-categories,
.post-tags {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.post-categories a,
.post-tags a {
    display: inline-block;
    padding: 5px 15px;
    background: var(--bg-alt);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: 20px;
    margin-left: 8px;
    margin-bottom: 8px;
    transition: 0.2s;
}

.post-categories a:hover,
.post-tags a:hover {
    background: var(--brand-red);
    color: white;
}

/* 9. التنقل بين المقالات */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 50px 0 30px;
    padding: 20px 0;
    border-top: 2px solid var(--border);
}

.post-navigation div {
    flex: 1;
}

.post-navigation .nav-previous {
    text-align: right;
}

.post-navigation .nav-next {
    text-align: left;
}

.post-navigation a {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: 0.2s;
    border: 1px solid var(--primary);
}

.post-navigation a:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(192, 0, 0, 0.2);
}

/* 10. التعليقات */
.comments-area {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 3px solid var(--primary);
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 25px;
    background: var(--bg-alt);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.comment .children {
    list-style: none;
    margin-right: 40px;
    margin-top: 20px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.comment-author img {
    border-radius: 50%;
    border: 2px solid var(--gold-accent);
}

.comment-metadata {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.reply {
    text-align: left;
}

.reply a {
    display: inline-block;
    padding: 5px 15px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: 20px;
}

/* 11. الصور داخل المقال */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: 5px;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    margin: 1.5em 0;
}

.entry-content .wp-caption {
    max-width: 100%;
    margin: 1.5em 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px;
}

.entry-content .wp-caption img {
    margin: 0;
    border: none;
    box-shadow: none;
}

.entry-content .wp-caption-text {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    padding: 10px;
    margin: 0;
}

/* معرض الصور */
.entry-content .wp-block-gallery {
    margin: 2em 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.entry-content .wp-block-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin: 0;
}

/* 12. الجداول */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.entry-content th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: right;
    font-weight: 700;
}

.entry-content td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.entry-content tr:nth-child(even) {
    background: var(--bg-alt);
}

.entry-content tr:hover {
    background: #f0f0f0;
}

/* ====== استجابة الموبايل ====== */
@media (max-width: 768px) {
    header {
        display: none;
    }
    
    .mobile-nav-bar {
        display: flex;
    }
    
    .burger-icon {
        display: flex;
    }
    
    nav {
        position: fixed;
        top: 55px;
        right: -100%;
        flex-direction: column;
        background: white;
        width: 250px;
        height: 100vh;
        padding: 20px;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        gap: 15px;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    nav .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-right: 15px;
        display: none;
    }
    
    nav li:hover > .sub-menu {
        display: block;
    }
    
    .entry-title {
        font-size: 2rem;
    }
    
    .entry-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    footer {
        grid-template-columns: 1fr 1fr;
    }
}

/* ====== فائدة: إخفاء العناصر ====== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}