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

/* ── حاويات بعرض أضيق للقراءة ─────────────────────────────── */
.sw-container--narrow { max-width: 760px; }
.sw-container--medium { max-width: 1040px; }

/* ── رأس المقالة ──────────────────────────────────────────── */
.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;
}
.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;
}

/* ── صف الميتا ────────────────────────────────────────────── */
.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; }
.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); }

/* ── الصورة البارزة ───────────────────────────────────────── */
.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;
}

/* ── المحتوى ──────────────────────────────────────────────── */
.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; }

/* ── الوسوم ───────────────────────────────────────────────── */
.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); }

/* ── أزرار المشاركة ───────────────────────────────────────── */
.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;
  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; }

/* ── تخطيط الافتراضي (محتوى + جانبي) ──────────────────────── */
.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) + 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; }
.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); }
.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; }

/* ── مواضيع ذات صلة ───────────────────────────────────────── */
.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; 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; }

/* ============================================================
   قالب: Featured (بطل)
   ============================================================ */
.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; }

/* ============================================================
   قالب: 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; }

/* ============================================================
   قالب: Magazine
   ============================================================ */
.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);
}

/* ============================================================
   قالب: 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; }

/* ============================================================
   استجابة
   ============================================================ */
@media (max-width: 980px) {
  .sw-single-layout--sidebar { grid-template-columns: 1fr; }
  .sw-single__aside { position: static; }
}
@media (max-width: 600px) {
  .sw-postnav { flex-direction: column; }
  .sw-single-hero { min-height: 340px; }
}
