.prose > * + * {
  margin-top: 1.5em;
}

/* Headings: a light weight, told apart from the text by size and a
   step more ink, under the essay's own title */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-weight: 500;
  color: var(--color-text-strong);
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
  scroll-margin-top: var(--spacing-xl);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1 {
  font-size: 1.5rem;
}
.prose h2 {
  font-size: 1.3rem;
}
.prose h3 {
  font-size: 1.15rem;
}
.prose h4,
.prose h5,
.prose h6 {
  font-size: var(--text-body);
}
.prose h5,
.prose h6 {
  font-weight: 600;
}

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.prose a:hover {
  color: var(--color-accent-hover);
}

.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-top: 1em;
  margin-bottom: 1em;
}

/* Our own bullet, set on the centre of the lowercase letters. The
   browser's marker centres on the capitals, which reads a touch high
   beside words that are mostly lowercase. */
.prose ul {
  list-style: none;
}

.prose ul > li {
  position: relative;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: -1.05em;
  top: 0.83em;
  width: 0.34em;
  height: 0.34em;
  border-radius: 50%;
  background: currentColor;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  padding-left: 1.5em;
}

.prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--spacing-lg);
  margin-left: 0;
  margin-right: 0;
  font-style: italic;
  color: var(--color-text-muted);
}

.prose blockquote p {
  margin: 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-2xl) 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  background-color: var(--color-code-bg);
  border-radius: 4px;
}

.prose pre {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.75;
  background-color: var(--color-code-bg);
  border-radius: 8px;
  padding: var(--spacing-lg);
  margin: 1.5em 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.prose th,
.prose td {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  text-align: left;
}

.prose th {
  font-weight: 600;
  background-color: var(--color-bg-subtle);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.prose figure {
  margin: 1.5em 0;
  text-align: center;
}

.prose figure img {
  display: inline-block;
}

.prose figcaption {
  margin-top: var(--spacing-sm);
  font-size: var(--text-label);
  color: var(--color-text-muted);
  text-align: center;
}

.prose abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
}

.prose dt {
  font-weight: 600;
  color: var(--color-text-strong);
}

.prose dd {
  margin-left: 1.5em;
}

.prose dd + dt {
  margin-top: 0.75em;
}

/* A footnote's number: small, raised, and kept from prising its line
   apart from the next */
.prose sup {
  line-height: 0;
}

.prose a.footnote-ref {
  font-size: 0.75em;
  font-weight: 600;
  padding: 0 0.15em;
  text-decoration: none;
}

.prose a.footnote-ref[aria-expanded="true"] {
  color: var(--color-text-muted);
}

/* A note unfolded under the passage that cites it */
.prose .note {
  position: relative;
  margin-top: 0.75em;
  padding: 0.1em 0 0.1em 1.25em;
  border-left: 2px solid color-mix(in srgb, var(--color-accent) 60%, transparent);
  font-size: 0.875em;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.prose .note + :not(.note) {
  margin-top: 1.25em;
}

.prose .note-number {
  float: left;
  margin-right: 0.5em;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 2;
  color: var(--color-accent);
}

.prose .note > p {
  margin: 0;
}

.prose .note > p + p {
  margin-top: 0.75em;
}

/* All the notes together, at the end */
.prose .footnote {
  font-size: 0.875em;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.prose .footnote hr {
  width: 6rem;
  margin: 0 0 var(--spacing-lg);
}

.prose .footnote ol {
  padding-left: 1.5em;
}

.prose .footnote li::marker {
  font-size: 0.85em;
  color: var(--color-accent);
}

.prose .footnote li {
  padding-left: 0.4em;
}

.prose .footnote li p {
  margin: 0;
}

.prose .footnote li p + p {
  margin-top: 0.75em;
}

.prose a.footnote-backref {
  text-decoration: none;
}
