/* Blog posts. Loaded after /styles.css: one reading column, centred on the page. */

:root {
  --line: #e9e9e7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --line: #303030;
  }
}

.post-shell {
  max-width: 46rem;
  margin: 0 auto;
  padding: 4rem;
}

.crumbs {
  gap: 0.5rem;
  margin: 0 0 4.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.post-head {
  margin-bottom: 2.5rem;
}

.post-head h1 {
  font-size: 2.125rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.dek {
  margin: 0.625rem 0 0;
  color: var(--muted);
  font-size: 1.1875rem;
  line-height: 1.4;
}

.meta {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Prose */

.prose {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose > * {
  margin: 0;
}

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

.prose > p:first-child {
  font-size: 1.1875rem;
  line-height: 1.6;
}

.prose p,
.prose li {
  text-wrap: pretty;
}

.prose h2 {
  margin-top: 2.5em;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.prose h2 + * {
  margin-top: 0.75em;
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

/* Numbered lists hang from their numbers, like a Notion list. A loose list holds
   whole paragraphs, so its items keep paragraph spacing. */

.prose ol {
  display: grid;
  gap: 0.625em;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.prose ol.loose {
  gap: 1.25em;
}

.prose ol > li {
  position: relative;
  padding-left: 1.75em;
  counter-increment: item;
}

.prose ol > li::before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  width: 1.125em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.post-foot {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-foot nav.back {
  margin-top: 0;
}

.post-shell a:focus-visible {
  border-radius: 2px;
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 34rem) {
  .post-shell {
    padding: 1.75rem 1.25rem 3rem;
  }

  .crumbs {
    margin-bottom: 2.75rem;
  }

  .post-head h1 {
    font-size: 1.75rem;
  }

  .dek {
    font-size: 1.0625rem;
  }

  .prose > p:first-child {
    font-size: 1.125rem;
  }
}

@media print {
  .crumbs,
  .post-foot {
    display: none;
  }

  .post-shell {
    padding: 0;
  }
}
