/* ===================================================
   VIO Comment Style - vioweb.ir
   استایل سفارشی بخش دیدگاه‌ها - وردپرس
   رنگ‌ها از طریق متغیرهای --vio-* و از پنل تنظیمات افزونه تعیین می‌شوند
   (مقدار دوم در var() همان پیش‌فرض است)
   =================================================== */


/* =============================================
   ۱. جابجایی فرم به بالای کامنت‌ها
   ============================================= */
#comments {
  display: flex;
  flex-direction: column;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px;
}
h2.title-comments {
  font-size: 20px;
  font-weight: 800;
}
#comments {
    max-width: 100%;
}
.comment-body {
    padding: 18px 50px 14px 20px !important;
}
#comments .avatar {
    margin: 5px 5px 0 0 !important;;
}
.comment-body img {
  margin-right: 13px;
}
/* فرم ابتدا نمایش داده شود */
#comments #respond {
  order: -1;
}

/* لیست کامنت‌ها بعد از فرم */
#comments .comments-title,
#comments ol.comment-list {
  order: 1;
}

/* =============================================
   ۲. بخش فرم دیدگاه
   ============================================= */

/* عنوان فرم */
#respond .comment-reply-title,
#respond #reply-title {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: right;
  margin: 0 0 6px 0;
  display: block;
}

/* زیرنویس فرم */
#respond .comment-notes,
#respond .must-log-in,
#respond .logged-in-as {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 13px;
  color: #888;
  text-align: right;
  margin-bottom: 22px;
  display: block;
}

#respond .comment-notes .required-field-message {
  color: #888;
}

/* مخفی کردن label ها */
#respond label {
  display: none !important;
}

/* چک‌باکس ذخیره اطلاعات (اگر از تنظیمات فعال شود) باید دیده شود */
#respond .comment-form-cookies-consent label {
  display: inline !important;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 13px;
  color: #666;
}

/* wrapper ردیف‌های فرم */
#respond .comment-form-author,
#respond .comment-form-email,
#respond .comment-form-url,
#respond .comment-form-comment {
  margin-bottom: 12px;
  position: relative;
}

/* =============================================
   ۳. استایل Input‌ها با آیکون دایره رنگی
   ============================================= */

#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  width: 100%;
  box-sizing: border-box;
  background: #f8f8f8;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 13px 46px 13px 16px;
  font-size: 14px;
  color: #333;
  direction: rtl;
  text-align: right;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

#respond input[type="text"]:focus,
#respond input[type="email"]:focus,
#respond input[type="url"]:focus,
#respond textarea:focus {
  border-color: var(--vio-focus, #7C3AED);
  background: #fff;
  box-shadow: 0 0 0 3px var(--vio-focus-ring, rgba(124, 58, 237, 0.1));
}

#respond input::placeholder,
#respond textarea::placeholder {
  color: #aaa;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* دایره رنگی کنار فیلدها (نام، ایمیل، وب‌سایت) */
#respond .comment-form-author::after,
#respond .comment-form-email::after,
#respond .comment-form-url::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vio-icon, #F59E0B);
  pointer-events: none;
}

/* textarea دیدگاه */
#respond textarea#comment {
  min-height: 140px;
  resize: vertical;
  padding: 13px 46px 13px 16px;
}

/* دایره رنگی فیلد دیدگاه */
#respond .comment-form-comment::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vio-icon, #F59E0B);
  pointer-events: none;
}

/* =============================================
   ۴. دکمه ارسال
   ============================================= */
#respond .form-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

#respond input#submit,
#respond .submit,
#respond input[type="submit"] {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--vio-btn-bg, #166215);
  color: var(--vio-btn-text, #fff);
  border: none;
  border-radius: 10px;
  padding: 12px 40px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: 0.01em;
}

#respond input#submit:hover,
#respond input[type="submit"]:hover {
  background: var(--vio-btn-hover, #074b06);
  transform: translateY(-1px);
}

#respond input#submit:active,
#respond input[type="submit"]:active {
  transform: translateY(0);
  background: var(--vio-btn-active, #0b3d0a);
}

/* =============================================
   ۵. لینک‌ها
   ============================================= */
#respond .logged-in-as a,
#respond .comment-notes a,
#respond .must-log-in a,
.comment .comment-content a {
  color: var(--vio-link, #166215);
  text-decoration: none;
  transition: color 0.2s;
}

#respond .logged-in-as a:hover,
#respond .comment-notes a:hover,
#respond .must-log-in a:hover,
.comment .comment-content a:hover {
  color: var(--vio-link-hover, #074b06);
  text-decoration: underline;
}

/* =============================================
   ۶. عنوان تعداد کامنت‌ها
   ============================================= */
#comments .comments-title {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 40px 0 20px 0;
  padding: 0;
  border: none;
  text-align: right;
}

/* =============================================
   ۷. لیست کامنت‌ها
   ============================================= */
ol.comment-list,
ul.comment-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

ol.comment-list li,
ul.comment-list li {
  list-style: none !important;
}

/* =============================================
   ۸. هر کامنت - باکس اصلی
   ============================================= */
.comment-list > li.comment > .comment-body,
.comment-list > .comment > .comment-body {
  background: #fff;
  border: 1.5px solid #EBEBEB;
  border-radius: 14px;
  padding: 18px 20px 14px 20px;
  margin-bottom: 14px;
  position: relative;
}

/* =============================================
   ۹. هدر کامنت - آواتار + اسم + تاریخ
   ============================================= */
.comment .comment-meta {
  display: flex;
  align-items: center;
  flex-direction: revert;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  margin-left: 25px;
}

/* آواتار گرد */
.comment .comment-author .avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  flex-shrink: 0;
  display: block;
}

/* اسم نویسنده */
.comment .comment-author .fn,
.comment .comment-author b {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.comment .comment-author .fn a,
.comment .comment-author b a {
  text-decoration: none;
  color: #1a1a1a;
}

/* تاریخ - سمت چپ */
.comment .comment-metadata {
  margin-right: auto;
  font-size: 11px;
  color: #aaa;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.comment .comment-metadata a {
  color: #aaa;
  text-decoration: none;
}

/* =============================================
   ۱۰. متن کامنت
   ============================================= */
.comment .comment-content {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.9;
  color: #444;
  margin: 0 0 12px 0;
  text-align: right;
}

.comment .comment-content p {
  margin: 0 0 8px 0;
}

.comment .comment-content p:last-child {
  margin-bottom: 0;
}

/* =============================================
   ۱۱. دکمه پاسخ (outline)
   ============================================= */
.comment .reply {
  display: flex;
  justify-content: flex-start;
}

.comment-reply-link {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  background: transparent;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 6px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.comment-reply-link:hover {
  border-color: var(--vio-reply-hover, #7C3AED);
  color: var(--vio-reply-hover, #7C3AED);
  background: var(--vio-reply-hover-bg, #f5f0ff);
  text-decoration: none;
}

/* =============================================
   ۱۲. کامنت‌های پاسخ (nested/children)
   ============================================= */
.comment-list .children {
  list-style: none !important;
  padding: 0 !important;
  margin: 10px 0 0 0 !important;
}

/* باکس nested کامنت */
.comment-list .children > li.comment > .comment-body {
  background: var(--vio-nested-bg, #ecf9ec);
  border: 1.5px solid var(--vio-nested-border, #e5efe5);
  border-radius: 14px;
  padding: 18px 20px 14px 20px;
  margin-bottom: 10px;
}

/* متن کامنت nested */
.comment-list .children .comment-content {
  color: var(--vio-nested-text, #4C1D95);
}

/* اسم نویسنده در nested */
.comment-list .children .comment-author .fn,
.comment-list .children .comment-author b {
  color: var(--vio-nested-text, #4C1D95);
}

/* تاریخ در nested */
.comment-list .children .comment-metadata,
.comment-list .children .comment-metadata a {
  color: var(--vio-nested-meta, #7C3AED);
  opacity: 0.6;
}

/* دکمه پاسخ در nested */
.comment-list .children .comment-reply-link {
  background: var(--vio-nested-btn, #166215);
  color: var(--vio-nested-btn-text, #fff);
  border-color: var(--vio-nested-btn, #166215);
  font-weight: 600;
}

.comment-list .children .comment-reply-link:hover {
  background: var(--vio-nested-btn-hover, #299928);
  border-color: var(--vio-nested-btn-hover, #299928);
  color: var(--vio-nested-btn-text, #fff);
}

/* =============================================
   ۱۳. پیام لغو پاسخ
   ============================================= */
#reply-title small {
  font-size: 12px;
  font-weight: 400;
}

#reply-title small a {
  color: var(--vio-cancel, #ef4444);
  text-decoration: none;
  margin-right: 8px;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* =============================================
   ۱۴. علامت ستاره اجباری
   ============================================= */
#respond .required {
  color: var(--vio-cancel, #ef4444);
}

/* =============================================
   ۱۵. ریسپانسیو موبایل
   ============================================= */
@media (max-width: 600px) {
  #respond input[type="text"],
  #respond input[type="email"],
  #respond input[type="url"],
  #respond textarea {
    font-size: 16px; /* جلوگیری از زوم روی iOS */
  }

  #respond .form-submit {
    justify-content: stretch;
  }

  #respond input[type="submit"] {
    width: 100%;
    text-align: center;
  }

  #comments .comment-metadata, #comments .reply {
    font-size: 8px;
  }
  .comment .comment-meta {
    margin-left: 10px;
  }
  .comment-author.vcard .fn, .comment-author.vcard .says {
    font-size: 13px;
  }
  .comment .comment-content {
    font-size: 12px;
    margin: 0 15px 5px 0;
  }
  #comments .reply {
    margin: 0 15px 0 0;
  }
  section#comments {
    padding: 0;
  }
  #comments .comment-meta {
    margin-block-end: 0.4rem;
  }
  #comments .comment .comment-body {
    padding: 15px 0 !important;
  }
  .comment-author.vcard img {
    margin: -10px 15px 0 0;
  }
}
