/* ===========================================
   Blog Single – Reference-like Layout (RTL)
   =========================================== */

.mc-single{
  max-width:1200px;
  margin:0 auto;
  padding:28px 22px;
  background:var(--bg);
}
.mc-single *{box-sizing:border-box}

/* ==================== HERO ==================== */
.mc-hero{ margin-top:10px; }

.mc-title{
  margin:0 0 12px;
  font-weight:900;
  font-size:38px;
  line-height:1.22;
  color:var(--ink);
}

/* chips row (category/date/reading time) */
.mc-submeta{ margin:0 0 10px; }
.mc-submeta__row{
  display:flex;
  flex-wrap:wrap;
  gap:10px 18px;
  align-items:center;
}

.mc-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 0;
  background:transparent;
  font-weight:400;
  font-size:13px;
  line-height:1;
  color:var(--muted);
  text-decoration:none;
}
.mc-chip__icon svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.mc-chip[href]:hover{ color:var(--blog-accent, var(--brand)); }
.mc-thumb{ margin-top:14px; }
.mc-thumb img{
  width:100%;
  height:auto;
  border-radius:16px;
  box-shadow:0 10px 26px var(--slate-shadow-06);
}

/* تصویر شاخص داخل ستون اصلی مقاله؛ هم‌تراز با شروع سایدبار */
.mc-thumb--content{
  margin:0 0 22px;
}
.mc-content .mc-thumb--content img{
  display:block;
  width:100%;
  height:auto;
  margin:0;
}

/* ==================== LAYOUT ==================== */
.mc-wrap{ margin-top:22px; }
.mc-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:28px;
  align-items:start;
}

.mc-content{
  min-width:0;
  color:var(--ink);
  font-size:16.5px;
  line-height:2.05;
}
.mc-content > *{ max-width:100%; }

.mc-content .alignwide,
.mc-content .alignfull{
  width:100% !important;
  max-width:100% !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

.mc-content h2{
  font-size:24px;
  margin:30px 0 12px;
  border-right:3px solid var(--blog-accent, var(--brand));
  padding-right:10px;
}
.mc-content h3{
  font-size:19px;
  margin:22px 0 10px;
}
.mc-content img{
  max-width:100%;
  height:auto;
  border-radius:14px;
  margin:16px 0;
}

/* ==================== SIDEBAR ==================== */
.mc-sidebar{ width:360px; }

/* ✅ تغییر اصلی: به جای sticky روی .blog-sidebar، sticky روی inner wrapper */
.mc-sidebar{
  position:relative;  /* مرز محدودکننده sticky */
  align-self:start;   /* برای Grid */
}

/* اگر wrapper را طبق توضیح اضافه کنید */
.mc-sidebar__inner{
  position:sticky;
  top:96px;
}

/* ❌ این بخش قبلاً sticky بود؛ الان باید عادی باشد تا تداخل ایجاد نکند */
.blog-sidebar{
  position:static;
  top:auto;
}

.blog-sidebar .widget{
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  margin-bottom:14px;
  box-shadow:0 8px 24px var(--slate-shadow-04);
}

.blog-sidebar .mcw-title{
  margin:0 0 12px;
  font-size:15px;
  font-weight:900;
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:8px;
}
.blog-sidebar .mcw-title::before{
  content:"";
  width:4px;
  height:18px;
  border-radius:999px;
  background:var(--blog-accent, var(--brand));
}

/* Ad boxes */
.mc-adbox{
  border:1px dashed var(--line);
  border-radius:14px;
  height:160px;
  display:grid;
  place-items:center;
  background:var(--shadow-015);
}
.mc-adbox__hint{
  color:var(--muted);
  font-weight:800;
  letter-spacing:.2px;
}

/* Search */
.mc-search__box{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:var(--bg);
}
.mc-search__input{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  min-width:0;
  border:0 !important;
  outline:0 !important;
  background:transparent !important;
  color:var(--ink);
  font-size:14px;
  padding:0 !important;
  margin:0 !important;
  line-height:1.6;
}
.mc-search__input::placeholder{ color:var(--muted); }

.mc-search__btn{
  appearance:none;
  -webkit-appearance:none;
  width:42px;
  height:42px;
  border:0 !important;
  border-radius:0;
  background:transparent !important;
  display:grid;
  place-items:center;
  cursor:pointer;
  padding:0 !important;
  flex:0 0 auto;
}
.mc-search__btn svg{ width:21px; height:21px; fill:var(--muted); }
.mc-search__btn:hover{ border-color:transparent !important; background:transparent !important; }
.mc-search__btn:focus-visible{
  outline:2px solid var(--blog-accent, var(--brand));
  outline-offset:2px;
}

/* Sidebar lists */
.blog-sidebar .mcw-list{
  margin:0;
  padding:0;
  list-style:none;
}
.blog-sidebar .mcw-list li{
  padding:0;
  border-bottom:1px solid var(--line, var(--shadow-06));
}
.blog-sidebar .mcw-list li:last-child{ border-bottom:0; }
.blog-sidebar .mcw-cat-link{
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--ink-soft, var(--ink));
  text-decoration:none;
}
.blog-sidebar .mcw-cat-name{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.blog-sidebar .mcw-cat-name svg{
  width:17px;
  height:17px;
  flex:0 0 auto;
  fill:none;
  stroke:var(--muted);
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.blog-sidebar .mcw-count{
  min-width:28px;
  height:25px;
  padding:0 7px;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  background:var(--surface-muted, var(--shadow-06));
  color:var(--muted);
  font-size:12px;
}
.blog-sidebar .mcw-cat-link:hover,
.blog-sidebar .mcw-cat-link:hover .mcw-cat-name svg{ color:var(--blog-accent, var(--brand)); stroke:var(--blog-accent, var(--brand)); }

/* More read */
.blog-sidebar ul.mc-more{
  margin:0;
  padding:0;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.blog-sidebar li.mc-more__item{ padding:0; border:0; }

.blog-sidebar a.mc-more__link{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:12px;
  align-items:center;
  text-decoration:none;
  color:var(--ink);
  line-height:1.6;
}

.blog-sidebar .mc-more__thumb{
  width:72px;
  height:72px;
  border-radius:14px;
  border:1px solid var(--line);
  overflow:hidden;
  background:var(--shadow-06);
}
.blog-sidebar img.mc-more__img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.blog-sidebar .mc-more__ph{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
}
.blog-sidebar .mc-more__ph svg{ width:18px; height:18px; fill:var(--muted); }

.blog-sidebar .mc-more__title{
  font-size:14px;
  font-weight:700;
  color:var(--ink);
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.blog-sidebar .mc-more__body{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.blog-sidebar .mc-more__date{ color:var(--muted); font-size:11.5px; }
.blog-sidebar a.mc-more__link:hover .mc-more__title{
  color:var(--blog-accent, var(--brand));
}
.blog-sidebar .mcw-special img,
.blog-sidebar .mcw-special iframe{
  display:block;
  max-width:100%;
  height:auto;
  border-radius:12px;
}

/* Per-post contextual widget */
.mc-post-widget{
  position:relative;
  margin:28px 0;
  padding:20px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface-muted, var(--bg));
  overflow:hidden;
}
.mc-post-widget__label{
  display:block;
  margin-bottom:12px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.mc-post-widget__content img,
.mc-post-widget__content iframe{ display:block; max-width:100%; height:auto; margin:0 auto; }

/* ==================== RELATED COUPONS (END) ==================== */
.mc-related{
  max-width:1200px;
  margin:26px auto 0;
  padding:0 22px;
}
.mc-related__head{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-end;
  justify-content:space-between;
  margin-bottom:12px;
}
.mc-related__title{
  margin:0;
  font-size:20px;
  font-weight:900;
  color:var(--ink);
  border-right:3px solid var(--blog-accent, var(--brand));
  padding-right:10px;
}
.mc-related__more{
  text-decoration:none;
  font-weight:900;
  color:var(--blog-accent, var(--brand));
}

.mc-coupon-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:12px;
}
.mc-coupon-card{
  display:flex;
  flex-direction:column;
  gap:10px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background:var(--bg);
  text-decoration:none;
  color:var(--ink);
  box-shadow:0 10px 22px var(--slate-shadow-04);
  transition:transform .15s, box-shadow .15s, border-color .15s;
}
.mc-coupon-card:hover{
  transform:translateY(-2px);
  border-color:var(--blog-accent, var(--brand));
  box-shadow:0 16px 30px var(--slate-shadow-08);
}
.mc-coupon-card__title{
  font-weight:900;
  font-size:14px;
  line-height:1.7;
}
.mc-coupon-card__desc{
  color:var(--muted);
  font-size:13px;
  line-height:1.9;
  min-height:50px;
}
.mc-coupon-card__cta{
  margin-top:auto;
  font-weight:900;
  color:var(--blog-accent, var(--brand));
}

/* ==================== AUTHOR BOX ==================== */
.mc-author{
  margin-top:8px;
}
.mc-author__box{
  display:flex;
  gap:14px;
  align-items:flex-start;
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  background:var(--bg);
  box-shadow:0 10px 24px var(--slate-shadow-05);
}
.mc-author__avatarwrap{
  flex:0 0 auto;
  display:block;
}
.mc-author__avatar{
  width:72px;
  height:72px;
  border-radius:18px;
  border:1px solid var(--line);
}
.mc-author__body{ min-width:0; }
.mc-author__top{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:6px;
}
.mc-author__name{
  text-decoration:none;
  font-weight:900;
  color:var(--ink);
}
.mc-author__role{
  font-weight:900;
  font-size:12px;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 10px;
}
.mc-author__bio{
  margin:0 0 10px;
  color:var(--muted);
  font-size:13.5px;
  line-height:1.95;
}
.mc-author__links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.mc-author__link{
  text-decoration:none;
  font-weight:900;
  color:var(--blog-accent, var(--brand));
}

/* ==================== FOOTER ==================== */
.mc-footer{
  display:flex;
  flex-direction:column;
  gap:18px;
  margin-top:26px;
}

.mc-postnav{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin:24px 0;
}
.mc-postnav a{
  text-decoration:none;
  color:var(--blog-accent, var(--brand));
  font-weight:900;
}
/* Ads: no box, just spacing */
.mc-single .mc-ad{ margin:20px 0; overflow:hidden; border-radius:14px; }
.mc-single .mc-ad img{ display:block; width:100%; height:auto; margin:0; border-radius:14px; }
.mc-single .mc-ad iframe{ display:block; max-width:100%; margin:0 auto; }
.mc-single .mc-ad--single-top{ margin:0 0 24px; }
.mc-single .mc-ad--inline{ margin:28px 0; }

/* sr-only label used in sidebar */
.mc-single .mc-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;
}
.mc-single .mc-ad > *{ margin: 0 0 12px; }
.mc-single .mc-ad > *:last-child{ margin-bottom: 0; }



/* ==================== GUTENBERG TABLE + SEPARATOR FIX ==================== */

/* حذف خطوط جداکننده وردپرس */
.mc-single .wp-block-separator,
.mc-content .wp-block-separator{
  display:none;
}

/* جدول های مقاله */
.mc-content .wp-block-table{
  margin:24px 0 32px;
}

.mc-content .wp-block-table table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:var(--bg);
}

/* حذف استایل پیش فرض Gutenberg */
.mc-content .wp-block-table th,
.mc-content .wp-block-table td{
  border:0;
  border-bottom:1px solid var(--line);
  padding:14px 16px;
  text-align:right;
  vertical-align:middle;
  line-height:1.9;
}

/* هدر جدول */
.mc-content .wp-block-table th{
  background:var(--surface-warm);
  font-weight:900;
}

/* حذف خط آخر جدول */
.mc-content .wp-block-table tr:last-child td{
  border-bottom:0;
}

/* حذف خطوط عمودی جدول */
.mc-content .wp-block-table td + td,
.mc-content .wp-block-table th + th{
  border-right:0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width:1100px){
  .mc-layout{ grid-template-columns:minmax(0,1fr) 330px; }
  .mc-sidebar{ width:330px; }
  .mc-coupon-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media (max-width:992px){
  .mc-layout{ grid-template-columns:1fr; }
  .mc-sidebar{ width:100%; }

  /* موبایل: sticky خاموش */
  .mc-sidebar__inner{
    position:static;
    top:auto;
  }

  .mc-coupon-grid{ grid-template-columns:1fr; }
}
