/* =========================
   BNW CK Content Polish (FINAL v2)
   محدود به محتوا (بدون تداخل با کل قالب)
   ========================= */

/* پایه متن */
.bnw-ck,
.bnw-ck p{
  line-height: 35px !important;
  text-align: justify !important;
  color: #1f1f1f;
  font-size: 17px;
}

/* فاصله پاراگراف‌ها (رفع فاصله زیاد بعد از Enter) */
.bnw-ck p{
  margin: 0 0 14px 0 !important;
}
.bnw-ck p + p{
  margin-top: 0 !important;
}
.bnw-ck p:empty{
  display: none !important;
}

/* لینک‌ها: حرفه‌ای مثل سایت خبری */
.bnw-ck a:link,
.bnw-ck a:visited{
  color: #5d0102 !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(93,1,2,.35);
  font-weight: 800;
  transition: opacity .15s ease, text-decoration-color .15s ease;
}
.bnw-ck a:hover{
  color: #750000 !important;
  text-decoration-color: rgba(93,1,2,.85);
  opacity: .92;
}
.bnw-ck a:active{
  color: #3b0000 !important;
}

/* تصاویر */
.bnw-ck img{
  border-radius: 16px !important;
  box-shadow: 0 12px 26px rgba(20,20,20,.10);
  border: 1px solid rgba(10,10,10,.08);
  margin: 10px 0 16px 0 !important;
  max-width: 100%;
  height: auto;
}

/* لیست‌ها */
.bnw-ck ul,
.bnw-ck ol{
  margin: 10px 0 16px 0 !important;
  padding-right: 22px !important;
}
.bnw-ck ul > li,
.bnw-ck ol > li{
  line-height: 30px !important;
  margin: 8px 0 !important;
}
.bnw-ck ul > li::marker,
.bnw-ck ol > li::marker{
  color: #5d0102;
  font-weight: 900;
}

/* =========================
   هدینگ‌ها (Newsroom style)
   - بدون باکس بزرگ
   - بدون خط عمودی
   - سازگار با موبایل (عدم مخفی شدن ::after)
   ========================= */

.bnw-ck h1,
.bnw-ck h2,
.bnw-ck h3,
.bnw-ck h4,
.bnw-ck h5,
.bnw-ck h6{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  color: #5d0102 !important;
  font-weight: 950 !important;

  padding: 0 !important;
  margin: 22px 0 12px 0 !important;

  line-height: 1.75 !important;
  text-align: right !important;

  position: relative;
  display: block !important;      /* مهم برای موبایل */
  overflow: visible !important;   /* مهم برای موبایل */
  clear: both !important;         /* اگر قبلش تصویر float داشت */
}

/* Kill switch برای حذف هر خط عمودی احتمالی از هر CSS دیگر */
.bnw-ck h1::before,
.bnw-ck h2::before,
.bnw-ck h3::before,
.bnw-ck h4::before,
.bnw-ck h5::before,
.bnw-ck h6::before{
  content: none !important;
  display: none !important;
}

/* اندازه‌ها */
.bnw-ck h1{ font-size: 30px !important; }
.bnw-ck h2{ font-size: 26px !important; }
.bnw-ck h3{ font-size: 22px !important; }
.bnw-ck h4{ font-size: 18px !important; }
.bnw-ck h5{ font-size: 16px !important; }
.bnw-ck h6{ font-size: 14px !important; opacity: .95; }

/* خط زیر تیترها (RTL درست) */
.bnw-ck h1::after,
.bnw-ck h2::after,
.bnw-ck h3::after{
  content: "";
  display: block;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(to left, rgba(93,1,2,.95), rgba(93,1,2,.20), rgba(93,1,2,0));
}

.bnw-ck h4::after,
.bnw-ck h5::after,
.bnw-ck h6::after{
  content: "";
  display: block;
  height: 2px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(to left, rgba(93,1,2,.55), rgba(93,1,2,.14), rgba(93,1,2,0));
}

/* اگر داخل تیتر لینک بود */
.bnw-ck h1 a,
.bnw-ck h2 a,
.bnw-ck h3 a,
.bnw-ck h4 a,
.bnw-ck h5 a,
.bnw-ck h6 a{
  color: inherit !important;
  text-decoration: none !important;
}
.bnw-ck h1 a:hover,
.bnw-ck h2 a:hover,
.bnw-ck h3 a:hover,
.bnw-ck h4 a:hover,
.bnw-ck h5 a:hover,
.bnw-ck h6 a:hover{
  opacity: .9;
}

/* جداکننده‌ها */
.bnw-ck hr{
  border: none;
  height: 1px;
  background: rgba(93,1,2,.18);
  margin: 18px 0 !important;
}

/* Quote / Callout */
.bnw-ck blockquote{
  margin: 16px 0 !important;
  padding: 14px 14px 14px 12px !important;
  border-right: 4px solid #5d0102 !important;
  border-left: 0 !important;
  background: linear-gradient(180deg, rgba(93,1,2,.07), rgba(93,1,2,.02)) !important;
  border-radius: 16px !important;
  color: #1f1f1f !important;
  box-shadow: 0 10px 26px rgba(20,20,20,.05) !important;
}
.bnw-ck blockquote p{
  margin: 0 !important;
}

/* Callout class-based (اختیاری برای استفاده در محتوا) */
.bnw-ck .bnw-callout{
  margin: 16px 0 !important;
  padding: 14px 14px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(10,10,10,.10) !important;
  box-shadow: 0 10px 26px rgba(20,20,20,.05) !important;
}
.bnw-ck .bnw-callout.bnw-callout--info{
  background: rgba(2,18,81,.06) !important;
  border-color: rgba(2,18,81,.18) !important;
}
.bnw-ck .bnw-callout.bnw-callout--warn{
  background: rgba(255,165,0,.10) !important;
  border-color: rgba(255,165,0,.28) !important;
}
.bnw-ck .bnw-callout.bnw-callout--danger{
  background: rgba(93,1,2,.07) !important;
  border-color: rgba(93,1,2,.18) !important;
}
.bnw-ck .bnw-callout .bnw-callout-title{
  font-weight: 900;
  margin-bottom: 6px;
}

/* کد و هایلایت‌ها */
.bnw-ck code{
  background: rgba(2,18,81,.06);
  border: 1px solid rgba(2,18,81,.14);
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 800;
}
.bnw-ck pre{
  background: #0b1020;
  color: #fff;
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
  margin: 14px 0 18px 0 !important;
  border: 1px solid rgba(255,255,255,.08);
}

/* جدول‌ها */
.bnw-ck table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0 18px 0 !important;
  border: 1px solid rgba(10,10,10,.10);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(20,20,20,.05);
}
.bnw-ck th,
.bnw-ck td{
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(10,10,10,.08);
}
.bnw-ck th{
  background: rgba(93,1,2,.06);
  color: #5d0102;
  font-weight: 900;
}
.bnw-ck tr:last-child td{
  border-bottom: none;
}

/* =========================
   اطمینان اضافه برای موبایل:
   اگر قالب روی ck-content هدینگ‌ها overflow:hidden داده بود
   ========================= */
.ck-content h1,
.ck-content h2,
.ck-content h3,
.ck-content h4,
.ck-content h5,
.ck-content h6{
  overflow: visible !important;
}
/* =========================
   MOBILE FIX: Force underline for headings
   این بخش را آخرِ آخر CSS بگذار
   ========================= */
@media (max-width: 991px){

  /* اگر کلاس bnw-ck روی موبایل نیومد، باز هم روی ck-content اعمال شود */
  .ck-content h1,
  .ck-content h2,
  .ck-content h3,
  .ck-content h4,
  .ck-content h5,
  .ck-content h6{
    display: block !important;
    position: relative !important;
    overflow: visible !important;
    clear: both !important;
  }

  /* خط زیر h1-h3 */
  .ck-content h1::after,
  .ck-content h2::after,
  .ck-content h3::after{
    content: "" !important;
    display: block !important;
    height: 3px !important;
    margin-top: 8px !important;
    border-radius: 999px !important;
    background: linear-gradient(to left, rgba(93,1,2,.95), rgba(93,1,2,.20), rgba(93,1,2,0)) !important;
  }

  /* خط زیر h4-h6 */
  .ck-content h4::after,
  .ck-content h5::after,
  .ck-content h6::after{
    content: "" !important;
    display: block !important;
    height: 2px !important;
    margin-top: 8px !important;
    border-radius: 999px !important;
    background: linear-gradient(to left, rgba(93,1,2,.55), rgba(93,1,2,.14), rgba(93,1,2,0)) !important;
  }

  /* اگر قالب pseudo element رو خاموش کرده بود */
  .ck-content h1::before,
  .ck-content h2::before,
  .ck-content h3::before,
  .ck-content h4::before,
  .ck-content h5::before,
  .ck-content h6::before{
    content: none !important;
    display: none !important;
  }
}