/**
 * Theme Name: Jarida Theme
 * File: Main Stylesheet (Full Version)
 */

/* =====================================================
   1. المتغيرات والأساسيات (Variables & Reset)
===================================================== */
:root {
    --jarida-primary: #e8001c; /* اللون الأحمر الأساسي */
    --jarida-secondary: #1e293b; /* اللون الداكن للفوتر */
    --jarida-bg: #f8fafc;
    --jarida-white: #ffffff;
    --jarida-text-main: #111827;
    --jarida-text-muted: #64748b;
    --jarida-border: #e2e8f0;
    --jarida-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --jarida-radius-lg: 24px;
    --jarida-radius-md: 16px;
    --jarida-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: "Cairo", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    background: var(--jarida-bg);
    color: var(--jarida-text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.jarida-container {
    width: min(100% - 32px, 1380px);
    margin-inline: auto;
}

a { text-decoration: none; transition: var(--jarida-transition); color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* =====================================================
   2. ترويسة الموقع (Header & Navigation)
===================================================== */
.jg-site-header {
    background: var(--jarida-white);
    border-bottom: 1px solid var(--jarida-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.jg-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 90px;
}

.jg-logo-text {
    font-size: 32px;
    font-weight: 900;
    color: var(--jarida-primary);
    letter-spacing: -1px;
}

.jg-main-navigation ul {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.jg-main-navigation a {
    font-size: 15px;
    font-weight: 800;
    color: var(--jarida-text-main);
    padding: 10px 0;
}

.jg-main-navigation a:hover,
.jg-main-navigation .current-menu-item > a {
    color: var(--jarida-primary);
}

/* =====================================================
   3. شبكة المجلة - الرئيسية (Magazine Grid)
===================================================== */
.jg-magazine-grid-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    margin: 30px 0 40px;
}

.jg-mag-main-block {
    position: relative;
    border-radius: var(--jarida-radius-lg);
    overflow: hidden;
    height: 500px;
    box-shadow: var(--jarida-shadow);
}

.jg-mag-main-block img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--jarida-transition);
}

.jg-mag-main-block:hover img { transform: scale(1.04); }

.jg-mag-overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    padding: 40px;
    color: #fff;
}

.jg-mag-overlay-content h2 {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.4;
}

.jg-mag-sub-blocks-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jg-mag-sub-item {
    background: var(--jarida-white);
    border: 1px solid var(--jarida-border);
    border-radius: var(--jarida-radius-md);
    padding: 14px;
    transition: var(--jarida-transition);
}

.jg-mag-sub-item a { display: flex; gap: 18px; align-items: center; }

.jg-mag-sub-item img {
    width: 130px;
    height: 95px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.jg-mag-sub-item:hover {
    transform: translateX(-5px);
    border-color: var(--jarida-primary);
}

.jg-mag-sub-info h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.5;
}

/* =====================================================
   4. تكرار المقالات (Posts Grid & Cards)
===================================================== */
.jg-index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 40px 0;
}

.jg-index-card {
    background: var(--jarida-white);
    border-radius: var(--jarida-radius-md);
    overflow: hidden;
    border: 1px solid var(--jarida-border);
    transition: var(--jarida-transition);
}

.jg-index-card:hover { transform: translateY(-8px); box-shadow: var(--jarida-shadow); }

.jg-index-thumb { width: 100%; height: 220px; object-fit: cover; }

.jg-index-content { padding: 24px; }

.jg-index-category {
    display: inline-block;
    padding: 4px 14px;
    background: #f5f3ff;
    color: var(--jarida-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}

.jg-index-card-title {
    font-size: 20px;
    font-weight: 900;
    margin: 0 0 15px;
    line-height: 1.6;
}

/* =====================================================
   5. صفحة المقال المنفرد (Single Post Page)
===================================================== */
.jg-single-wrap { padding: 60px 0; }

.jg-single-article {
    max-width: 900px;
    margin: 0 auto;
    background: var(--jarida-white);
    border-radius: var(--jarida-radius-lg);
    padding: 50px;
    border: 1px solid var(--jarida-border);
}

.jg-single-title {
    font-size: 42px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.3;
}

.jg-single-meta {
    text-align: center;
    color: var(--jarida-text-muted);
    font-weight: 700;
    margin-bottom: 40px;
}

.jg-single-thumb {
    margin-bottom: 40px;
    border-radius: var(--jarida-radius-md);
    overflow: hidden;
}

.jg-single-content {
    font-size: 18px;
    line-height: 2.2;
    color: #374151;
}

/* =====================================================
   6. صفحة البحث والـ 404 (Search & 404)
===================================================== */
.jg-search-header, .jg-404-box {
    text-align: center;
    padding: 60px 0;
}

.jg-404-number {
    font-size: 120px;
    font-weight: 900;
    color: var(--jarida-primary);
    line-height: 1;
}

.jg-search-page-form, .jg-404-search {
    display: flex;
    max-width: 600px;
    margin: 30px auto;
    gap: 10px;
}

.jg-search-page-form input, .jg-404-search input {
    flex: 1;
    height: 55px;
    border-radius: 14px;
    border: 1px solid var(--jarida-border);
    padding: 0 20px;
    outline: none;
}

.jg-search-page-form button, .jg-404-search button {
    background: var(--jarida-primary);
    color: #fff;
    border: none;
    padding: 0 30px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* =====================================================
   7. تذييل الموقع (Footer)
===================================================== */
.jg-site-footer {
    background: var(--jarida-secondary);
    color: #e2e8f0;
    padding: 70px 0 30px;
    margin-top: 80px;
}

.jg-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    border-bottom: 1px solid #334155;
    padding-bottom: 50px;
}

.jg-footer-info h3 { font-size: 26px; color: #fff; margin-bottom: 20px; }

.jg-footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
}

.jg-footer-navigation ul { display: flex; gap: 20px; list-style: none; }
.jg-footer-navigation a { color: #94a3b8; font-weight: 700; font-size: 14px; }
.jg-footer-navigation a:hover { color: #fff; }

.jg-copyright-text { color: #64748b; font-size: 14px; font-weight: 700; }
/* =====================================================
   8. شريط الأخبار العاجلة (Breaking News Ticker)
===================================================== */
.jg-breaking-bar {
    background: var(--jarida-white);
    border-bottom: 2px solid var(--jarida-border);
    padding: 10px 0;
    overflow: hidden;
}

.jg-breaking-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 38px;
}

.jg-breaking-label {
    background: var(--jarida-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    padding: 5px 18px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.jg-ticker-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.jg-ticker-track {
    display: flex;
    align-items: center;
    gap: 40px;
    white-space: nowrap;
    animation: ticker-rtl 40s linear infinite;
}

.jg-ticker-track:hover { animation-play-state: paused; }

.jg-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--jarida-text-main);
    white-space: nowrap;
    transition: color 0.2s;
}

.jg-ticker-item:hover { color: var(--jarida-primary); }

.jg-ticker-dot {
    color: var(--jarida-primary);
    font-size: 10px;
}

@keyframes ticker-rtl {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* =====================================================
   9. الهيرو سلايدر (Hero Slider)
===================================================== */
.jg-hero-slider-section {
    padding: 20px 0 0;
}

.jg-hero-slider-wrap {
    position: relative;
}

.jg-hero-slider {
    position: relative;
    border-radius: var(--jarida-radius-lg);
    overflow: hidden;
    height: 520px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

.jg-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}

.jg-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.jg-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.jg-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jg-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.90) 0%,
        rgba(0,0,0,0.50) 45%,
        rgba(0,0,0,0.05) 100%
    );
}

.jg-slide-content {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 40px 44px;
    color: #fff;
}

.jg-slide-category {
    display: inline-block;
    background: var(--jarida-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.jg-slide-title {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.4;
    margin: 0 0 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.jg-slide-excerpt {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    margin: 0 0 14px;
    line-height: 1.7;
}

.jg-slide-time {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
}

/* أزرار التنقل */
.jg-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jg-slider-btn:hover { background: rgba(232,0,28,0.8); }
.jg-slider-prev { left: 20px; }
.jg-slider-next { right: 20px; }

/* النقاط */
.jg-slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.jg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.45);
    cursor: pointer;
    transition: background 0.25s, transform 0.25s;
    padding: 0;
}

.jg-dot.is-active {
    background: var(--jarida-primary);
    transform: scale(1.3);
}

/* =====================================================
   10. شريط التصنيفات السريعة (Category Pills)
===================================================== */
.jg-cats-bar {
    padding: 16px 0;
    border-bottom: 1px solid var(--jarida-border);
    margin-bottom: 6px;
}

.jg-cats-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

.jg-cat-pill {
    display: inline-block;
    padding: 7px 18px;
    background: var(--jarida-white);
    border: 1.5px solid var(--jarida-border);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 800;
    color: var(--jarida-text-main);
    transition: var(--jarida-transition);
}

.jg-cat-pill:hover {
    background: var(--jarida-primary);
    color: #fff;
    border-color: var(--jarida-primary);
}

/* =====================================================
   11. عناوين الأقسام (Section Titles)
===================================================== */
.jg-section-title {
    font-size: 24px;
    font-weight: 900;
    margin: 40px 0 24px;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--jarida-primary);
    display: inline-block;
}

.jg-latest-section {
    padding-bottom: 60px;
}

/* =====================================================
   12. صفحات البحث والأرشيف - CSS مفقودة
===================================================== */
.jg-archive-wrap, .jg-search-wrap-page { padding: 40px 0; }

.jg-archive-title, .jg-search-title {
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 8px;
}

.jg-search-title span { color: var(--jarida-primary); }
.jg-search-count { color: var(--jarida-text-muted); font-size: 14px; margin-bottom: 24px; }

.jg-search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 30px;
}

.jg-search-card {
    background: var(--jarida-white);
    border-radius: var(--jarida-radius-md);
    overflow: hidden;
    border: 1px solid var(--jarida-border);
    transition: var(--jarida-transition);
}

.jg-search-card:hover { transform: translateY(-6px); box-shadow: var(--jarida-shadow); }

.jg-search-thumb { width: 100%; height: 200px; object-fit: cover; }
.jg-search-content { padding: 20px; }

.jg-search-category {
    display: inline-block;
    padding: 3px 12px;
    background: #fff0f0;
    color: var(--jarida-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
}

.jg-search-card-title { font-size: 18px; font-weight: 900; margin: 0 0 12px; line-height: 1.5; }
.jg-search-excerpt { font-size: 14px; color: var(--jarida-text-muted); line-height: 1.7; }
.jg-search-meta { margin-top: 10px; font-size: 13px; color: var(--jarida-text-muted); font-weight: 700; }

.jg-search-empty { text-align: center; padding: 60px 0; color: var(--jarida-text-muted); }

.jg-pagination-wrap { margin: 40px 0; display: flex; justify-content: center; }
.jg-pagination-wrap .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--jarida-border);
    font-weight: 800;
    font-size: 15px;
    margin: 0 4px;
    color: var(--jarida-text-main);
    transition: var(--jarida-transition);
}
.jg-pagination-wrap .page-numbers.current,
.jg-pagination-wrap .page-numbers:hover {
    background: var(--jarida-primary);
    color: #fff;
    border-color: var(--jarida-primary);
}

/* =====================================================
   13. صفحة Page (Page Template)
===================================================== */
.jg-page-wrap { padding: 60px 0; }

.jg-page-title {
    font-size: 38px;
    font-weight: 900;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--jarida-primary);
}

.jg-page-content {
    font-size: 17px;
    line-height: 2;
    color: #374151;
}
