/* =====================================================
   الموسوعة السعودية — ksawiki.com
   تنسيقات مخصصة للهوية البصرية
   ===================================================== */

/* ── بطاقة القسم الكاملة ── */
.np-section {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E8E8EC;
  box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 48px;
}
body.np-dark .np-section {
  background: #16161E;
  border-color: #27273A;
}

/* ── ترويسة القسم — خضراء سعودية ── */
.np-sec-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: linear-gradient(135deg, #004D25 0%, #006C35 100%) !important;
  min-height: 52px !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
  border-bottom: 3px solid #C9A227 !important;
  position: relative !important;
}
.np-sec-head::before,
.np-sec-head::after { display: none !important; }

/* ── أيقونة القسم ── */
.np-sec-icon-wrap {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 52px !important;
  height: 52px !important;
  font-size: 20px !important;
  flex-shrink: 0 !important;
  margin-left: 14px !important;
}

/* ── عنوان القسم ── */
.np-sec-head .np-sec-title {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  color: #fff !important;
  padding: 0 !important;
}
.np-sec-title::before { display: none !important; }
.np-sec-title-text { padding-right: 4px; }

/* ── زر عرض الكل ── */
.np-view-all {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 16px !important;
  margin-left: 14px !important;
  border-radius: 30px !important;
  background: rgba(201,162,39,.25) !important;
  border: 1.5px solid rgba(201,162,39,.6) !important;
  color: #C9A227 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: background .2s, border-color .2s !important;
}
.np-view-all:hover {
  background: rgba(201,162,39,.45) !important;
  color: #fff !important;
  border-color: #C9A227 !important;
}

/* ── محتوى القسم ── */
.np-section > .np-latest-list  { padding: 8px 20px 16px !important; }
.np-section > .np-numbered-list { padding: 8px 20px 16px !important; }
.np-section > .np-grid         { padding: 20px !important; }
.np-section > .np-magazine-layout,
.np-section > .np-layout-featured { padding: 20px !important; }
.np-section > .np-load-more-wrap  { padding-bottom: 20px !important; }
.np-section > .np-hlist        { padding: 20px !important; }

/* ── قوائم المقالات — خطوط فاصلة ── */
.np-latest-list { display: flex !important; flex-direction: column !important; }
.np-latest-item {
  display: flex !important;
  gap: 14px !important;
  align-items: flex-start !important;
  padding: 14px 0 !important;
  border-bottom: 1px solid #E8E8EC !important;
}
body.np-dark .np-latest-item { border-bottom-color: #27273A !important; }
.np-latest-item:first-child { padding-top: 10px !important; }
.np-latest-item:last-child  { border-bottom: none !important; padding-bottom: 10px !important; }

/* ── الأكثر قراءة — عناصر مع خطوط فاصلة ── */
.np-numbered-list { display: flex !important; flex-direction: column !important; }
.np-num-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  padding: 14px 0 !important;
  border-bottom: 1px solid #E8E8EC !important;
}
body.np-dark .np-num-item { border-bottom-color: #27273A !important; }
.np-num-item:first-child { padding-top: 10px !important; }
.np-num-item:last-child  { border-bottom: none !important; padding-bottom: 10px !important; }

/* ── ترقيم الأكثر قراءة — لون ذهبي سعودي ── */
.np-num-count {
  color: #C9A227 !important;
  font-weight: 900 !important;
}

/* ── قسم البطل والنشرة — بدون بطاقة ── */
.np-sec-hero,
.np-sec-newsletter {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

/* ── ترويسة الشريط الجانبي ── */
.np-widget-title {
  background: linear-gradient(135deg, #004D25 0%, #006C35 100%) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 14px 18px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-bottom: 2px solid #C9A227 !important;
}
.np-widget-title::before {
  content: '' !important;
  display: block !important;
  width: 3.5px !important;
  height: 18px !important;
  background: #C9A227 !important;
  border-radius: 3px !important;
  flex-shrink: 0 !important;
}

/* ── الشعار النصي — ذهبي ── */
.np-logo-text {
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #C9A227 !important;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.np-logo-text::before {
  content: '🌿 ';
}

/* ── صورة الشعار — إطار ذهبي خفيف ── */
.np-logo-img {
  filter: drop-shadow(0 0 6px rgba(201,162,39,.4));
}

/* ── شريط الأخبار العاجل — خضراء ذهبية ── */
.np-topbar {
  background: linear-gradient(135deg, #003D1C 0%, #004D25 100%) !important;
  border-bottom: 2px solid #C9A227 !important;
}
.np-ticker-lbl {
  background: #C9A227 !important;
  color: #003D1C !important;
  font-weight: 900 !important;
}

/* ── الهيدر — خضراء داكنة ── */
.np-header {
  background: linear-gradient(180deg, #003D1C 0%, #004D25 100%) !important;
  border-bottom: 3px solid #C9A227 !important;
}

/* ── شريط التقدم — ذهبي ── */
#np-progress-bar {
  background: linear-gradient(90deg, #C9A227, #F0C040) !important;
}

/* ── بطاقة التصنيف — شارة ملونة ── */
.np-cat-badge,
.np-card-cat {
  background: #006C35 !important;
  color: #fff !important;
}
.np-card-cat:hover {
  background: #004D25 !important;
}

/* ── زر قراءة المزيد ── */
.np-load-more,
.np-btn-primary {
  background: #006C35 !important;
  border-color: #006C35 !important;
}
.np-load-more:hover,
.np-btn-primary:hover {
  background: #004D25 !important;
  border-color: #004D25 !important;
}

/* ── الفوتر — خضراء عميقة ── */
.np-footer {
  background: linear-gradient(180deg, #002E15 0%, #001A0C 100%) !important;
  border-top: 3px solid #C9A227 !important;
}
.np-footer-bottom {
  border-top: 1px solid rgba(201,162,39,.3) !important;
}
.np-copyright {
  color: rgba(201,162,39,.8) !important;
}

/* ── روابط الفوتر ── */
.np-footer-nav a:hover {
  color: #C9A227 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   الصفحات القانونية (سياسة الخصوصية، من نحن، اتصل بنا...)
   ═══════════════════════════════════════════════════════════════════ */

.np-legal-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.np-legal-article {
  background: var(--np-card, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  padding: 2.5rem 3rem;
}

.np-legal-header {
  border-bottom: 3px solid var(--np-primary, #006C35);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.np-legal-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--np-primary, #006C35);
  margin: 0 0 .4rem;
}

.np-legal-updated {
  font-size: .85rem;
  color: var(--np-muted, #888);
  margin: 0;
}

/* المحتوى الداخلي للصفحات القانونية */
.np-legal-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--np-primary, #006C35);
  margin: 2rem 0 .75rem;
  padding-right: .75rem;
  border-right: 4px solid var(--np-accent, #C9A227);
}

.np-legal-body p,
.np-legal-body li {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--np-text, #222);
}

.np-legal-body ul {
  padding-right: 1.5rem;
  list-style: disc;
}

.np-legal-body a {
  color: var(--np-primary, #006C35);
  text-decoration: underline;
}

.np-legal-body a:hover {
  color: var(--np-accent, #C9A227);
}

/* الوضع الليلي */
.dark-mode .np-legal-article {
  background: var(--np-dark-2, #1a1a1a);
}

@media (max-width: 640px) {
  .np-legal-article {
    padding: 1.5rem 1.25rem;
  }
  .np-legal-title {
    font-size: 1.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   الرابط المختصر — Short URL Box
   ═══════════════════════════════════════════════════════════════════ */
.np-short-url {
  position: relative;
  margin: 2rem 0;
  border-radius: 12px;
  border: 2px solid var(--np-accent, #C0392B);
  background: linear-gradient(135deg, #fff9f9 0%, #fff 100%);
  overflow: visible;
}
.dark-mode .np-short-url {
  background: linear-gradient(135deg, #1e1515 0%, #1a1a1a 100%);
  border-color: var(--np-accent, #C0392B);
}
.np-su-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.25rem;
  flex-wrap: wrap;
}
.np-su-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.np-su-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: .15rem;
}
.np-su-lbl {
  font-size: .72rem;
  font-weight: 700;
  color: var(--np-accent, #C0392B);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.np-su-link {
  font-size: .9rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}
.dark-mode .np-su-link { color: #e0e0e0; }
.np-su-link:hover { color: var(--np-accent, #C0392B); text-decoration: underline; }

.np-su-copy {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  background: var(--np-accent, #C0392B);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.np-su-copy:hover { background: #a02020; transform: scale(1.04); }
.np-su-copy:active { transform: scale(.97); }

.np-su-qr-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .45rem .85rem;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.np-su-qr-btn:hover { background: #444; }

.np-su-toast {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 1.25rem;
  background: #2e7d32;
  color: #fff;
  padding: .45rem 1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  z-index: 200;
  animation: npFadeIn .25s ease;
  white-space: nowrap;
}
@keyframes npFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.np-su-qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.np-su-qr-box {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  position: relative;
  max-width: 260px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.dark-mode .np-su-qr-box { background: #1e1e1e; color: #e0e0e0; }
.np-su-qr-close {
  position: absolute;
  top: .6rem;
  left: .6rem;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 28px;
  text-align: center;
}
.dark-mode .np-su-qr-close { background: #333; color: #fff; }
.np-su-qr-title { font-weight: 700; font-size: .9rem; margin: 0 0 .75rem; }
.np-su-qr-img { border-radius: 8px; border: 4px solid #eee; }
.np-su-qr-url { font-size: .75rem; color: #777; margin: .6rem 0 0; direction: ltr; }

/* ═══════════════════════════════════════════════════════════════════
   المقالات المشابهة — Related Posts Grid
   ═══════════════════════════════════════════════════════════════════ */
.np-related-section {
  margin: 2.5rem 0 0;
  padding: 0 0 2rem;
}
.np-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}
@media (max-width: 900px) {
  .np-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .np-related-grid { grid-template-columns: 1fr; }
}

.np-related-card {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.dark-mode .np-related-card { background: #1e1e1e; box-shadow: 0 2px 12px rgba(0,0,0,.3); }
.np-related-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.13); }

.np-related-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #f0f0f0;
}
.np-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.np-related-card:hover .np-related-thumb img { transform: scale(1.06); }

.np-related-cat {
  position: absolute;
  top: .6rem;
  right: .6rem;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 4px;
  line-height: 1.4;
}

.np-related-body {
  padding: .85rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.np-related-title {
  margin: 0;
  font-size: .92rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.np-related-title a {
  color: inherit;
  text-decoration: none;
}
.np-related-title a:hover { color: var(--np-accent, #C0392B); }
.dark-mode .np-related-title a { color: #e0e0e0; }

.np-related-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .75rem;
  color: #888;
  margin-top: auto;
}
.dark-mode .np-related-meta { color: #999; }

@media (max-width: 640px) {
  .np-su-inner { gap: .5rem; padding: .75rem 1rem; }
  .np-su-link { font-size: .82rem; }
}
