/* Compact in-article book promo — dark-theme friendly, beats #articlecontent a rules */
.article-book-promo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.35rem 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.55);
  max-width: 100%;
  box-sizing: border-box;
  text-align: start;
  direction: rtl;
  color: #e2e8f0;
}

[data-bs-theme="light"] .article-book-promo {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.04), rgba(16, 185, 129, 0.06));
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.article-book-promo__cover {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  border-radius: 0.4rem;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  background: #0b1220;
}

.article-book-promo__cover img {
  display: block;
  width: 58px;
  height: 80px;
  object-fit: cover;
}

.article-book-promo__content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.article-book-promo__ai {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: flex-start;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  color: #6ee7b7 !important;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="light"] .article-book-promo__ai {
  color: #047857 !important;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: none;
}

#articlecontent .article-book-promo a.article-book-promo__title-en,
#articlecontent .article-book-promo a.article-book-promo__title-fa,
.article-book-promo__title-en,
.article-book-promo__title-fa {
  text-decoration: none !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#articlecontent .article-book-promo a.article-book-promo__title-en,
#articlecontent.card .article-book-promo a.article-book-promo__title-en,
.article-book-promo__title-en {
  font-size: 0.98rem;
  font-weight: 800 !important;
  line-height: 1.3;
  color: #f8fafc !important;
  -webkit-line-clamp: 2;
}

#articlecontent .article-book-promo a.article-book-promo__title-fa,
.article-book-promo__title-fa {
  font-size: 0.8rem;
  font-weight: 600 !important;
  line-height: 1.35;
  color: #94a3b8 !important;
  -webkit-line-clamp: 1;
}

[data-bs-theme="light"] #articlecontent .article-book-promo a.article-book-promo__title-en,
[data-bs-theme="light"] .article-book-promo__title-en {
  color: #0f172a !important;
}

[data-bs-theme="light"] #articlecontent .article-book-promo a.article-book-promo__title-fa,
[data-bs-theme="light"] .article-book-promo__title-fa {
  color: #64748b !important;
}

#articlecontent .article-book-promo a.article-book-promo__title-en:hover,
#articlecontent .article-book-promo a.article-book-promo__title-fa:hover {
  text-decoration: underline !important;
  color: #6ee7b7 !important;
}

.article-book-promo__pricing {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.article-book-promo__free {
  color: #6ee7b7;
  font-weight: 700;
}

.article-book-promo__old {
  color: #fca5a5;
  text-decoration: line-through;
  font-size: 0.78rem;
}

.article-book-promo__price {
  color: #6ee7b7;
  font-weight: 700;
}

[data-bs-theme="light"] .article-book-promo__free,
[data-bs-theme="light"] .article-book-promo__price {
  color: #15803d;
}

[data-bs-theme="light"] .article-book-promo__old {
  color: #dc2626;
}

#articlecontent .article-book-promo a.article-book-promo__cta,
.article-book-promo__cta {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700 !important;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none !important;
  line-height: 1.2;
  color: #fff !important;
}

#articlecontent .article-book-promo a.article-book-promo__cta--free,
.article-book-promo__cta--free {
  background: #16a34a;
  color: #fff !important;
}

#articlecontent .article-book-promo a.article-book-promo__cta--paid,
.article-book-promo__cta--paid {
  background: #2563eb;
  color: #fff !important;
}

#articlecontent .article-book-promo a.article-book-promo__cta:hover,
.article-book-promo__cta:hover {
  filter: brightness(1.08);
  color: #fff !important;
  text-decoration: none !important;
}

@media (max-width: 575.98px) {
  .article-book-promo {
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .article-book-promo__cta {
    width: 100%;
    text-align: center;
  }
}
