/* ============================================================
   المنارة — بوابة الأخبار
   نظام التصميم: عربي RTL، وضع فاتح/داكن، هوية حمراء إخبارية
   ============================================================ */

/* ---------- المتغيرات ---------- */
:root{
  --red:        #C8102E;
  --red-dark:   #A30D25;
  --red-soft:   rgba(200,16,46,.08);
  --bg:         #F7F6F3;
  --bg-alt:     #FFFFFF;
  --card:       #FFFFFF;
  --ink:        #191A1C;
  --ink-2:      #515358;
  --ink-3:      #8A8C92;
  --line:       #E7E5E0;
  --line-2:     #D8D5CF;
  --chip:       #F1EFEB;
  --footer-bg:  #141519;
  --footer-ink: #C9CBd0;
  --shadow:     0 1px 2px rgba(20,21,25,.05), 0 8px 24px -12px rgba(20,21,25,.12);
  --shadow-lg:  0 2px 6px rgba(20,21,25,.08), 0 18px 44px -16px rgba(20,21,25,.18);
  --header-ink: #FFFFFF;
  --radius:    12px;
  --radius-lg: 18px;
  --container:  1240px;
  --font: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
}
html[data-theme="dark"]{
  --bg:        #101013;
  --bg-alt:    #17181C;
  --card:      #1B1C21;
  --ink:       #EDEDEF;
  --ink-2:     #B4B6BD;
  --ink-3:     #7E8087;
  --line:      #2A2B31;
  --line-2:    #383A41;
  --chip:      #24262C;
  --red-soft:  rgba(200,16,46,.16);
  --shadow:     0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-lg:  0 2px 6px rgba(0,0,0,.5), 0 18px 44px -16px rgba(0,0,0,.6);
  --footer-bg:  #0B0C0E;
}

/* ---------- الأساسيات ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--ink);
  font-size:16px;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
::selection{ background:var(--red); color:#fff; }

.container{ max-width:var(--container); margin-inline:auto; padding-inline:20px; }

.skip-link{
  position:fixed; inset-inline-start:12px; top:-48px; z-index:200;
  background:var(--red); color:#fff; padding:8px 16px; border-radius:8px;
  font-weight:700; transition:top .2s;
}
.skip-link:focus{ top:12px; }

/* التركيز */
a:focus-visible, button:focus-visible, input:focus-visible{
  outline:2px solid var(--red); outline-offset:2px; border-radius:6px;
}

/* ============================================================
   الترويسة
   ============================================================ */
.site-header{ position:sticky; top:0; z-index:100; background:var(--bg-alt); box-shadow:var(--shadow); }

/* الشريط العلوي */
.topbar{ background:#141519; color:#E7E9EC; font-size:.82rem; }
.topbar-inner{ display:flex; align-items:center; justify-content:space-between; min-height:38px; gap:12px; }
.topbar-date{ color:#B9BBC1; }
.topbar-actions{ display:flex; align-items:center; gap:6px; }
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border:0; border-radius:10px;
  background:transparent; color:inherit; padding:0;
  transition:background .18s, color .18s;
}
.icon-btn svg{ width:21px; height:21px; fill:currentColor; }
.topbar .icon-btn:hover{ background:rgba(255,255,255,.12); }
.ico-sun{ display:none; }
html[data-theme="dark"] .ico-moon{ display:none; }
html[data-theme="dark"] .ico-sun{ display:block; }

/* صف العلامة */
.brand-row{ background:var(--bg-alt); }
.brand-inner{ display:flex; align-items:center; gap:16px; min-height:76px; }
.brand{ display:flex; align-items:center; gap:14px; }
.brand-mark{ width:46px; height:46px; flex:none; }
.brand-mark .mk-tower, .brand-mark .mk-deck, .brand-mark .mk-base{ fill:var(--ink); }
.brand-mark .mk-lamp{ fill:var(--red); }
.brand-mark .mk-ray{ stroke:var(--red); stroke-width:2.4; stroke-linecap:round; }
.brand-text{ display:flex; flex-direction:column; line-height:1.15; }
.brand-text strong{ font-size:1.65rem; font-weight:900; letter-spacing:.5px; color:var(--ink); }
.brand-text small{ font-size:.72rem; font-weight:600; color:var(--ink-3); letter-spacing:.2px; }
.search-btn-desktop{
  width:auto; gap:8px; padding-inline:14px; height:40px;
  border-radius:999px; border:1px solid var(--line-2);
  color:var(--ink-2); background:var(--card); margin-inline-start:auto;
  font-size:.9rem; font-weight:700;
}
.search-btn-desktop:hover{ border-color:var(--red); color:var(--red); }
.search-btn-desktop svg{ width:18px; height:18px; }

/* زر القائمة (جوال) */
.nav-toggle{ display:none; flex-direction:column; gap:5px; width:42px; height:42px; align-items:center; justify-content:center; border:1px solid var(--line-2); border-radius:10px; color:var(--ink); background:var(--card); }
.nav-toggle span{ display:block; width:20px; height:2.5px; background:currentColor; border-radius:2px; transition:transform .22s, opacity .22s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform:translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform:translateY(-7.5px) rotate(-45deg); }

/* شريط التنقل */
.main-nav{ background:var(--bg-alt); border-top:1px solid var(--line); }
.nav-list{
  display:flex; align-items:stretch; gap:2px; margin:0; padding:0;
  list-style:none; overflow-x:auto; scrollbar-width:none;
}
.nav-list::-webkit-scrollbar{ display:none; }
.nav-list > li > a{
  display:flex; align-items:center; gap:6px; white-space:nowrap;
  padding:13px 13px; font-weight:800; font-size:.95rem; color:var(--ink-2);
  border-bottom:3px solid transparent; transition:color .18s, border-color .18s;
}
.nav-list > li > a:hover{ color:var(--ink); border-bottom-color:var(--line-2); }
.nav-list > li > a.is-active{ color:var(--red); border-bottom-color:var(--red); }
.caret{ font-size:.7em; transition:transform .2s; }
.has-drop:hover .caret, .has-drop.open .caret{ transform:rotate(180deg); }
.has-drop{ position:relative; }
.dropdown{
  position:absolute; top:100%; inset-inline-start:0; z-index:120;
  display:none; min-width:210px; margin:0; padding:8px; list-style:none;
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  box-shadow:var(--shadow-lg);
}
.has-drop:hover .dropdown, .has-drop:focus-within .dropdown, .has-drop.open .dropdown{ display:block; }
.dropdown a{
  display:block; padding:9px 14px; border-radius:9px; font-weight:700; font-size:.92rem; color:var(--ink-2);
}
.dropdown a:hover{ background:var(--red-soft); color:var(--red); }

/* ============================================================
   شريط الأخبار العاجلة
   ============================================================ */
.ticker{ background:var(--card); border-bottom:1px solid var(--line); }
.ticker-inner{ display:flex; align-items:center; gap:14px; min-height:44px; }
.ticker-label{
  flex:none; background:var(--red); color:#fff; font-weight:900; font-size:.8rem;
  padding:3px 12px; border-radius:6px; letter-spacing:.5px;
  animation:pulse-label 2.4s ease-in-out infinite;
}
@keyframes pulse-label{ 0%,100%{ box-shadow:0 0 0 0 rgba(200,16,46,.45);} 55%{ box-shadow:0 0 0 7px rgba(200,16,46,0);} }
.ticker-viewport{ overflow:hidden; flex:1; }
.ticker-track{
  display:inline-flex; gap:0; white-space:nowrap; will-change:transform;
  animation:ticker-move 45s linear infinite;
}
.ticker:hover .ticker-track{ animation-play-state:paused; }
.ticker-item{ display:inline-flex; align-items:center; padding-inline:26px; font-weight:600; font-size:.92rem; color:var(--ink); position:relative; }
.ticker-item::after{
  content:""; position:absolute; inset-inline-end:0; top:50%; translate:0 -50%;
  width:6px; height:6px; border-radius:50%; background:var(--red); opacity:.75;
}
.ticker-item:hover{ color:var(--red); }
@keyframes ticker-move{ from{ transform:translateX(0); } to{ transform:translateX(50%); } }
@media (prefers-reduced-motion:reduce){
  .ticker-track{ animation:none; }
  .ticker-viewport{ overflow-x:auto; }
}

/* ============================================================
   الهيكل العام للصفحات
   ============================================================ */
.site-main{ min-height:62vh; padding-block:28px 52px; }
.page-head{ margin:8px 0 22px; }
.page-head .crumbs{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  font-size:.82rem; font-weight:700; color:var(--ink-3); margin-bottom:10px;
}
.page-head .crumbs a:hover{ color:var(--red); }
.page-head .crumbs .sep{ opacity:.6; }
.page-title{
  margin:0; font-size:clamp(1.6rem, 3.4vw, 2.3rem); font-weight:900; color:var(--ink);
  line-height:1.25;
}
.page-title::after{
  content:""; display:block; width:64px; height:5px; margin-top:12px;
  background:var(--accent, var(--red)); border-radius:3px;
}
.page-sub{ margin:10px 0 0; color:var(--ink-2); font-size:.98rem; max-width:70ch; }

.section-grid{ display:grid; grid-template-columns:minmax(0,1fr) 336px; gap:32px; align-items:start; }
.layout-center{ max-width:860px; margin-inline:auto; }

/* ============================================================
   البطاقات
   ============================================================ */
/* البطاقة الرئيسية */
.lead-card{
  display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:0;
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  overflow:hidden; box-shadow:var(--shadow); transition:box-shadow .2s, transform .2s;
}
.lead-card:hover{ box-shadow:var(--shadow-lg); }
.lead-media{ position:relative; aspect-ratio:16/9.6; overflow:hidden; background:var(--chip); }
.lead-media img{ width:100%; height:100%; object-fit:cover; transition:transform .45s ease; }
.lead-card:hover .lead-media img{ transform:scale(1.035); }
.lead-body{ padding:24px 26px; display:flex; flex-direction:column; gap:12px; align-self:center; }
.lead-body h2{ margin:0; font-size:clamp(1.3rem, 2.6vw, 1.7rem); font-weight:900; line-height:1.4; color:var(--ink); }
.lead-card:hover .lead-body h2{ color:var(--red); }
.lead-excerpt{ margin:0; color:var(--ink-2); font-size:1rem; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.lead-meta, .card-meta{ display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; font-size:.8rem; font-weight:700; color:var(--ink-3); }
.lead-meta .cat, .card-meta .cat, .cat-chip{
  color:var(--red); background:var(--red-soft); padding:2px 10px; border-radius:999px; font-size:.78rem;
}

/* بطاقات الصفوف */
.rows-list{ display:flex; flex-direction:column; }
.row-card{
  display:grid; grid-template-columns:210px minmax(0,1fr); gap:18px; align-items:center;
  padding-block:18px; border-bottom:1px solid var(--line);
}
.row-card:last-child{ border-bottom:0; }
.rows-list .row-card + .row-card{ border-top:0; }
.row-media{ position:relative; aspect-ratio:16/10.5; border-radius:var(--radius); overflow:hidden; background:var(--chip); }
.row-media img{ width:100%; height:100%; object-fit:cover; transition:transform .4s ease; }
.row-card:hover .row-media img{ transform:scale(1.05); }
.row-body h3{
  margin:0 0 6px; font-size:1.06rem; font-weight:800; line-height:1.55; color:var(--ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.row-card:hover .row-body h3{ color:var(--red); }
.row-excerpt{
  margin:0 0 8px; color:var(--ink-2); font-size:.92rem;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.row-body .card-meta{ margin-top:2px; }

/* شارات */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  font-size:.74rem; font-weight:900; padding:3px 10px; border-radius:999px;
  background:var(--chip); color:var(--ink-2); vertical-align:middle;
}
.badge-live{ background:var(--red); color:#fff; }
.badge-live .dot{ width:7px; height:7px; border-radius:50%; background:#fff; animation:blink 1.1s infinite alternate; }
@keyframes blink{ from{opacity:1} to{opacity:.25} }
.badge-breaking{ background:var(--red); color:#fff; }
.badge-gallery{ color:var(--ink-2); }

/* زر المزيد */
.btn-more{
  display:flex; align-items:center; justify-content:center; gap:10px;
  width:100%; max-width:420px; margin:26px auto 4px; padding:13px 22px;
  border:2px solid var(--red); border-radius:999px; background:transparent;
  color:var(--red); font-weight:900; font-size:1rem;
  transition:background .2s, color .2s, box-shadow .2s;
}
.btn-more:hover:not(:disabled){ background:var(--red); color:#fff; box-shadow:0 10px 26px -10px rgba(200,16,46,.55); }
.btn-more:disabled{ opacity:.55; cursor:default; }
.btn-more .spin{
  width:18px; height:18px; border-radius:50%;
  border:2.5px solid currentColor; border-top-color:transparent;
  animation:spin .8s linear infinite; display:none;
}
.btn-more.loading .spin{ display:block; }
@keyframes spin{ to{ transform:rotate(360deg);} }

/* ============================================================
   الشريط الجانبي — الأكثر قراءة
   ============================================================ */
.side-widget{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:22px; box-shadow:var(--shadow); position:sticky; top:132px;
}
.side-widget + .side-widget{ margin-top:22px; }
.widget-title{
  display:flex; align-items:center; gap:10px; margin:0 0 8px;
  font-size:1.12rem; font-weight:900; color:var(--ink);
}
.widget-title::before{ content:""; width:5px; height:22px; border-radius:3px; background:var(--red); }
.most-read{ list-style:none; margin:0; padding:0; }
.most-read li{ border-bottom:1px dashed var(--line); }
.most-read li:last-child{ border-bottom:0; }
.most-read a{ display:grid; grid-template-columns:34px minmax(0,1fr); gap:12px; align-items:start; padding:13px 4px; }
.most-read .num{
  font-size:1.55rem; font-weight:900; color:var(--line-2); line-height:1;
  padding-top:3px; font-variant-numeric:tabular-nums; transition:color .2s;
}
.most-read li:hover .num{ color:var(--red); }
.most-read .t{
  font-weight:800; font-size:.94rem; line-height:1.6; color:var(--ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.most-read li:hover .t{ color:var(--red); }
.most-read .m{ font-size:.76rem; font-weight:700; color:var(--ink-3); margin-top:3px; }
.widget-note{ margin:10px 0 0; font-size:.78rem; color:var(--ink-3); }

/* ============================================================
   صفحة المقال
   ============================================================ */
.article-page{ max-width:840px; margin-inline:auto; }
.article-head{ margin:6px 0 18px; }
.article-badges{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.article-title{
  margin:0 0 12px; font-size:clamp(1.55rem, 4vw, 2.35rem); font-weight:900; line-height:1.4; color:var(--ink);
}
.article-sub{ margin:0 0 16px; font-size:1.08rem; color:var(--ink-2); line-height:1.9; font-weight:600; }
.article-byline{
  display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center;
  padding:12px 0; border-block:1px solid var(--line);
  font-size:.86rem; font-weight:700; color:var(--ink-3);
}
.article-byline .who{ color:var(--ink-2); }
.featured-figure{ margin:22px 0 8px; }
.featured-figure .ph{ border-radius:var(--radius-lg); overflow:hidden; background:var(--chip); box-shadow:var(--shadow); }
.featured-figure img{ width:100%; aspect-ratio:16/9.4; object-fit:cover; }
.featured-figure figcaption{
  display:flex; gap:10px; padding:10px 4px 0; font-size:.82rem; color:var(--ink-3); font-weight:600;
}
.featured-figure figcaption .credit{ color:var(--red); flex:none; }

/* محتوى المقال */
.article-content{ font-size:1.07rem; color:var(--ink); }
.article-content > *:first-child{ margin-top:0; }
.article-content p{ margin:0 0 1.35em; line-height:2.05; }
.article-content h2{ font-size:1.45rem; font-weight:900; margin:1.6em 0 .6em; color:var(--ink); }
.article-content h3{ font-size:1.22rem; font-weight:800; margin:1.5em 0 .55em; }
.article-content a{ color:var(--red); font-weight:700; text-decoration:underline; text-underline-offset:3px; }
.article-content ul, .article-content ol{ padding-inline-start:1.6em; margin:0 0 1.3em; }
.article-content li{ margin-bottom:.5em; }
.article-content blockquote{
  margin:1.6em 0; padding:14px 20px; background:var(--red-soft);
  border-inline-start:4px solid var(--red); border-radius:10px;
  font-weight:700; font-size:1.06em; color:var(--ink);
}
.article-content img{ border-radius:var(--radius); margin:1.4em auto; }
.article-content figure{ margin:1.4em 0; }
.article-content figcaption{ font-size:.82rem; color:var(--ink-3); padding-top:8px; }
.article-content iframe{ width:100%; aspect-ratio:16/9; border:0; border-radius:var(--radius); margin:1.4em 0; background:#000; }
.article-content table{ width:100%; border-collapse:collapse; margin:1.4em 0; font-size:.95rem; }
.article-content th, .article-content td{ border:1px solid var(--line-2); padding:9px 12px; text-align:start; }
.article-content th{ background:var(--chip); font-weight:800; }
.article-content hr{ border:0; border-top:1px dashed var(--line-2); margin:2em 0; }
.article-content strong{ color:var(--ink); }

/* الوسوم */
.tag-row{ display:flex; flex-wrap:wrap; gap:8px; margin-top:26px; padding-top:18px; border-top:1px solid var(--line); }
.tag-row .tag{
  font-size:.8rem; font-weight:800; padding:5px 14px; border-radius:999px;
  background:var(--chip); color:var(--ink-2); transition:all .18s;
}
.tag-row .tag:hover{ background:var(--red); color:#fff; }

/* المزيد من */
.related-block{ margin-top:34px; }
.related-title{
  display:flex; align-items:center; gap:10px; margin:0 0 16px;
  font-size:1.25rem; font-weight:900;
}
.related-title::before{ content:""; width:5px; height:24px; border-radius:3px; background:var(--red); }
.related-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(215px, 1fr)); gap:18px; }
.mini-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; transition:box-shadow .2s; }
.mini-card:hover{ box-shadow:var(--shadow-lg); }
.mini-media{ aspect-ratio:16/10; overflow:hidden; background:var(--chip); position:relative; }
.mini-media img{ width:100%; height:100%; object-fit:cover; transition:transform .4s; }
.mini-card:hover .mini-media img{ transform:scale(1.06); }
.mini-body{ padding:13px 14px; }
.mini-body h4{
  margin:6px 0 0; font-size:.95rem; font-weight:800; line-height:1.6; color:var(--ink);
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.mini-card:hover h4{ color:var(--red); }
.mini-body .m{ font-size:.74rem; font-weight:700; color:var(--red); }

/* المدونة المباشرة */
.liveup-head{
  display:flex; flex-wrap:wrap; align-items:center; gap:12px;
  background:var(--red); color:#fff; border-radius:var(--radius);
  padding:12px 20px; font-weight:900; margin-bottom:20px;
}
.liveup-head .dot{ width:9px; height:9px; background:#fff; border-radius:50%; animation:blink 1.1s infinite alternate; }
.liveup-head .hint{ margin-inline-start:auto; font-size:.78rem; font-weight:700; opacity:.9; }
.live-timeline{ position:relative; padding-inline-start:8px; }
.live-post{
  position:relative; padding:18px 20px; margin-bottom:16px;
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
}
.live-post::before{
  content:""; position:absolute; inset-inline-start:-6px; top:26px;
  width:11px; height:11px; border-radius:50%; background:var(--red);
  box-shadow:0 0 0 4px var(--red-soft);
}
.live-post .when{ font-size:.78rem; font-weight:900; color:var(--red); margin-bottom:6px; display:block; }
.live-post h3{ margin:0 0 8px; font-size:1.12rem; font-weight:900; color:var(--ink); }
.live-post .article-content{ font-size:1rem; }
.live-post.highlight{ border-color:var(--red); box-shadow:0 0 0 3px var(--red-soft); }

/* ============================================================
   الفيديو
   ============================================================ */
.video-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(228px, 1fr)); gap:20px; }
.video-card{ position:relative; }
.video-media{
  position:relative; aspect-ratio:4/4.6; border-radius:var(--radius-lg); overflow:hidden;
  background:var(--chip); box-shadow:var(--shadow);
}
.video-media img{ width:100%; height:100%; object-fit:cover; transition:transform .45s; }
.video-card:hover .video-media img{ transform:scale(1.05); }
.play-badge{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(to top, rgba(10,10,14,.55) 0%, transparent 45%);
}
.play-badge .pb{
  width:58px; height:58px; border-radius:50%; background:rgba(200,16,46,.94);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 30px -6px rgba(0,0,0,.5); transition:transform .2s, background .2s;
}
.video-card:hover .pb{ transform:scale(1.12); }
.play-badge svg{ width:26px; height:26px; fill:#fff; margin-inline-start:3px; }
.dur-badge{
  position:absolute; bottom:10px; inset-inline-start:10px; z-index:2;
  background:rgba(12,12,16,.82); color:#fff; font-size:.74rem; font-weight:800;
  padding:3px 9px; border-radius:6px; font-variant-numeric:tabular-nums;
}
.video-body h3{
  margin:12px 0 4px; font-size:1rem; font-weight:800; line-height:1.6; color:var(--ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.video-card:hover h3{ color:var(--red); }
.video-body .m{ font-size:.78rem; font-weight:700; color:var(--ink-3); }

/* ============================================================
   البحث
   ============================================================ */
.search-overlay{
  position:fixed; inset:0; z-index:150;
  background:rgba(10,11,14,.55); backdrop-filter:blur(5px);
  display:flex; justify-content:center; align-items:flex-start;
  padding:min(9vh, 90px) 18px 18px;
}
.search-overlay[hidden]{ display:none; }
.search-panel{
  width:min(720px, 100%); background:var(--bg-alt); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); overflow:hidden;
  animation:panel-in .22s ease;
}
@keyframes panel-in{ from{ opacity:0; transform:translateY(-14px);} to{ opacity:1; transform:none;} }
.search-head{ display:flex; align-items:center; gap:10px; padding:8px 10px 8px 20px; border-bottom:1px solid var(--line); }
.search-head .search-ico{ width:24px; height:24px; fill:var(--red); flex:none; }
#search-input{
  flex:1; border:0; background:transparent; color:var(--ink);
  font-family:inherit; font-size:1.06rem; font-weight:700; padding:15px 4px;
}
#search-input:focus{ outline:none; }
#search-input::placeholder{ color:var(--ink-3); font-weight:600; }
.search-body{ max-height:min(58vh, 520px); overflow-y:auto; }
.search-hint{ padding:22px 24px; color:var(--ink-3); font-size:.92rem; font-weight:600; }
.search-status{ padding:14px 24px 4px; font-size:.8rem; font-weight:800; color:var(--ink-3); }
.sr-row{ display:grid; grid-template-columns:96px minmax(0,1fr); gap:14px; padding:13px 24px; border-bottom:1px solid var(--line); }
.sr-row:last-child{ border-bottom:0; }
.sr-row .ph{ width:96px; aspect-ratio:16/10; border-radius:8px; overflow:hidden; background:var(--chip); }
.sr-row img{ width:100%; height:100%; object-fit:cover; }
.sr-row h4{ margin:0 0 3px; font-size:.95rem; font-weight:800; line-height:1.55; color:var(--ink); }
.sr-row:hover h4{ color:var(--red); }
.sr-row .m{ font-size:.74rem; font-weight:700; color:var(--ink-3); }
.sr-empty{ padding:26px 24px; text-align:center; color:var(--ink-3); font-weight:700; }

/* ============================================================
   حالات التحميل والخطأ
   ============================================================ */
.skeleton{ border-radius:var(--radius); background:var(--chip); position:relative; overflow:hidden; }
.skeleton::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation:shimmer 1.4s infinite;
}
html[data-theme="dark"] .skeleton::after{ background:linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer{ from{ transform:translateX(-100%);} to{ transform:translateX(100%);} }
.sk-lead{ display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:0; background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); overflow:hidden; }
.sk-lead .sk-img{ aspect-ratio:16/9.6; }
.sk-lead .sk-txt{ padding:26px; display:flex; flex-direction:column; gap:14px; }
.sk-line{ height:14px; border-radius:6px; }
.sk-rows .skeleton{ margin-bottom:16px; height:96px; }

.error-box{
  max-width:640px; margin:40px auto; text-align:center;
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:44px 28px; box-shadow:var(--shadow);
}
.error-box .code{ font-size:3.4rem; font-weight:900; color:var(--red); line-height:1; }
.error-box h2{ margin:12px 0 8px; font-weight:900; }
.error-box p{ color:var(--ink-2); margin:0 0 22px; }
.error-box .btn-more{ max-width:240px; }

/* ============================================================
   التذييل
   ============================================================ */
.site-footer{ background:var(--footer-bg); color:var(--footer-ink); margin-top:26px; }
.footer-grid{
  display:grid; grid-template-columns:minmax(0,1.6fr) repeat(2, minmax(0,1fr));
  gap:34px; padding-block:44px 30px;
}
.footer-brand{ display:flex; align-items:center; gap:10px; font-size:1.3rem; font-weight:900; color:#fff; margin-bottom:12px; }
.footer-brand .brand-mark{ width:34px; height:34px; }
.footer-brand .brand-mark path, .footer-brand .brand-mark circle{ fill:#fff; }
.footer-about p{ margin:0 0 10px; font-size:.9rem; line-height:1.9; color:var(--footer-ink); }
.footer-src{ opacity:.85; font-size:.8rem !important; }
.footer-col h3{ margin:4px 0 14px; font-size:1rem; font-weight:900; color:#fff; }
.footer-col a{ display:block; padding:5px 0; font-size:.9rem; font-weight:600; color:var(--footer-ink); }
.footer-col a:hover{ color:#fff; }
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.12); padding-block:18px;
  font-size:.82rem; font-weight:600; display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between;
}

/* ============================================================
   استجابة الشاشات
   ============================================================ */
@media (max-width: 1080px){
  .section-grid{ grid-template-columns:minmax(0,1fr) 300px; gap:24px; }
}
@media (max-width: 960px){
  .brand-inner{ min-height:64px; }
  .search-btn-desktop{ display:none; }
  .nav-toggle{ display:flex; order:2; }
  .brand{ order:1; }
  .brand-mark{ width:40px; height:40px; }
  .brand-text strong{ font-size:1.4rem; }
  .main-nav{
    position:fixed; inset:0 0 auto 0; top:0; padding-top:118px;
    background:var(--bg-alt); border:0; z-index:95;
    max-height:100vh; overflow-y:auto; box-shadow:var(--shadow-lg);
    transform:translateY(-105%); transition:transform .26s ease;
  }
  html[dir="rtl"] .main-nav{ } /* التنقل من الأعلى */
  .main-nav.open{ transform:translateY(0); }
  .nav-list{ flex-direction:column; align-items:stretch; overflow:visible; padding:10px 0 18px; }
  .nav-list > li > a{ padding:13px 20px; border-bottom:0; border-inline-start:4px solid transparent; font-size:1.05rem; }
  .nav-list > li > a:hover, .nav-list > li > a.is-active{ border-inline-start-color:var(--red); border-bottom:0; }
  .dropdown{
    position:static; display:block; box-shadow:none; border:0; border-radius:0;
    background:transparent; padding:0 14px 6px; min-width:0;
  }
  .dropdown a{ font-size:.98rem; color:var(--ink-2); }
  .section-grid{ grid-template-columns:minmax(0,1fr); }
  .side-widget{ position:static; order:2; }
  .section-grid > .feed-col{ order:1; }
  .lead-card{ grid-template-columns:minmax(0,1fr); }
  .lead-body{ padding:20px; }
  .row-card{ grid-template-columns:128px minmax(0,1fr); gap:14px; }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .footer-about{ grid-column:1 / -1; }
}
@media (max-width: 620px){
  .container{ padding-inline:16px; }
  .site-main{ padding-block:20px 40px; }
  .topbar-date{ font-size:.72rem; }
  .row-card{ grid-template-columns:104px minmax(0,1fr); padding-block:14px; }
  .row-body h3{ font-size:.98rem; }
  .row-excerpt{ display:none; }
  .video-grid{ grid-template-columns:repeat(auto-fill, minmax(164px, 1fr)); gap:14px; }
  .sr-row{ grid-template-columns:72px minmax(0,1fr); }
  .sr-row .ph{ width:72px; }
  .footer-grid{ grid-template-columns:1fr; gap:24px; }
  .lead-media{ aspect-ratio:16/10.5; }
}

/* ============================================================
   إضافات النسخة الشاملة: صفحات السياسات، نموذج الاتصال،
   مشغل الفيديو، شارات، ولوحة التحكم
   ============================================================ */

/* ---------- تذييل بأربعة أعمدة ---------- */
.footer-grid-4{ grid-template-columns:1.4fr 1fr 1fr 1.2fr; }
@media (max-width: 960px){ .footer-grid-4{ grid-template-columns:1fr 1fr; } }
@media (max-width: 620px){ .footer-grid-4{ grid-template-columns:1fr; } }

/* ---------- شارات إضافية للبطاقات ---------- */
.badge-video{ background:rgba(0,0,0,.72); color:#fff; }
.badge-pin{ background:#B45309; color:#fff; }
.badge-manual{ background:var(--red); color:#fff; }
.cat-manual{ background:var(--red); color:#fff !important; }
.ext-as-text{ text-decoration:underline dotted; text-decoration-color:var(--ink-3); }

/* ---------- صندوق التصحيح ---------- */
.correction-box{
  margin:18px 0; padding:14px 18px; border-radius:12px;
  background:rgba(180,83,9,.08); border:1px solid rgba(180,83,9,.35);
  color:var(--ink-1); font-size:.95rem; line-height:1.9;
}
.correction-box strong{ color:#B45309; }

/* ============================================================
   صفحات السياسات
   ============================================================ */
.policy-page{ max-width:820px; margin-inline:auto; }
.policy-page section{
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:22px 26px; margin-top:16px;
}
.policy-page section h2{
  font-size:1.12rem; font-weight:800; margin-bottom:12px; color:var(--ink-1);
  padding-inline-start:12px; border-inline-start:4px solid var(--red);
}
.policy-page p{ color:var(--ink-2); line-height:2.05; margin-bottom:10px; }
.policy-page ul{ list-style:none; margin:6px 0 4px; display:grid; gap:9px; }
.policy-page li{
  position:relative; padding-inline-start:22px; color:var(--ink-2); line-height:1.95;
}
.policy-page li::before{
  content:""; position:absolute; inset-inline-start:4px; top:.72em;
  width:8px; height:8px; border-radius:3px; background:var(--red); transform:rotate(45deg);
}
.policy-nav{ margin-top:22px; }
.policy-nav h2{ font-size:1.05rem; margin-bottom:12px; }
.policy-links{ display:flex; flex-wrap:wrap; gap:8px; }
.policy-links .tag{ text-decoration:none; }

/* ---------- نموذج اتصل بنا ---------- */
.contact-section{ border-color:rgba(200,16,46,.3) !important; }
.contact-form{ display:grid; gap:14px; margin-top:8px; }
.contact-form label{ display:grid; gap:6px; font-weight:700; font-size:.92rem; color:var(--ink-1); }
.contact-form .req{ color:var(--red); }
.cf-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.contact-form input, .contact-form textarea{
  font:inherit; padding:11px 14px; border-radius:10px; border:1px solid var(--line);
  background:var(--bg); color:var(--ink-1); transition:border-color .15s;
}
.contact-form input:focus, .contact-form textarea:focus{ outline:none; border-color:var(--red); }
.cf-actions{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.cf-note{ font-size:.9rem; color:var(--ink-3); }
.cf-note.cf-ok{ color:#166534; font-weight:700; }
.cf-note.cf-err{ color:var(--red); font-weight:700; }
@media (max-width: 620px){ .cf-grid{ grid-template-columns:1fr; } }

/* ============================================================
   مشغل الفيديو
   ============================================================ */
.player-wrap{
  position:relative; width:100%; margin:4px 0 18px;
  border-radius:16px; overflow:hidden; background:#000;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}
.mn-video{ display:block; width:100%; max-height:78vh; background:#000; }
.player-wrap iframe{ display:block; width:100%; aspect-ratio:16/9; border:0; }
.player-fallback iframe{ aspect-ratio:16/9; width:100%; border:0; }

/* ============================================================
   لوحة التحكم
   ============================================================ */
.admin-wrap{ max-width:1080px; margin-inline:auto; }
.admin-head{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  flex-wrap:wrap; margin-bottom:18px;
}
.admin-title{ font-size:1.5rem; font-weight:900; display:flex; align-items:center; gap:10px; }
.admin-dot{ width:14px; height:14px; border-radius:5px; background:var(--red); display:inline-block; transform:rotate(45deg); }
.admin-sub{ color:var(--ink-3); font-size:.9rem; margin-top:4px; }
.admin-actions{ display:flex; align-items:center; gap:12px; }
.admin-live{
  display:inline-flex; align-items:center; gap:7px; font-size:.85rem; font-weight:700;
  color:#166534; background:rgba(22,101,52,.09); padding:7px 13px; border-radius:99px;
}
.admin-live .dot{ width:8px; height:8px; border-radius:50%; background:#16a34a; animation:pulse 1.6s infinite; }
@keyframes pulse{ 0%,100%{opacity:1} 50%{opacity:.35} }

.admin-tabs{
  display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px;
  border-bottom:2px solid var(--line); padding-bottom:0;
}
.atab{
  font:inherit; font-weight:700; font-size:.95rem; cursor:pointer;
  padding:11px 18px; border:0; border-bottom:3px solid transparent;
  background:transparent; color:var(--ink-2); margin-bottom:-2px;
  border-radius:10px 10px 0 0; transition:color .15s, background .15s;
}
.atab:hover{ background:rgba(200,16,46,.06); color:var(--ink-1); }
.atab.on{ color:var(--red); border-bottom-color:var(--red); background:rgba(200,16,46,.07); }

/* بطاقات لوحة التحكم */
.admin-card{
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:20px 22px; margin-bottom:18px;
}
.ac-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.admin-card h3{ font-size:1.05rem; font-weight:800; }
.admin-warn{
  background:rgba(200,16,46,.08); border:1px solid rgba(200,16,46,.3);
  padding:12px 16px; border-radius:12px; margin-bottom:16px; font-size:.92rem; color:var(--ink-1);
}

/* مؤشرات KPI */
.kpi-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(158px, 1fr)); gap:14px; margin-bottom:18px; }
.kpi{
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:18px 18px 16px; position:relative; overflow:hidden;
}
.kpi::after{
  content:""; position:absolute; inset-block-start:0; inset-inline-start:0;
  width:100%; height:4px; background:linear-gradient(90deg, var(--red), transparent 70%);
}
.kpi-v{ font-size:1.6rem; font-weight:900; color:var(--ink-1); line-height:1.2; }
.kpi-l{ font-size:.86rem; font-weight:700; color:var(--ink-2); margin-top:4px; }
.kpi-s{ font-size:.76rem; color:var(--ink-3); margin-top:3px; }

/* أزرار */
.abtn{
  font:inherit; font-size:.86rem; font-weight:700; cursor:pointer;
  padding:8px 15px; border-radius:9px; border:1px solid var(--line);
  background:var(--bg); color:var(--ink-1); text-decoration:none;
  display:inline-block; transition:all .15s;
}
.abtn:hover{ border-color:var(--red); color:var(--red); }
.abtn:disabled{ opacity:.45; cursor:not-allowed; }
.abtn-red{ background:var(--red); border-color:var(--red); color:#fff; }
.abtn-red:hover{ filter:brightness(1.08); color:#fff; }

/* الجداول */
.table-scroll{ overflow-x:auto; border-radius:12px; border:1px solid var(--line); }
.atable{ width:100%; border-collapse:collapse; font-size:.86rem; min-width:720px; }
.atable th{
  background:rgba(200,16,46,.07); color:var(--ink-1); font-weight:800;
  padding:11px 12px; text-align:right; white-space:nowrap; border-bottom:1px solid var(--line);
}
.atable td{ padding:10px 12px; border-bottom:1px solid var(--line); color:var(--ink-2); vertical-align:top; }
.atable tr:last-child td{ border-bottom:0; }
.atable tr:hover td{ background:rgba(200,16,46,.035); }
.td-path{ font-family:ui-monospace, monospace; font-size:.78rem; max-width:230px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.td-fp{ font-family:ui-monospace, monospace; font-size:.78rem; }
.td-actions{ white-space:nowrap; }

/* الفلاتر */
.vf-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px; }
.vf-grid label{ display:grid; gap:5px; font-size:.8rem; font-weight:700; color:var(--ink-2); }
.vf-grid input, .vf-grid select, .admin-card textarea, .admin-card input[type="url"], .admin-card input[type="text"], .admin-card input[type="password"], .admin-card select{
  font:inherit; font-size:.88rem; padding:9px 12px; border-radius:9px;
  border:1px solid var(--line); background:var(--bg); color:var(--ink-1); width:100%;
  box-sizing:border-box;
}
.vf-grid input:focus, .vf-grid select:focus, .admin-card textarea:focus{ outline:none; border-color:var(--red); }
.vf-bar{ display:flex; gap:10px; align-items:center; margin-top:14px; flex-wrap:wrap; }
.pager{ display:flex; align-items:center; justify-content:center; gap:14px; margin-top:14px; font-size:.9rem; font-weight:700; color:var(--ink-2); }

/* بوابة كلمة المرور */
.admin-gate{
  max-width:430px; margin:40px auto; text-align:center;
  background:var(--card); border:1px solid var(--line); border-radius:20px; padding:36px 30px;
}
.gate-mark{ color:var(--red); margin-bottom:10px; }
.admin-gate h2{ font-size:1.3rem; font-weight:900; margin-bottom:6px; }
.admin-gate p{ color:var(--ink-3); font-size:.9rem; line-height:1.9; }
.gate-form{ display:flex; gap:10px; margin:18px 0 8px; }
.gate-form input{ flex:1; font:inherit; padding:11px 14px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink-1); }
.gate-form input:focus{ outline:none; border-color:var(--red); }
.gate-note{ font-size:.85rem; color:var(--ink-3); min-height:1.4em; }
.gate-err{ color:var(--red); font-weight:700; }
.gate-ok{ color:#166534; font-weight:700; }
.gate-hint{ font-size:.76rem; color:var(--ink-3); margin-top:10px; }
.gate-hint code{ background:rgba(200,16,46,.08); padding:2px 7px; border-radius:6px; direction:ltr; display:inline-block; }

/* الرسوم البيانية */
.charts-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:16px; }
.ch-wide{ grid-column:1 / -1; }
.admin-card canvas{ max-width:100%; }

/* نموذج المواضيع */
.post-form{ display:grid; gap:14px; }
.post-form label{ display:grid; gap:6px; font-weight:700; font-size:.9rem; color:var(--ink-1); }
.post-form .req{ color:var(--red); }
.post-form textarea{ font:inherit; font-size:.92rem; padding:11px 14px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink-1); resize:vertical; line-height:1.9; }
.post-form input[type="text"], .post-form input[type="url"]{ font:inherit; font-size:.92rem; padding:11px 14px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink-1); }
.pf-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.pf-preview{ margin-top:6px; }
.pf-preview img{ max-width:100%; max-height:150px; border-radius:10px; border:1px solid var(--line); }
.pf-check{ display:flex !important; flex-direction:row !important; align-items:center; gap:9px !important; font-size:.9rem; }
.pf-check input{ width:auto; }
@media (max-width: 620px){ .pf-grid{ grid-template-columns:1fr; } }

/* الرسائل */
.msg-list{ display:grid; gap:12px; }
.msg-item{ border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.msg-head{ display:flex; gap:12px; flex-wrap:wrap; align-items:baseline; font-size:.85rem; color:var(--ink-3); }
.msg-head strong{ color:var(--ink-1); font-size:.95rem; }
.msg-mail{ direction:ltr; font-family:ui-monospace, monospace; }
.msg-subject{ font-weight:800; color:var(--ink-1); margin-top:6px; }
.msg-body{ color:var(--ink-2); line-height:1.95; margin:8px 0 10px; white-space:pre-wrap; }
.msg-item .abtn{ margin-top:4px; }

/* حالات فارغة */
.empty{
  text-align:center; color:var(--ink-3); padding:34px 18px; font-size:.92rem;
  border:2px dashed var(--line); border-radius:14px; line-height:2;
}

/* شاشات صغيرة للوحة */
@media (max-width: 620px){
  .admin-head{ flex-direction:column; align-items:flex-start; }
  .kpi-grid{ grid-template-columns:repeat(2, 1fr); }
  .admin-card{ padding:16px; }
  .gate-form{ flex-direction:column; }
}
