/* ==========================================================================
   Faragoman — Purple article theme (تم بنفش صفحات مقاله)
   Scoped to the single-article page (.article) so feed cards & the rest of the
   site keep the default blue palette. Loaded only on article pages.
   ========================================================================== */

.article {
  /* local purple token set — overrides the global blue accents inside .article */
  --art-purple: #a855f7;
  --art-purple-2: #7c3aed;
  --art-purple-soft: rgba(168, 85, 247, .14);
  --art-purple-line: rgba(168, 85, 247, .28);
  --art-gold: #fbbf24;
}

/* soft purple aura behind the whole article column */
.article {
  position: relative;
}
.article::before {
  content: "";
  position: absolute;
  inset: -80px -40px auto -40px;
  height: 320px;
  z-index: -1;
  background:
    radial-gradient(60% 100% at 80% 0%, rgba(168, 85, 247, .18), transparent 70%),
    radial-gradient(50% 100% at 15% 10%, rgba(124, 58, 237, .16), transparent 72%);
  pointer-events: none;
  filter: blur(2px);
}

/* cover */
.article__cover img {
  box-shadow: 0 20px 60px rgba(124, 58, 237, .28);
  border: 1px solid var(--art-purple-line);
}

/* header card */
.article__head.card {
  background:
    linear-gradient(160deg, rgba(124, 58, 237, .12), rgba(24, 14, 40, .55)),
    var(--surface, rgba(20, 27, 51, .66));
  border: 1px solid var(--art-purple-line);
  box-shadow: 0 10px 40px rgba(30, 12, 58, .35);
}

.article__title {
  background: linear-gradient(180deg, #f5ecff, #cbb6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #e9ddff; /* fallback */
}

/* category badge + reading-time pill in purple */
.article .badge {
  background: var(--art-purple-soft) !important;
  color: #d9c6ff !important;
  border: 1px solid var(--art-purple-line);
}
.article .reading-time {
  background: var(--art-purple-soft) !important;
  color: #dcc9ff !important;
}
.article__author { color: #d6c2ff; }
.article__author:hover { color: #fff; }
.article__excerpt {
  border-inline-start: 3px solid var(--art-purple);
  padding-inline-start: 14px;
}

/* body card */
.article__body.card {
  background:
    linear-gradient(180deg, rgba(124, 58, 237, .06), transparent 220px),
    var(--surface, rgba(20, 27, 51, .66));
  border: 1px solid var(--art-purple-line);
}

/* rich-text accents inside the body */
.article__body a:not(.wiki-term) {
  color: #c4a7ff;
  text-decoration-color: var(--art-purple-line);
}
.article__body a:not(.wiki-term):hover { color: #e2d3ff; }
.article__body h1, .article__body h2, .article__body h3, .article__body h4 {
  color: #ecdfff;
}
.article__body blockquote {
  border-inline-start: 3px solid var(--art-purple);
  background: var(--art-purple-soft);
  border-radius: 10px;
  padding: .6rem 1rem;
}

/* interaction bar + active reaction */
.article ~ .interaction-bar.card,
.interaction-bar.card {
  border: 1px solid var(--art-purple-line);
}
.reaction-btn.is-active {
  background: var(--art-purple-soft);
  border-color: var(--art-purple-line);
}
.bookmark-btn.is-active {
  background: var(--art-purple-soft);
  border-color: var(--art-purple-line);
  color: var(--art-gold);
}

@media (max-width: 640px) {
  .article::before { height: 220px; }
}

/* ==========================================================================
   Tables inside article bodies (جدول داخل متن مقاله)
   The base theme styled p / h / ul / blockquote / pre etc. inside
   .article__body but never <table>, so author-inserted tables rendered as raw
   unstyled browser defaults. Give them a clean, theme-matching look and make
   them horizontally scrollable on small screens.
   ========================================================================== */
.article__body table{
  width:100%;
  border-collapse:collapse;
  margin:1.5rem 0;
  font-size:.95rem;
  line-height:1.7;
  border:1px solid var(--art-purple-line);
  border-radius:12px;
  overflow:hidden;
  background:rgba(24,14,40,.35);
  /* let very wide tables scroll instead of breaking the layout */
  display:block;
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.article__body table thead th{
  background:linear-gradient(180deg,rgba(168,85,247,.22),rgba(124,58,237,.14));
  color:#f1e8ff;
  font-weight:700;
}
.article__body table th,
.article__body table td{
  padding:.7rem 1rem;
  border:1px solid var(--art-purple-line);
  text-align:right;
  vertical-align:top;
}
.article__body table tbody tr:nth-child(even){
  background:rgba(168,85,247,.07);
}
.article__body table tbody tr:hover{
  background:rgba(168,85,247,.13);
}
.article__body table caption{
  caption-side:bottom;
  color:var(--muted,#9aa6cc);
  font-size:.82rem;
  padding-top:.6rem;
}
@media (max-width:640px){
  .article__body table th,
  .article__body table td{padding:.55rem .7rem;font-size:.88rem}
}
