/* ===============================
   Otoemdad — فقط blog-details.html
   هم‌خوان با فیگما (node 570:3329)
   استایل مشترک در global.css
   =============================== */

.blog-detail-main {
  padding-top: 10rem;
  padding-bottom: 3.5rem;
  background: #f9fafb;
  min-height: 60vh;
}

/* breadcrumb بوت‌استرپ — هماهنگ با تم صفحه */
.blog-detail-main .breadcrumb {
  font-size: 0.88rem;
  --bs-breadcrumb-divider: "›";
}

.blog-detail-main .breadcrumb-item a {
  color: #4a5565;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-detail-main .breadcrumb-item a:hover {
  color: var(--oto-primary);
}

.blog-detail-main .breadcrumb-item.active {
  color: #1e2939;
  font-weight: 600;
}

/* ===============================
   کارت پایه (سفید گوشه‌گرد با سایه ملایم)
   =============================== */

.blog-detail-card {
  margin-bottom: 1.5rem;
  padding: 2rem;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 1px 1.5px rgba(0, 0, 0, 0.1),
    0 1px 1px rgba(0, 0, 0, 0.1);
}

/* ===============================
   هدر مقاله: عنوان + متا + اشتراک‌گذاری
   =============================== */

.blog-detail-header__title {
  margin: 0 0 1.25rem;
  color: #1e2939;
  font-size: clamp(1.45rem, 3.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
  text-align: right;
}

.blog-detail-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.blog-detail-header__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #4a5565;
  font-size: 0.875rem;
}

.blog-detail-header__meta-item .bi {
  font-size: 1rem;
  color: var(--oto-primary);
}

.blog-detail-header__actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1rem;
}

.blog-detail-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border: 2px solid #ff8904;
  border-radius: 12px;
  background: #fff;
  color: #ff6900;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-detail-share-btn .bi {
  font-size: 1rem;
}

.blog-detail-share-btn:hover {
  background: #fff7ed;
  border-color: #ff6900;
  color: #ff6900;
}

.blog-detail-share-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--oto-focus-ring);
}

/* ===============================
   بدنه مقاله: لید + تیترها + پاراگراف‌ها + لیست
   =============================== */

.blog-detail-body__lead {
  margin: 0 0 1.25rem;
  color: #364153;
  font-size: 1rem;
  line-height: 1.85;
  text-align: justify;
}

.blog-detail-body__heading {
  margin: 1.75rem 0 0.75rem;
  color: #1e2939;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
}

.blog-detail-body__heading:first-child {
  margin-top: 0;
}

.blog-detail-body__paragraph {
  margin: 0 0 1rem;
  color: #364153;
  font-size: 1rem;
  line-height: 1.85;
  text-align: justify;
}

.blog-detail-body__list {
  margin: 0 0 1.25rem;
  padding-right: 1.25rem;
  list-style: disc;
}

.blog-detail-body__list li {
  margin-bottom: 0.5rem;
  color: #364153;
  font-size: 1rem;
  line-height: 1.65;
}

/* ===============================
   سوالات متداول (آکاردئون بوت‌استرپ)
   =============================== */

.blog-detail-faq__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.blog-detail-faq__title {
  margin: 0;
  color: #1e2939;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
}

.blog-detail-faq__icon-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff7ed;
  color: var(--oto-primary);
  flex-shrink: 0;
}

.blog-detail-faq__icon-bubble .bi {
  font-size: 1.25rem;
}

.blog-detail-faq .accordion {
  --bs-accordion-bg: #fff;
  --bs-accordion-border-color: #e5e7eb;
  --bs-accordion-border-radius: 12px;
  --bs-accordion-inner-border-radius: 11px;
  --bs-accordion-active-bg: #fff;
  --bs-accordion-active-color: #1e2939;
  --bs-accordion-btn-focus-box-shadow: 0 0 0 3px var(--oto-focus-ring);
  --bs-accordion-btn-padding-x: 1.25rem;
  --bs-accordion-btn-padding-y: 1.15rem;
  --bs-accordion-body-padding-x: 1.25rem;
  --bs-accordion-body-padding-y: 0.75rem;
}

.blog-detail-faq .accordion-item {
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.blog-detail-faq .accordion-item:last-of-type {
  margin-bottom: 0;
}

.blog-detail-faq .accordion-button {
  color: #1e2939;
  font-size: 1rem;
  font-weight: 700;
  background: #fff;
}

.blog-detail-faq .accordion-button:not(.collapsed) {
  color: #1e2939;
  background: #fff;
  box-shadow: none;
}

.blog-detail-faq .accordion-body {
  padding-top: 0.75rem;
  padding-bottom: 1.15rem;
  border-top: 1px solid #f3f4f6;
  color: #364153;
  font-size: 0.875rem;
  line-height: 1.7;
  text-align: justify;
}

/* ===============================
   نظرات
   =============================== */

.blog-detail-comments__title {
  margin: 0 0 1.5rem;
  color: #1e2939;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: right;
}

.blog-detail-comments__list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 1.5rem;
}

.blog-detail-comment {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-detail-comment__top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.blog-detail-comment__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0;
}

.blog-detail-comment__avatar--blue {
  background: linear-gradient(135deg, #51a2ff 0%, #155dfc 100%);
}

.blog-detail-comment__avatar--orange {
  background: linear-gradient(135deg, #ff8904 0%, #f54900 100%);
}

.blog-detail-comment__avatar--green {
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
}

.blog-detail-comment__avatar--purple {
  background: linear-gradient(135deg, #c084fc 0%, #7c3aed 100%);
}

.blog-detail-comment__body {
  flex: 1;
  min-width: 0;
}

.blog-detail-comment__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.blog-detail-comment__name {
  margin: 0;
  color: #1e2939;
  font-size: 1rem;
  font-weight: 700;
}

.blog-detail-comment__date {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #6a7282;
  font-size: 0.75rem;
}

.blog-detail-comment__date .bi {
  font-size: 0.85rem;
}

.blog-detail-comment__text {
  margin: 0 0 0.5rem;
  color: #364153;
  font-size: 0.875rem;
  line-height: 1.65;
}

.blog-detail-comment__reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ff6900;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.blog-detail-comment__reply-btn:hover {
  color: #e6861a;
}

.blog-detail-comment__reply-btn:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--oto-focus-ring);
}

.blog-detail-comment__reply-btn .bi {
  font-size: 0.85rem;
}

/* پاسخ ثبت‌شدهٔ تیم پشتیبانی (پیش‌نمایش) */
.blog-detail-comment__reply-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #fff7ed;
}

.blog-detail-comment__reply-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.blog-detail-comment__reply-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  background: linear-gradient(135deg, #ff8904 0%, #f54900 100%);
}

.blog-detail-comment__reply-body {
  flex: 1;
  min-width: 0;
}

.blog-detail-comment__reply-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.blog-detail-comment__reply-name {
  margin: 0;
  color: #1e2939;
  font-size: 0.875rem;
  font-weight: 700;
}

/* فرم پاسخ گذاشتن (پیش‌فرض مخفی، با کلیک «پاسخ» باز می‌شود) */
.blog-detail-comment__reply-form {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f9fafb;
}

.blog-detail-comment__textarea {
  width: 100%;
  min-height: 86px;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.65;
  resize: vertical;
}

.blog-detail-comment__form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.blog-detail-btn-muted {
  padding: 0.45rem 1rem;
  border: 1px solid #d1d5dc;
  border-radius: 8px;
  background: #fff;
  color: #364153;
  font-size: 0.875rem;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.blog-detail-btn-muted:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.blog-detail-btn-send {
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 8px;
  background: #ff6900;
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.blog-detail-btn-send:hover {
  background: #e6861a;
}

/* ===============================
   ثبت نظر جدید (فرم انتهای کارت نظرات)
   =============================== */

.blog-detail-new-comment__textarea.is-invalid ~ .invalid-feedback,
.blog-detail-comment__textarea.is-invalid ~ .invalid-feedback {
  display: block;
}

.blog-detail-new-comment__textarea.is-invalid,
.blog-detail-comment__textarea.is-invalid {
  border-color: #dc3545;
}

.blog-detail-new-comment__title {
  margin: 0 0 1rem;
  color: #1e2939;
  font-size: 1.125rem;
  font-weight: 700;
}

/* یکسان‌سازی radius اینپوت‌ها با textareaهای فرم نظر (textareaها از قبل 12px دارند) */
.blog-detail-new-comment input.form-control,
.blog-detail-comment__reply-form input.form-control {
  border-radius: 12px;
}

.blog-detail-new-comment__textarea {
  width: 100%;
  min-height: 106px;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #1e2939;
  resize: vertical;
}

.blog-detail-new-comment__textarea::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.blog-detail-new-comment__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.blog-detail-new-comment__submit {
  padding: 0.65rem 1.5rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #ff6900, #ff8904);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.blog-detail-new-comment__submit:hover {
  filter: brightness(0.95);
  box-shadow: 0 4px 12px rgba(247, 147, 30, 0.35);
}

.blog-detail-new-comment__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--oto-focus-ring);
}

/* ===============================
   سایدبار: کارت آیکن فیچرد + مقالات مرتبط
   =============================== */

.blog-detail-sidebar-cover {
  margin: 0 0 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  background: #e8eaef;
  aspect-ratio: 16 / 9;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.blog-detail-sidebar-cover__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* مقالات مرتبط */
.blog-detail-related {
  padding: 1.5rem;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 1px 1.5px rgba(0, 0, 0, 0.1),
    0 1px 1px rgba(0, 0, 0, 0.1);
}

.blog-detail-related__title {
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #1e2939;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: right;
}

.blog-detail-related__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.blog-detail-related__list li {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.blog-detail-related__list li:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.blog-detail-related-item {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.blog-detail-related-item:hover .blog-detail-related-item__title {
  color: var(--oto-primary);
}

.blog-detail-related-item__title {
  margin: 0 0 0.5rem;
  color: #1e2939;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.45;
  transition: color 0.2s ease;
}

.blog-detail-related-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
}

.blog-detail-related-item__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #6a7282;
  font-size: 0.75rem;
}

.blog-detail-related-item__meta-item .bi {
  font-size: 0.75rem;
}

.blog-detail-related-item:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--oto-focus-ring);
}

/* ===============================
   مودال اشتراک‌گذاری مقاله
   =============================== */

.blog-share-modal .modal-content {
  border-radius: 18px;
  border: 0;
  box-shadow: 0 24px 48px rgba(11, 60, 93, 0.18);
  overflow: hidden;
}

.blog-share-modal__header {
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid #f3f4f6;
}

.blog-share-modal__header .modal-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  margin: 0;
  color: #1e2939;
  font-weight: 700;
  text-align: right;
}

.blog-share-modal__header .modal-title .bi {
  color: var(--oto-primary);
  font-size: 1.1rem;
}

.blog-share-modal__header .btn-close {
  margin: 0;
  padding: 0.65rem;
  flex-shrink: 0;
}

.blog-share-modal .modal-body {
  padding: 1.5rem 1.35rem 1.35rem;
}

.blog-share-modal__hint {
  margin: 0 0 1.25rem;
  color: #4a5565;
  font-size: 0.875rem;
  line-height: 1.7;
  text-align: right;
}

.blog-share-modal__networks {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.blog-share-network {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #364153;
  text-decoration: none;
  text-align: center;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.blog-share-network:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.blog-share-network:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--oto-focus-ring);
}

.blog-share-network__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #4a5565;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.blog-share-network__icon .bi {
  font-size: 1.4rem;
  line-height: 1;
}

.blog-share-network__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e2939;
}

/* رنگ برند هر شبکه — در hover/focus پر می‌شود */
.blog-share-network--telegram:hover,
.blog-share-network--telegram:focus-visible {
  border-color: rgba(36, 161, 222, 0.45);
}

.blog-share-network--telegram:hover .blog-share-network__icon,
.blog-share-network--telegram:focus-visible .blog-share-network__icon {
  background: #24a1de;
  color: #fff;
}

.blog-share-network--whatsapp:hover,
.blog-share-network--whatsapp:focus-visible {
  border-color: rgba(37, 211, 102, 0.45);
}

.blog-share-network--whatsapp:hover .blog-share-network__icon,
.blog-share-network--whatsapp:focus-visible .blog-share-network__icon {
  background: #25d366;
  color: #fff;
}

.blog-share-network--twitter:hover,
.blog-share-network--twitter:focus-visible {
  border-color: rgba(20, 20, 20, 0.5);
}

.blog-share-network--twitter:hover .blog-share-network__icon,
.blog-share-network--twitter:focus-visible .blog-share-network__icon {
  background: #141414;
  color: #fff;
}

.blog-share-network--facebook:hover,
.blog-share-network--facebook:focus-visible {
  border-color: rgba(24, 119, 242, 0.45);
}

.blog-share-network--facebook:hover .blog-share-network__icon,
.blog-share-network--facebook:focus-visible .blog-share-network__icon {
  background: #1877f2;
  color: #fff;
}

.blog-share-network--linkedin:hover,
.blog-share-network--linkedin:focus-visible {
  border-color: rgba(10, 102, 194, 0.45);
}

.blog-share-network--linkedin:hover .blog-share-network__icon,
.blog-share-network--linkedin:focus-visible .blog-share-network__icon {
  background: #0a66c2;
  color: #fff;
}

.blog-share-network--email:hover,
.blog-share-network--email:focus-visible {
  border-color: rgba(247, 147, 30, 0.5);
}

.blog-share-network--email:hover .blog-share-network__icon,
.blog-share-network--email:focus-visible .blog-share-network__icon {
  background: var(--oto-primary);
  color: #fff;
}

/* بخش کپی لینک */
.blog-share-modal__copy-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #1e2939;
  font-size: 0.875rem;
  font-weight: 600;
}

.blog-share-modal__copy {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  padding: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-share-modal__copy:focus-within {
  border-color: var(--oto-primary);
  box-shadow: 0 0 0 3px var(--oto-focus-ring);
  background: #fff;
}

.blog-share-modal__copy-input.form-control {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #364153;
  font-size: 0.875rem;
  text-align: left;
  direction: ltr;
  unicode-bidi: plaintext;
  box-shadow: none;
}

.blog-share-modal__copy-input.form-control:focus {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.blog-share-modal__copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0 0.95rem;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--oto-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-share-modal__copy-btn:hover {
  background: #e6861a;
}

.blog-share-modal__copy-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--oto-focus-ring);
}

.blog-share-modal__copy-btn .bi {
  font-size: 1rem;
}

.blog-share-modal__copy-btn.is-copied {
  background: #15803d;
}

.blog-share-modal__copy-status {
  margin: 0.65rem 0 0;
  min-height: 1.1rem;
  color: #15803d;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.blog-share-modal__copy-status.is-visible {
  opacity: 1;
}

.blog-share-modal__copy-status.is-error {
  color: #b91c1c;
}

@media (max-width: 575.98px) {
  .blog-share-modal__networks {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-share-modal .modal-body {
    padding: 1.25rem 1.1rem 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .blog-detail-share-btn,
  .blog-detail-comment__reply-btn,
  .blog-detail-related-item,
  .blog-detail-related-item__title,
  .blog-detail-new-comment__submit,
  .blog-detail-btn-send,
  .blog-detail-btn-muted,
  .blog-share-network,
  .blog-share-network__icon,
  .blog-share-modal__copy,
  .blog-share-modal__copy-btn,
  .blog-share-modal__copy-status {
    transition-duration: 0.01ms !important;
  }
}
