/* ============================================================
   single.css — أنماط قوالب المقالة المفردة
   sw-theme v4  |  تُحمَّل على is_singular('post') فقط
   تعتمد متغيّرات style.css + متغيّرات v4 المُعرَّفة أدناه.

   القوالب المغطّاة:
     default | classic | featured | wide | magazine | infographic
     video   | breaking | opinion  | longform | photo-story

   البادئة الموحّدة: sw-
   ============================================================ */

/* ============================================================
   ─── متغيّرات v4 (override من :root في style.css إن أردت) ─
   ============================================================ */
:root {
  /* اللون الرئيسي — يرث --sw-blue من style.css */
  --sw-primary:        var(--sw-blue,       #1557a0);
  --sw-primary-mid:    var(--sw-blue-dark,  #0e4080);
  --sw-primary-light:  var(--sw-blue-light, #e8f0fe);

  /* اللون الأحمر للعاجل */
  --sw-accent:         var(--sw-red,        #c0392b);
  --sw-accent-light:   var(--sw-red-light,  #fdecea);

  /* حاوي الأعمدة الضيقة */
  --sw-container-narrow: 760px;
  --sw-container-medium: 1040px;
}


/* ══════════════════════════════════════════════════════════════
   1. حاويات القراءة
   ══════════════════════════════════════════════════════════════ */
.sw-container--narrow { max-width: var(--sw-container-narrow, 760px); }
.sw-container--medium { max-width: var(--sw-container-medium, 1040px); }


/* ══════════════════════════════════════════════════════════════
   2. المحتوى المضمّن والوسائط الخارجية (Embeds & Media)
   ──────────────────────────────────────────────────────────────
   قاعدة عامة: أي iframe/embed/object في الصفحة لا يتجاوز حاويه.
   داخل .sw-entry-content: عرض كامل + منع التجاوز الأفقي.
   التضمينات الاجتماعية تُجبر على عرض كامل لأنها تحقن inline styles.
   ══════════════════════════════════════════════════════════════ */

/* ── قاعدة أساسية (global) ── */
iframe,
embed,
object {
  max-width: 100%;
}

/* ── حاوي المحتوى: لا تجاوز أفقي ── */
.sw-entry-content {
  overflow-x: hidden;
  /* overflow-y مفتوح لاحتواء عناصر sticky داخل المحتوى */
}

/* ── عناصر الوسائط داخل المحتوى ── */
.sw-entry-content iframe,
.sw-entry-content embed,
.sw-entry-content object,
.sw-entry-content video,
.sw-entry-content audio {
  max-width: 100% !important;
  height: auto;
}

/* ── Gutenberg embed block ── */
.sw-entry-content .wp-block-embed { margin-block: 1.5rem; }

.sw-entry-content .wp-block-embed.is-type-video .wp-block-embed__wrapper,
.sw-entry-content .wp-block-embed-youtube .wp-block-embed__wrapper,
.sw-entry-content .wp-block-embed-vimeo  .wp-block-embed__wrapper {
  aspect-ratio: 16 / 9;
  width: 100%;
}
.sw-entry-content .wp-block-embed.is-type-video .wp-block-embed__wrapper iframe,
.sw-entry-content .wp-block-embed-youtube .wp-block-embed__wrapper iframe,
.sw-entry-content .wp-block-embed-vimeo  .wp-block-embed__wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* ── التضمينات الاجتماعية (تحقن inline styles — نُجبرها) ── */

/* Twitter / X */
.sw-entry-content .twitter-tweet,
.sw-entry-content .twitter-tweet-rendered {
  max-width: 100% !important;
  width: 100% !important;
  margin-inline: auto !important;
}
/* Twitter timeline */
.sw-entry-content .twitter-timeline,
.twitter-timeline,
.twitter-timeline-rendered {
  width: 100%    !important;
  max-width: 100% !important;
}

/* Instagram */
.sw-entry-content .instagram-media {
  max-width: 100% !important;
  min-width: unset !important;
  width: 100% !important;
}

/* Facebook */
.sw-entry-content .fb-post,
.sw-entry-content .fb-video,
.sw-entry-content .facebook-video {
  max-width: 100% !important;
  width: 100% !important;
}
.sw-entry-content .fb-post > span,
.sw-entry-content .fb-video > span {
  max-width: 100% !important;
  width: 100% !important;
}

/* TikTok */
.sw-entry-content .tiktok-embed {
  max-width: 100% !important;
  width: 100% !important;
  min-width: unset !important;
}

/* Pinterest */
.sw-entry-content .pinterest-embed-widget,
.sw-entry-content [data-pin-do] {
  max-width: 100% !important;
}

/* Reddit */
.sw-entry-content .reddit-embed-bq { max-width: 100% !important; }

/* Snapchat */
.sw-entry-content .snapchat-embed { max-width: 100% !important; width: 100% !important; }

/* SoundCloud / Spotify */
.sw-entry-content .wp-block-embed-spotify .wp-block-embed__wrapper,
.sw-entry-content .wp-block-embed-soundcloud .wp-block-embed__wrapper {
  padding-top: 0; /* لا نسبة ثابتة للصوت */
}
.sw-entry-content .wp-block-embed-spotify iframe,
.sw-entry-content .wp-block-embed-soundcloud iframe {
  position: static;
  width: 100%;
  height: 166px;
}

/* ── الجداول: تمرير أفقي حين تتجاوز العرض ── */
.sw-entry-content .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  max-width: 100%;
  margin-block: 1.5rem;
}
/* العنصر table نفسه يعود لطبيعته داخل الـ wrapper */
.sw-entry-content .wp-block-table table {
  display: table;
  min-width: 100%;
  border-collapse: collapse;
}
/* جداول الـ classic editor */
.sw-entry-content > table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-block: 1.5rem;
}

/* ── الكود البرمجي: تمرير أفقي ── */
.sw-entry-content pre,
.sw-entry-content .wp-block-code {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}


/* ══════════════════════════════════════════════════════════════
   3. رأس المقالة المشترك
   ══════════════════════════════════════════════════════════════ */
.sw-single__header { margin-bottom: 22px; }

/* شارة التصنيف */
.sw-single-cat {
  display: inline-block;
  background: var(--sw-blue);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  text-decoration: none;
  transition: filter var(--sw-transition);
}
.sw-single-cat:hover { filter: brightness(1.08); color: #fff; }

/* العنوان الرئيسي */
.sw-single-title {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 900;
  line-height: 1.35;
  color: var(--sw-gray-900);
  margin: 0 0 16px;
}


/* ══════════════════════════════════════════════════════════════
   4. صف الميتا (مؤلف + تاريخ + وقت قراءة)
   ══════════════════════════════════════════════════════════════ */
.sw-single-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: .9rem;
  color: var(--sw-gray-600);
}
.sw-single-meta__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--sw-gray-900);
}
.sw-single-meta__author img { width: 32px; height: 32px; border-radius: 50%; }
.sw-single-meta__author a   { color: inherit; }
.sw-single-meta__item { display: inline-flex; align-items: center; gap: 5px; }
.sw-single-meta__item .sw-icon { opacity: .7; }

/* نسخة فاتحة — فوق صور الـ hero */
.sw-single-meta--light,
.sw-single-meta--light .sw-single-meta__author,
.sw-single-meta--light .sw-single-meta__author a { color: #fff; }
.sw-single-meta--light .sw-single-meta__item { color: rgba(255,255,255,.85); }


/* ══════════════════════════════════════════════════════════════
   5. الصورة البارزة المشتركة
   ══════════════════════════════════════════════════════════════ */
.sw-single-figure {
  margin: 0 0 26px;
  border-radius: var(--sw-radius-lg);
  overflow: hidden;
}
.sw-single-figure img,
.sw-single-figure picture { display: block; width: 100%; height: auto; }

.sw-single-caption {
  font-size: .82rem;
  color: var(--sw-gray-600);
  padding: 8px 4px 0;
  text-align: center;
}


/* ══════════════════════════════════════════════════════════════
   6. المحتوى المشترك
   ══════════════════════════════════════════════════════════════ */
.sw-page-links {
  margin: 20px 0;
  font-weight: 700;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sw-page-links a {
  padding: 2px 10px;
  border: 1px solid var(--sw-gray-200);
  border-radius: 4px;
}


/* ══════════════════════════════════════════════════════════════
   7. الوسوم
   ══════════════════════════════════════════════════════════════ */
.sw-post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 26px 0;
}
.sw-post-tags__label { font-weight: 700; color: var(--sw-gray-600); }


/* ══════════════════════════════════════════════════════════════
   8. أزرار المشاركة
   ══════════════════════════════════════════════════════════════ */
.sw-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}
.sw-share__label {
  font-weight: 700;
  color: var(--sw-gray-600);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sw-share__btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sw-gray-100);
  color: var(--sw-gray-900);
  font-size: 15px;
  text-decoration: none;
  transition: all var(--sw-transition);
}
.sw-share__btn:hover { transform: translateY(-2px); color: #fff; }
.sw-share__btn--facebook:hover { background: #1877f2; }
.sw-share__btn--twitter:hover  { background: #000;    }
.sw-share__btn--whatsapp:hover { background: #25d366; }
.sw-share__btn--telegram:hover { background: #229ed9; }


/* ══════════════════════════════════════════════════════════════
   9. قالب: Default — محتوى + قائمة جانبية
   ══════════════════════════════════════════════════════════════ */
.sw-single-layout--sidebar {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 40px;
  align-items: start;
}
.sw-single__aside {
  position: sticky;
  top: calc(var(--sw-header-height, 60px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* بطاقات الجانبي */
.sw-aside-card {
  background: var(--sw-white);
  border: 1px solid var(--sw-gray-200);
  border-radius: var(--sw-radius-lg);
  padding: 16px;
}
.sw-aside-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--sw-gray-900);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sw-gray-200);
}
.sw-aside-author { text-align: center; }
.sw-aside-author img { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 8px; }
.sw-aside-author h4 { margin: 0 0 6px; }
.sw-aside-author p  { font-size: .85rem; color: var(--sw-gray-600); margin: 0; }

.sw-aside-popular { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sw-aside-popular a { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.sw-aside-popular__thumb { flex: 0 0 60px; width: 60px; height: 48px; border-radius: 6px; overflow: hidden; }
.sw-aside-popular__title { display: block; font-size: .88rem; font-weight: 700; color: var(--sw-gray-900); line-height: 1.4; }
.sw-aside-popular__date  { font-size: .75rem; color: var(--sw-gray-400); }

.sw-aside-cats { list-style: none; margin: 0; padding: 0; }
.sw-aside-cats li + li { border-top: 1px solid var(--sw-gray-100); }
.sw-aside-cats a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: var(--sw-gray-900);
  text-decoration: none;
}
.sw-aside-cats em {
  font-style: normal;
  font-size: .78rem;
  color: var(--sw-gray-400);
  background: var(--sw-gray-100);
  border-radius: 10px;
  padding: 1px 9px;
}


/* ══════════════════════════════════════════════════════════════
   10. مواضيع ذات صلة + تنقّل المقالة + الكاتب
   ══════════════════════════════════════════════════════════════ */
.sw-related { margin-top: 44px; }

.sw-postnav { display: flex; justify-content: space-between; gap: 16px; margin: 32px 0; }
.sw-postnav .nav-links { display: contents; }
.sw-postnav a {
  flex: 1;
  background: var(--sw-gray-100);
  border-radius: var(--sw-radius);
  padding: 12px 16px;
  text-decoration: none;
  transition: background var(--sw-transition);
}
.sw-postnav a:hover { background: var(--sw-gray-200); }
.sw-postnav .sw-postnav__sub   { display: block; font-size: .78rem; color: var(--sw-gray-400); margin-bottom: 4px; }
.sw-postnav .sw-postnav__title { display: block; font-weight: 700; color: var(--sw-gray-900); font-size: .92rem; }
.sw-postnav .nav-next { text-align: left; }

.sw-single__footer + .sw-author-box,
.sw-single__main .sw-author-box { margin-top: 24px; }


/* ══════════════════════════════════════════════════════════════
   10. قالب: Featured Hero (بطل مميّز)
   ══════════════════════════════════════════════════════════════ */
.sw-single-hero {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.sw-single-hero__bg { position: absolute; inset: 0; z-index: 0; }
.sw-single-hero__bg img,
.sw-single-hero__bg picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-single-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.1) 100%);
}
.sw-single-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: 60px;
  padding-bottom: 38px;
}
.sw-single-hero__inner { max-width: 860px; }
.sw-single-hero__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.3;
  color: #fff;
  margin: 12px 0 16px;
}


/* ══════════════════════════════════════════════════════════════
   11. قالب: Wide (عرض واسع)
   ══════════════════════════════════════════════════════════════ */
.sw-single--wide .sw-single-wide__header { padding: 36px 0 22px; }
.sw-single-wide__figure { margin: 0 0 28px; }
.sw-single-wide__figure img,
.sw-single-wide__figure picture {
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: cover;
  display: block;
}
.sw-single-wide__body { padding-bottom: 10px; }


/* ══════════════════════════════════════════════════════════════
   12. قالب: Magazine (مجلّة) + drop-cap
   ══════════════════════════════════════════════════════════════ */
.sw-single-mag__header { margin-bottom: 22px; }
.sw-single-mag__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sw-single-mag__top .sw-share { margin: 0; }
.sw-single-mag__title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.3;
  color: var(--sw-gray-900);
  margin: 0 0 16px;
}
.sw-single-mag__byline { display: flex; align-items: center; gap: 12px; }
.sw-single-mag__byline img { width: 48px; height: 48px; border-radius: 50%; }
.sw-single-mag__author { display: block; font-weight: 800; color: var(--sw-gray-900); }
.sw-single-mag__date   { display: block; font-size: .82rem; color: var(--sw-gray-600); }

/* الحرف الاستهلالي */
.sw-drop-cap {
  float: right;
  font-size: 3.6em;
  font-weight: 900;
  line-height: .82;
  margin: 6px 0 2px 12px;
  color: var(--sw-blue);
}


/* ══════════════════════════════════════════════════════════════
   13. قالب: Infographic
   ══════════════════════════════════════════════════════════════ */
.sw-single--infographic { text-align: center; }
.sw-single-info__head {
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}
.sw-single-info__head .sw-single-meta { justify-content: center; }
.sw-single-info__image  { margin: 0 auto 28px; max-width: 760px; }
.sw-single-info__img    { width: 100%; height: auto; border-radius: var(--sw-radius-lg); }
.sw-single-info__content { max-width: 760px; margin: 0 auto; text-align: start; }
.sw-single--infographic .sw-post-tags,
.sw-single--infographic .sw-single__footer { max-width: 760px; margin-inline: auto; }


/* ══════════════════════════════════════════════════════════════
   14. قالب: Video (فيديو)
   ══════════════════════════════════════════════════════════════ */
.sw-single--video .sw-single-video { margin-block: 1.75rem; }

/* حاوي الفيديو — aspect-ratio يحافظ على نسبة 16:9 تلقائياً */
.sw-single-video__wrapper {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--sw-radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 24px rgba(0,0,0,.18);
}
.sw-single-video__wrapper iframe,
.sw-single-video__wrapper video {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
/* Gutenberg embed wrapper داخل الحاوي */
.sw-single-video__wrapper .wp-block-embed__wrapper {
  width: 100%;
  height: 100%;
}
.sw-single-video__wrapper .wp-block-embed__wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.sw-single-video__caption {
  margin-top: .5rem;
  font-size: .82rem;
  color: var(--sw-gray-600);
  text-align: center;
}


/* ══════════════════════════════════════════════════════════════
   15. قالب: Breaking News (خبر عاجل)
   ══════════════════════════════════════════════════════════════ */

/* الشريط الأحمر العلوي */
.sw-breaking-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--sw-accent, #c0392b);
  color: #fff;
  padding: .6rem 1.25rem;
  font-size: .82rem;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 100;
  line-height: 1.2;
  animation: sw-bar-pulse 2.5s ease-in-out infinite;
}

@keyframes sw-bar-pulse {
  0%, 100% { background: var(--sw-accent, #c0392b); }
  50%       { background: #e74c3c; }
}

/* بادج "عاجل" داخل الشريط */
.sw-breaking-bar__label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #fff;
  color: var(--sw-accent, #c0392b);
  padding: .2rem .7rem;
  border-radius: 3px;
  font-size: .78rem;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* النقطة النابضة */
.sw-breaking-bar__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sw-accent, #c0392b);
  animation: sw-dot-blink 1.2s ease-in-out infinite;
}
@keyframes sw-dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.sw-breaking-bar__time {
  font-size: .76rem;
  font-weight: 400;
  opacity: .88;
  margin-inline-start: auto;
}

/* رأس الخبر العاجل */
.sw-single-breaking__header {
  text-align: center;
  padding-block: 2rem 1.5rem;
  border-bottom: 3px solid var(--sw-accent, #c0392b);
  margin-bottom: 1.75rem;
}
.sw-single-breaking__title {
  font-size: clamp(1.85rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.18;
  color: var(--sw-gray-900);
  margin-top: .6rem;
  margin-bottom: .5rem;
}

/* إطار أحمر للصورة */
.sw-single-breaking__figure {
  border: 3px solid var(--sw-accent, #c0392b);
  border-radius: var(--sw-radius-lg);
  overflow: hidden;
}

/*
 * أول <ul> في خبر عاجل = "أبرز النقاط"
 * يُصمَّم تلقائياً عبر CSS دون تعديل PHP.
 */
.sw-entry-content--breaking > ul:first-of-type,
.sw-entry-content--breaking > .wp-block-list:first-of-type {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  border: 2px solid var(--sw-accent, #c0392b);
  border-radius: var(--sw-radius-lg);
  overflow: hidden;
  background: var(--sw-accent-light, #fdecea);
}
.sw-entry-content--breaking > ul:first-of-type::before,
.sw-entry-content--breaking > .wp-block-list:first-of-type::before {
  content: "أبرز النقاط";
  display: block;
  background: var(--sw-accent, #c0392b);
  color: #fff;
  padding: .45rem 1rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.sw-entry-content--breaking > ul:first-of-type li,
.sw-entry-content--breaking > .wp-block-list:first-of-type li {
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(192,57,43,.15);
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.sw-entry-content--breaking > ul:first-of-type li::before,
.sw-entry-content--breaking > .wp-block-list:first-of-type li::before {
  content: '▸';
  color: var(--sw-accent, #c0392b);
  font-size: .75rem;
  flex-shrink: 0;
}
.sw-entry-content--breaking > ul:first-of-type li:last-child,
.sw-entry-content--breaking > .wp-block-list:first-of-type li:last-child {
  border-bottom: 0;
}


/* ══════════════════════════════════════════════════════════════
   16. قالب: Opinion / Column (رأي وعمود)
   ══════════════════════════════════════════════════════════════ */
.sw-single-opinion__header {
  padding-bottom: 1.75rem;
  border-bottom: 2px solid var(--sw-gray-200);
  margin-bottom: 2rem;
}

/* بطاقة الكاتب العلوية */
.sw-opinion-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.sw-opinion-author__avatar {
  width: 80px !important;
  height: 80px !important;
  min-width: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sw-blue);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.sw-opinion-author__info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  flex: 1;
  min-width: 140px;
}
.sw-opinion-author__role {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sw-blue);
  font-weight: 700;
}
.sw-opinion-author__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sw-gray-900);
  text-decoration: none;
  transition: color var(--sw-transition);
}
.sw-opinion-author__name:hover { color: var(--sw-blue); }
.sw-opinion-author__date { font-size: .78rem; color: var(--sw-gray-600); }
.sw-opinion-author__badge { margin-inline-start: auto; }

/* عنوان الرأي */
.sw-single-opinion__title {
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--sw-gray-900);
}

/* الاقتباس البارز */
.sw-opinion-pullquote {
  border: 0;
  padding: 1.4rem 1.75rem;
  margin: 2rem 0;
  background: var(--sw-primary-light, #e8f0fe);
  border-inline-start: 5px solid var(--sw-blue);
  border-radius: 0 var(--sw-radius-lg) var(--sw-radius-lg) 0;
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--sw-gray-900);
}
.sw-opinion-pullquote p { margin: 0; }

/* طباعة المحتوى */
.sw-entry-content--opinion { font-size: 1.08rem; line-height: 1.92; }
.sw-entry-content--opinion > p:first-of-type {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--sw-gray-900);
  line-height: 1.75;
}
/* تمييز الـ blockquote داخل الرأي */
.sw-entry-content--opinion blockquote {
  border-inline-start: 4px solid var(--sw-blue);
  padding-inline-start: 1.25rem;
  color: var(--sw-gray-600);
  font-style: italic;
  margin-inline: 0;
}


/* ══════════════════════════════════════════════════════════════
   17. قالب: Longform / تحقيق طويل
   ══════════════════════════════════════════════════════════════ */

/* ── شريط تقدم القراءة ── */
.sw-reading-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: rgba(0,0,0,.08);
  z-index: 9999;
  pointer-events: none;
}
.sw-reading-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--sw-blue);
  transition: width .08s linear;
  will-change: width;
}

/* ── رأس التحقيق ── */
.sw-single-longform__header { padding-block: 2.25rem 1.5rem; }

/* ── التخطيط: محتوى + فهرس جانبي ── */
.sw-single-longform__layout {
  display: grid;
  grid-template-columns: 1fr minmax(0, 230px);
  grid-template-areas: "body toc";
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.5rem;
}
.sw-single-longform__body { grid-area: body; min-width: 0; }
.sw-toc                    { grid-area: toc;  }

/* ── فهرس المحتويات ── */
.sw-toc {
  position: sticky;
  top: calc(var(--sw-header-height, 60px) + 1rem);
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  background: var(--sw-gray-100);
  border: 1px solid var(--sw-gray-200);
  border-radius: var(--sw-radius-lg);
  padding: 1.25rem;
  font-size: .84rem;
  scrollbar-width: thin;
}
.sw-toc__title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sw-gray-600);
  margin: 0 0 .85rem;
  font-weight: 700;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--sw-gray-200);
}
.sw-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.sw-toc__item--h3 { padding-inline-start: 1rem; font-size: .8rem; }

.sw-toc__link {
  display: block;
  padding: .32rem .55rem;
  border-radius: 4px;
  color: var(--sw-gray-600);
  text-decoration: none;
  line-height: 1.45;
  transition: background var(--sw-transition), color var(--sw-transition);
  border-inline-start: 2px solid transparent;
}
.sw-toc__link:hover {
  background: var(--sw-primary-light, #e8f0fe);
  color: var(--sw-blue);
}
.sw-toc__link.active {
  background: var(--sw-primary-light, #e8f0fe);
  color: var(--sw-blue);
  font-weight: 700;
  border-inline-start-color: var(--sw-blue);
}

/* ── طباعة المحتوى ── */
.sw-entry-content--longform { font-size: 1.06rem; line-height: 1.88; }
.sw-entry-content--longform > p:first-of-type { font-size: 1.15rem; font-weight: 500; }

/* هامش علوي للعناوين عند الانتقال بالـ anchor لتعويض header الثابت */
.sw-entry-content--longform h2[id],
.sw-entry-content--longform h3[id] {
  scroll-margin-top: calc(var(--sw-header-height, 60px) + 1.5rem);
}


/* ══════════════════════════════════════════════════════════════
   18. قالب: Photo Story (قصة مصورة)
   ══════════════════════════════════════════════════════════════ */
.sw-single--photo-story { overflow-x: hidden; }

/* ── صورة البطل ── */
.sw-photo-story__lead {
  position: relative;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  margin: 0;
  display: block;
}
.sw-photo-story__lead-img {
  width: 100%;
  height: 88vh;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.sw-photo-story__lead-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.78) 0%,
    rgba(0,0,0,.2)  45%,
    transparent     75%
  );
  pointer-events: none;
}
.sw-photo-story__lead-caption {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 3rem 2rem 2.25rem;
  color: #fff;
  max-width: 900px;
  margin-inline: auto;
}
.sw-photo-story__title {
  font-size: clamp(1.85rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.14;
  color: #fff;
  margin-top: .6rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
/* رأس نصي بديل حين لا توجد صورة مميزة */
.sw-photo-story__text-header { padding-block: 2.5rem; }

/* ── سحب صور المحتوى الداخلية لعرض كامل ── */
.sw-entry-content--photo-story figure:not(.alignleft):not(.alignright),
.sw-entry-content--photo-story .wp-block-image:not(.alignleft):not(.alignright):not(.is-style-rounded) {
  max-width: 100vw;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  border-radius: 0;
}
.sw-entry-content--photo-story figure img,
.sw-entry-content--photo-story .wp-block-image img {
  width: 100%;
  height: auto;
  display: block;
}
.sw-entry-content--photo-story figure figcaption {
  max-width: var(--sw-container-narrow, 760px);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ── معرض الصور المرفقة ── */
.sw-photo-story__gallery {
  padding-block: 3rem;
  background: var(--sw-gray-100);
  margin-block: 3rem;
}
.sw-photo-story__gallery-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sw-gray-600);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sw-photo-story__gallery-count {
  font-weight: 400;
  font-size: .85rem;
  opacity: .7;
}
.sw-photo-story__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}
.sw-photo-story__item {
  margin: 0;
  overflow: hidden;
  border-radius: var(--sw-radius-lg);
  background: #000;
}
.sw-photo-story__link { display: block; overflow: hidden; }
.sw-photo-story__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform .35s ease, opacity .35s ease;
}
.sw-photo-story__item:hover .sw-photo-story__img {
  transform: scale(1.05);
  opacity: .9;
}
.sw-photo-story__caption {
  padding: .5rem .75rem;
  font-size: .8rem;
  color: var(--sw-gray-600);
  line-height: 1.5;
  background: rgba(0,0,0,.04);
}
/* أول صورة في المعرض تشغل عرضاً مضاعفاً */
.sw-photo-story__grid > .sw-photo-story__item:first-child { grid-column: span 2; }
.sw-photo-story__grid > .sw-photo-story__item:first-child .sw-photo-story__img { aspect-ratio: 16 / 7; }


/* ══════════════════════════════════════════════════════════════
   19. استجابة الشاشات — Responsive
   ══════════════════════════════════════════════════════════════ */

/* ── ≤ 980px: إلغاء الجانبي في قالب Default ── */
@media (max-width: 980px) {
  .sw-single-layout--sidebar { grid-template-columns: 1fr; }
  .sw-single__aside           { position: static; }
}

/* ── ≤ 960px: فهرس Longform يُصبح أفقياً فوق المحتوى ── */
@media (max-width: 960px) {
  .sw-single-longform__layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "toc"
      "body";
  }
  .sw-toc { position: static; max-height: none; }
}

/* ── ≤ 600px ── */
@media (max-width: 600px) {
  /* تنقّل المقالة */
  .sw-postnav { flex-direction: column; }

  /* featured hero */
  .sw-single-hero { min-height: 340px; }

  /* العاجل: الشريط */
  .sw-breaking-bar { flex-wrap: wrap; gap: .35rem; padding: .55rem 1rem; }
  .sw-breaking-bar__time { margin-inline-start: 0; width: 100%; font-size: .72rem; }

  /* العاجل: العنوان */
  .sw-single-breaking__title { font-size: clamp(1.5rem, 6vw, 2.2rem); }

  /* الرأي: أفاتار أصغر */
  .sw-opinion-author__avatar { width: 62px !important; height: 62px !important; min-width: 62px; }
  .sw-opinion-pullquote      { padding: 1rem 1.25rem; font-size: 1.05rem; }

  /* الفيديو: يمتد للحواف */
  .sw-single--video .sw-single-video { margin-inline: -1rem; }
  .sw-single-video__wrapper { border-radius: 0; }

  /* القصة المصورة */
  .sw-photo-story__lead-img                                       { height: 60vh; }
  .sw-photo-story__lead-caption                                   { padding: 2rem 1rem 1.25rem; }
  .sw-photo-story__grid                                           { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .sw-photo-story__grid > .sw-photo-story__item:first-child       { grid-column: span 1; }
  .sw-photo-story__grid > .sw-photo-story__item:first-child .sw-photo-story__img { aspect-ratio: 4 / 3; }
}