/* ==========================================================================
   إسناد: واجهة الموقع
   نظام بصري لمجلة رأي عربية: أبيض، رماديات، أسود، والأحمر #983132 لونًا وحيدًا للتمييز.
   العلامة المميزة: «قطع الألف» المائل ونقطة الشعار المستديرة، مأخوذان من هندسة الشعار.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* اللون */
  --red: #983132;
  --red-deep: #7b2627;
  --red-wash: #f8efef;
  --ink: #121212;
  --ink-2: #2d2d2d;
  --ink-3: #5c5c5c;
  --ink-4: #8a8a8a;
  --rule: #e4e4e4;
  --rule-2: #cdcdcd;
  --paper: #ffffff;
  --paper-2: #f4f4f3;
  --paper-3: #e8e8e6;
  --focus: #983132;

  /* الخطوط */
  --font-display: "Alexandria", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-text: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", "Times New Roman", serif;

  /* سلّم الأحجام (مرن) */
  --fs-2xs: 0.75rem;
  --fs-xs: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --fs-sm: clamp(0.86rem, 0.83rem + 0.14vw, 0.94rem);
  --fs-base: clamp(1rem, 0.97rem + 0.16vw, 1.075rem);
  --fs-md: clamp(1.08rem, 1.02rem + 0.28vw, 1.22rem);
  --fs-lg: clamp(1.22rem, 1.1rem + 0.55vw, 1.5rem);
  --fs-xl: clamp(1.45rem, 1.25rem + 0.95vw, 2rem);
  --fs-2xl: clamp(1.75rem, 1.4rem + 1.7vw, 2.75rem);
  --fs-3xl: clamp(1.75rem, 1.43rem + 1.33vw, 2.6rem);
  --fs-4xl: clamp(1.875rem, 1.36rem + 2.1vw, 3.25rem);
  /* عنوان المادة الرئيسية في الواجهة */
  --fs-lead: clamp(1.75rem, 1.425rem + 1.33vw, 2.625rem);
  /* المادة البارزة في صفحات الأقسام */
  --fs-feature: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);

  --lh-tight: 1.2;
  --lh-display: 1.35;
  --lh-snug: 1.38;
  --lh-ui: 1.6;
  --lh-text: 1.9;

  /* المسافات */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --gutter: clamp(16px, 3.2vw, 40px);
  --col-gap: clamp(20px, 2.4vw, 36px);
  --block-gap: clamp(56px, 7vw, 104px);

  /* المقاسات */
  --container: 1320px;
  --measure: 680px;
  --header-h: 72px;
  --header-shrink: 14px;
  --radius: 2px;
  --radius-round: 999px;

  /* الحركة */
  --dur-1: 120ms;
  --dur-2: 220ms;
  --dur-3: 300ms;
  --dur-4: 520ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* علامة الألف: عمود رأسه مقطوع بميل كما في الشعار */
  --alef: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  line-height: var(--lh-ui);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
html.is-locked, html.is-locked body { overflow: hidden; }
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
/* بلا وزن (:where) كي لا يلغي الحشو الذي تضبطه القوائم لنفسها */
:where(ul[class], ol[class]) { list-style: none; padding: 0; }
:where(h1, h2, h3, h4) { font-weight: 700; line-height: 1.4; text-wrap: balance; }
p { text-wrap: pretty; }
[x-cloak] { display: none !important; }
[hidden] { display: none !important; }
.no-js .tabs__panel[hidden] { display: block !important; }
::selection { background: var(--red); color: #fff; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 1px;
}
.main:focus { outline: none; }

.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: fixed;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  transition: top var(--dur-2) var(--ease-out);
}
.skip:focus { top: 12px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.ltr, [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }
kbd {
  font-family: var(--font-display);
  font-size: 0.72em;
  line-height: 1;
  padding: 3px 6px;
  border: 1px solid var(--rule-2);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--ink-3);
  background: var(--paper);
}

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* نقطة الشعار: فاصل صغير بين عناصر السطر */
.dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  margin-inline: 0.55em;
  vertical-align: middle;
  flex: none;
}

/* ---------- 3. Splash between pages ---------- */
/*
 * عند كل انتقال داخلي: شاشة بيضاء يُكتب عليها الشعار من اليمين إلى اليسار ثم تحطّ نقطة النون.
 * .is-leaving في الصفحة التي يغادرها القارئ، و.is-splash في الصفحة التي يصل إليها حتى تجهز.
 * --splash-t سالب بقدر ما مضى منذ النقرة، فتكمل الحركة في الصفحة الجديدة من حيث بلغت.
 */
.splash {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.is-leaving .splash, .is-splash .splash { opacity: 1; visibility: visible; pointer-events: auto; }
.is-leaving .splash { transition: opacity 180ms linear; }
/* احتياط: إن تعطل JavaScript تختفي الشاشة وحدها */
.is-splash .splash { animation: splash-failsafe 1ms 5s forwards; }
.is-splash.is-splash-out .splash { opacity: 0; pointer-events: none; transition: opacity 340ms var(--ease-out); }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

.splash__in { display: grid; justify-items: center; gap: var(--sp-6); }
.splash__logo { width: clamp(150px, 17vw, 210px); height: auto; color: var(--red); overflow: visible; }
.splash .logo__body { clip-path: inset(0 0 0 100%); }
.splash .logo__dot { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
:is(.is-leaving, .is-splash) .splash .logo__body {
  animation: splash-ink 440ms var(--ease-in-out) var(--splash-t, 0ms) both;
}
:is(.is-leaving, .is-splash) .splash .logo__dot {
  animation: splash-dot 300ms cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--splash-t, 0ms) + 360ms) both;
}
@keyframes splash-ink { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes splash-dot { from { opacity: 0; transform: translateY(-90%) scale(0.3); } to { opacity: 1; transform: none; } }

/* شريط تقدّم صغير تحت الشعار، لا يظهر إلا إن تأخرت الصفحة */
.splash__bar {
  position: relative;
  width: 88px;
  height: 2px;
  background: var(--rule);
  overflow: hidden;
  opacity: 0;
}
.splash__bar span {
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right center;
}
:is(.is-leaving, .is-splash) .splash__bar { animation: fade-in 240ms linear calc(var(--splash-t, 0ms) + 900ms) both; }
:is(.is-leaving, .is-splash) .splash__bar span { animation: splash-load 8s cubic-bezier(0.05, 0.75, 0.2, 1) calc(var(--splash-t, 0ms) + 900ms) both; }
@keyframes splash-load { to { transform: scaleX(0.88); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* الشاشة تغطي كل شيء، فلا داعي لنقل الترويسة والغلاف بين الصفحتين */
:is(.is-leaving, .is-splash) :is(.masthead, .story__cover .media img) { view-transition-name: none; }
.is-splash::view-transition-old(root) { animation: vt-fade-out 180ms linear both; }
.is-splash::view-transition-new(root) { animation: fade-in 180ms linear both; }
@keyframes vt-fade-out { to { opacity: 0; } }

/* ---------- 4. Top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.topbar__in {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: 38px;
}
.topbar__date { font-weight: 500; color: var(--ink-2); }
.topbar__tagline {
  padding-inline-start: var(--sp-5);
  border-inline-start: 1px solid var(--rule-2);
  line-height: 1;
}
.topbar__links {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-inline-start: auto;
}
.topbar__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  transition: color var(--dur-1);
}
.topbar__links a:hover { color: var(--red); }
.topbar__links .icon { width: 16px; height: 16px; }
.topbar__admin { font-weight: 600; color: var(--ink) !important; }

/* ---------- 5. Masthead ---------- */
.masthead {
  position: sticky;
  top: calc(-1 * var(--header-shrink));
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  view-transition-name: masthead;
}
.masthead__in {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  transition: transform var(--dur-3) var(--ease-out);
}
.is-scrolled .masthead__in { transform: translateY(calc(var(--header-shrink) / 2)); }
.masthead__logo {
  display: block;
  color: var(--red);
  flex: none;
  transform-origin: right center;
  transition: transform var(--dur-3) var(--ease-out);
}
.masthead__logo .logo { height: 40px; width: auto; }
.is-scrolled .masthead__logo { transform: scale(0.8); }
.iconbtn.masthead__burger { display: none; }

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  color: var(--ink);
  transition: background-color var(--dur-1), color var(--dur-1);
}
.iconbtn:hover { background: var(--paper-2); }
.iconbtn .icon { width: 24px; height: 24px; }

.nav { position: relative; flex: 1; min-width: 0; align-self: stretch; }
.nav__dot {
  position: absolute;
  bottom: 12px;
  left: 0;
  width: 6px; height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--red);
  pointer-events: none;
  opacity: 0;
  transform: translateX(var(--x, 0px)) scale(0);
  transition: transform 420ms var(--ease-out), opacity var(--dur-2);
}
.nav__dot.is-on { opacity: 1; transform: translateX(var(--x, 0px)) scale(1); }
.nav__dot.is-instant { transition: none; }
.nav.has-dot .nav__link::after { display: none; }
.nav__list { display: flex; height: 100%; align-items: stretch; gap: 2px; }
.nav__item { position: relative; display: flex; align-items: center; }
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding-inline: 14px;
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0;
  color: var(--ink);
  transition: color var(--dur-1);
}
.nav__item--has .nav__link { padding-inline-end: 4px; }
.nav__link::after {
  content: "";
  position: absolute;
  bottom: 12px;
  inset-inline-start: 50%;
  width: 6px; height: 6px;
  margin-inline-start: -3px;
  border-radius: 50%;
  background: var(--red);
  transform: scale(0);
  transition: transform var(--dur-2) var(--ease-out);
}
.nav__item--has .nav__link::after { inset-inline-start: calc(50% + 4px); }
.nav__link:hover { color: var(--red); }
.nav__link.is-active::after { transform: scale(1); }
.nav__toggle {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  margin-inline-end: 6px;
  border-radius: 50%;
  color: var(--ink-3);
  transition: transform var(--dur-2) var(--ease-out), color var(--dur-1);
}
.nav__toggle .icon { width: 16px; height: 16px; }
.nav__item.is-open .nav__toggle, .nav__toggle:hover { color: var(--red); }
.nav__item.is-open .nav__toggle { transform: rotate(180deg); }
.nav__panel {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  inset-inline-start: 0;
  width: 520px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-top: 3px solid var(--red);
  padding: var(--sp-4) var(--sp-4) 0;
  z-index: 60;
}
.nav__item.is-open .nav__panel,
.no-js .nav__item:hover .nav__panel,
.no-js .nav__item:focus-within .nav__panel {
  display: block;
  animation: drop var(--dur-2) var(--ease-out);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.nav__sub { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.nav__sub a {
  display: block;
  padding: var(--sp-3) var(--sp-3) var(--sp-3);
  transition: background-color var(--dur-1);
}
.nav__sub a:hover, .nav__sub a:focus-visible { background: var(--paper-2); }
.nav__sub strong { display: block; font-weight: 700; font-size: var(--fs-base); }
.nav__sub a:hover strong { color: var(--red); }
.nav__sub a.is-active strong { color: var(--red); }
.nav__sub span {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  line-height: 1.6;
}
.nav__all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--sp-3) calc(-1 * var(--sp-4)) 0;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.nav__all:hover { color: var(--red); }

.masthead__tools { display: flex; align-items: center; gap: var(--sp-2); margin-inline-start: auto; }
.searchbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding-inline: 14px 10px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-round);
  font-size: var(--fs-sm);
  color: var(--ink-3);
  min-width: 190px;
  transition: border-color var(--dur-1), color var(--dur-1);
}
.searchbtn .icon { width: 20px; height: 20px; color: var(--ink); }
.searchbtn__kbd { margin-inline-start: auto; }
.searchbtn:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- 6. Drawer (mobile) ---------- */
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(18, 18, 18, 0.5); }
.drawer__panel {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(88vw, 400px);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-inline-end: 1px solid var(--ink);
}
.drawer-enter, .drawer-leave { transition: transform var(--dur-3) var(--ease-out); }
.drawer-from { transform: translateX(100%); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--rule);
}
.drawer__logo { color: var(--red); }
.drawer__logo .logo { height: 34px; width: auto; }
.drawer__search {
  display: flex;
  margin: var(--sp-4);
  border: 1px solid var(--ink);
}
.drawer__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 12px 14px;
  font-size: 1rem;
  background: none;
}
.drawer__search input:focus { outline: none; }
.drawer__search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drawer__search button { width: 48px; display: grid; place-items: center; background: var(--ink); color: #fff; }
.drawer__nav { padding: 0 var(--sp-4); }
.drawer__nav > li { border-bottom: 1px solid var(--rule); }
.drawer__row { display: flex; align-items: center; justify-content: space-between; }
.drawer__row > a {
  flex: 1;
  padding: 14px 0;
  font-size: var(--fs-lg);
  font-weight: 700;
}
.drawer__row > a.is-active, .drawer__sub a.is-active { color: var(--red); }
.drawer__toggle .icon { transition: transform var(--dur-2) var(--ease-out); }
.drawer__toggle.is-open .icon { transform: rotate(180deg); }
.drawer__sub { padding: 0 0 var(--sp-3); }
.drawer__sub a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: var(--fs-md);
  color: var(--ink-2);
}
.drawer__sub a::before {
  content: "";
  width: 6px; height: 14px;
  background: var(--rule-2);
  clip-path: var(--alef);
}
.drawer__foot {
  margin-top: auto;
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.drawer__admin { display: inline-flex; gap: 6px; align-items: center; color: var(--ink); font-weight: 600; }

/* ---------- 7. Search overlay ---------- */
.sov { position: fixed; inset: 0; z-index: 85; }
.sov__backdrop { position: absolute; inset: 0; background: rgba(18, 18, 18, 0.45); }
.sov__panel {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  max-height: 100dvh;
  overflow-y: auto;
}
.sov-enter, .sov-leave { transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) linear; }
.sov-from { transform: translateY(-16px); opacity: 0; }
.sov__in { padding-block: var(--sp-6) var(--sp-7); max-width: 880px; }
.sov__form {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border-bottom: 2px solid var(--ink);
  padding-bottom: var(--sp-2);
}
.sov__icon { width: 30px; height: 30px; color: var(--red); }
.sov__form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: var(--fs-2xl);
  font-weight: 700;
  padding: 6px 0;
  line-height: 1.3;
}
.sov__form input::placeholder { color: var(--ink-4); font-weight: 400; }
.sov__form input:focus { outline: none; }
.sov__form input::-webkit-search-cancel-button { display: none; }
.sov__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  padding: 8px;
}
.sov__close .icon { width: 24px; height: 24px; }
.sov__close:hover { color: var(--ink); }
.sov__body { padding-top: var(--sp-4); min-height: 120px; }
.sov__list { display: grid; gap: 2px; transition: opacity var(--dur-2); }
.sov__list.is-stale { opacity: 0.55; }
.sov__item {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  padding: 10px;
  margin-inline: -10px;
  position: relative;
  transition: background-color var(--dur-1);
}
.sov__item.is-active { background: var(--paper-2); }
.sov__item.is-active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 10px;
  width: 3px;
  background: var(--red);
}
.sov__thumb { width: 96px; aspect-ratio: 3 / 2; flex: none; overflow: hidden; }
.sov__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sov__text { display: grid; gap: 2px; min-width: 0; }
.sov__kicker { font-size: var(--fs-xs); color: var(--red); font-weight: 600; }
.sov__title { font-weight: 700; font-size: var(--fs-md); line-height: var(--lh-snug); }
.sov__title mark, .hl { background: none; color: inherit; box-shadow: inset 0 -0.38em 0 rgba(152, 49, 50, 0.18); }
.sov__meta { font-size: var(--fs-xs); color: var(--ink-3); display: flex; align-items: center; }
.sov__hint { color: var(--ink-3); font-size: var(--fs-sm); padding-block: var(--sp-3); }
.sov__keys { display: inline-flex; gap: 4px; align-items: center; margin-inline-start: var(--sp-3); }
.sov__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--sp-4);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--red);
}
.sov__all:hover { color: var(--red-deep); }

/* هياكل التحميل */
.sk {
  display: block;
  background: var(--paper-3);
  position: relative;
  overflow: hidden;
}
.sk::after, .media::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  background: linear-gradient(-90deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { transform: translateX(-100%); } }
.sk-row { display: flex; gap: var(--sp-4); align-items: center; padding-block: 10px; }
.sk--thumb { width: 96px; aspect-ratio: 3 / 2; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 10px; }
.sk--line { height: 14px; width: 80%; }
.sk--short { width: 40%; }

/* ---------- 8. Media (blur-up) ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--paper-3);
  aspect-ratio: 3 / 2;
  isolation: isolate;
}
.media--16x9 { aspect-ratio: 16 / 9; }
.media--1x1 { aspect-ratio: 1; }
.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: var(--ph, var(--paper-3));
  background-image: var(--lqip, none);
  background-size: cover;
  background-position: center;
  transition: filter var(--dur-4) var(--ease-out), transform 900ms var(--ease-out);
}
.media::after { z-index: 1; pointer-events: none; opacity: 0; transition: opacity var(--dur-2); }
.js .media:not(.is-loaded)::after { opacity: 1; }
.js .media:not(.is-loaded) img { filter: blur(14px); transform: scale(1.06); }
.media.is-loaded::after { animation: none; }
.media__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--paper-2);
}
.media__empty::before {
  content: "";
  width: 14%;
  aspect-ratio: 1 / 2.4;
  background: var(--rule-2);
  clip-path: var(--alef);
}
.no-js .media::after, .media:has(.media__empty)::after { display: none; }
@media (hover: hover) {
  a.media:hover img, .card:hover .media img, .hero:hover .hero__media img, .feature:hover .media img, .row:hover .media img, .op:hover .media img { transform: scale(1.03); }
}

/* ---------- 9. Kicker, meta, monogram ---------- */
.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--red);
  line-height: 1.5;
}
.kicker a { position: relative; z-index: 2; }
.kicker a:hover { color: var(--red-deep); text-decoration: underline; text-underline-offset: 4px; }
.kicker__sep { color: var(--rule-2); font-weight: 300; }
.kicker__tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--rule-2);
  padding: 1px 6px;
  border-radius: var(--radius);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  line-height: 1.7;
}
.meta a { position: relative; z-index: 2; }
.meta__author { color: var(--ink); font-weight: 600; }
.meta__author:hover { color: var(--red); }
.meta__orig { font-family: var(--font-text); font-weight: 600; color: var(--ink-2); }
.card .meta__tr, .row .meta__tr { display: none; }

.mono {
  --s: 44px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-weight: 800;
  font-size: calc(var(--s) * 0.34);
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mono--sm { --s: 34px; }
.mono--md { --s: 46px; }
.mono--lg { --s: 72px; }
.mono--xl { --s: 104px; }
.mono--img img { width: 100%; height: 100%; object-fit: cover; }
.mono__l { display: inline-block; }
.authorbox .mono__d, .profile .mono__d, .wstrip__item:hover .mono__d, .wcard:hover .mono__d { background: #fff; }
.mono__d {
  display: inline-block;
  width: calc(var(--s) * 0.07);
  height: calc(var(--s) * 0.07);
  min-width: 3px; min-height: 3px;
  border-radius: 50%;
  background: var(--red);
  margin-inline: calc(var(--s) * 0.06);
  transform: translateY(calc(var(--s) * 0.08));
}

/* ---------- 10. Section heads ---------- */
.shead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-5);
  border-top: 3px solid var(--ink);
  padding-top: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.shead__title {
  display: flex;
  align-items: center;
  gap: 0.42em;
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.25;
}
.shead__title::before {
  content: "";
  width: 0.3em;
  height: 0.88em;
  background: var(--red);
  clip-path: var(--alef);
  flex: none;
  transform: translateY(-0.04em);
}
.shead__title a:hover { color: var(--red); }
.shead__desc {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  padding-inline-start: var(--sp-5);
  border-inline-start: 1px solid var(--rule-2);
  line-height: 1.5;
}
.shead__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.shead__more .icon { width: 18px; height: 18px; transition: transform var(--dur-2) var(--ease-out); }
.shead__more:hover { color: var(--red); }
.shead__more:hover .icon { transform: translateX(-4px); }

/* ---------- 11. Cards ---------- */
.card { position: relative; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.card__body { display: flex; flex-direction: column; gap: 6px; container-type: inline-size; }
/* في الأعمدة الضيقة: الكاتب ثم التاريخ في سطرين بدل أن ينكسر السطر بعد النقطة */
@container (max-width: 250px) {
  .meta { flex-direction: column; align-items: flex-start; line-height: 1.6; }
  .meta .dot { display: none; }
}
.card__title { font-size: var(--fs-md); font-weight: 700; line-height: 1.42; }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
/* خط أحمر يُرسم تحت العنوان من بداية السطر (اليمين) عند المرور، ويعبر الأسطر بالترتيب */
.card__title a, .row__title a, .feature__title a, .hero__title a, .op__title a, .popular__h a {
  background-image: linear-gradient(var(--red), var(--red));
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0 2px;
  padding-bottom: 0.12em;
  transition: background-size 460ms var(--ease-out), color var(--dur-1);
}
@media (hover: hover) {
  .card:hover .card__title a, .row:hover .row__title a, .feature:hover .feature__title a,
  .hero:hover .hero__title a, .op:hover .op__title a, .popular__item:hover .popular__h a { background-size: 100% 2px; }
}
:is(.card__title, .row__title, .feature__title, .hero__title, .op__title, .popular__h) a:focus-visible { background-size: 100% 2px; }
.card__excerpt {
  font-family: var(--font-text);
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta { margin-top: 2px; }
.card--big .card__title { font-size: var(--fs-xl); font-weight: 800; line-height: 1.42; }
.card--big .card__excerpt { font-size: var(--fs-base); -webkit-line-clamp: 4; }
.card.is-new { animation: rise var(--dur-3) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-7) var(--col-gap);
}
.card--skeleton .sk--media { aspect-ratio: 3 / 2; }
.card--skeleton .sk--line { height: 16px; }
.card--skeleton .sk--kicker { width: 30%; height: 12px; }

/* صف أفقي */
.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: var(--sp-4);
  align-items: start;
}
.row__media { order: 2; }
.row--text { grid-template-columns: minmax(0, 1fr); }
.row__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; container-type: inline-size; }
.row__title { font-size: var(--fs-base); font-weight: 700; line-height: 1.5; }
.row__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.row__excerpt { font-family: var(--font-text); font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.8; }

/* مادة بارزة أفقية */
.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--col-gap);
  align-items: center;
}
.feature__body { display: flex; flex-direction: column; gap: var(--sp-3); }
.feature__title { font-size: var(--fs-feature); font-weight: 800; line-height: 1.4; }
.feature__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.feature__dek { font-family: var(--font-text); font-size: var(--fs-md); line-height: 1.8; color: var(--ink-2); }

/* ---------- 12. Home: front page ---------- */
.front { padding-top: var(--sp-6); }
.front__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-areas: "lead popular" "second second";
  gap: 0 var(--col-gap);
}
.hero { grid-area: lead; position: relative; }
.hero__body { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-5); }
.hero__title {
  font-size: var(--fs-lead);
  font-weight: 800;
  line-height: var(--lh-display);
}
.hero__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hero__dek {
  font-family: var(--font-text);
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 62ch;
}
.hero__by { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-1); }

/* صف المواد البارزة تحت المادة الرئيسية */
.front__second {
  grid-area: second;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-6) var(--col-gap);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--rule);
}
.card--second .card__title { font-size: var(--fs-md); line-height: 1.45; }

.popular { grid-area: popular; padding-inline-start: var(--col-gap); border-inline-start: 1px solid var(--rule); }
.popular__title {
  font-size: var(--fs-md);
  font-weight: 800;
  padding-bottom: var(--sp-3);
  border-bottom: 3px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 0.42em;
}
.popular__title::before {
  content: "";
  width: 0.3em;
  height: 0.88em;
  background: var(--red);
  clip-path: var(--alef);
}
.popular__list { counter-reset: pop; }
.popular__item {
  position: relative;
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: var(--sp-3);
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--rule);
}
.popular__item:last-child { border-bottom: 0; }
.popular__n {
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 0.9;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.popular__h { font-size: var(--fs-base); font-weight: 700; line-height: 1.5; margin-top: 2px; }
.popular__h a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.popular__by { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; }

/* ---------- 13. Blocks ---------- */
.block { margin-top: var(--block-gap); }
.block--last { margin-bottom: var(--block-gap); }

/* شريط رمادي للأقسام ذات الفروع */
.band {
  margin-top: var(--block-gap);
  background: var(--paper-2);
  padding-block: var(--sp-7) var(--sp-8);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.band .shead { border-top-color: var(--ink); }
.band .media::after { background: linear-gradient(-90deg, transparent 20%, rgba(255, 255, 255, 0.4) 50%, transparent 80%); }

.tabs__list {
  position: relative;
  display: flex;
  gap: var(--sp-6);
  box-shadow: inset 0 -1px 0 var(--rule-2);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__tab {
  position: relative;
  padding: 0 0 var(--sp-3);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--ink-3);
  white-space: nowrap;
  transition: color var(--dur-1);
}
.tabs__tab::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform var(--dur-2) var(--ease-out);
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.tabs__tab[aria-selected="true"]::after { transform: scaleX(1); }
.tabs__list.has-bar .tabs__tab::after { display: none; }
.tabs__list.has-bar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--tw, 0px);
  background: var(--red);
  transform: translateX(var(--tx, 0px));
}
.tabs__list.is-ready::after { transition: transform 380ms var(--ease-out), width 380ms var(--ease-out); }
.tabs__panel:focus-visible { outline-offset: 8px; }
.js .tabs__panel:not([hidden]) { animation: fade var(--dur-3) var(--ease-out); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.tabs__nojs { display: none; }
.no-js .tabs__nojs { display: block; font-size: var(--fs-lg); margin-bottom: var(--sp-4); }
.no-js .tabs__panel + .tabs__panel { margin-top: var(--sp-7); }
.no-js .tabs__list { display: none; }
.tabs__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--col-gap);
}
.tabs__grid .feature { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.tabs__grid .feature__title { font-size: var(--fs-xl); }
.tabs__rest {
  display: flex;
  flex-direction: column;
  padding-inline-start: var(--col-gap);
  border-inline-start: 1px solid var(--rule-2);
}
.tabs__rest > * + * { border-top: 1px solid var(--rule-2); padding-top: var(--sp-4); margin-top: var(--sp-4); }
.tabs__rest .row { grid-template-columns: minmax(0, 1fr) 96px; }
.tabs__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--rule-2);
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.tabs__foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tabs__foot a:hover { color: var(--red); }
.tabs__foot .icon { width: 18px; height: 18px; }
:is(.tabs__foot a, .authorbox__more, .nav__all, .sov__all, .pn__dir) .icon { transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) {
  :is(.tabs__foot a, .authorbox__more, .nav__all, .sov__all, .pn__item--next):hover .icon { transform: translateX(-4px); }
  .pn__item--prev:hover .icon { transform: translateX(4px); }
}

/* كتلة الرأي: مادة كبيرة وقائمة بالكتّاب */
.opinion {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--col-gap);
}
.opinion__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--col-gap);
  align-content: start;
  padding-inline-start: var(--col-gap);
  border-inline-start: 1px solid var(--rule);
}
/* كل مادة: النص ثم صورة الغلاف في آخر السطر كما في بقية القوائم، والصورة بعرض ثابت ونسبة ٤:٣ */
.op {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: var(--sp-4);
  align-items: start;
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--rule);
}
.op__media { order: 2; aspect-ratio: 4 / 3; }
.opinion__list .op:nth-child(-n+2) { padding-top: 0; }
.op__body { display: flex; flex-direction: column; gap: 4px; }
.op__author { font-size: var(--fs-xs); font-weight: 700; color: var(--red); position: relative; z-index: 2; }
.op__author:hover { text-decoration: underline; text-underline-offset: 4px; }
.op__title { font-size: var(--fs-base); font-weight: 700; line-height: 1.5; }
.op__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.op__date { font-size: var(--fs-xs); color: var(--ink-3); }
.mono { transition: border-color var(--dur-2), color var(--dur-2); }

/* شريط الكتّاب */
.wstrip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--sp-3);
  scrollbar-width: thin;
  scrollbar-color: var(--rule-2) transparent;
}
.wstrip li { scroll-snap-align: start; }
.wstrip__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: var(--sp-5) var(--sp-3);
  border: 1px solid var(--rule);
  height: 100%;
  transition: border-color var(--dur-2);
}
.wstrip__item .mono { margin-bottom: var(--sp-2); }
.wstrip__name { font-weight: 700; font-size: var(--fs-base); line-height: 1.4; }
.wstrip__job { font-size: var(--fs-xs); color: var(--ink-3); }
.wstrip__item:hover { border-color: var(--ink); }
.wstrip__item:hover .mono { background: var(--red); border-color: var(--red); color: #fff; }

/* الوسوم */
.tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-round);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: border-color var(--dur-1), color var(--dur-1), background-color var(--dur-1);
}
.tag::before { content: "#"; color: var(--red); font-weight: 600; }
.tag__n { font-size: var(--fs-2xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tag:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.tag:hover .tag__n { color: #bbb; }
.tags--cloud .tag { font-size: var(--fs-base); }

/* ---------- 14. Buttons & load more ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding-inline: 28px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1);
}
.btn:hover { background: var(--red); border-color: var(--red); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.more { display: flex; justify-content: center; margin-top: var(--sp-7); position: relative; }
.more::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  border-top: 1px solid var(--rule);
  z-index: -1;
}
.listing { position: relative; isolation: isolate; }
.btn--more {
  background: var(--paper);
  color: var(--ink);
  min-width: 220px;
  box-shadow: 0 0 0 12px var(--paper);
}
.btn--more:hover { background: var(--ink); color: #fff; }
.btn__spin {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn--more.is-loading { pointer-events: none; color: var(--ink-3); }
.btn--more.is-loading .btn__spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.listing__from { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: var(--sp-5); }
.listing__from a { color: var(--red); font-weight: 600; }
.listing__lead { margin-bottom: var(--sp-7); padding-bottom: var(--sp-7); border-bottom: 1px solid var(--rule); }

/* ---------- 15. Page heads (section/tag/writer/search) ---------- */
.phead { padding-block: var(--sp-7) var(--sp-6); }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin-bottom: var(--sp-4);
}
.crumbs a:hover { color: var(--red); }
.crumbs__sep { color: var(--rule-2); }
.phead__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--red);
  margin-bottom: var(--sp-2);
}
.phead__title {
  display: flex;
  align-items: center;
  gap: 0.28em;
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: var(--lh-display);
}
.phead__title::before {
  content: "";
  width: 0.24em;
  height: 0.84em;
  background: var(--red);
  clip-path: var(--alef);
  flex: none;
}
.phead__title--plain::before { display: none; }
.phead__row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-7);
  padding-bottom: var(--sp-5);
  border-bottom: 3px solid var(--ink);
}
.phead__desc {
  max-width: 60ch;
  font-family: var(--font-text);
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--ink-2);
  margin-top: var(--sp-3);
}
.phead__count {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  white-space: nowrap;
}
.phead__count strong { color: var(--ink); font-size: var(--fs-xl); font-weight: 800; margin-inline-end: 4px; }
.chips {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-round);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: border-color var(--dur-1), background-color var(--dur-1), color var(--dur-1);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-body { padding-bottom: var(--block-gap); }

/* ---------- 16. Writer profile ---------- */
.profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--sp-6);
  align-items: center;
  padding-bottom: var(--sp-6);
  border-bottom: 3px solid var(--ink);
}
.profile .mono--xl { --s: 132px; font-size: 2.6rem; background: var(--red); border-color: var(--red); color: #fff; }
.profile__name { font-size: var(--fs-3xl); font-weight: 800; line-height: var(--lh-display); }
.profile__job { font-size: var(--fs-md); color: var(--red); font-weight: 600; margin-top: var(--sp-2); }
.profile__bio { font-family: var(--font-text); font-size: var(--fs-md); line-height: 1.85; color: var(--ink-2); margin-top: var(--sp-3); max-width: 62ch; }
.profile__social { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.profile__social a { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); padding: 6px 12px; border: 1px solid var(--rule-2); border-radius: var(--radius-round); }
.profile__social a:hover { border-color: var(--ink); }
.profile__count { text-align: center; padding-inline-start: var(--sp-6); border-inline-start: 1px solid var(--rule); }
.profile__count strong { display: block; font-size: var(--fs-3xl); font-weight: 900; line-height: 1; color: var(--ink); }
.profile__count span { font-size: var(--fs-sm); color: var(--ink-3); }

/* فهرس الكتّاب */
.wgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}
.wgrid > li { border-bottom: 1px solid var(--rule); }
.wgrid > li:not(:nth-child(3n)) { border-inline-end: 1px solid var(--rule); }
.wcard {
  position: relative;
  display: flex;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-6) var(--sp-5);
  height: 100%;
  transition: background-color var(--dur-2);
}
.wcard:hover { background: var(--paper-2); }
.wcard__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wcard__name { font-size: var(--fs-lg); font-weight: 800; }
.wcard__name a::after { content: ""; position: absolute; inset: 0; }
.wcard:hover .wcard__name a { color: var(--red); }
.wcard:hover .mono { background: var(--red); border-color: var(--red); color: #fff; }
.wcard__job { font-size: var(--fs-sm); color: var(--red); font-weight: 600; }
.wcard__facts { display: flex; align-items: center; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }

/* ---------- 17. Search page ---------- */
.searchform {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0;
  margin-top: var(--sp-5);
  border: 2px solid var(--ink);
  max-width: 860px;
}
.searchform__q {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-inline: var(--sp-4);
}
.searchform__q .icon { width: 24px; height: 24px; color: var(--red); }
.searchform input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: var(--fs-lg);
  font-weight: 600;
  padding: 14px 0;
}
.searchform input:focus, .searchform select:focus { outline: none; }
.searchform:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.searchform select {
  border: 0;
  border-inline-start: 1px solid var(--rule-2);
  background: var(--paper);
  padding-inline: var(--sp-4) var(--sp-6);
  font-size: var(--fs-sm);
  font-weight: 600;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23121212' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  cursor: pointer;
}
.searchform button {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  padding-inline: var(--sp-6);
  transition: background-color var(--dur-1);
}
.searchform button:hover { background: var(--red); }
.search-summary { margin-top: var(--sp-5); color: var(--ink-3); font-size: var(--fs-sm); }
.search-summary strong { color: var(--ink); }
mark.hl { padding: 0; }

.empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: start;
  padding: var(--sp-7) 0;
  max-width: 820px;
}
.empty__mark {
  width: 64px;
  height: 120px;
  background: var(--paper-3);
  clip-path: var(--alef);
  position: relative;
}
.empty__title { font-size: var(--fs-xl); font-weight: 800; }
.empty__text { font-family: var(--font-text); font-size: var(--fs-md); color: var(--ink-2); margin-top: var(--sp-2); line-height: 1.8; }
.empty__links { margin-top: var(--sp-5); }
.empty__links h2 { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; margin-bottom: var(--sp-3); }

/* ---------- 18. Article ---------- */
.preview-bar {
  position: sticky;
  top: calc(var(--header-h) - var(--header-shrink));
  z-index: 40;
  background: var(--red);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.preview-bar .wrap { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; }
.preview-bar .wrap::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.readbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 89;
  pointer-events: none;
}
.readbar span {
  display: block;
  height: 100%;
  background: var(--red);
  transform-origin: right center;
  transform: scaleX(var(--p, 0));
}

.story__head { padding-top: var(--sp-7); }
.story__head-in { max-width: 980px; }
.story__kicker { font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.story__title {
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: var(--lh-display);
}
.story__dek {
  font-family: var(--font-text);
  font-size: var(--fs-lg);
  line-height: 1.75;
  color: var(--ink-2);
  margin-top: var(--sp-4);
  max-width: 54ch;
}
.story__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-6);
  margin-top: var(--sp-6);
  padding-block: var(--sp-4);
  border-top: 1px solid var(--ink);
}
.byline { display: flex; align-items: center; gap: var(--sp-3); }
.byline__name { font-weight: 700; font-size: var(--fs-base); line-height: 1.4; }
.byline__name a:hover { color: var(--red); }
.byline__job { font-size: var(--fs-xs); color: var(--ink-3); }
.story__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.story__facts > span { display: inline-flex; align-items: center; gap: 6px; }
.story__facts .icon { width: 16px; height: 16px; }
.story__bar .share { margin-inline-start: auto; }

.story__cover { margin-top: var(--sp-2); }
.story__cover .media { aspect-ratio: 16 / 9; }
.story__cover .media img { view-transition-name: cover; }
.story__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px var(--sp-5);
  padding-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--sp-3);
}
.story__caption-text { font-family: var(--font-text); font-size: var(--fs-sm); color: var(--ink-2); }
.story__credit { font-weight: 500; }

.story__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(0, 1fr);
  gap: var(--sp-7);
  padding-top: var(--sp-7);
}
.story__rail { grid-column: 1; justify-self: end; }
.story__rail .share { position: sticky; top: calc(var(--header-h) + var(--sp-6)); }
.story__main { grid-column: 2; min-width: 0; }
.story__toc { grid-column: 3; }

.toc {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-6));
  max-width: 260px;
  font-size: var(--fs-sm);
}
.toc__title { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--ink); margin-bottom: var(--sp-2); }
.toc__list { counter-reset: toc; }
.toc__list a {
  position: relative;
  display: block;
  padding: 7px var(--sp-3) 7px 0;
  border-inline-start: 2px solid var(--rule);
  color: var(--ink-3);
  line-height: 1.5;
  transition: color var(--dur-1), border-color var(--dur-2);
}
.toc__list .toc--3 a { padding-inline-start: var(--sp-5); font-size: var(--fs-xs); }
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-active { color: var(--ink); font-weight: 600; border-inline-start-color: var(--red); }

/* بيانات النص المترجم: تعريف خفيف بين خطين، كله محاذى إلى اليمين، والعنوان الأصلي بخط النص */
.transl {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-bottom: var(--sp-6);
  padding-block: var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.transl__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  margin-bottom: 2px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--red);
}
.transl__label::before {
  content: "";
  width: 0.32em;
  height: 0.95em;
  background: var(--red);
  clip-path: var(--alef);
}
.transl__title {
  font-family: var(--font-text);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}
.transl__title cite { font-style: normal; }
.transl__title a {
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color var(--dur-2), color var(--dur-1);
}
.transl__title a:hover { text-decoration-color: var(--red); }
.transl__title .icon {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-inline-start: 0.3em;
  vertical-align: 0.1em;
  color: var(--ink-3);
}
.transl__title a:hover .icon { color: var(--red); }
.transl__src {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
}
.transl__by { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.transl__by a { color: var(--ink); font-weight: 600; }
.transl__by a:hover { color: var(--red); }
.transl__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--red); }
.transl__link .icon { width: 16px; height: 16px; }
.transl__link:hover { color: var(--red-deep); text-decoration: underline; text-underline-offset: 4px; }

.story__end { margin-top: var(--sp-7); display: grid; gap: var(--sp-6); }
.story__tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.story__tags-label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); margin-inline-end: var(--sp-2); }
.story__tags .tag { padding: 5px 12px; font-size: var(--fs-xs); }

.authorbox {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-6) 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.authorbox .mono { --s: 84px; background: var(--red); border-color: var(--red); color: #fff; }
.authorbox__label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.authorbox__name { font-size: var(--fs-xl); font-weight: 800; margin-top: 2px; }
.authorbox__name a:hover { color: var(--red); }
.authorbox__job { font-size: var(--fs-sm); color: var(--red); font-weight: 600; }
.authorbox__bio { font-family: var(--font-text); font-size: var(--fs-base); line-height: 1.85; color: var(--ink-2); margin-top: var(--sp-3); }
.authorbox__more { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-3); font-weight: 700; font-size: var(--fs-sm); }
.authorbox__more:hover { color: var(--red); }
.authorbox__more .icon { width: 18px; height: 18px; }

.share__list { display: flex; gap: 6px; align-items: center; }
.share--rail .share__list { flex-direction: column; }
.share__label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); margin-bottom: var(--sp-3); }
.share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 40px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-round);
  color: var(--ink);
  transition: border-color var(--dur-1), background-color var(--dur-1), color var(--dur-1);
}
.share__btn .icon { width: 19px; height: 19px; }
.share__btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.share__btn--copy { padding-inline: 12px; }
.share--row .share__btn--copy { padding-inline: 16px; font-size: var(--fs-sm); font-weight: 600; }
.share__btn.is-done { background: var(--red); border-color: var(--red); color: #fff; }
.share--compact .share__btn { height: 36px; min-width: 36px; border-color: transparent; }
.share--compact .share__btn:hover { border-color: var(--ink); }

.pn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  margin-top: var(--block-gap);
}
.pn__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-6) var(--sp-5);
  transition: background-color var(--dur-2);
}
.pn__item--next { grid-column: 2; border-inline-start: 1px solid var(--rule); text-align: end; align-items: flex-end; }
.pn__item:hover { background: var(--paper-2); }
.pn__dir { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 700; color: var(--red); }
.pn__dir .icon { width: 18px; height: 18px; }
.pn__title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.4; }
.pn__item:hover .pn__title { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.28em; }

.story__more { padding-bottom: var(--block-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-7) var(--col-gap); }
.rows-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--col-gap); }
.rows-4 > * { padding-bottom: var(--sp-5); border-bottom: 1px solid var(--rule); }

/* صفحة ثابتة */
.static__head { padding-top: var(--sp-8); max-width: var(--measure); margin-inline: auto; }
.static__title { font-size: var(--fs-4xl); font-weight: 800; line-height: var(--lh-display); padding-bottom: var(--sp-5); border-bottom: 3px solid var(--ink); }
.static__body { max-width: var(--measure); margin-inline: auto; padding-block: var(--sp-6) var(--block-gap); }

/* ---------- 19. Error ---------- */
.errorpage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: center;
  padding-block: var(--sp-9);
  min-height: 56vh;
}
.errorpage__code {
  font-size: clamp(6rem, 3rem + 14vw, 15rem);
  font-weight: 900;
  line-height: 0.85;
  color: var(--red);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.errorpage__title { font-size: var(--fs-3xl); font-weight: 800; line-height: var(--lh-display); }
.errorpage__text { font-family: var(--font-text); font-size: var(--fs-md); line-height: 1.8; color: var(--ink-2); margin-top: var(--sp-3); max-width: 46ch; }
.errorpage .searchform { margin-top: var(--sp-6); grid-template-columns: minmax(0, 1fr) auto; }
.errorpage__links { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }

/* ---------- 20. Footer ---------- */
.footer {
  background: var(--ink);
  color: #c9c9c9;
  margin-top: 0;
  border-top: 6px solid var(--red);
  font-size: var(--fs-sm);
}
.footer a { color: #f1f1f1; transition: color var(--dur-1); }
.footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--red); }
.footer__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-block: var(--sp-8) var(--sp-6);
  border-bottom: 1px solid #333;
}
.footer__logo { color: #fff; display: block; }
.footer__logo:hover { text-decoration: none !important; }
.footer__logo .logo { height: 64px; width: auto; }
.footer__about { max-width: 46ch; font-family: var(--font-text); font-size: var(--fs-base); line-height: 1.9; color: #c9c9c9; }
.footer__cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-6);
  padding-block: var(--sp-6) var(--sp-7);
}
.footer__h { font-size: var(--fs-xs); font-weight: 700; color: #8f8f8f; margin-bottom: var(--sp-4); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer__col > ul { display: grid; gap: var(--sp-3); }
.footer__col > ul > li > a { font-weight: 600; }
.footer__col:first-child > ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-6); }
.footer__sub { display: flex; flex-wrap: wrap; gap: 4px var(--sp-4); margin-top: var(--sp-2); }
.footer__sub a { color: #b9b9b9; font-weight: 400; }
.footer__social a { display: inline-flex; align-items: center; gap: 10px; }
.footer__social .icon { width: 18px; height: 18px; color: #8f8f8f; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding-block: var(--sp-5);
  border-top: 1px solid #333;
  font-size: var(--fs-xs);
  color: #8f8f8f;
}
.footer__top-link { display: inline-flex; align-items: center; gap: 6px; }
.footer__top-link .icon { width: 16px; height: 16px; }

/* ---------- 21. Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 50%;
  translate: 50% 0;
  z-index: 95;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  font-size: var(--fs-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-out);
}
.toast:empty { visibility: hidden; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
.toast.is-on { opacity: 1; transform: none; }

/* ---------- 22. Motion: entrance and reveal ---------- */
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }
@keyframes settle { from { scale: 1.06; } }

/*
 * أعلى الصفحة يدخل بالتتابع عند التحميل. تحت شاشة الانتقال لا تُطبَّق الحركة،
 * ثم تبدأ من أولها حين تبدأ الشاشة بالاختفاء (.is-splash-out).
 */
:is(.js:not(.is-splash), .is-splash-out) :is(.hero__body, .story__head-in, .phead, .static__head, .popular__list, .front__second) > *,
:is(.js:not(.is-splash), .is-splash-out) :is(.story__bar, .popular__title) {
  animation: enter 640ms var(--ease-out) calc(60ms + (var(--e0, 0) + var(--e, 0)) * 70ms) backwards;
}
:is(.js:not(.is-splash), .is-splash-out) :is(.hero__media, .story__cover .media) img {
  animation: settle 1400ms var(--ease-out) backwards;
}
:is(.hero__body, .story__head-in, .phead, .static__head, .popular__list, .front__second) > :nth-child(2) { --e: 1; }
:is(.hero__body, .story__head-in, .phead, .static__head, .popular__list, .front__second) > :nth-child(3) { --e: 2; }
:is(.hero__body, .story__head-in, .phead, .static__head, .popular__list, .front__second) > :nth-child(4) { --e: 3; }
:is(.hero__body, .story__head-in, .phead, .static__head, .popular__list, .front__second) > :nth-child(n+5) { --e: 4; }
.story__bar { --e: 3; }
.popular { --e0: 1; }
.popular__list { --e0: 2; }
.front__second { --e0: 4; }

/* الكتل الأدنى تظهر عند التمرير إليها: العنوان ثم العناصر واحدًا بعد الآخر */
.js [data-reveal] { transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); }
.js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(12px); }
.js [data-reveal]:not(.is-in) [data-stagger] > * { opacity: 0; }
.js [data-reveal].is-in [data-stagger] > * { animation: enter 560ms var(--ease-out) calc(120ms + var(--i, 0) * 55ms) backwards; }
.js [data-reveal] .shead__title::before { transform-origin: 50% 100%; transition: scale 520ms var(--ease-out) 160ms; }
.js [data-reveal]:not(.is-in) .shead__title::before { scale: 1 0; }

/* ---------- 23. View transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 160ms var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in 260ms var(--ease-out) both; }
::view-transition-group(cover) { animation-duration: 360ms; animation-timing-function: var(--ease-out); }
::view-transition-image-pair(cover) { isolation: isolate; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 24. Responsive ---------- */
@media (max-width: 1180px) {
  .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .story__layout { grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); gap: var(--sp-7); }
  .story__rail { display: none; }
  .story__main { grid-column: 1; }
  .story__toc { grid-column: 2; }
}

@media (max-width: 960px) {
  :root { --header-h: 60px; --header-shrink: 0px; }
  .iconbtn.masthead__burger { display: inline-grid; margin-inline-start: -8px; }
  .masthead__in { gap: var(--sp-3); }
  .masthead__logo .logo { height: 32px; }
  .is-scrolled .masthead__logo { transform: none; }
  .nav { display: none; }
  .searchbtn { min-width: 0; border: 0; padding: 0; width: 42px; justify-content: center; }
  .searchbtn__label, .searchbtn__kbd { display: none; }
  .searchbtn .icon { width: 24px; height: 24px; }
  .topbar__tagline { display: none; }

  .front__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "second" "popular"; }
  .front__second { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--sp-6); }
  .popular { padding-inline-start: 0; border-inline-start: 0; margin-top: var(--sp-7); }
  .popular__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .popular__item:last-child { border-bottom: 1px solid var(--rule); }

  .feature, .tabs__grid, .tabs__grid .feature, .opinion { grid-template-columns: minmax(0, 1fr); }
  .tabs__rest { padding-inline-start: 0; border-inline-start: 0; padding-top: var(--sp-5); border-top: 1px solid var(--rule-2); }
  .opinion__list { padding-inline-start: 0; border-inline-start: 0; padding-top: var(--sp-5); border-top: 1px solid var(--rule); }
  .opinion__list .op:nth-child(-n+2) { padding-top: var(--sp-5); }

  .story__layout { grid-template-columns: minmax(0, 1fr); }
  .story__toc { display: none; }
  .story__main { grid-column: 1; }
  .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wgrid > li:not(:nth-child(3n)) { border-inline-end: 0; }
  .wgrid > li:nth-child(odd) { border-inline-end: 1px solid var(--rule); }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .footer__col:first-child { grid-column: 1 / -1; }
  .profile { grid-template-columns: auto minmax(0, 1fr); }
  .profile__count { grid-column: 1 / -1; text-align: start; padding-inline-start: 0; border-inline-start: 0; display: flex; align-items: baseline; gap: 8px; }
  .profile__count strong { display: inline; font-size: var(--fs-xl); }
  .errorpage { grid-template-columns: 1fr; gap: var(--sp-5); padding-block: var(--sp-8); }
}

@media (max-width: 820px) {
  .grid-cards, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rows-4 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  :root { --col-gap: 16px; }
  .topbar__in { min-height: 32px; }
  .topbar { font-size: var(--fs-2xs); }
  /* الغلاف الرئيسي من الحافة إلى الحافة، والمواد البارزة صفوفًا بصورة صغيرة */
  .front { padding-top: 0; }
  .hero__media { margin-inline: calc(-1 * var(--gutter)); }
  .hero__body { padding-top: var(--sp-4); }
  .hero__dek { font-size: var(--fs-base); }
  .front__second { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: var(--sp-5); padding-top: 0; border-top: 3px solid var(--ink); }
  .popular__list { grid-template-columns: minmax(0, 1fr); }
  .popular__item:last-child { border-bottom: 0; }

  /* البطاقات على الجوال: صف أفقي مضغوط بعد البطاقة الأولى */
  .grid-cards, .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .grid-cards > .card, .grid-3 > .card, .front__second > .card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: var(--sp-3);
    align-items: start;
    padding-block: var(--sp-4);
    border-bottom: 1px solid var(--rule);
  }
  .grid-cards > .card .card__media, .grid-3 > .card .card__media, .front__second > .card .card__media { order: 2; }
  .grid-cards > .card .card__excerpt, .grid-3 > .card .card__excerpt { display: none; }
  .grid-cards > .card .card__title, .grid-3 > .card .card__title, .front__second > .card .card__title { font-size: var(--fs-base); line-height: 1.5; }
  .grid-cards > .card:first-child:not(.is-new), .grid-3 > .card:first-child { display: flex; align-items: stretch; padding-top: 0; }
  .grid-cards > .card:first-child:not(.is-new) .card__media, .grid-3 > .card:first-child .card__media { order: 0; }
  .grid-cards > .card:first-child:not(.is-new) .card__title, .grid-3 > .card:first-child .card__title { font-size: var(--fs-lg); }
  .grid-cards > .card:first-child:not(.is-new) .card__excerpt { display: -webkit-box; }
  .grid-cards > .card--skeleton { display: grid !important; grid-template-columns: minmax(0, 1fr) 112px; align-content: start; }
  .card--skeleton .sk--media { grid-column: 2; grid-row: 1 / span 3; }
  .card--skeleton .sk { grid-column: 1; }
  .card--skeleton .sk.sk--media { grid-column: 2; }

  .row { grid-template-columns: minmax(0, 1fr) 104px; }
  .tabs__rest .row { grid-template-columns: minmax(0, 1fr) 88px; }
  .tabs__list { gap: var(--sp-5); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .tabs__foot { flex-direction: column; align-items: flex-start; }
  .opinion__list { grid-template-columns: 1fr; }
  .op { padding-block: var(--sp-4); grid-template-columns: minmax(0, 1fr) 104px; gap: var(--sp-3); }
  .opinion__list .op:nth-child(-n+2) { padding-top: var(--sp-4); }
  .shead__desc { display: none; }
  .band { padding-block: var(--sp-6) var(--sp-7); }

  .phead { padding-block: var(--sp-6) var(--sp-5); }
  .phead__row { flex-direction: column; align-items: flex-start; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }

  .story__head { padding-top: var(--sp-5); }
  .story__dek { font-size: var(--fs-md); }
  .story__bar { gap: var(--sp-3); }
  .story__bar .share { margin-inline-start: 0; width: 100%; }
  .story__cover.wrap { padding-inline: 0; }
  .story__cover .media { aspect-ratio: 3 / 2; }
  .story__caption { padding-inline: var(--gutter); }
  .story__layout { padding-top: var(--sp-5); }
  .pn { grid-template-columns: 1fr; }
  .pn__item--next { grid-column: 1; border-inline-start: 0; }
  .pn__item + .pn__item { border-top: 1px solid var(--rule); }
  .pn__item { padding-inline: 0; }
  .authorbox { grid-template-columns: 1fr; }

  .wgrid { grid-template-columns: 1fr; }
  .wgrid > li:nth-child(odd) { border-inline-end: 0; }
  .wcard { padding-inline: 0; }
  .profile { grid-template-columns: 1fr; gap: var(--sp-4); }
  .profile .mono--xl { --s: 96px; font-size: 1.9rem; }
  .searchform { grid-template-columns: minmax(0, 1fr) auto; }
  .searchform select { grid-column: 1 / -1; grid-row: 2; border-inline-start: 0; border-top: 1px solid var(--rule-2); padding-block: 12px; }
  .searchform button { padding-inline: var(--sp-5); }
  .errorpage .searchform select { display: none; }
  .empty { grid-template-columns: 1fr; gap: var(--sp-4); }
  .empty__mark { width: 40px; height: 76px; }

  .footer__top { flex-direction: column; align-items: flex-start; padding-top: var(--sp-7); }
  .footer__logo .logo { height: 52px; }
  .footer__cols { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column-reverse; align-items: flex-start; }
  .sov__in { padding-block: var(--sp-4) var(--sp-6); }
  .sov__form input { font-size: var(--fs-xl); }
  .sov__close kbd, .sov__keys { display: none; }
  .sov__thumb, .sk--thumb { width: 76px; }
}

/* ---------- 25. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal]:not(.is-in), .js [data-reveal]:not(.is-in) [data-stagger] > * { opacity: 1; transform: none; }
  .js [data-reveal]:not(.is-in) .shead__title::before { scale: none; }
  [data-stagger] > *, .story__bar, .popular__title, .hero__media img, .story__cover .media img,
  :is(.hero__body, .story__head-in, .phead, .static__head, .popular__list, .front__second) > * { animation: none !important; }
  .js .media:not(.is-loaded) img { filter: none; transform: none; }
  .sk::after, .media::after { display: none; }
  @view-transition { navigation: none; }
}

@media print {
  .topbar, .masthead, .footer, .story__rail, .story__toc, .share, .readbar, .splash, .pn, .story__more, .sov, .drawer { display: none !important; }
  .story__layout { display: block; }
}

/* ---------- 26. Additions ---------- */
.byline__role { font-weight: 400; color: var(--ink-3); }
.phead__title--tag::before { display: none; }
.phead__hash { color: var(--red); font-weight: 400; margin-inline-end: 0.06em; }
.static__cover { margin-top: var(--sp-6); }
.toc-inline { display: none; }
.masthead--min { position: static; }
.page-error--min .errorpage { min-height: 70vh; }

@media (max-width: 960px) {
  .toc-inline {
    display: block;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--rule);
    margin-bottom: var(--sp-6);
    font-size: var(--fs-sm);
  }
  .toc-inline summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) 0;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  .toc-inline summary::-webkit-details-marker { display: none; }
  .toc-inline summary::after {
    content: "";
    width: 10px; height: 10px;
    border-inline-end: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform var(--dur-2);
  }
  .toc-inline[open] summary::after { transform: rotate(-135deg); }
  .toc-inline ol { list-style: none; padding: 0 0 var(--sp-4); margin: 0; display: grid; gap: 2px; }
  .toc-inline a { display: block; padding: 6px 0; color: var(--ink-2); }
  .toc-inline .toc--3 a { padding-inline-start: var(--sp-4); color: var(--ink-3); }
}
.listing__lead--split { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); gap: var(--col-gap); }
.listing__lead--split .feature { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
/* الغلاف يملأ ارتفاع الكتلة كلها فيتساوى طرفه السفلي مع القائمة المجاورة */
@media (min-width: 1181px) {
  .listing__lead--split .feature__media { align-self: stretch; aspect-ratio: auto; min-height: 18rem; }
}
.listing__lead--split .feature__title { font-size: var(--fs-feature); }
.listing__aside { display: flex; flex-direction: column; padding-inline-start: var(--col-gap); border-inline-start: 1px solid var(--rule); }
.listing__aside > * + * { border-top: 1px solid var(--rule); padding-top: var(--sp-4); margin-top: var(--sp-4); }
.listing__aside .row { grid-template-columns: minmax(0, 1fr) 96px; }
@media (max-width: 1180px) {
  .listing__lead--split { grid-template-columns: minmax(0, 1fr); }
  .listing__aside { padding-inline-start: 0; border-inline-start: 0; padding-top: var(--sp-5); border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); }
  .listing__aside > * + * { border-top: 0; padding-top: 0; margin-top: 0; }
}
@media (max-width: 820px) {
  .listing__aside { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .listing__aside > * + * { border-top: 1px solid var(--rule); padding-top: var(--sp-4); margin-top: var(--sp-4); }
  .listing__lead--split .feature { grid-template-columns: minmax(0, 1fr); }
}
