/* ============================================
   SOURCES — reusable citation list for articles
   --------------------------------------------
   Usage (inside .post-body):
     <section class="post-sources" aria-labelledby="sources">
       <h2 id="sources">...</h2>
       <ol class="post-sources__list">
         <li class="post-sources__item">
           <cite class="post-sources__name">Publisher — Title</cite>
           <p class="post-sources__note">How it was used.</p>
           <a class="post-sources__link" href="..." rel="noopener" target="_blank">domain/path</a>
         </li>
       </ol>
     </section>
   Link after post.css. Uses tokens from tokens.css only.
   ============================================ */

.post-sources {
  max-width: var(--container-reading);
  margin: var(--space-8) auto var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-line);
}

.post-body .post-sources__list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  counter-reset: source;
}

.post-body .post-sources__item {
  counter-increment: source;
  list-style: none;
  position: relative;
  padding: var(--space-4) 0 var(--space-4) var(--space-7);
  margin: 0;
  border-bottom: 1px solid var(--color-line);
}

.post-body .post-sources__item:last-child {
  border-bottom: none;
}

.post-sources__item::before {
  content: counter(source, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: var(--space-4);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-moss);
}

.post-sources__name {
  display: block;
  font-style: normal;
  font-weight: 500;
  font-size: var(--text-base);
  color: var(--color-ink);
  margin-bottom: var(--space-1);
}

.post-body p.post-sources__note {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-ink-soft);
  margin: 0 0 var(--space-2);
}

/* post.css applies a drop-cap to `.post-body p:first-of-type`, which also
   matches the first <p> inside each list item. Neutralise it here. */
.post-body p.post-sources__note::first-letter {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  float: none;
  padding: 0;
  color: inherit;
}

.post-body .post-sources__list,
.post-body .post-sources__item p {
  padding-inline: 0;
}

.post-body a.post-sources__link {
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
  word-break: break-word;
}
