.blog-index-hero {
  padding-top: var(--s10);
  padding-bottom: var(--s9);
}

.blog-eyebrow {
  margin: 0 0 var(--s3);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--text-caption);
  font-weight: var(--medium);
  letter-spacing: var(--letter-label);
}

.blog-index-hero h1 {
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: var(--title);
  font-weight: var(--regular);
  line-height: var(--title-leading);
}

.blog-index-lead {
  max-width: var(--description-width);
  margin: var(--s5) 0 0;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: var(--body-leading);
}

.blog-catalog {
  padding-top: var(--s9);
  padding-bottom: var(--section-space);
}

.blog-catalog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s7);
  align-items: end;
  margin-bottom: var(--s8);
}

.blog-catalog-head h2 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-heading);
  font-weight: var(--regular);
  line-height: var(--heading-leading);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: flex-end;
}

.blog-filter {
  min-height: var(--touch);
  padding: var(--s2) var(--s4);
  border: var(--rule) solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted, var(--muted));
  font: inherit;
  font-size: var(--text-base);
  cursor: pointer;
  transition:
    border-color var(--transition-time),
    color var(--transition-time),
    background-color var(--transition-time);
}

.blog-filter:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.blog-filter:focus-visible {
  outline: var(--focus) solid var(--accent);
  outline-offset: var(--focus);
}

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

.blog-list {
  display: grid;
  border-top: var(--rule) solid var(--border);
}

.post-card {
  display: grid;
  grid-template-columns: var(--platform-width) minmax(0, 1fr);
  gap: var(--s8);
  padding: var(--s7) 0;
  border-bottom: var(--rule) solid var(--border);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--text-caption);
  line-height: var(--caption-leading);
}

.post-card > .post-meta {
  align-content: start;
  align-items: flex-start;
}

.tag {
  display: inline-block;
  max-width: 100%;
  padding: var(--s1) var(--s2);
  border: var(--rule) solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--accent-dark);
  font-family: var(--body);
  font-size: var(--text-caption);
  font-weight: var(--medium);
  line-height: var(--caption-leading);
  overflow-wrap: anywhere;
}

.post-card-content h3,
.related-card h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-section);
  font-weight: var(--medium);
  line-height: var(--heading-leading);
}

.post-card-content h3 a,
.related-card h3 a {
  color: inherit;
  text-decoration: none;
}

.post-card-content h3 a:hover,
.related-card h3 a:hover {
  color: var(--accent);
}

.post-card-content h3 a:focus-visible,
.related-card h3 a:focus-visible,
.post-link:focus-visible,
.post-nav-link:focus-visible {
  outline: var(--focus) solid var(--accent);
  outline-offset: var(--focus);
}

.post-card-content p,
.related-card p {
  margin: var(--s3) 0 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: var(--body-leading);
}

.post-link {
  display: inline-block;
  margin-top: var(--s4);
  color: var(--accent-dark);
  font-size: var(--text-base);
  font-weight: var(--medium);
  text-decoration: none;
}

.post-link::after {
  content: " →";
  color: var(--orange);
}

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

.blog-empty {
  margin: var(--s8) 0 0;
  padding: var(--s6);
  border: var(--rule) solid var(--border);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  gap: var(--s2);
  align-items: center;
  min-width: 0;
  margin-top: var(--s5);
  margin-bottom: var(--s5);
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: var(--caption-leading);
  white-space: nowrap;
}

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

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

.blog-breadcrumb a:focus-visible,
nav.breadcrumb a:focus-visible,
nav.breadcrumbs a:focus-visible {
  outline: var(--focus) solid var(--accent);
  outline-offset: var(--focus);
}

.blog-breadcrumb .separator,
nav.breadcrumb .separator,
nav.breadcrumbs .separator {
  flex: 0 0 auto;
  color: var(--border);
}

.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;
  color: var(--muted);
  text-overflow: ellipsis;
}

.article-shell {
  padding-top: var(--s3);
  padding-bottom: var(--s10);
}

.article-shell > .blog-breadcrumb,
.article-shell > nav.breadcrumb,
.article-shell > nav.breadcrumbs {
  margin-top: var(--s2);
}

.article-hero {
  max-width: calc(var(--reading-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-top: var(--s3);
  padding-bottom: var(--s8);
}

.article-hero .post-meta {
  margin-bottom: var(--s4);
}

.article-hero h1 {
  max-width: 100%;
  margin: var(--s4) 0 var(--s3);
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: var(--regular);
  line-height: 1.32;
  overflow-wrap: break-word;
}

.article-lead {
  margin: var(--s3) 0 0;
  color: var(--muted);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
}

.article-body,
.blog-article,
.prose {
  color: var(--text);
  font-size: var(--text-body);
  line-height: var(--body-leading);
}

.article-body > section,
.blog-article > section,
.prose > section {
  padding: 0;
}

.article-body > section + section,
.blog-article > section + section,
.prose > section + section {
  margin-top: var(--s9);
}

.article-body h2,
.blog-article h2,
.prose h2 {
  max-width: 100%;
  margin: var(--s9) 0 var(--s4);
  color: var(--text);
  font-size: var(--text-section);
  font-weight: var(--medium);
  line-height: var(--heading-leading);
}

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

.article-body h3,
.blog-article h3,
.prose h3 {
  max-width: 100%;
  margin: var(--s7) 0 var(--s3);
  color: var(--text);
  font-size: var(--text-brand);
  font-weight: var(--medium);
  line-height: var(--heading-leading);
}

.article-body p,
.blog-article p,
.prose p {
  margin: 0 0 var(--s5);
}

.article-body ul,
.article-body ol,
.blog-article ul,
.blog-article ol,
.prose ul,
.prose ol {
  margin: 0 0 var(--s6);
  padding-inline-start: var(--s7);
}

.article-body li + li,
.blog-article li + li,
.prose li + li {
  margin-top: var(--s2);
}

.prose a:not([class*="btn"]):not([class*="button"]),
.article-body a:not([class*="btn"]):not([class*="button"]),
.blog-article a:not([class*="btn"]):not([class*="button"]) {
  color: var(--accent-dark);
  text-decoration-color: var(--border);
  text-underline-offset: var(--s1);
}

.prose a:not([class*="btn"]):not([class*="button"]):hover,
.article-body a:not([class*="btn"]):not([class*="button"]):hover,
.blog-article a:not([class*="btn"]):not([class*="button"]):hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.article-body blockquote,
.blog-article blockquote,
.prose blockquote {
  margin: var(--s7) 0;
  padding: var(--s4) var(--s6);
  border-left: var(--focus) solid var(--accent);
  background: var(--panel);
  color: var(--muted);
}

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

.article-body :not(pre) > code,
.blog-article :not(pre) > code,
.prose :not(pre) > code {
  padding: var(--s1) var(--s2);
  border: var(--rule) solid var(--border);
  background: var(--panel);
  color: var(--accent-dark);
}

.article-body pre,
.blog-article pre,
.prose pre {
  max-width: 100%;
  margin: var(--s6) 0;
  padding: var(--s5);
  overflow-x: auto;
  border: var(--rule) solid var(--border);
  background: var(--text);
  color: var(--bg);
  font-family: var(--mono);
  font-size: var(--text-base);
  line-height: var(--code-leading);
  tab-size: 2;
}

.article-download {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s7);
  align-items: center;
  margin-top: var(--s9);
  padding: var(--s7);
  border: var(--rule) solid var(--border);
  background: linear-gradient(to right, var(--bg), var(--lavender));
}

.article-download h2 {
  margin: 0 0 var(--s2);
  color: var(--text);
  font-size: var(--text-section);
  font-weight: var(--medium);
  line-height: var(--heading-leading);
}

.article-download p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: var(--body-leading);
}

.article-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: flex-end;
}

#related-posts {
  max-width: var(--reading-width);
  margin: var(--s10) auto 0;
  padding-top: var(--s8);
  border-top: var(--rule) solid var(--border);
}

#related-posts > h2 {
  margin: 0 0 var(--s6);
  color: var(--text);
  font-size: var(--text-section);
  font-weight: var(--regular);
  line-height: var(--heading-leading);
}

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

.related-card {
  min-width: 0;
  padding: var(--s5);
  border: var(--rule) solid var(--border);
  background: var(--bg);
}

.related-card .post-meta {
  margin-bottom: var(--s3);
}

.related-card h3 {
  font-size: var(--text-body);
}

#post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
  max-width: var(--reading-width);
  margin: var(--s8) auto 0;
}

.post-nav-link {
  display: grid;
  gap: var(--s2);
  min-width: 0;
  padding: var(--s5);
  border: var(--rule) solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color var(--transition-time),
    color var(--transition-time);
}

.post-nav-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.post-nav-next {
  grid-column: 2;
  text-align: right;
}

.post-nav-direction {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--text-caption);
  font-weight: var(--regular);
}

.post-nav-link strong {
  font-size: var(--text-base);
  font-weight: var(--medium);
  line-height: var(--heading-leading);
}

@media (max-width: 800px) {
  .blog-index-hero {
    padding-top: var(--s8);
    padding-bottom: var(--s8);
  }

  .blog-index-hero h1 {
    font-size: var(--text-heading);
  }

  .blog-catalog {
    padding-top: var(--s8);
    padding-bottom: var(--s10);
  }

  .blog-catalog-head {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s5);
  }

  .blog-filters {
    justify-content: flex-start;
  }

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

  .article-shell {
    padding-top: var(--s2);
  }

  .article-hero {
    padding-bottom: var(--s7);
  }

  .article-download {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-download-actions {
    justify-content: flex-start;
  }

  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .blog-index-hero h1 {
    font-size: var(--text-section);
  }

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

  .blog-filter {
    width: 100%;
  }

  .post-card-content h3 {
    font-size: var(--text-brand);
  }

  #post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-nav-next {
    grid-column: 1;
    text-align: left;
  }
}

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