:root {
  --blog-title-size: clamp(2rem, 3.5vw, 3rem);
  --blog-article-title-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --blog-lead-size: clamp(.9375rem, .85rem + .45vw, 1.125rem);
  --blog-h2-size: 1.5rem;
  --blog-h3-size: 1.25rem;
  --blog-meta-size: .8125rem;
  --blog-body-size: 1rem;
  --blog-body-leading: 1.85;
  --blog-card-gap: 1.5rem;
  --blog-card-padding: 1.5rem;
  --blog-focus-width: 2px;
  --blog-focus-offset: 4px;
  --blog-crumb-muted: .65;
  --blog-crumb-divider: .35;
}

.blog-index,
.article-page,
.blog-article {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.blog-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.blog-skip {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: var(--r-btn);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-200%);
}

.blog-skip:focus {
  transform: translateY(0);
}

.blog-hero {
  padding-block: 4rem 2.5rem;
}

.blog-hero .eyebrow {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: var(--blog-meta-size);
}

.blog-hero h1 {
  display: block;
  max-width: 100%;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--blog-title-size);
  font-weight: var(--weight-regular);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.blog-hero__lead {
  max-width: var(--reading);
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  font-size: var(--blog-lead-size);
  line-height: 1.7;
}

.blog-catalog {
  padding-bottom: 5rem;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
}

.blog-filter {
  padding: .625rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--blog-body-size);
  font-weight: var(--weight-regular);
  line-height: 1.5;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.blog-filter:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.blog-filter[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.blog-filter:focus-visible,
.post-card a:focus-visible,
.post-nav__link:focus-visible,
.blog-skip:focus-visible {
  outline: var(--blog-focus-width) solid var(--link);
  outline-offset: var(--blog-focus-offset);
}

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

.blog-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--blog-card-gap);
}

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--blog-card-padding);
  border: 1px solid var(--border);
  border-radius: var(--r-tile);
  background: var(--bg);
  color: var(--text);
  overflow-wrap: anywhere;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: var(--blog-meta-size);
  line-height: 1.6;
}

.post-card .tag,
.article-meta .tag {
  display: inline-block;
  padding: .25rem .625rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--blog-meta-size);
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

.post-card h2,
.post-card h3 {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--blog-h3-size);
  font-weight: var(--weight-regular);
  line-height: 1.55;
}

.post-card h2 a,
.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover,
.post-card h3 a:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.post-card > p {
  margin: 1rem 0 1.5rem;
  color: var(--text-muted);
  font-size: var(--blog-body-size);
  line-height: 1.8;
}

.post-card__more {
  align-self: flex-start;
  margin-top: auto;
  color: var(--link);
  font-size: var(--blog-body-size);
  line-height: 1.6;
  text-decoration: none;
}

.post-card__more:hover {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding-block: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.blog-empty a {
  color: var(--link);
}

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding-top: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--blog-meta-size);
  line-height: 1.6;
  white-space: nowrap;
}

.blog-breadcrumb a,
nav.breadcrumb a,
nav.breadcrumbs a {
  flex: 0 0 auto;
  color: var(--text-muted);
  opacity: var(--blog-crumb-muted);
  text-decoration: none;
}

.blog-breadcrumb a:hover,
nav.breadcrumb a:hover,
nav.breadcrumbs a:hover {
  color: var(--link);
  opacity: 1;
}

.blog-breadcrumb > span:not([aria-current]),
nav.breadcrumb > span:not([aria-current]),
nav.breadcrumbs > span:not([aria-current]) {
  flex: 0 0 auto;
  opacity: var(--blog-crumb-divider);
}

.blog-breadcrumb [aria-current="page"],
nav.breadcrumb [aria-current="page"],
nav.breadcrumbs [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section:has(> .blog-breadcrumb),
.section:has(> nav.breadcrumb),
.section:has(> nav.breadcrumbs) {
  padding-top: 0;
  padding-bottom: 0;
}

.article-page main.section,
.blog-article main.section,
main.section:has(.article-hero) {
  padding-top: 0;
  padding-bottom: 6rem;
}

.article-page main,
.blog-article main,
main:has(.article-hero) {
  padding-bottom: 6rem;
}

.article-hero,
.article-hero.section {
  padding-top: .5rem;
  padding-bottom: 1.75rem;
}

.article-meta,
.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .625rem 1rem;
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: var(--blog-meta-size);
  line-height: 1.6;
}

main.reading:has(> nav + header, > nav + article) {
  padding-top: 32px;
  padding-bottom: 6rem;
}

main.reading > nav:first-child {
  margin-top: 0;
}

main.reading > nav:first-child > p {
  margin-top: 0;
}

main.reading > header h1,
main.reading > article > header h1,
.article-hero h1 {
  display: block;
  max-width: 100%;
  margin: 1rem 0 .75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-article-title-size);
  font-weight: var(--weight-regular);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.article-lead,
.article-hero__lead,
.article-hero > p:last-child {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: var(--blog-lead-size);
  line-height: 1.7;
}

.article-body,
.article-page .prose,
.blog-article .prose {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--blog-body-size);
  line-height: var(--blog-body-leading);
  overflow-wrap: anywhere;
}

.article-body h2,
.article-body h3,
.article-page .prose h2,
.article-page .prose h3,
.blog-article .prose h2,
.blog-article .prose h3 {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: 1.5;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.article-body h2,
.article-page .prose h2,
.blog-article .prose h2 {
  margin: 2.5rem 0 1rem;
  font-size: var(--blog-h2-size);
}

.article-body h3,
.article-page .prose h3,
.blog-article .prose h3 {
  margin: 1.75rem 0 .75rem;
  font-size: var(--blog-h3-size);
}

.article-body > h2:first-of-type,
.article-body > section:first-of-type > h2:first-child,
.article-page .prose > h2:first-of-type,
.blog-article .prose > h2:first-of-type,
.article-page .prose > section:first-of-type > h2:first-child,
.blog-article .prose > section:first-of-type > h2:first-child {
  margin-top: 0;
}

.article-body section,
.article-page .prose section,
.blog-article .prose section {
  margin-block: 0;
  padding-block: 0;
}

.article-body section + section,
.article-page .prose section + section,
.blog-article .prose section + section {
  margin-top: 2rem;
}

.article-body section > :first-child,
.article-page .prose section > :first-child,
.blog-article .prose section > :first-child {
  margin-top: 0;
}

.article-body section > :last-child,
.article-page .prose section > :last-child,
.blog-article .prose section > :last-child {
  margin-bottom: 0;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-page .prose p,
.article-page .prose ul,
.article-page .prose ol,
.blog-article .prose p,
.blog-article .prose ul,
.blog-article .prose ol {
  margin-block: 1rem;
}

.article-body ul,
.article-body ol {
  padding-inline-start: 1.5rem;
}

.article-body li + li {
  margin-top: .5rem;
}

.article-body a:not([class*="btn"]):not([class*="button"]),
.prose a:not([class*="btn"]):not([class*="button"]) {
  color: var(--link);
  text-underline-offset: .2em;
}

.article-body blockquote,
.article-page .prose blockquote,
.blog-article .prose blockquote {
  margin: 1.5rem 0;
  padding: .75rem 1.25rem;
  border-inline-start: 2px solid var(--border);
  color: var(--text-muted);
}

.article-body code,
.article-page .prose code,
.blog-article .prose code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .9em;
  overflow-wrap: anywhere;
}

.article-body pre,
.article-page .prose pre,
.blog-article .prose pre {
  max-width: 100%;
  margin: 1.5rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  background: var(--bg-panel);
  color: var(--text);
  line-height: 1.7;
}

.article-body pre code,
.prose pre code {
  padding: 0;
  background: var(--clear);
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.article-body img,
.article-body video,
.prose img,
.prose video {
  max-width: 100%;
  height: auto;
}

.article-body .table-scroll,
.prose .table-scroll {
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
}

.article-body table,
.prose table {
  display: block;
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border-collapse: collapse;
  color: var(--text);
  font-size: var(--blog-body-size);
}

.article-body .table-scroll table,
.prose .table-scroll table {
  margin-block: 0;
}

.article-body th,
.article-body td,
.prose th,
.prose td {
  min-width: 7em;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}

.article-body th,
.prose th {
  background: var(--bg-panel);
  font-weight: var(--weight-medium);
}

.article-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  margin-block: 2.5rem;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
}

.article-download > div {
  min-width: 0;
}

.article-download h2,
.article-body .article-download h2,
.prose .article-download h2 {
  display: block;
  margin: 0 0 .75rem;
  font-family: var(--font-display);
  font-size: var(--blog-h2-size);
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

.article-download p,
.article-body .article-download p,
.prose .article-download p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--blog-body-size);
  line-height: 1.75;
}

.article-download .actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

#related-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--blog-card-gap);
  margin-block: 1.25rem 2rem;
}

#post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 2rem 0;
}

#related-posts[hidden],
#post-nav[hidden] {
  display: none;
}

#post-nav .post-nav__link {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-tile);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.post-nav__link--previous {
  grid-column: 1;
}

.post-nav__link--next {
  grid-column: 2;
}

.post-nav__label {
  color: var(--text-muted);
  font-size: var(--blog-meta-size);
  line-height: 1.6;
}

.post-nav__title {
  color: var(--text);
  font-size: var(--blog-body-size);
  line-height: 1.7;
}

.post-nav__link:hover .post-nav__title {
  color: var(--link);
}

@media (max-width: 900px) {
  .blog-post-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --blog-title-size: clamp(1.5rem, 5vw, 1.875rem);
    --blog-article-title-size: 1.5rem;
    --blog-card-padding: 1.25rem;
  }

  .blog-hero {
    padding-block: 2.5rem 2rem;
  }

  .blog-catalog {
    padding-bottom: 3rem;
  }

  .article-download {
    padding: 1.25rem;
  }

  #post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav__link--previous,
  .post-nav__link--next {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-filter {
    transition: none;
  }
}