.an-single{
  --an-single-max: 980px;
  --an-single-radius: 16px;
  --an-single-shadow: none;
  --an-font: "IRANSansX", Tahoma, Arial, sans-serif;
  font-family: var(--an-font);
  padding: 24px 16px 60px;
  display: flex;
  justify-content: center;
}
.an-single .an-entry{ width: 100%; max-width: var(--an-single-max); }
.an-media{ overflow:hidden; margin:0 auto 20px; background:#000; }
.an-media iframe, .an-media video, .an-media img{ width:100%; height:100%; display:block; object-fit:cover; border:0; }
.an-r-16x9{ aspect-ratio:16 / 9; }
.an-r-4x3{  aspect-ratio:4 / 3; }
.an-r-1x1{  aspect-ratio:1 / 1; }
.an-r-auto img{ height:auto; }
.an-head{ margin: 8px 0 10px; }
.an-title{ font-size: clamp(22px, 2.3vw, 32px); margin:0; color:#0f172a; }
.an-sub{ display:flex; gap:12px; align-items:center; color:#6b7280; margin-top:6px; font-size:14px; }
.an-type{ padding:2px 8px; border-radius:999px; background:#e5e7eb; color:#0f172a; }
.an-type.is-video{ background:#e8f7ee; color:#117a36; }
.an-type.is-image{ background:#e8f4fb; color:#0b6390; }

.an-content{ color:#0f172a; font-size:16px; line-height:1.9; }
.an-content p{ margin: 0 0 1em; }

.an-reactions{ display:flex; align-items:center; gap:10px; margin:18px 0; }
.an-reactions button{ border:0; background:#f3f4f6; padding:8px 12px; border-radius:10px; cursor:pointer; }
.an-reactions button.is-active{ background:#e0ecff; }
.an-reactions .v{ font-weight:600; margin-inline-start:4px; }

.an-share{ display:flex; align-items:center; gap:10px; margin:22px 0; flex-wrap:wrap; }
.an-share span{ color:#6b7280; }
.an-share a, .an-share button{ border:0; background:#eef2ff; color:#223; padding:8px 12px; border-radius:999px; cursor:pointer; text-decoration:none; }
.an-share .an-copy{ background:#f3f4f6; }

.an-comments{ margin-top:30px; }
.an-comments h3{ margin:0 0 12px; }

@media (max-width: 640px){
  .an-single{ padding:16px 10px 40px; }
}
/* Hide stray close buttons when components are closed */
.an-modal:not(.is-open) .close{display:none !important;}
.an-reader:not(.is-open) .an-r-close{display:none !important;}
/* ===== Anamis Single – polish ===== */
.an-ss-wrap{
  --an-font: "IRANSansX", IRANSans, Tahoma, Arial, sans-serif;
  --an-text: #0f172a;
  font-family: var(--an-font);
  color: var(--an-text);
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.an-ss-media{
  border-radius:16px;
  overflow:hidden;
  background:#000;
  box-shadow:0 10px 28px rgba(2,6,23,.08);
}
.an-ss-media iframe,
.an-ss-media video,
.an-ss-media img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio: var(--an-aspect, 16/9);
  object-fit: contain;
}

.an-ss-head{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin:14px 0 8px;
}
.an-ss-badge{
  font-size:12px;
  padding:.35rem .7rem;
  border-radius:999px;
  color:#fff;
  background:#0ea5e9;
}
.an-ss-badge.is-video{ background:#16a34a; }
.an-ss-badge.is-podcast{ background:#ef4444; }

.an-ss-title{
  margin:0;
  font-weight:800;
  font-size:clamp(22px, 3.2vw, 32px);
}

.an-ss-content{
  line-height:2.1;
  color:#334155;
  background:#fff;
  border:1px solid rgba(2,6,23,.06);
  border-radius:16px;
  padding:18px 20px;
  box-shadow:0 6px 18px rgba(2,6,23,.06);
}

.an-ss-stats{
  display:flex;
  align-items:center;
  gap:10px;
  margin:14px 0 6px;
  color:#475569;
}
.an-ss-stats a{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#f1f5f9;
  border:1px solid rgba(2,6,23,.06);
  padding:6px 10px;
  border-radius:999px;
  transition:.15s transform ease;
}
.an-ss-stats a:hover{ transform:translateY(-1px); }
.an-ss-stats a.is-active{ background:#111827; color:#fff; }

.an-ss-share{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin:12px 0 0;
}
.an-ss-share > span{ color:#64748b; }
.an-ss-share .copy-link,
.an-ss-share .tg,
.an-ss-share .wa{
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 12px; border-radius:10px; text-decoration:none;
  border:1px solid rgba(2,6,23,.08); color:#fff;
}
.an-ss-share .copy-link{ background:#334155; }
.an-ss-share .tg{ background:#229ED9; }
.an-ss-share .wa{ background:#25D366; }

/* Comments / Respond form */
.an-ss-wrap #comments,
.an-ss-wrap .comment-respond{ margin-top:24px; }
.an-ss-wrap .comment-respond h3{ font-size:20px; margin-bottom:8px; }
.an-ss-wrap .comment-form textarea,
.an-ss-wrap .comment-form input[type="text"],
.an-ss-wrap .comment-form input[type="email"]{
  width:100%;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:10px 12px;
}
.an-ss-wrap .comment-form p{ margin-bottom:12px; }
.an-ss-wrap .form-submit input[type="submit"]{
  background:#1f2937; color:#fff; border:none;
  padding:10px 16px; border-radius:12px; cursor:pointer;
  transition:.15s filter ease;
}
.an-ss-wrap .form-submit input[type="submit"]:hover{ filter:brightness(1.08); }

/* Small screens */
@media (max-width:700px){
  .an-ss-content{ padding:14px 16px; }
  .an-ss-share{ gap:6px; }
}
/***دیدگاها***
/* ====== Anamis Single – Comments (Polished RTL) ====== */
.an-ss-wrap,
.an-ss-comments{
  --c-text: #0f172a;
  --c-muted:#64748b;
  --c-card:#fff;
  --c-line: rgba(2,6,23,.08);
  --c-shadow: 0 8px 20px rgba(2,6,23,.06);
  --c-pill:#f1f5f9;
  --c-accent:#1f2937;
  --rad:14px;
}

/* فاصله‌های بلوک دیدگاه و فرم */
.an-ss-wrap #comments,
.an-ss-comments #comments,
.an-ss-wrap .comment-respond,
.an-ss-comments .comment-respond{ margin-top:26px; }

/* تیترها */
.an-ss-wrap #comments > .title-comments,
.an-ss-wrap #comments > h2,
.an-ss-comments #comments > h2,
.an-ss-wrap .comment-reply-title,
.an-ss-comments .comment-reply-title{
  margin:0 0 12px;
  font-size:20px;
  font-weight:800;
  color:var(--c-text);
}

/* لیست به صورت گریدِ تمیز */
.an-ss-wrap .comment-list,
.an-ss-comments .comment-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:12px;
}

/* کارت هر نظر */
.an-ss-wrap .comment .comment-body,
.an-ss-comments .comment .comment-body{
  background:var(--c-card);
  border:1px solid var(--c-line);
  border-radius:var(--rad);
  padding:16px 18px;
  box-shadow:var(--c-shadow);
  color:var(--c-text);
}

/* هدر کارت: آواتار، نام، زمان */
.an-ss-wrap .comment .comment-author,
.an-ss-comments .comment .comment-author{
  display:flex;
  align-items:center;
  gap:10px;
  line-height:1;
  font-weight:700;
  color:var(--c-text);
}
.an-ss-wrap .comment .comment-author img.avatar,
.an-ss-comments .comment .comment-author img.avatar{
  width:40px; height:40px; border-radius:50%; object-fit:cover;
  flex:0 0 auto;
  box-shadow:0 2px 8px rgba(2,6,23,.08);
}
.an-ss-wrap .comment .comment-metadata,
.an-ss-comments .comment .comment-metadata{
  margin-top:6px;
  font-size:12px; color:var(--c-muted);
}
.an-ss-wrap .comment .comment-metadata a,
.an-ss-comments .comment .comment-metadata a{
  color:var(--c-muted); text-decoration:none;
}

/* متن */
.an-ss-wrap .comment .comment-content,
.an-ss-comments .comment .comment-content{
  margin-top:8px;
  color:#334155; line-height:2;
}
.an-ss-wrap .comment .comment-content p,
.an-ss-comments .comment .comment-content p{ margin:0 0 .9em; }

/* برچسب نویسنده پست */
.an-ss-wrap .bypostauthor > .comment-body .comment-author .fn::after,
.an-ss-comments .bypostauthor > .comment-body .comment-author .fn::after{
  content:"نویسنده";
  font-weight:600;
  font-size:11px;
  margin-inline-start:8px;
  padding:.2rem .5rem;
  border-radius:999px;
  background:#e8f7ee;
  color:#117a36;
}

/* لینک پاسخ */
.an-ss-wrap .comment .reply a,
.an-ss-comments .comment .reply a{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--c-pill);
  color:var(--c-text);
  text-decoration:none;
  border:1px solid var(--c-line);
  padding:6px 10px;
  border-radius:999px;
  font-size:13px;
  transition:transform .15s ease, filter .15s ease;
}
.an-ss-wrap .comment .reply a:hover,
.an-ss-comments .comment .reply a:hover{ transform:translateY(-1px); filter:brightness(1.03); }

/* درخت پاسخ‌ها: خط راهنما + فاصله */
.an-ss-wrap .children,
.an-ss-comments .children{
  list-style:none;
  margin:10px 0 0;
  padding-right:14px;            /* RTL */
  display:grid; gap:10px;
  position:relative;
}
.an-ss-wrap .children::before,
.an-ss-comments .children::before{
  content:"";
  position:absolute;
  inset-inline-start:0;          /* راست در RTL */
  top:4px; bottom:4px;
  width:2px; background:var(--c-line);
  border-radius:2px;
}

/* پیام در صف بررسی */
.an-ss-wrap .comment-awaiting-moderation,
.an-ss-comments .comment-awaiting-moderation{
  display:inline-block;
  margin-top:6px;
  font-size:12px; color:#b45309;
  background:#fff7ed;
  border:1px dashed #fdba74;
  padding:4px 8px; border-radius:8px;
}

/* فرم ارسال نظر */
.an-ss-wrap .comment-respond,
.an-ss-comments .comment-respond{
  background:var(--c-card);
  border:1px solid var(--c-line);
  border-radius:16px;
  padding:18px 20px;
  box-shadow:var(--c-shadow);
}
.an-ss-wrap .comment-form p,
.an-ss-comments .comment-form p{ margin-bottom:12px; }
.an-ss-wrap .comment-form textarea,
.an-ss-wrap .comment-form input[type="text"],
.an-ss-wrap .comment-form input[type="email"],
.an-ss-wrap .comment-form input[type="url"],
.an-ss-comments .comment-form textarea,
.an-ss-comments .comment-form input[type="text"],
.an-ss-comments .comment-form input[type="email"],
.an-ss-comments .comment-form input[type="url"]{
  width:100%;
  background:#f8fafc; color:var(--c-text);
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:10px 12px;
}
.an-ss-wrap .comment-form textarea:focus,
.an-ss-wrap .comment-form input:focus,
.an-ss-comments .comment-form textarea:focus,
.an-ss-comments .comment-form input:focus{
  outline:2px solid #bfdbfe; outline-offset:1px;
  border-color:#93c5fd;
}
.an-ss-wrap .form-submit input[type="submit"],
.an-ss-comments .form-submit input[type="submit"]{
  background:var(--c-accent); color:#fff; border:none;
  padding:10px 16px;
  border-radius:12px;
  cursor:pointer;
  transition:filter .15s ease, transform .15s ease;
}
.an-ss-wrap .form-submit input[type="submit"]:hover,
.an-ss-comments .form-submit input[type="submit"]:hover{
  filter:brightness(1.06); transform:translateY(-1px);
}

/* ناوبری صفحات دیدگاه */
.an-ss-wrap #comments .navigation,
.an-ss-comments #comments .navigation{
  display:flex; gap:8px; flex-wrap:wrap; margin-top:10px;
}
.an-ss-wrap #comments .navigation a,
.an-ss-comments #comments .navigation a{
  background:var(--c-pill); border:1px solid var(--c-line);
  padding:6px 10px; border-radius:999px; text-decoration:none; color:var(--c-text);
}

/* فیکس RTL: بعضی تم‌ها پدینگ راست را صفر می‌کنند */
.an-ss-wrap #comments .comment .comment-body,
.an-ss-comments #comments .comment .comment-body{
  padding-inline-start:18px;  /* راست در RTL */
  padding-inline-end:18px;    /* چپ در RTL */
}

/* موبایل */
@media (max-width:700px){
  .an-ss-wrap .comment .comment-author img.avatar,
  .an-ss-comments .comment .comment-author img.avatar{ width:36px; height:36px; }
  .an-ss-wrap .comment .comment-body,
  .an-ss-comments .comment .comment-body{ padding:12px 14px; }
}
/* ===== Fix avatar overlap in comments (RTL safe) ===== */

/* 1) خنثی کردن قوانین قالب: نه float، نه position عجیـب */
.an-ss-wrap .comment .comment-author img.avatar,
.an-ss-comments .comment .comment-author img.avatar{
  float:none !important;
  position:static !important;
  margin:0 !important;
}

/* 2) هدر نظر را فلکس می‌کنیم تا آواتار و نام درست کنار هم بنشینند */
.an-ss-wrap .comment .comment-author,
.an-ss-comments .comment .comment-author{
  display:flex;
  align-items:center;
  gap:10px;              /* فاصله بین آواتار و نام */
  line-height:1;
  flex-wrap:nowrap;
}

/* 3) اندازه و رفتار آواتار (حتی اگر خالی/پیش‌فرض باشد) */
.an-ss-wrap .comment .comment-author img.avatar,
.an-ss-comments .comment .comment-author img.avatar{
  flex:0 0 40px;         /* عرض ثابت */
  inline-size:40px;      /* معادل width؛ سازگار با RTL */
  block-size:40px;       /* معادل height */
  border-radius:50%;
  object-fit:cover;
  background:#e5e7eb;    /* پس‌زمینه‌ی خنثی برای آواتار پیش‌فرض */
  box-shadow:0 2px 8px rgba(2,6,23,.08);
}

/* 4) نام کاربر کوتاه‌سازی ایمن (تا نَرود زیر آواتار) */
.an-ss-wrap .comment .comment-author .fn,
.an-ss-comments .comment .comment-author .fn{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-inline-size:100%;
}

/* 5) واژه «گفت» را در صورت مزاحمت مخفی کن (اختیاری) */
.an-ss-wrap .comment .comment-author .says,
.an-ss-comments .comment .comment-author .says{ display:none; }

/* 6) نسخهٔ موبایل: کمی کوچک‌تر */
@media (max-width:700px){
  .an-ss-wrap .comment .comment-author img.avatar,
  .an-ss-comments .comment .comment-author img.avatar{
    inline-size:36px; block-size:36px;
  }
}
