/* Blog pages (blog/*.html, written by tools/site/build-blog.mjs). Loaded after
   style.css: same tokens, header and footer; this adds the reading column and
   the article typography. */

.wrap-text {
  max-width: calc(44rem + 2rem);
}

@media (min-width: 640px) {
  .wrap-text {
    max-width: calc(44rem + 3rem);
  }
}

.blog-head,
.post-head {
  display: grid;
  gap: 1rem;
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.blog-head h1,
.post-head h1 {
  font-size: clamp(2rem, 5.6vw, 3rem);
  line-height: 1.1;
  overflow-wrap: break-word;
}

.post-meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-dek {
  font-size: clamp(1.125rem, 2.6vw, 1.3125rem);
  line-height: 1.5;
}

.blog-feed {
  font-size: 0.9375rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--muted);
}

.crumbs a {
  color: var(--muted);
}

.draft-badge {
  justify-self: start;
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--brand);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Article text */

.prose {
  font-size: 1.125rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

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

.prose h2 {
  margin-top: 2.25em;
  font-size: clamp(1.375rem, 3.6vw, 1.75rem);
  line-height: 1.25;
}

.prose h3 {
  margin-top: 1.9em;
  font-size: 1.25rem;
}

.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.6em;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
  margin-top: 0.6em;
}

.prose ul,
.prose ol {
  margin-bottom: 0;
  padding-left: 1.4em;
}

.prose li + li,
.prose li > ul,
.prose li > ol {
  margin-top: 0.4em;
}

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

.prose strong {
  color: var(--ink);
  font-weight: 650;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.125em;
  border-left: 3px solid var(--line);
  color: var(--ink);
}

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

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.prose pre {
  margin-inline: 0;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  background: var(--surface);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

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

.prose figure {
  margin: 2em 0;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: 12px;
}

.prose figcaption {
  margin-top: 0.75em;
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

.prose hr {
  margin-block: 2.5em;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose .table-scroll {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 0.625em 0.75em;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--ink);
  font-weight: 600;
}

.prose .align-center {
  text-align: center;
}

.prose .align-right {
  text-align: right;
}

.prose .fnref {
  line-height: 0;
}

.prose .fnref a {
  padding-inline: 0.1em;
  text-decoration: none;
  font-size: 0.8em;
}

.prose .footnotes {
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The standard box at the end of each post */

.post-note {
  display: grid;
  gap: 0.75rem;
  margin-top: 3rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 16px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.post-note-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-weight: 600;
}

/* Lists of posts: the blog index and "Keep reading" */

.post-list {
  margin: 0 0 clamp(2rem, 6vw, 4rem);
  padding: 0;
  list-style: none;
}

.post-list > li {
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-list article {
  display: grid;
  gap: 0.5rem;
}

.post-list h2,
.post-list h3 {
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  line-height: 1.25;
}

.post-list h2 a,
.post-list h3 a {
  text-decoration: none;
}

.post-list h2 a:hover,
.post-list h3 a:hover {
  text-decoration: underline;
}

.related {
  margin-top: clamp(3rem, 8vw, 5rem);
}

.related > h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.empty {
  padding-block: 1.5rem clamp(2rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

/* The home page has the big wordmark between the footer links and the fine
   print; blog pages don't, so give the fine print room of its own. */
.blog-page .foot-fine {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
}
