/* ================================================================
   Sehaty · Sources & References
   Bibliography page + reusable citation component.
   ================================================================ */

/* ============================================================
   SOURCES PAGE — hero
   ============================================================ */
.sources-page {
  background: var(--bg);
}

.sources-hero {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding-block: var(--space-16) var(--space-12);
  border-bottom: 1px solid var(--border-on-dark);
}

.sources-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-5);
}

.sources-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text-on-dark);
  max-width: 20ch;
  margin-bottom: var(--space-6);
}

html[dir="rtl"] .sources-title {
  font-family: var(--font-ar);
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 24ch;
}

.sources-lede {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-loose);
  color: var(--text-on-dark-mid);
  max-width: 68ch;
}

/* ============================================================
   SOURCES PAGE — body
   ============================================================ */
.sources-body {
  padding-block: var(--space-16) var(--space-24);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-16);
  align-items: start;
}

@media (min-width: 900px) {
  .sources-body {
    grid-template-columns: 220px 1fr;
    gap: var(--space-20);
  }
}

/* ---------- Table of contents (sticky sidebar) ---------- */
.sources-toc {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  border-top: 1px solid var(--border);
  padding-top: var(--space-5);
}

.sources-toc h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.sources-toc ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sources-toc a {
  display: block;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-mid);
  transition: color var(--t-fast);
}
.sources-toc a:hover {
  color: var(--primary);
}

@media (max-width: 899px) {
  .sources-toc {
    position: static;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding-top: 0;
    padding-bottom: var(--space-5);
  }
  .sources-toc ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-3);
  }
  .sources-toc a {
    padding: 4px 0;
  }
}

/* ---------- Source sections ---------- */
.sources-list-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.source-section {
  scroll-margin-top: calc(var(--header-height) + var(--space-6));
}

.source-section-head {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.source-section-head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-2);
}

html[dir="rtl"] .source-section-head h2 {
  font-family: var(--font-ar);
  font-weight: 700;
}

.source-section-head p {
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
  color: var(--text-mid);
  max-width: 68ch;
}

/* ---------- Numbered citation list ---------- */
.source-list {
  list-style: decimal;
  padding-inline-start: 28px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.source-list li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  padding-inline-start: var(--space-2);
}

.source-list li::marker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.source-list em {
  font-style: italic;
}

.source-list a {
  color: var(--primary);
  border-bottom: 1px solid currentColor;
  transition: color var(--t-fast);
}
.source-list a:hover {
  color: var(--primary-hover);
}

.source-list .src-note {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: normal;
}

/* ============================================================
   CITATION COMPONENT — used at the bottom of each clinical tool
   ============================================================ */
.source-note {
  margin-top: var(--space-10);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-mid);
  max-width: 72ch;
}

.source-note-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.source-note-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.source-note-list li {
  position: relative;
  padding-inline-start: var(--space-5);
}

.source-note-list li::before {
  content: '—';
  position: absolute;
  inset-inline-start: 0;
  color: var(--text-muted);
}

.source-note-list em {
  font-style: italic;
}

.source-note-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  transition: color var(--t-fast);
}

.source-note-link::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 1px;
  background: currentColor;
  transition: width var(--t-fast);
}

.source-note-link:hover {
  color: var(--primary-hover);
}
.source-note-link:hover::after {
  width: 18px;
}