/* ═══════════════════════════════════════════════════════════
   Nova Zone — التصميم الكامل
   ═══════════════════════════════════════════════════════════ */

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

:root {
    --bg:        #0a0e1a;
    --bg-2:      #0f172a;
    --bg-card:   #1e293b;
    --bg-hover:  #293548;
    --text:      #e2e8f0;
    --text-dim:  #94a3b8;
    --text-mute: #64748b;
    --primary:   #8b5cf6;
    --primary-d: #7c3aed;
    --accent:    #22d3ee;
    --success:   #4ade80;
    --warning:   #facc15;
    --danger:    #f87171;
    --border:    rgba(255, 255, 255, 0.08);
    --shadow:    0 10px 40px rgba(0, 0, 0, 0.4);
    --radius:    16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
}

body {
    font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════ */

.site-header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 900;
    color: var(--text);
}

.logo:hover { color: var(--text); }

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 18px;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.main-nav {
    display: flex;
    gap: 8px;
}

.main-nav a {
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text-dim);
    transition: all 0.2s;
}

.main-nav a:hover {
    background: var(--bg-card);
    color: var(--text);
}

.main-nav a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-d));
    color: #fff;
}

.mobile-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   Hero
   ═══════════════════════════════════════════════════════════ */

.hero {
    padding: 70px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #67e8f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 17px;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   Section
   ═══════════════════════════════════════════════════════════ */

.section {
    padding: 40px 0 60px;
}

.section-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
    width: 4px;
    height: 26px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   Articles Grid
   ═══════════════════════════════════════════════════════════ */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.article-card {
    background: linear-gradient(160deg, var(--bg-card), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 50px rgba(139, 92, 246, 0.15);
}

.article-cover {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 60%);
    z-index: 1;
    pointer-events: none;
}

.article-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.4s ease;
}

.article-card:hover .article-cover img {
    transform: scale(1.06);
}

.article-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(10, 14, 26, 0.6) 100%);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.article-card:hover .article-cover::after {
    opacity: 1;
}

.article-cover .cover-emoji {
    font-size: 64px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,0.4));
}

.article-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-mute);
    margin-bottom: 10px;
    font-weight: 700;
}

.article-title {
    font-size: 17px;
    font-weight: 900;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-desc {
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 13.5px;
    color: var(--primary);
    margin-top: auto;
}

.article-read::after {
    content: "←";
    transition: transform 0.2s;
}

.article-card:hover .article-read::after {
    transform: translateX(-6px);
}

/* ═══════════════════════════════════════════════════════════
   Single Article
   ═══════════════════════════════════════════════════════════ */

.article-single {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* صورة المقال داخل الصفحة */
.article-hero {
    width: 100%;
    max-width: 780px;
    margin: 0 auto 30px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.article-header {
    margin-bottom: 30px;
}

.article-breadcrumb {
    font-size: 13px;
    color: var(--text-mute);
    margin-bottom: 14px;
    font-weight: 700;
}

.article-breadcrumb a {
    color: var(--text-dim);
}

.article-header h1 {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 16px;
    color: #fff;
}

.article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-mute);
    font-weight: 700;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.article-content {
    font-size: 16.5px;
    line-height: 1.9;
    color: #cbd5e1;
}

.article-content h2 {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.article-content h3 {
    font-size: 19px;
    font-weight: 900;
    color: #f1f5f9;
    margin: 26px 0 12px;
}

.article-content p {
    margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
    margin: 16px 0 20px;
    padding-inline-start: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    color: #fff;
    font-weight: 800;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content blockquote {
    background: rgba(139, 92, 246, 0.08);
    border-right: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    color: #e2e8f0;
    font-style: italic;
}

.article-content img {
    border-radius: var(--radius);
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
}

.article-content th {
    background: rgba(139, 92, 246, 0.15);
    padding: 12px;
    text-align: right;
    font-weight: 800;
    color: #fff;
}

.article-content td {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ═══════════════════════════════════════════════════════════
   CTA Button (زر المتابعة)
   ═══════════════════════════════════════════════════════════ */

.cta-box {
    margin: 40px 0;
    padding: 30px 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(34, 211, 238, 0.08));
    border: 1.5px solid rgba(139, 92, 246, 0.4);
    border-radius: var(--radius-lg);
    text-align: center;
}

.cta-title {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 8px;
}

.cta-desc {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4);
    transition: all 0.25s;
    text-decoration: none;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(139, 92, 246, 0.5);
    color: #fff;
}

.cta-btn:active {
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════ */

.site-footer {
    background: #060912;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-top: 50px;
    padding-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 400px;
}

.footer-col h4 {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-mute);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   Reading Progress Bar — شريط تقدم القراءة
   ═══════════════════════════════════════════════════════════ */

#readingProgress {
    position: fixed;
    top: 0;
    right: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, #8b5cf6, #22d3ee, #8b5cf6);
    background-size: 200% 100%;
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 
        0 0 15px rgba(139, 92, 246, 0.8),
        0 0 30px rgba(34, 211, 238, 0.4);
    border-radius: 0 0 4px 4px;
    animation: progressShine 3s linear infinite;
    pointer-events: none;
}

@keyframes progressShine {
    0%   { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* ═══════════════════════════════════════════════════════════
   زر العودة للأعلى
   ═══════════════════════════════════════════════════════════ */

#scrollTopBtn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    color: #fff;
    border: 0;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 
        0 10px 25px rgba(139, 92, 246, 0.5),
        0 0 30px rgba(34, 211, 238, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    line-height: 1;
}

#scrollTopBtn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scrollTopBtn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(139, 92, 246, 0.7),
        0 0 50px rgba(34, 211, 238, 0.5);
}

#scrollTopBtn:active {
    transform: translateY(-1px) scale(0.98);
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .hero { padding: 45px 0 30px; }
    .hero h1 { font-size: 28px; }
    .hero p  { font-size: 15px; }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--bg-2);
        flex-direction: column;
        padding: 12px;
        gap: 4px;
        border-bottom: 1px solid var(--border);
    }

    body.nav-open .main-nav {
        display: flex;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-inner { position: relative; }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 35px;
        padding-bottom: 25px;
    }

    .article-header h1 { font-size: 24px; }
    .article-content { font-size: 15.5px; }
    .article-content h2 { font-size: 20px; }
    .article-content h3 { font-size: 17px; }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .cta-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 24px; }
    .article-single { padding: 25px 16px 40px; }
    .article-header h1 { font-size: 21px; }

    #readingProgress {
        height: 3px;
    }

    #scrollTopBtn {
        width: 46px;
        height: 46px;
        font-size: 20px;
        bottom: 18px;
        left: 18px;
    }
}