/*
 * الواجهة الجديدة لموقع النجاة — ملف واحد بلا أدوات بناء.
 * الألوان: كحلي #0B4F6C، كهرماني #E09F3E، ورقي #F6F4EF، حبر #13232E.
 * الخطوط: Noto Kufi Arabic للعناوين، IBM Plex Sans Arabic للنص.
 */
:root {
  --primary: #0B4F6C;
  --primary-700: #083A50;
  --primary-50: #E4EEF2;
  --teal: #1F7A8C;
  --amber: #E09F3E;
  --amber-50: #FBEBD3;
  --amber-900: #5A3604;
  --paper: #F6F4EF;
  --sand: #E9E4D8;
  --line: #E3DED3;
  --line-soft: #EFEBE3;
  --ink: #13232E;
  --ink-2: #3C4A53;
  --muted: #5B6770;
  --night: #0F2B39;
  --night-2: #13232E;
  --white: #FFFFFF;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 18px 40px rgba(19, 35, 46, .14);
  --shadow-sm: 0 6px 18px rgba(19, 35, 46, .08);
  --font: "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-head: "Noto Kufi Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.8 var(--font); text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); margin: 0; line-height: 1.5; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; top: -100px; right: 16px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { top: 12px; color: #fff; }
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.mt { margin-top: 20px; }
.ph { background-color: var(--sand); background-image: repeating-linear-gradient(135deg, rgba(19, 35, 46, .05) 0 10px, transparent 10px 20px); }
.ph-dark { background-color: #1B3442; background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 10px, transparent 10px 20px); }

/* ---------- أزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 14px; padding: 11px 20px; font-weight: 700; font-size: 15px; line-height: 1.4; text-align: center; transition: background-color .15s, color .15s, border-color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 14px; border-radius: 12px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: #C9D9E0; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-amber { background: var(--amber); color: var(--ink); align-self: flex-start; }
.btn-amber:hover { background: #cf8e2f; color: var(--ink); }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: var(--primary-50); color: var(--primary); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn-ghost-light:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .08); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions.center { justify-content: center; }

/* ---------- الشريط العلوي والترويسة ---------- */
.topbar { background: var(--primary); color: #E8F1F4; font-size: 13px; }
.topbar-in { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-links { display: flex; gap: 22px; }
.topbar a { color: #E8F1F4; }
.topbar a:hover { color: #fff; text-decoration: underline; }

.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 24px 18px; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { width: auto; height: 56px; max-width: 160px; object-fit: contain;background: white;
  padding: 0.3rem;
  border-radius: 0.4rem; }
.brand-mark { width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 800 26px/1 var(--font-head); }
.brand-mark.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 800 clamp(19px, 2.4vw, 26px)/1.4 var(--font-head); }
.brand-slogan { font-size: 14px; color: var(--muted); }

.search { display: flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px; width: min(340px, 100%); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11, 79, 108, .12); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; padding: 7px 14px; color: var(--ink); outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { width: 40px; height: 40px; flex-shrink: 0; border-radius: 999px; border: 0; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.search button:hover { background: var(--primary-700); }
.search-lg { width: 100%; max-width: 640px; margin-bottom: 8px; background: #fff; }
.search-lg input { font-size: 17px; padding: 10px 16px; }
.search-lg button { width: 48px; height: 48px; }

.menu-btn { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); align-items: center; justify-content: center; }

.sitenav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; font-size: 15px; font-weight: 600; margin-bottom: -1px; }
.sitenav::-webkit-scrollbar { display: none; }
.sitenav a { flex-shrink: 0; padding: 12px 14px; color: var(--ink-2); border-bottom: 3px solid transparent; white-space: nowrap; }
.sitenav a:hover { color: var(--primary); }
.sitenav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- البطل: نشرة اليوم ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-block: 56px; }
.pill { align-self: flex-start; display: inline-block; background: var(--amber-50); color: #7A4A06; font-weight: 700; font-size: 13px; padding: 5px 14px; border-radius: 999px; }
.hero-text { display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.45; font-weight: 800; }
.hero-date { display: inline-block; font-size: 1.2em; margin-top: 4px; }
.hero-date { color: var(--primary); }
.lead { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.9; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.chip { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.chip:hover { border-color: var(--primary); color: var(--primary); }

.hero-covers { position: relative; height: clamp(360px, 42vw, 540px); }
.hero-cover { position: absolute; display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: transform .25s ease; }
.hero-cover .cover { border-radius: 0; }
.hero-cover.pos-0 { top: 0; right: 4%; width: 58%; z-index: 3; border: 6px solid #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(19, 35, 46, .28); }
.hero-cover.pos-1 { top: 6%; right: 30%; width: 48%; z-index: 2; transform: rotate(-3deg); }
.hero-cover.pos-2 { top: 12%; right: 50%; width: 44%; z-index: 1; transform: rotate(-7deg); opacity: .92; }
.hero-cover:hover { transform: translateY(-6px) rotate(0); z-index: 4; }

/* ---------- غلاف النشرة المرسوم من القالب ---------- */
.cover { position: relative; display: block; width: 100%; overflow: hidden; container-type: inline-size; background-repeat: no-repeat; background-position: top center; border-radius: 10px; font-family: var(--font); }
.cover-el { position: absolute; display: block; }
.cover-text { overflow: hidden; white-space: pre-line; }
.mini-cover { display: block; width: 120px; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 24px rgba(19, 35, 46, .14); transition: transform .2s; }
.mini-cover:hover { transform: translateY(-4px); }
.mini-cover.wide { width: 100%; max-height: 240px; }

/* ---------- الأشرطة والعناوين ---------- */
.band { padding-block: 0 56px; }
.band-tight { padding-block: 0 40px; }
.band-flush { padding-block: 8px 56px; }
.band-dark { background: var(--night); color: #E8F1F4; padding-block: 56px; margin-bottom: 56px; }
.band-dark h2, .band-dark h3, .band-dark .sec-head h2 a { color: #fff; }
.band-code { padding-bottom: 40px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.sec-head h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; }
.sec-head h2 a { color: var(--ink); }
.sec-head h2 a:hover { color: var(--primary); }
.kicker { display: block; font-size: 13px; font-weight: 700; color: var(--teal); margin-bottom: 4px; }
.band-dark .kicker { color: var(--amber); }
.more { font-weight: 700; font-size: 15px; white-space: nowrap; }
.band-dark .more { color: #CFE3EA; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-clips { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.list { display: flex; flex-direction: column; gap: 16px; }

/* ---------- بطاقات الأخبار ---------- */
.nc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.nc:hover { box-shadow: var(--shadow-sm); }
.nc-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background-color: var(--sand); }
.nc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.nc:hover .nc-media img { transform: scale(1.03); }
.nc-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.nc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.nc-meta span + span::before { content: "·"; margin-inline-end: 12px; }
.nc-title { font-size: 17px; line-height: 1.6; font-weight: 700; }
.nc-title a { color: var(--ink); }
.nc-title a:hover { color: var(--primary); }
.nc-excerpt { font-size: 15px; line-height: 1.85; color: var(--ink-2); }
.nc-more { align-self: flex-start; font-weight: 700; font-size: 14px; margin-top: auto; }
.nc .btn-amber { margin-top: auto; }

.nc-lead { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); border-radius: var(--radius-lg); }
.nc-lead .nc-media { aspect-ratio: auto; min-height: 340px; }
.nc-lead .nc-media img, .nc-row .nc-media img { position: absolute; inset: 0; }
.nc-lead .nc-body { justify-content: center; gap: 14px; padding: 28px 32px; }
.nc-lead .nc-title { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.55; font-weight: 800; }
.nc-lead .nc-excerpt { font-size: 16px; }

.nc-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.nc-row .nc-media { aspect-ratio: auto; min-height: 150px; }
.nc-row .nc-body { padding: 18px 22px; }

.nc-clip .nc-media { aspect-ratio: 3 / 4; }
.nc-clip .nc-media img { object-position: top; }
.nc-clip .nc-body { padding: 14px 16px 16px; gap: 6px; }
.nc-clip .nc-title { font-size: 16px; }
.figure-wrap { max-width: 560px; margin-inline: auto; }
.nc-figure { display: block; background: var(--sand); }
.nc-figure img { width: 100%; }
.nc-caption { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.nc-caption .nc-title { font-size: 16px; }
.badge-paper { position: absolute; bottom: 12px; right: 12px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 10px; box-shadow: 0 2px 8px rgba(19, 35, 46, .12); }

.nc-mini { border: 0; border-radius: 0; background: none; overflow: visible; }
.nc-mini:hover { box-shadow: none; }
.nc-mini + .nc-mini { border-top: 1px solid var(--line-soft); }
.nc-mini-link { display: flex; gap: 12px; padding: 14px 0; color: var(--ink); }
.nc-mini img, .nc-mini-ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.nc-mini-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nc-mini-title { font-weight: 600; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-mini-link:hover .nc-mini-title { color: var(--primary); }

/* ---------- مواقع التواصل ---------- */
.social { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.social-media { display: block; position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.social-media img { width: 100%; height: 100%; object-fit: cover; }
.social-media .figure-wrap { max-width: 560px; margin-inline: auto; }
.nc-figure { display: block; background: var(--sand); }
.nc-figure img { width: 100%; }
.nc-caption { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.nc-caption .nc-title { font-size: 16px; }
.badge-paper { top: 12px; bottom: auto; }
.social-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; }
.social-body p { font-size: 15px; line-height: 1.85; color: var(--ink-2); }

/* ---------- الصوتيات والمرئيات ---------- */
.audio-list { display: flex; flex-direction: column; gap: 12px; }
.audio { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.band-dark .audio { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.play { width: 48px; height: 48px; flex-shrink: 0; border-radius: 999px; border: 0; background: var(--amber); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; transition: transform .15s; }
.play:hover { transform: scale(1.06); color: var(--ink); }
.play.is-off { background: rgba(224, 159, 62, .35); }
.play .i-pause, .audio.is-playing .play .i-play { display: none; }
.audio.is-playing .play .i-pause { display: block; }
.audio-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.audio-title { font-weight: 700; line-height: 1.6; color: var(--ink); }
.band-dark .audio-title { color: #fff; }
.audio-sub { font-size: 13px; color: var(--muted); }
.band-dark .audio-sub { color: #A9C4CE; }
.audio-bar { display: block; height: 4px; border-radius: 4px; background: rgba(127, 127, 127, .25); margin-top: 6px; overflow: hidden; }
.audio-bar span { display: block; height: 100%; width: 0; background: var(--amber); transition: width .25s linear; }

.video { display: flex; flex-direction: column; gap: 16px; }
.video-info { display: flex; flex-direction: column; gap: 14px; }
.video.is-solo { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: center; }
.video-frame { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background-color: #1B3442; background-size: cover; background-position: center; }
.video-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 50%); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; }
.video-play { position: relative; z-index: 1; width: 76px; height: 76px; border-radius: 999px; background: var(--amber); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: transform .15s; }
.video-frame:hover .video-play { transform: scale(1.08); }
.video-title { font-size: 20px; line-height: 1.6; }
.video-title a { color: inherit; }
.video-more { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.video-more a { display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.video-more a::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--amber); flex-shrink: 0; }
.band-dark .video-more a { color: #CFE3EA; }
.band-dark .video-more a:hover { color: #fff; }

.media-pair { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; }
.media-pair .sec-head { margin-bottom: 18px; }

/* ---------- البانر والأرشيف والاشتراك ---------- */
.banner { border-radius: var(--radius-lg); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.banner img { width: 100%; }
.banner-desc, .banner .prose { padding: 16px 22px; }

.archive-cta { display: flex; align-items: center; gap: 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px 40px; margin-bottom: 56px; }
.archive-cta > div:first-child { display: flex; flex-direction: column; gap: 10px; flex: 1; align-items: flex-start; }
.archive-cta h2 { font-size: 26px; font-weight: 800; }
.archive-cta p { color: var(--muted); }
.archive-cta-covers { display: flex; gap: 16px; }

.subscribe { display: flex; align-items: center; justify-content: space-between; gap: 32px; background: var(--primary); color: #fff; border-radius: var(--radius-lg); padding: 40px; margin-bottom: 56px; }
.subscribe h2 { color: #fff; font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; }
.subscribe p { color: #CFE3EA; margin-top: 6px; }
.subscribe-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.empty { text-align: center; background: #fff; border: 1px dashed #D5CFC2; border-radius: var(--radius-lg); padding: 48px 24px; margin-bottom: 56px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty h2 { font-size: 22px; }
.empty p { color: var(--muted); }

/* ---------- شعار الجريدة (مصدر الخبر): site/partials/paper ---------- */
.paper { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); font-weight: 600; }
.paper img { display: block; width: auto; object-fit: contain; }
.paper.has-logo img { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 3px 6px; box-sizing: content-box; }
.paper-sm img { height: 22px; max-width: 92px; }
.paper-md img { height: 28px; max-width: 120px; }
.paper-lg img { height: 44px; max-width: 170px; padding: 6px 10px; border-radius: 12px; }
.paper-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-lg .paper-name { font-weight: 700; color: var(--ink); }
.paper-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.nc-meta { align-items: center; }
.nc-mini .nc-meta { margin-top: 4px; }
.badge-paper .paper img { border: 0; padding: 0; }
.nc-caption .paper { flex-shrink: 0; }
.article-source { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; align-self: flex-start; }
.article-source .paper.has-logo img { border: 0; padding: 0; }
.article-source-issue { font-size: 14px; color: var(--muted); padding-inline-start: 16px; border-inline-start: 1px solid var(--line); }

/* ---------- تبديل العرض في القسم: شبكي | قائمة ---------- */
.page-head.page-head-row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.view-switch { display: inline-flex; padding: 4px; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.view-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.view-switch a:hover { color: var(--primary); }
.view-switch a.is-active { background: var(--primary); color: #fff; }
.news-list { display: flex; flex-direction: column; gap: 16px; }
.news-list .nc-row { grid-template-columns: 280px minmax(0, 1fr); }
.news-list .nc-row .nc-media { min-height: 180px; }

/* ---------- الصفحات الداخلية ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 32px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs [aria-current] { color: var(--ink); }
.page-head { padding-block: 20px 28px; display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }

.article-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 40px; padding-block: 24px 64px; align-items: start; }
.article { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.article-head { display: flex; flex-direction: column; gap: 16px; }
.article-head h1 { font-size: clamp(26px, 3.6vw, 42px); line-height: 1.45; font-weight: 800; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 600; }
.tag { background: #fff; border: 1px solid var(--line); color: var(--ink-2); padding: 5px 12px; border-radius: 999px; }
a.tag:hover { border-color: var(--primary); color: var(--primary); }
.tag-primary { background: var(--primary-50); border-color: var(--primary-50); color: var(--primary); }
.article-figure { position: relative; margin: 0; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.article-figure img { width: 100%; }
.paper-badge { position: absolute; top: 16px; right: 16px; background: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: 0 6px 18px rgba(19, 35, 46, .15); }
.paper-badge img { max-height: 44px; width: auto; }
.article-video { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #000; }
.article-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article-audio audio { width: 100%; }
.prose { font-size: 18px; line-height: 2; color: var(--ink); overflow-wrap: anywhere; }
.prose p { margin: 0 0 1em; }
.prose img { border-radius: 14px; margin-block: 1em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose iframe { max-width: 100%; }
.article-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.share { display: flex; align-items: center; gap: 8px; }
.share span { font-size: 14px; color: var(--muted); }
.share a, .share button { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.share a:hover, .share button:hover { background: var(--primary-50); color: var(--primary); }
.share button.is-copied { background: #DDF3E4; color: #1E6B3A; }

.aside { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; }
.panel h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.panel-primary { background: var(--primary); border-color: var(--primary); color: #fff; gap: 14px; }
.panel-primary h2 { color: #fff; margin: 0; }

.archive-month { margin-bottom: 40px; }
.archive-month-title { font-size: 20px; font-weight: 800; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px; }
.issue { display: flex; flex-direction: column; gap: 12px; }
.issue-cover { display: block; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 24px rgba(19, 35, 46, .12); transition: transform .2s, box-shadow .2s; }
.issue-cover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.issue-body h3 { font-size: 15px; line-height: 1.6; }
.issue-body h3 a { color: var(--ink); }
.issue-links { display: flex; gap: 12px; font-size: 13px; font-weight: 700; margin-top: 2px; }

.issue-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; padding-block: 28px 56px; }
.issue-hero-cover { display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 5px solid #fff; }
.issue-hero-text { display: flex; flex-direction: column; gap: 18px; }
.issue-hero-text h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; }

.pager-wrap { margin-top: 15px; margin-bottom: 15px;}
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pager-pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pager-btn, .pager-num { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 700; }
.pager-num { padding-inline: 8px; }
a.pager-btn:hover, a.pager-num:hover { border-color: var(--primary); color: var(--primary); }
.pager-num.is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-btn.is-off { opacity: .45; }
.pager-gap { align-self: center; color: var(--muted); }

/* ---------- التذييل والنوافذ ---------- */
.footer { background: var(--night-2); color: #A9B6BE; font-size: 14px; }
.footer-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 32px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: #E8F1F4; font-weight: 600; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { color: #A9B6BE; }
.footer a:hover { color: #fff; }

.dialog { border: 0; border-radius: 20px; padding: 28px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); color: var(--ink); }
.dialog::backdrop { background: rgba(19, 35, 46, .55); }
.dialog h2 { font-size: 20px; margin-bottom: 6px; }
.dialog p { color: var(--muted); margin-bottom: 16px; }
.dialog-close-form { position: absolute; top: 12px; left: 12px; }
.dialog-x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--paper); font-size: 22px; line-height: 1; }
.dialog-form { display: flex; gap: 10px; }
.dialog-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font: inherit; }
.dialog-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11, 79, 108, .12); }

body.closed { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.closed-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 40px; max-width: 520px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.closed-card h1 { font-size: 26px; font-weight: 800; }
.closed-cause { margin-top: 10px; background: var(--paper); border-radius: 14px; padding: 16px 18px; line-height: 1.9; }

/* ---------- الجوال واللوحي ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { gap: 32px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .media-pair { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .video.is-solo { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 820px) {
  .topbar-links a:not(:first-child) { display: none; }
  .masthead-in { flex-wrap: wrap; padding-block: 14px; gap: 12px; }
  .brand { flex: 1 1 0; }
  .brand-logo, .brand-mark { height: 46px; }
  .brand-mark { width: 46px; font-size: 22px; border-radius: 14px; }
  .brand-slogan { display: none; }
  .masthead .search { order: 3; width: 100%; }
  .menu-btn { display: inline-flex; }
  .sitenav { display: none; flex-direction: column; gap: 0; padding-bottom: 8px; }
  .sitenav.is-open { display: flex; }
  .sitenav a { border-bottom: 1px solid var(--line-soft); border-inline-start: 3px solid transparent; padding: 12px 6px; }
  .sitenav a[aria-current="page"] { border-bottom-color: var(--line-soft); border-inline-start-color: var(--primary); padding-inline-start: 12px; }

  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 28px 40px; gap: 24px; }
  .hero-covers { order: -1; height: auto; aspect-ratio: 16 / 11; max-height: 420px; }
  .hero-cover.pos-0 { right: 18%; width: 48%; }
  .hero-cover.pos-1 { right: 42%; width: 38%; }
  .hero-cover.pos-2 { right: 58%; width: 34%; }
  .hero .actions .btn { flex: 1 1 200px; }

  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4, .grid-clips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .nc-lead { grid-template-columns: minmax(0, 1fr); }
  .nc-lead .nc-media { min-height: 0; aspect-ratio: 16 / 10; }
  .nc-lead .nc-body { padding: 18px 20px 22px; }
  .nc-row { grid-template-columns: 110px minmax(0, 1fr); }
  .nc-row .nc-media { min-height: 110px; }
  .nc-row .nc-body { padding: 12px 14px; }
  .news-list .nc-row { grid-template-columns: 120px minmax(0, 1fr); }
  .news-list .nc-row .nc-media { min-height: 120px; }
  .view-switch a span { display: none; }
  .view-switch a { padding: 8px 10px; }
  .paper-lg img { height: 36px; }
  .paper-md.has-logo .paper-name { display: none; }
  .nc-row .nc-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
  .nc-clip .nc-body { padding: 10px 12px 12px; }
  .nc-clip .nc-title { font-size: 14px; }
  .band { padding-bottom: 40px; }
  .band-dark { padding-block: 40px; margin-bottom: 40px; }
  .sec-head { margin-bottom: 16px; }

  .archive-cta { flex-direction: column; align-items: stretch; padding: 24px; gap: 24px; margin-bottom: 40px; }
  .archive-cta-covers { justify-content: center; }
  .mini-cover { width: 30%; max-width: 120px; }
  .subscribe { flex-direction: column; align-items: stretch; text-align: center; padding: 28px 22px; margin-bottom: 40px; }
  .subscribe-actions { justify-content: center; }
  .subscribe-actions .btn { flex: 1 1 160px; }

  .article-actions { padding: 16px; }
  .article-actions .actions { width: 100%; }
  .article-actions .actions .btn { flex: 1 1 140px; }
  .prose { font-size: 17px; }

  .issue-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .issue-hero-cover { max-width: 240px; justify-self: center; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .footer-in { flex-direction: column; text-align: center; }
  .dialog-form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .masthead form, .menu-btn, .sitenav, .subscribe, .footer, .aside, .share, .article-actions { display: none !important; }
  body { background: #fff; }
}
