/* ==========================================================
   Aurora Theme - قالب أورورا الإخباري
   ========================================================== */

:root {
    --primary: #2563eb;
    --accent: #7c3aed;
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    --border: #e5e9f0;
    --radius: 14px;
    --shadow: 0 2px 14px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
    --max: 1240px;
    --font: "Segoe UI", Tahoma, "Cairo", system-ui, sans-serif;
}

[data-theme="dark"] {
    --bg: #0b1220;
    --bg-soft: #121c2e;
    --text: #e8eefc;
    --text-2: #a8b6cc;
    --text-3: #6b7a90;
    --border: #22304a;
    --shadow: 0 2px 14px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.85;
    color: var(--text);
    background: var(--bg);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.45; margin: 0 0 .5em; font-weight: 800; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 18px; }

/* ============ شريط العاجل ============ */
.ticker {
    background: linear-gradient(90deg, #dc2626, #b91c1c);
    color: #fff;
    overflow: hidden;
    font-size: 14.5px;
}
.ticker .wrap { display: flex; align-items: center; gap: 14px; height: 42px; }
.ticker .tag {
    background: #fff; color: #dc2626; font-weight: 800; padding: 3px 12px;
    border-radius: 20px; font-size: 12.5px; white-space: nowrap; flex-shrink: 0;
}
.ticker-track { flex: 1; overflow: hidden; position: relative; height: 42px; }
.ticker-items { display: flex; align-items: center; gap: 40px; height: 42px; white-space: nowrap;
                animation: ticker-move 40s linear infinite; }
.ticker-items a { color: #fff; }
.ticker-items a:hover { color: #fde68a; }
.ticker:hover .ticker-items { animation-play-state: paused; }
@keyframes ticker-move { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============ الشريط العلوي ============ */
.topbar {
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    font-size: 13px; color: var(--text-2);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 38px; }
.topbar .spacer { flex: 1; }
.topbar-menu { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; }
.social-links { display: flex; gap: 8px; }
.social-links a {
    width: 26px; height: 26px; border-radius: 50%; background: var(--bg);
    display: grid; place-items: center; font-size: 13px; border: 1px solid var(--border);
}
.social-links a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============ الهيدر ============ */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.header-main { display: flex; align-items: center; gap: 20px; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 11px; }
.logo img { max-height: 54px; width: auto; }
.logo .txt strong {
    font-size: 26px; font-weight: 900; line-height: 1.1; display: block;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo .txt span { font-size: 12px; color: var(--text-3); }
.header-main .spacer { flex: 1; }

.header-centered { text-align: center; padding: 22px 0 14px; }
.header-centered .logo { justify-content: center; }

.search-box { position: relative; }
.search-box input {
    padding: 9px 38px 9px 14px; border: 1px solid var(--border); border-radius: 22px;
    background: var(--bg-soft); font-family: inherit; font-size: 14px; width: 210px;
    color: var(--text); transition: width .2s;
}
.search-box input:focus { outline: none; width: 260px; border-color: var(--primary); }
.search-box button {
    position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
    border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--text-3);
}

.icon-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-soft); cursor: pointer; display: grid; place-items: center;
    font-size: 16px; color: var(--text);
}
.icon-btn:hover { background: var(--primary); color: #fff; }

/* ============ القائمة الرئيسية ============ */
.main-nav { background: var(--bg); border-bottom: 2px solid var(--primary); }
.main-nav .wrap { display: flex; align-items: center; }
.sn-menu { display: flex; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.sn-menu > li { position: relative; }
.sn-menu > li > a {
    display: block; padding: 13px 16px; font-weight: 700; font-size: 15px;
    border-bottom: 3px solid transparent;
}
.sn-menu > li > a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.sn-menu .sub-menu {
    position: absolute; top: 100%; inset-inline-start: 0; background: var(--bg);
    border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
    min-width: 200px; padding: 6px; list-style: none; margin: 0; display: none; z-index: 60;
}
.sn-menu li:hover > .sub-menu { display: block; }
.sn-menu .sub-menu a { display: block; padding: 8px 13px; border-radius: 7px; font-size: 14px; }
.sn-menu .sub-menu a:hover { background: var(--bg-soft); }

.menu-toggle { display: none; }

/* ============ التخطيط ============ */
.layout { display: grid; gap: 30px; padding: 30px 0; }
.layout.with-sidebar { grid-template-columns: minmax(0, 1fr) 330px; }
.layout.sidebar-right { grid-template-columns: 330px minmax(0, 1fr); }
.layout.sidebar-right .content { order: 2; }

/* ============ الأقسام ============ */
.section-head {
    display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
    padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.section-head h2 { margin: 0; font-size: 21px; position: relative; padding-inline-start: 14px; }
.section-head h2::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
    width: 5px; height: 22px; border-radius: 3px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}
.section-head .spacer { flex: 1; }
.section-head .more { font-size: 13.5px; color: var(--primary); font-weight: 700; }

/* ============ قسم الصدارة ============ */
.hero { display: grid; gap: 16px; margin: 26px 0; }
.hero.split { grid-template-columns: 1.55fr 1fr; }
.hero.grid { grid-template-columns: repeat(3, 1fr); }

.hero-main {
    position: relative; border-radius: var(--radius); overflow: hidden; min-height: 420px;
    display: flex; align-items: flex-end; box-shadow: var(--shadow);
}
.hero-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-main .ov {
    position: relative; width: 100%; padding: 28px;
    background: linear-gradient(to top, rgba(2, 6, 23, .94) 10%, rgba(2, 6, 23, .55) 55%, transparent);
    color: #fff;
}
.hero-main h2 { font-size: 30px; margin: 8px 0; color: #fff; }
.hero-main h2 a:hover { color: #bfdbfe; }
.hero-main p { margin: 0; color: #cbd5e1; font-size: 14.5px; }

.hero-side { display: grid; gap: 14px; grid-template-rows: repeat(4, 1fr); }
.hero-small {
    position: relative; border-radius: 11px; overflow: hidden; min-height: 96px;
    display: flex; align-items: flex-end;
}
.hero-small img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-small .ov {
    position: relative; padding: 12px 14px; width: 100%; color: #fff;
    background: linear-gradient(to top, rgba(2, 6, 23, .92), transparent);
}
.hero-small h3 { font-size: 15px; margin: 0; color: #fff; line-height: 1.5; }

/* ============ شارة القسم ============ */
.cat-badge {
    display: inline-block; padding: 3px 11px; border-radius: 20px;
    font-size: 11.5px; font-weight: 800; background: var(--primary); color: #fff;
}

/* ============ بطاقة الخبر ============ */
.cards { display: grid; gap: 22px; }
.cards.c2 { grid-template-columns: repeat(2, 1fr); }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.cards.c4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card .thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-soft); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .thumb img { transform: scale(1.06); }
.card .thumb .cat-badge { position: absolute; top: 11px; inset-inline-start: 11px; }
.card .body { padding: 15px 16px 17px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 17px; margin: 0 0 8px; line-height: 1.6; }
.card p { margin: 0 0 12px; font-size: 14px; color: var(--text-2); flex: 1; }
.card .meta {
    display: flex; gap: 12px; font-size: 12.5px; color: var(--text-3);
    border-top: 1px solid var(--border); padding-top: 10px; flex-wrap: wrap;
}

/* بطاقة أفقية */
.card-h { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.card-h:last-child { border-bottom: 0; }
.card-h .thumb { width: 116px; height: 78px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.card-h .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-h h3 { font-size: 15px; margin: 0 0 5px; line-height: 1.6; }
.card-h .meta { font-size: 12px; color: var(--text-3); }

/* قائمة مرقّمة */
.rank-list { counter-reset: r; }
.rank-list .card-h { position: relative; padding-inline-start: 40px; }
.rank-list .card-h::before {
    counter-increment: r; content: counter(r);
    position: absolute; inset-inline-start: 0; top: 14px;
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 13px;
}

/* ============ الشريط الجانبي ============ */
.widget {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 22px; overflow: hidden;
}
.widget-head {
    padding: 13px 17px; border-bottom: 1px solid var(--border); background: var(--bg-soft);
    font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 8px;
}
.widget-body { padding: 15px 17px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a {
    padding: 5px 13px; border-radius: 20px; background: var(--bg-soft);
    border: 1px solid var(--border); font-size: 13px; color: var(--text-2);
}
.tag-cloud a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a { display: flex; align-items: center; gap: 9px; padding: 10px 0; font-weight: 600; font-size: 14.5px; }
.cat-list .dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.cat-list .count { margin-inline-start: auto; font-size: 12px; color: var(--text-3); }

/* ============ صفحة المقال ============ */
.article-head { margin-bottom: 22px; }
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 14px; display: flex; gap: 7px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }
.article-head h1 { font-size: 34px; line-height: 1.4; margin: 10px 0 12px; }
.article-excerpt { font-size: 18px; color: var(--text-2); line-height: 1.9; margin-bottom: 16px; font-weight: 500; }
.article-meta {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 13px 0; border-block: 1px solid var(--border); font-size: 13.5px; color: var(--text-2);
}
.article-meta .author { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.article-meta .author img { width: 34px; height: 34px; border-radius: 50%; }

.featured-figure { margin: 22px 0; }
.featured-figure img { width: 100%; border-radius: var(--radius); }
.featured-figure figcaption { font-size: 13px; color: var(--text-3); padding-top: 8px; text-align: center; }

.article-body { font-size: 17.5px; line-height: 2.1; }
.article-body p { margin: 0 0 1.3em; }
.article-body h2 { font-size: 25px; margin: 1.6em 0 .6em; }
.article-body h3 { font-size: 21px; margin: 1.4em 0 .5em; }
.article-body img, .article-body figure img { border-radius: 10px; margin: 1em 0; }
.article-body figure { margin: 1.4em 0; }
.article-body figcaption { font-size: 13px; color: var(--text-3); text-align: center; padding-top: 6px; }
.article-body blockquote {
    border-inline-start: 5px solid var(--primary); background: var(--bg-soft);
    padding: 14px 20px; margin: 1.5em 0; border-radius: 0 10px 10px 0;
    font-size: 18px; color: var(--text-2);
}
.article-body ul, .article-body ol { padding-inline-start: 26px; margin: 0 0 1.3em; }
.article-body li { margin-bottom: .5em; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15.5px; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 12px; }
.article-body th { background: var(--bg-soft); font-weight: 800; }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.sn-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 1.5em 0; border-radius: 10px; overflow: hidden; }
.sn-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* مشاركة */
.share-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0; }
.share-bar a, .share-bar button {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
    border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border);
    font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit; color: var(--text);
}
.share-bar a:hover, .share-bar button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 22px 0; }

/* صندوق الكاتب */
.author-box {
    display: flex; gap: 16px; padding: 20px; background: var(--bg-soft);
    border-radius: var(--radius); margin: 26px 0; align-items: flex-start;
}
.author-box img { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; }
.author-box h4 { margin: 0 0 4px; font-size: 17px; }
.author-box p { margin: 0; font-size: 14px; color: var(--text-2); }

/* السابق والتالي */
.adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0; }
.adjacent a {
    padding: 15px 18px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-soft);
}
.adjacent a:hover { border-color: var(--primary); }
.adjacent span { font-size: 12px; color: var(--text-3); display: block; margin-bottom: 5px; }
.adjacent b { font-size: 15px; font-weight: 700; line-height: 1.6; }

/* التعليقات */
.comments { margin: 34px 0; }
.comment {
    display: flex; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--border);
}
.comment .av {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px;
}
.comment .cbody { flex: 1; }
.comment .cname { font-weight: 800; font-size: 14.5px; }
.comment .cdate { font-size: 12px; color: var(--text-3); }
.comment .ctext { margin: 6px 0 0; font-size: 15px; color: var(--text-2); }
.comment.reply { margin-inline-start: 52px; }

.comment-form { background: var(--bg-soft); padding: 20px; border-radius: var(--radius); margin-top: 20px; }
.comment-form .row { display: flex; gap: 12px; }
.comment-form .row > * { flex: 1; }
.comment-form input, .comment-form textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px;
    font-family: inherit; font-size: 14.5px; margin-bottom: 12px; background: var(--bg); color: var(--text);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--primary); }

.btn-primary {
    display: inline-block; padding: 11px 26px; background: var(--primary); color: #fff;
    border: 0; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { background: var(--accent); color: #fff; }

.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14.5px; }
.notice-success { background: #dcfce7; color: #166534; }
.notice-error { background: #fee2e2; color: #991b1b; }

/* ============ الأرشيف ============ */
.archive-head {
    padding: 28px; border-radius: var(--radius); margin-bottom: 26px;
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
}
.archive-head h1 { margin: 0 0 6px; font-size: 30px; color: #fff; }
.archive-head p { margin: 0; opacity: .9; font-size: 15px; }

/* ============ الترقيم ============ */
.sn-pagination { margin: 34px 0; }
.sn-pagination ul { display: flex; gap: 6px; justify-content: center; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.sn-pagination a, .sn-pagination span {
    display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 10px; font-size: 14.5px; font-weight: 600;
}
.sn-pagination a:hover { background: var(--bg-soft); }
.sn-pagination .active span { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============ التذييل ============ */
.site-footer { background: #0b1220; color: #94a3b8; margin-top: 50px; padding: 46px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 34px; padding-bottom: 34px; }
.site-footer h4 { color: #fff; font-size: 16px; margin: 0 0 14px; }
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; font-size: 14px; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08); padding: 18px 0;
    font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
}
.footer-bottom .spacer { flex: 1; }

.to-top {
    position: fixed; bottom: 24px; inset-inline-start: 24px; width: 46px; height: 46px;
    border-radius: 50%; background: var(--primary); color: #fff; border: 0; cursor: pointer;
    font-size: 19px; display: none; place-items: center; box-shadow: var(--shadow-lg); z-index: 90;
}
.to-top.show { display: grid; }

/* ============ 404 ============ */
.error-page { text-align: center; padding: 70px 20px; }
.error-page .code {
    font-size: 110px; font-weight: 900; line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ الاستجابة ============ */
@media (max-width: 1024px) {
    .layout.with-sidebar, .layout.sidebar-right { grid-template-columns: 1fr; }
    .layout.sidebar-right .content { order: 0; }
    .hero.split, .hero.grid { grid-template-columns: 1fr; }
    .hero-side { grid-template-rows: none; grid-template-columns: repeat(2, 1fr); }
    .cards.c4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    body { font-size: 15.5px; }
    .cards.c3, .cards.c4, .cards.c2 { grid-template-columns: 1fr; }
    .hero-side { grid-template-columns: 1fr; }
    .hero-main { min-height: 290px; }
    .hero-main h2 { font-size: 22px; }
    .article-head h1 { font-size: 25px; }
    .article-body { font-size: 16.5px; }
    .adjacent { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .topbar .wrap { justify-content: center; }
    .topbar-menu, .header-main .search-box { display: none; }

    .menu-toggle {
        display: grid; place-items: center; width: 40px; height: 40px;
        border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft);
        cursor: pointer; font-size: 18px; color: var(--text);
    }
    .main-nav .wrap { padding: 0; }
    .sn-menu {
        display: none; flex-direction: column; width: 100%;
        border-top: 1px solid var(--border);
    }
    .sn-menu.open { display: flex; }
    .sn-menu > li > a { padding: 12px 18px; border-bottom: 1px solid var(--border); }
    .sn-menu .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding-inline-start: 16px; }
    .comment-form .row { flex-direction: column; gap: 0; }
}

@media print {
    .site-header, .site-footer, .main-nav, .ticker, .topbar, .share-bar, .comments, .to-top { display: none !important; }
    .layout { grid-template-columns: 1fr !important; }
}
