
/* ---------------------------------------------------------------------------
   Inline citations + collapsible Sources (post.php "cited mode")
   ---------------------------------------------------------------------------
   Used only when a post body carries <sup class="citation"> links. A post with
   none renders the flat .sources-list above, unchanged.

   The number is REAL TEXT (.source-num), not the CSS counter the flat list
   uses. A counter numbers what is painted; the body numbers by position in
   meta.sources. If those ever differ (an "Also consulted" entry, a skipped
   row) a counter silently shows the wrong number beside the right source, and
   CSS-generated content is invisible to every DOM-reading check.

   scroll-margin-top: the site header is sticky (render-helpers.php), so an
   in-page jump would otherwise land the target underneath it. 11rem is an
   ESTIMATE from the header's Tailwind classes, not a browser measurement. */
.prose sup.citation,
.sources-list--cited li {
  scroll-margin-top: 11rem;
}

.sources-list--cited li::before { content: none; }
.sources-list--cited { counter-reset: none; }
.sources-list--cited li { counter-increment: none; }

.sources-list--cited .source-num {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
  border-radius: 0.375rem;
  padding: 0.125rem 0.5rem;
  background: #fff4bf;
  color: #0a2b5c;
  min-width: 1.5rem;
  text-align: center;
}

/* Compact rows: this list is reference material, not reading copy. */
.prose ol.sources-list--cited li,
.sources-list--cited li {
  font-size: 0.875rem;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}
.prose ol.sources-list--cited > * + *,
.sources-list--cited > * + * { margin-top: 0.25rem; }

.source-backlink,
.prose .source-backlink {
  margin-left: 0.375rem;
  font-size: 0.8em;
  font-weight: 600;
  text-decoration: none !important;
  color: #1b3c6e;
}
.source-backlinks { margin-left: 0.375rem; color: #1b3c6e; }
.source-backlinks .source-backlink { margin-left: 0.25rem; }
.source-backlink:hover { text-decoration: underline !important; }

.sources-details { border-top: 1px solid #e5e7eb; }
.sources-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  padding: 1rem 0 0.5rem;
}
.sources-summary::-webkit-details-marker { display: none; }
.sources-summary::marker { content: ''; }
.prose .sources-heading,
.sources-heading {
  margin: 0 !important;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}
.sources-count { font-weight: 400; color: #6b7280; }
.sources-hint {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1b3c6e;
  white-space: nowrap;
}
.sources-hint--open { display: none; }
.sources-details[open] .sources-hint--open { display: inline; }
.sources-details[open] .sources-hint--closed { display: none; }
.sources-summary:focus-visible { outline: 2px solid #1b3c6e; outline-offset: 2px; }

.prose .sources-note,
.sources-note {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0.25rem 0 0.5rem;
}

.prose .sources-also-heading,
.sources-also-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}
.prose ul.sources-also,
.sources-also {
  font-size: 0.875rem;
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}
.prose ul.sources-also li { margin: 0.25rem 0; }
