/* ============================================================
   مدونة ApproveID — قالب صحفي احترافي (طراز جنة/صحيفة)
   ============================================================ */
:root {
    --accent:  #c62828;
    --ink:     #101828;
    --mut:     #667085;
    --line:    #e7e9ef;
    --bg:      #f7f8fa;
    --card:    #ffffff;
    --dark:    #0f1523;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Cairo', Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.75; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 18px; }

/* ---------- الشريط العلوي ---------- */
.topbar { background: var(--dark); color: #cbd2e1; font-size: 12.5px; font-weight: 600; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar a { color: #ffd479; }
.topbar a:hover { color: #fff; }

/* ---------- الرأس ---------- */
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 40px; line-height: 1; }
.brand-text strong { display: block; font-size: 26px; font-weight: 900; letter-spacing: -.5px; }
.brand-text small { color: var(--mut); font-weight: 600; font-size: 12.5px; }
.msearch { display: flex; flex: 0 1 340px; min-width: 220px; }
.msearch input { flex: 1; min-width: 0; border: 2px solid var(--line); border-inline-end: 0; border-radius: 0 10px 10px 0; padding: 9px 14px; font: inherit; font-weight: 600; }
.msearch input:focus { outline: none; border-color: var(--accent); }
.msearch button { border: 0; background: var(--accent); color: #fff; padding: 0 16px; border-radius: 10px 0 0 10px; cursor: pointer; font-size: 16px; }

/* ---------- التنقل ---------- */
.mainnav { background: #fff; border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(16,24,40,.06); }
.mainnav .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mainnav .wrap::-webkit-scrollbar { display: none; }
.mainnav a { padding: 12px 16px; font-weight: 800; font-size: 14.5px; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px; transition: .15s; }
.mainnav a:hover { color: var(--cat, var(--accent)); border-bottom-color: var(--cat, var(--accent)); }
.nav-home { color: var(--accent); }

/* ---------- شريط الأحدث ---------- */
.ticker { background: #fff; border-bottom: 1px solid var(--line); }
.ticker .wrap { display: flex; align-items: center; gap: 12px; height: 40px; overflow: hidden; }
.ticker-label { background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.ticker-view { overflow: hidden; flex: 1; }
.ticker-track { display: inline-flex; gap: 34px; white-space: nowrap; animation: tick 40s linear infinite; }
.ticker-track a { font-size: 13px; font-weight: 700; color: var(--mut); }
.ticker-track a:hover { color: var(--accent); }
.ticker-track a::before { content: '●'; color: var(--accent); font-size: 8px; margin-inline-end: 7px; vertical-align: 2px; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ---------- الرئيسية ---------- */
.main { padding: 26px 18px 40px; }
.empty-home { background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-align: center; padding: 60px 20px; color: var(--mut); font-weight: 700; }
.empty-home a { color: var(--accent); }

.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 34px; }
.hero-main, .hero-mini { position: relative; border-radius: 16px; overflow: hidden; background: #333 center/cover no-repeat; }
.hero-main { min-height: 430px; }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hero-mini { min-height: 208px; }
.hero-link { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.hero-overlay { width: 100%; padding: 26px 22px; background: linear-gradient(0deg, rgba(5,10,25,.92) 0%, rgba(5,10,25,.35) 65%, transparent 100%); color: #fff; }
.hero-overlay-sm { padding: 14px 14px; }
.hero-overlay h1 { font-size: clamp(20px, 3vw, 30px); font-weight: 900; line-height: 1.45; margin: 10px 0 6px; }
.hero-overlay-sm h3 { font-size: 14.5px; font-weight: 800; line-height: 1.5; margin-top: 8px; }
.hero-overlay p { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 600; }
.hero-meta { color: rgba(255,255,255,.75); font-size: 12px; font-weight: 700; margin-top: 8px; }
.hero-main:hover h1, .hero-mini:hover h3 { text-decoration: underline; text-underline-offset: 4px; }

.badge { display: inline-block; color: #fff; font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 6px; }
.badge-sm { font-size: 10.5px; padding: 2px 9px; }
.badge-lg { font-size: 13px; padding: 5px 16px; border-radius: 8px; }

/* ---------- أقسام وعناوين ---------- */
.section { margin-bottom: 38px; }
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; --cat: var(--accent); }
.sec-head h1, .sec-head h2 { font-size: 22px; font-weight: 900; color: var(--ink); border-inline-start: 5px solid var(--cat); padding-inline-start: 12px; line-height: 1.3; }
.page-head h1 { font-size: 26px; }
.sec-line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--cat), transparent); border-radius: 2px; opacity: .35; }
.sec-more { font-size: 13px; font-weight: 800; color: var(--cat); white-space: nowrap; }
.sec-more:hover { text-decoration: underline; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---------- بطاقة مقال ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: .2s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(16,24,40,.1); }
.card-media { position: relative; aspect-ratio: 16/9.6; background: #eceff4; display: block; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.card:hover .card-media img { transform: scale(1.05); }
.card-noimg { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 40px; opacity: .35; }
.card-media .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 15.5px; font-weight: 800; line-height: 1.55; }
.card-body h3 a:hover { color: var(--accent); }
.card-ex { color: var(--mut); font-size: 13px; font-weight: 600; }
.card-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px; color: #98a2b3; font-size: 11.5px; font-weight: 700; }

/* ---------- صفحة المقال ---------- */
.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 26px; margin-bottom: 38px; }
.article { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 4vw, 38px); }
.article-title { font-size: clamp(24px, 4vw, 34px); font-weight: 900; line-height: 1.5; margin: 14px 0 10px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--mut); font-size: 13px; font-weight: 700; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.article-cover { margin: 0 0 22px; border-radius: 14px; overflow: hidden; }
.article-lead { font-size: 17px; font-weight: 700; color: #344054; background: #f5f7fb; border-inline-start: 4px solid var(--accent); border-radius: 8px; padding: 14px 18px; margin-bottom: 22px; }
.article-body { font-size: 16.5px; line-height: 2.05; color: #1d2939; }
.article-body p { margin-bottom: 18px; }
.article-body h2, .article-body h3, .article-body h4 { font-weight: 900; margin: 28px 0 12px; line-height: 1.5; }
.article-body h2 { font-size: 24px; border-inline-start: 4px solid var(--accent); padding-inline-start: 12px; }
.article-body h3 { font-size: 20px; }
.article-body img { border-radius: 12px; margin: 10px auto; }
.article-body blockquote { font-family: 'Amiri', serif; font-size: 20px; background: #fdf6ec; border-inline-start: 4px solid #d4a017; border-radius: 10px; padding: 18px 22px; margin: 22px 0; color: #6b4e0e; }
.article-body ul, .article-body ol { padding-inline-start: 26px; margin-bottom: 18px; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body pre { background: var(--dark); color: #e2e8f0; border-radius: 10px; padding: 16px; overflow-x: auto; direction: ltr; text-align: left; font-size: 13.5px; margin-bottom: 18px; }
.article-body iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px; margin: 10px 0 18px; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; border-top: 1px solid var(--line); margin-top: 26px; padding-top: 20px; font-weight: 800; font-size: 13.5px; }
.sh { color: #fff; padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 800; border: 0; cursor: pointer; font-family: inherit; }
.sh-wa { background: #25d366; } .sh-fb { background: #1877f2; } .sh-x { background: #111; } .sh-tg { background: #279fd9; }
.sh-cp { background: #eef1f6; color: #344054; }
.sh:hover { filter: brightness(1.08); }

/* ---------- الشريط الجانبي ---------- */
.widget { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 18px; }
.widget-title { font-weight: 900; font-size: 15px; border-inline-start: 4px solid var(--accent); padding-inline-start: 10px; margin-bottom: 14px; }
.wpost { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.wpost:last-child { border-bottom: 0; }
.wpost img, .wpost-noimg { width: 62px; height: 48px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: #eceff4; display: flex; align-items: center; justify-content: center; }
.wpost-t { font-size: 12.5px; font-weight: 800; line-height: 1.55; }
.wpost-t small { display: block; color: #98a2b3; font-size: 10.5px; margin-top: 2px; }
.wpost:hover .wpost-t { color: var(--accent); }
.wcat { display: flex; align-items: center; gap: 9px; padding: 8px 2px; font-weight: 800; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.wcat:last-child { border-bottom: 0; }
.wcat b { margin-inline-start: auto; background: #f2f4f7; border-radius: 999px; font-size: 11px; padding: 1px 10px; color: var(--mut); }
.wcat-dot { width: 10px; height: 10px; border-radius: 50%; }
.wcat:hover { color: var(--accent); }

/* ---------- ترقيم الصفحات ---------- */
.pager { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }
.pager a { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 22px; font-weight: 800; font-size: 14px; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- التذييل ---------- */
.sitefooter { background: var(--dark); color: #98a2b3; margin-top: 30px; }
.footgrid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 30px; padding: 40px 18px 26px; }
.sitefooter h4 { color: #fff; font-size: 16px; font-weight: 900; margin-bottom: 12px; border-inline-start: 4px solid var(--accent); padding-inline-start: 10px; }
.sitefooter p { font-size: 13.5px; font-weight: 600; }
.footlink { display: block; padding: 5px 0; font-size: 13px; font-weight: 700; color: #98a2b3; }
.footlink:hover { color: #ffd479; }
.copyline { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 18px; text-align: center; font-size: 12.5px; font-weight: 700; }
.copyline a { color: #ffd479; }

/* ---------- استجابة ---------- */
@media (max-width: 980px) {
    .hero { grid-template-columns: 1fr; }
    .hero-main { min-height: 320px; }
    .hero-mini { min-height: 150px; }
    .grid4 { grid-template-columns: repeat(2, 1fr); }
    .article-layout { grid-template-columns: 1fr; }
    .footgrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .grid3 { grid-template-columns: 1fr; }
    .grid4 { grid-template-columns: 1fr; }
    .hero-side { grid-template-columns: 1fr 1fr; }
    .masthead .wrap { justify-content: center; text-align: center; }
    .footgrid { grid-template-columns: 1fr; }
    .topbar .wrap { font-size: 11px; }
}

/* ============ السلايدر البطولي ============ */
.slider { position: relative; border-radius: 16px; overflow: hidden; min-height: 430px; background: #1a2236; }
.slide { position: absolute; inset: 0; background: #333 center/cover no-repeat; opacity: 0; transform: scale(1.04); transition: opacity .7s ease, transform 1.2s ease; pointer-events: none; }
.slide.on { opacity: 1; transform: scale(1); pointer-events: auto; }
.sl-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; backdrop-filter: blur(4px); transition: .2s; }
.sl-arrow:hover { background: var(--accent); }
.sl-prev { inset-inline-start: 14px; }
.sl-next { inset-inline-end: 14px; }
.sl-dots { position: absolute; bottom: 14px; inset-inline-start: 22px; z-index: 5; display: flex; gap: 7px; }
.sl-dot { width: 9px; height: 9px; border-radius: 999px; border: 0; background: rgba(255,255,255,.4); cursor: pointer; transition: .25s; padding: 0; }
.sl-dot.on { width: 26px; background: var(--accent); }
.sl-bar { position: absolute; top: 0; inset-inline-start: 0; inset-inline-end: 0; height: 4px; background: rgba(255,255,255,.15); z-index: 5; }
.sl-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
@media (max-width: 980px) { .slider { min-height: 340px; } }

/* ============ الأكثر قراءة ============ */
.trend { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.trend-item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; transition: .2s; }
.trend-item:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16,24,40,.09); }
.trend-num { font-size: 34px; font-weight: 900; color: transparent; -webkit-text-stroke: 2px #b8860b; flex: 0 0 auto; line-height: 1; min-width: 34px; text-align: center; }
.trend-item img { width: 74px; height: 56px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.trend-t { font-size: 13.5px; font-weight: 800; line-height: 1.55; }
.trend-t small { display: block; font-size: 10.5px; font-weight: 900; margin-bottom: 2px; }
.trend-t em { display: block; font-style: normal; color: #98a2b3; font-size: 11px; font-weight: 700; margin-top: 3px; }
.trend-item:hover .trend-t { color: var(--accent); }

/* ============ بانر المنصة ============ */
.promo { margin-bottom: 38px; }
.promo-in { background: linear-gradient(135deg, #06906e, #3a82f0); border-radius: 18px; color: #fff; padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: 0 16px 40px rgba(6,110,144,.22); }
.promo-in h3 { font-size: 19px; font-weight: 900; margin-bottom: 4px; }
.promo-in p { color: rgba(255,255,255,.9); font-size: 13.5px; font-weight: 700; max-width: 640px; }
.promo-in a { background: #fff; color: #06906e; font-weight: 900; font-size: 14px; padding: 12px 26px; border-radius: 999px; white-space: nowrap; transition: .2s; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.promo-in a:hover { transform: translateY(-2px); }

/* ============ شارة جديد ============ */
.newtag { display: inline-block; background: var(--accent); color: #fff; font-size: 9px; font-weight: 900; padding: 1px 8px; border-radius: 999px; vertical-align: 2px; margin-inline-start: 5px; animation: newpulse 2s ease infinite; }
@keyframes newpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ============ حركة الظهور عند التمرير ============ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .slide { transition: opacity .3s; } }

/* ============ زر العودة للأعلى ============ */
.totop { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 60; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 20px; cursor: pointer; box-shadow: 0 10px 26px rgba(198,40,40,.35); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .25s; }
.totop.show { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { filter: brightness(1.12); }

/* ============ شريط تقدم القراءة (صفحة المقال) ============ */
.readbar { position: fixed; top: 0; inset-inline-start: 0; inset-inline-end: 0; height: 4px; z-index: 200; background: transparent; }
.readbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ff8a65); }

/* ============ الوضع الليلي ============ */
html[data-theme="dark"] {
    --ink: #e6eaf3; --mut: #98a2b3; --line: #232c40; --bg: #0c111d; --card: #141b2b; --dark: #080d16;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .masthead, html[data-theme="dark"] .mainnav, html[data-theme="dark"] .ticker { background: var(--card); }
html[data-theme="dark"] .sec-head h1, html[data-theme="dark"] .sec-head h2 { color: var(--ink); }
html[data-theme="dark"] .article-body { color: #cdd5e4; }
html[data-theme="dark"] .article-lead { background: #1a2336; color: #b9c3d8; }
html[data-theme="dark"] .msearch input, html[data-theme="dark"] .cform input, html[data-theme="dark"] .cform textarea, html[data-theme="dark"] .news-form input { background: #0f1523; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .sh-cp { background: #232c40; color: #cdd5e4; }
html[data-theme="dark"] .wcat b { background: #232c40; }
html[data-theme="dark"] .card-noimg, html[data-theme="dark"] .card-media { background: #1a2336; }
html[data-theme="dark"] .pager a { background: var(--card); }
html[data-theme="dark"] .trend-item img { opacity: .9; }
.theme-toggle { background: none; border: 0; cursor: pointer; font-size: 15px; padding: 2px 4px; }
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.topbar .soc { color: #cbd2e1; font-size: 13px; }
.topbar .soc:hover { color: #ffd479; }

/* ============ الوسوم ============ */
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag { background: var(--bg); border: 1px solid var(--line); color: var(--mut); font-size: 12px; font-weight: 800; padding: 4px 14px; border-radius: 999px; transition: .15s; }
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ============ التعليقات ============ */
.cbox { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 22px; }
.cbox-title { font-size: 18px; font-weight: 900; margin-bottom: 16px; }
.cmt { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; background: var(--bg); }
.cmt-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.cmt-head b { font-size: 13.5px; }
.cmt-head span { color: #98a2b3; font-size: 11px; font-weight: 700; }
.cmt p { font-size: 13.5px; font-weight: 600; color: var(--mut); }
.cmt-none { color: #98a2b3; font-weight: 700; font-size: 13.5px; margin-bottom: 14px; }
.cform { border: 1px dashed var(--line); border-radius: 14px; padding: 16px; margin-top: 14px; }
.cform h4 { font-weight: 900; font-size: 15px; margin-bottom: 10px; }
.cform input, .cform textarea { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; margin-bottom: 9px; }
.cform input:focus, .cform textarea:focus { outline: none; border-color: var(--accent); }
.cform button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 26px; font: inherit; font-weight: 900; cursor: pointer; }
.cform small { display: block; color: #98a2b3; font-weight: 700; font-size: 11px; margin-top: 8px; }
.cmsg { font-weight: 800; font-size: 13px; margin-top: 8px; display: none; }
.cmsg.ok { display: block; color: #0e7a45; }
.cmsg.err { display: block; color: #b42318; }

/* ============ النشرة البريدية ============ */
.newsletter { background: var(--dark); }
.news-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 30px 18px; }
.news-in h3 { color: #fff; font-size: 19px; font-weight: 900; }
.news-in > div > p { color: #98a2b3; font-size: 13px; font-weight: 700; }
.news-form { display: flex; flex: 0 1 420px; min-width: 260px; }
.news-form input { flex: 1; min-width: 0; border: 0; border-radius: 0 12px 12px 0; padding: 12px 16px; font: inherit; font-weight: 700; }
.news-form input:focus { outline: 2px solid var(--accent); }
.news-form button { border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 900; padding: 0 26px; border-radius: 12px 0 0 12px; cursor: pointer; }
.news-msg { width: 100%; font-weight: 800; font-size: 13px; display: none; }
.news-msg.ok { display: block; color: #4ade80; }
.news-msg.err { display: block; color: #ff8a8a; }
.foot-social { display: flex; gap: 10px; margin-top: 12px; }
.foot-social a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #cbd2e1; font-size: 15px; transition: .2s; }
.foot-social a:hover { background: var(--accent); color: #fff; }
