:root{
  --bg0:#070912;
  --bg1:#0b1020;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.085);
  --stroke:rgba(255,255,255,.10);
  --stroke2:rgba(255,255,255,.16);
  --txt:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.62);
  --a:#8b5cf6;
  --b:#22d3ee;
  --c:#fb7185;
  --g:#34d399;
  --r:18px;
  --r2:24px;
  --shadow: 0 16px 60px rgba(0,0,0,.55);
  --w: 1180px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: Sahel, system-ui, -apple-system, "Segoe UI", Arial;
  color:var(--txt);
  background:
    radial-gradient(900px 600px at 85% 10%, rgba(139,92,246,.22), transparent 60%),
    radial-gradient(900px 600px at 20% 20%, rgba(34,211,238,.16), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(251,113,133,.10), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* ===== Rate Buttons: Green / Red ===== */
.rate-box{display:inline-flex; gap:8px; align-items:center}
.rate-button-box.rate-up .rate-button{
  border-color: rgba(52, 211, 153, .32);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, rgba(52,211,153,.22), rgba(34,211,238,.12));
  color: rgba(255,255,255,.92);
}
.rate-button-box.rate-down .rate-button{
  border-color: rgba(251, 113, 133, .34);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(135deg, rgba(251,113,133,.24), rgba(139,92,246,.10));
  color: rgba(255,255,255,.92);
}
.rate-button-box.rate-up .rate-button:hover{
  filter:saturate(1.08);
  transform: translateY(-1px);
}
.rate-button-box.rate-down .rate-button:hover{
  filter:saturate(1.08);
  transform: translateY(-1px);
}
/* اگر کاربر رأی داده بود یه حالت پررنگ‌تر */
.rate-box.rated .rate-button{
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}

html{
  min-height: 100%;
  background:
    radial-gradient(900px 600px at 85% 10%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(900px 600px at 20% 20%, rgba(34, 211, 238, .16), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(251, 113, 133, .10), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-repeat: no-repeat;
  background-attachment: fixed; /* مهم: دیگه “بالا” نمی‌شکنه */
}

body{
  background: transparent; /* بک‌گراند اصلی از html میاد */
  min-height: 100%;
}

/* هاله‌ی نور (بدون خط افتادن روی پست‌ها) */
body:before{
  content:"";
  position:fixed;
  inset:-20%;
  pointer-events:none;
  background:
    radial-gradient(closest-side at 70% 25%, rgba(34,211,238,.10), transparent 65%),
    radial-gradient(closest-side at 25% 35%, rgba(139,92,246,.12), transparent 62%),
    radial-gradient(closest-side at 60% 80%, rgba(251,113,133,.10), transparent 60%);
  filter: blur(18px);
  opacity:.9;
  z-index:0;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; height:auto; display:block}
.muted{color:var(--muted)}
.hide{display:none}

/* Topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(14px);
  background: rgba(7,9,18,.55);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.topbar__in{
  max-width:var(--w);
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 180px;
}

.brand__mark{
  width:38px;height:38px;
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(135deg, rgba(139,92,246,.85), rgba(34,211,238,.75));
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
  display:flex;align-items:center;justify-content:center;
  font-weight:900;
}

.brand__txt{display:flex;flex-direction:column;line-height:1.15}
.brand__title{font-weight:900; letter-spacing:-.2px}
.brand__tag{font-size:12px;color:var(--muted)}

.nav ul{
  list-style:none;
  margin:0;padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.nav a{
  display:inline-flex;
  align-items:center;
  padding:9px 12px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color:rgba(255,255,255,.85);
  font-size:13px;
  transition:.18s ease;
}

.nav a:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
}

.nav a.selected{
  border-color: transparent;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, rgba(139,92,246,.65), rgba(34,211,238,.55));
  color:white;
}

/* Layout */
.shell{
  position:relative;
  z-index:1;
  max-width:var(--w);
  margin:0 auto;
  padding:18px 16px 40px;
  display:grid;
  grid-template-columns: 1fr 340px;
  gap:18px;
}
@media (max-width: 980px){
  .shell{grid-template-columns:1fr}
}

.card{
  border-radius: var(--r2);
  background: var(--card);
  border:1px solid rgba(255,255,255,.09);
  box-shadow: var(--shadow);
}

.card--soft{
  background: rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 38px rgba(0,0,0,.35);
}

/* Featured (آخرین پست) */
.featured{
  padding:16px;
  overflow:hidden;
  position:relative;
}
.featured:before{
  content:"";
  position:absolute;
  inset:-40px -50px auto auto;
  width:340px;height:340px;
  background: radial-gradient(circle at 30% 30%, rgba(34,211,238,.25), transparent 60%);
  filter: blur(10px);
  opacity:.9;
  pointer-events:none;
}

.featured__kicker{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.featured__kicker .label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.86);
  font-size:12px;
  white-space:nowrap;
}

.featured__kicker .quote{
  font-size:12px;
  color:var(--muted);
  text-align:left;
}

.featured__title{
  font-size:22px;
  margin:10px 0 8px;
  letter-spacing:-.2px;
  line-height:1.5;
}

.featured__meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
  margin-bottom:10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.82);
  font-size:12px;
  white-space:nowrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(135deg, rgba(139,92,246,.65), rgba(34,211,238,.55));
  color:white;
  font-weight:800;
  font-size:13px;
  transition:.18s ease;
}
.btn:hover{transform: translateY(-1px); filter:saturate(1.05)}

.clamp{
  display:-webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow:hidden;
  line-height: 2;
  color: rgba(255,255,255,.86);
}

/* Messages */
.msg{
  margin-top:14px;
  padding:12px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.86);
}
.item_err{border-color: rgba(251,113,133,.35)}
.item_success{border-color: rgba(52,211,153,.30)}
.item_wrn{border-color: rgba(250,204,21,.22)}

/* Post list grid */
.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media (min-width: 760px){
  .grid{grid-template-columns: 1fr 1fr}
}

.post{
  padding:14px;
  border-radius: var(--r2);
  background: rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.08);
  position:relative;
  overflow:hidden;
}
.post:hover{
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.055);
}

.post__img{
  border-radius: 16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  margin-bottom:12px;
  background: rgba(255,255,255,.02);
}

.post__t{
  margin:0 0 8px;
  font-size:16px;
  line-height:1.8;
  letter-spacing:-.15px;
}

.post__meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
  margin-bottom:10px;
}

.post__foot{
  margin-top:12px;
  display:flex;
  justify-content:end;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Single */
.single{
  margin-top:14px;
  padding:16px;
}

.single__kicker{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.chips{display:flex; gap:8px; flex-wrap:wrap}

.chip{
  display:inline-flex;
  align-items:center;
  padding:7px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.84);
  font-size:12px;
  white-space:nowrap;
}
.chip:hover{
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

.single__t{
  margin: 6px 0 12px;
  font-size:24px;
  line-height:1.9;
  letter-spacing:-.25px;
}

.single__content{
  color: rgba(255,255,255,.88);
  line-height:2.2;
  font-size:15px;
}

/* تگ‌های داخل متن */
.single__content a{color: rgba(34,211,238,.95)}
.single__content img{border-radius: 16px; border:1px solid rgba(255,255,255,.10)}
.single__content blockquote{
  margin:16px 0;
  padding:12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.86);
}

/* Single bar (همه در یک سطر) */
.single__bar{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.08);
}
.single__bar .group{display:flex; gap:8px; align-items:center; flex-wrap:wrap}

/* Rating (موافق/مخالف) */
.rate-box{display:inline-flex; gap:8px; align-items:center}
.rate-button-box{}
.rate-button{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.86);
  font-size:12px;
}
.rate-button:hover{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16)}
.rateimg{display:none}

/* Comments */
.comments__hdr{
  margin-top:18px;
  padding:12px 14px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.cmt{
  margin-top:12px;
  padding:12px 14px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
}

.cmt__top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
  margin-bottom:10px;
}

.cmt__who{
  display:flex;
  gap:10px;
  align-items:center;
  color: rgba(255,255,255,.86);
  font-weight:800;
}

.cmt__who img{
  width:30px;height:30px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10)
}

.cmt__body{line-height:2; color: rgba(255,255,255,.86)}

.reply{
  margin-top:10px;
  padding:10px 12px;
  border-radius: 16px;
  background: rgba(34,211,238,.06);
  border:1px solid rgba(34,211,238,.18);
  color: rgba(255,255,255,.86);
  line-height:2;
}

/* Sidebar widgets */
.widget{ padding:14px; margin-bottom:14px; }

.widget__title{
  margin:0 0 10px;
  font-size:13px;
  color: rgba(255,255,255,.86);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.widget__title:after{
  content:"";
  flex:1;
  height:1px;
  background: linear-gradient(90deg, rgba(255,255,255,.18), transparent);
  opacity:.65;
  margin-right:10px;
}

.about{
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.about__img{
  width:64px;
  height:64px;
  border-radius: 18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  flex:0 0 auto;
}

.about__txt{
  line-height:2;
  color: rgba(255,255,255,.84);
  font-size:13px;
  margin:0 auto;
}

.mini{ margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }

.list{
  list-style:none;
  padding:0;margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.rowlink{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 10px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

.rowlink:hover{background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12)}

.rowlink .name{
  color: rgba(255,255,255,.86);
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.rowlink .count{
  color: rgba(255,255,255,.70);
  font-size:12px;
  white-space:nowrap
}

/* آرشیو: فقط ۱۰ مورد */
.archiveList li:nth-child(n+11){display:none}

/* Tag cloud */
.tags{display:flex;flex-wrap:wrap;gap:8px}

.tags a{
  display:inline-flex;
  padding:7px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.84);
  font-size:12px;
}

.tags a:hover{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16)}

.tags a.selected{
  background: rgba(139,92,246,.22);
  border-color: rgba(139,92,246,.35);
}

/* Pagination */
.pager{
  margin-top:16px;
  padding:12px 14px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.pages{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.pages a,.pages span{
  min-width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.86);
  font-size:13px;
}

.pages a:hover{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16)}

.pages a.current{
  border-color: transparent;
  background: linear-gradient(135deg, rgba(139,92,246,.55), rgba(34,211,238,.50));
}

.dots{opacity:.8}

/* Footer */
footer{
  position:relative;
  z-index:1;
  max-width:var(--w);
  margin:10px auto 40px;
  padding:0 16px;
  color: rgba(255,255,255,.60);
  font-size:12px;
}

.foot{
  padding:14px 16px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* =========================================================
   ✅ FIXES FOR MOBILE: single layout + overflow + topbar symmetry
   (اضافه شده)
   ========================================================= */

/* 1) Mobile Topbar Fix */
@media (max-width: 720px){
  .topbar__in{
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
  }

  .brand{
    min-width: 0;
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .brand__txt{align-items:center}

  .nav{width:100%}

  .nav ul{
    justify-content: center;
    gap: 8px;
  }

  .nav a{
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* 2) Mobile Overflow Fix: pills & chips */
@media (max-width: 720px){
  .pill,
  .chip{
    max-width: 100%;
    white-space: normal; /* مهم */
    line-height: 1.7;
  }

  .post__meta,
  .featured__meta,
  .single__kicker,
  .chips{
    gap: 6px;
  }

  .featured__kicker{
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .featured__kicker .quote{
    text-align: center;
  }
}

/* 3) Single Content: Hard Overflow Protection */
.single{
  overflow: hidden; /* جلوی بیرون‌زدن عناصر */
}

.single__content{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* تصاویر و مدیا داخل پست */
.single__content img,
.single__content video{
  max-width: 100%;
  height: auto;
}

/* iframe / embed */
.single__content iframe,
.single__content embed,
.single__content object{
  max-width: 100%;
}

/* جدول‌ها */
.single__content table{
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* کدها */
.single__content pre,
.single__content code{
  max-width: 100%;
}

.single__content pre{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}

/* هر عنصر داخل محتوا، نهایتاً از عرض بیشتر نشه */
.single__content *{
  max-width: 100%;
}

/* 4) Mobile Spacing Polishing */
@media (max-width: 720px){
  .shell{
    padding: 14px 12px 34px;
    gap: 14px;
  }

  .single{
    padding: 14px;
  }

  .single__t{
    font-size: 20px;
  }

  .single__content{
    font-size: 14px;
    line-height: 2.05;
  }

  .post{
    padding: 12px;
  }

  .pages a, .pages span{
    min-width: 34px;
    height: 34px;
  }
}
																																													/* =========================================================
   ✅ SINGLE PAGE MOBILE FIX (alignment + overflow)
   فقط برای سینگل‌ها روی موبایل
   ========================================================= */
@media (max-width: 720px){

  /* 0) جلوگیری از بیرون‌زدن کلی */
  html, body{ overflow-x: hidden; }
  .shell, main, article, .single{ max-width: 100vw; }

  /* 1) کیکر بالای سینگل (chips + تاریخ) وسط‌چین و ستونی */
  .single__kicker{
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
  }

  .chips{
    width: 100%;
    justify-content: center;
  }

  /* چیپ‌ها و pill ها روی موبایل wrap واقعی داشته باشن */
  .chip,
  .pill{
    max-width: 100%;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* 2) عنوان و محتوای سینگل دقیقاً وسط‌چین نشه؟ (RTL بهتر: متن راست، باکس وسط) */
  .single__t{
    width: 100%;
    text-align: right;
  }

  .single__content{
    width: 100%;
    text-align: right;
  }

  /* 3) bar پایین سینگل (بازدید/موافق/مخالف) — روی موبایل ستونی و بدون فشار */
  .single__bar{
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
  }

  .single__bar .group{
    width: 100%;
    justify-content: center;
  }

  /* 4) دکمه‌های موافق/مخالف معمولاً باعث overflow می‌شن */
  .rate-box{
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .rate-button{
    white-space: normal !important;
    max-width: 100%;
    text-align: center;
  }

  /* 5) هدر نظرات (نظرات + تعداد) — وسط‌چین و ستونی */
  .comments__hdr{
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
  }

  /* 6) بالای هر کامنت (اسم + تاریخ) — ستونی تا بیرون نزنه */
  .cmt__top{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cmt__top .pill{
    align-self: flex-start;
  }

  /* 7) مورد مهم در flex: اجازه بده بچه‌ها کوچیک بشن */
  .single__kicker > *,
  .single__bar > *,
  .cmt__top > *,
  .post__meta > *{
    min-width: 0;
  }
}

/* =========================================================
   ✅ EXTRA: جلوگیری از overflow داخل محتوای پست (همه صفحات)
   ========================================================= */
.single__content{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.single__content img,
.single__content video{
  max-width: 100%;
  height: auto;
}

.single__content iframe,
.single__content embed,
.single__content object{
  max-width: 100%;
}

.single__content table{
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.single__content pre{
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}
@media (max-width: 720px){
  /* مطمئن شو چیزی 100vw نشده که با padding بجنگه */
  .shell, main, aside, article, .card{
    width: 100%;
    max-width: 100%;
  }

  /* خود کارت سینگل دقیقاً هم‌تراز با پدینگ شل */
  article.card.single{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* خیلی مهم برای Grid/Flex: اجازه بده بچه‌ها جمع بشن */
  main, aside{
    min-width: 0;
  }
}
/* ✅ Fix: single card alignment on mobile (no left cut / no mis-align) */
.single{
  overflow-x: hidden;   /* فقط افقی رو ببند */
  overflow-y: visible;  /* عمودی باز باشه */
  width: 100%;
  margin: 14px auto 0;  /* وسط‌چین */
}

