/* Blog pages. Loaded after /styles.css; reuses its tokens. Hand-written, not generated. */

.masthead__nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.blogindex,
.post {
  padding: clamp(2.5rem, 7vh, 4.5rem) 0 clamp(2.5rem, 6vh, 4rem);
}

.blogindex h1,
.post h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.blogindex__lede,
.post__desc {
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--graphite);
  max-width: 40ch;
}

.post__meta {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--graphite);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.tags li {
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--rule);
  color: var(--graphite);
}

/* index list */

.postlist {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
  max-width: 44rem;
}

.postlist__item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.postlist__item h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
}

.postlist__item h2 a {
  color: var(--ink);
  text-decoration: none;
}

.postlist__item h2 a:hover {
  color: var(--cobalt);
}

.postlist__item p {
  margin-bottom: 0.4rem;
}

/* post body */

.post__head {
  max-width: var(--measure);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.prose {
  max-width: var(--measure);
  min-width: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin: 2.25em 0 0.6em;
  font-weight: 500;
  line-height: 1.2;
  scroll-margin-top: 1.5rem;
}

.prose h1 {
  font-size: 1.9rem;
}

.prose h2 {
  font-size: 1.55rem;
}

.prose h3 {
  font-size: 1.25rem;
}

.prose h4 {
  font-size: 1.1rem;
}

.prose h1 a,
.prose h2 a,
.prose h3 a,
.prose h4 a {
  color: inherit;
  text-decoration: none;
}

.prose h1 a:hover::after,
.prose h2 a:hover::after,
.prose h3 a:hover::after,
.prose h4 a:hover::after {
  content: " #";
  color: var(--graphite);
}

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

.prose li {
  margin-bottom: 0.35rem;
}

.prose blockquote {
  margin: 0 0 1.25em;
  padding-left: 1.25rem;
  border-left: 2px solid var(--cobalt);
  color: var(--graphite);
  font-style: italic;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85em;
  padding: 0.1em 0.3em;
  background: var(--paper-2);
}

.prose pre {
  margin: 0 0 1.5em;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  font-size: 0.9rem;
  line-height: 1.5;
  tab-size: 2;
}

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

.tok-c {
  color: var(--graphite);
  font-style: italic;
}

.tok-k {
  color: var(--cobalt);
}

.tok-s {
  color: #1c6b4a;
}

@media (prefers-color-scheme: dark) {
  .tok-s {
    color: #6fcf9f;
  }
}

.tok-n {
  color: var(--alert);
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.5em;
  border-collapse: collapse;
  font-size: 1rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.prose th {
  font-weight: 500;
  border-bottom-color: var(--ink);
}

.post__back {
  margin-top: 3rem;
}

@media (max-width: 560px) {
  .blogindex__lede,
  .post__desc {
    font-size: 1.15rem;
  }

  .prose pre {
    margin-inline: calc(var(--gutter) * -1);
    border-inline: 0;
    padding-inline: var(--gutter);
  }
}
