.blog-main {
  padding-top: 2rem;
  padding-bottom: 5rem;
}

main.reading {
  padding-top: 32px;
}

main.reading > nav > p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  white-space: nowrap;
}

main.reading > nav a {
  flex-shrink: 0;
}

main.reading > nav [aria-current="page"] {
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main.reading > article > header {
  padding-bottom: 12px;
}

main.reading > article > header h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  line-height: 1.4;
}

main.reading > article > header > p:last-child {
  margin-bottom: 0;
}

main.reading > article > header + .prose,
main.reading > article > header + section {
  margin-top: 0;
  padding-top: 20px;
}

main.reading > article > header + .prose > :first-child,
main.reading > article > header + section > :first-child {
  margin-top: 0;
}

.blog-hero {
  padding: 3rem;
  border-radius: var(--r-canvas);
  background: var(--bg-panel);
  color: var(--text);
}

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.blog-hero h1 {
  max-width: 100%;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 2.6vw + 1rem, 3rem);
  font-weight: var(--weight-regular);
  line-height: 1.3;
  overflow-wrap: break-word;
}

.blog-intro {
  max-width: 42rem;
  margin: 1.25rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.blog-library {
  padding-top: 3rem;
}

.blog-library-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

.blog-library-head h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-regular);
  line-height: 1.4;
}

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

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
}

.blog-filter {
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: var(--weight-regular);
  line-height: 1.4;
  cursor: pointer;
}

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

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

.blog-filter:focus-visible,
.post-card a:focus-visible,
.post-nav-card:focus-visible,
.blog-breadcrumb a:focus-visible,
nav.breadcrumb a:focus-visible,
nav.breadcrumbs a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

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

.blog-post-grid .post-card,
#related-posts .post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
  box-shadow: none;
}

.post-meta,
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.post-meta time,
.article-meta time {
  font-variant-numeric: tabular-nums;
}

.post-card .post-meta {
  margin: 0 0 1rem;
}

.blog-post-grid .post-card h3,
#related-posts .post-card h3 {
  max-width: 100%;
  margin: 0 0 0.875rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-regular);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

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

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

.post-card .post-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.8;
}

.post-card .post-read {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 1.5rem;
  color: var(--accent);
  font-size: 0.9375rem;
  text-decoration: none;
}

.post-card .post-read:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem;
  border-radius: var(--r-window);
  background: var(--bg-panel);
  color: var(--text-muted);
  line-height: 1.8;
}

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

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

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

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

.blog-breadcrumb [aria-hidden="true"],
nav.breadcrumb [aria-hidden="true"],
nav.breadcrumbs [aria-hidden="true"] {
  flex: 0 0 auto;
  color: var(--text-muted);
  opacity: 0.55;
}

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

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

.blog-article > .section:first-child,
.article-page > .section:first-child {
  padding-top: 1.5rem;
  padding-bottom: 0;
}

.article-hero,
.article-hero.section {
  padding-top: 0.5rem;
  padding-bottom: 1.75rem;
  color: var(--text);
}

.article-hero .article-meta,
.article-hero .post-meta {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 13px;
}

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

.article-hero .article-lead,
.article-hero .article-summary,
.article-hero .lede {
  max-width: 100%;
  margin-top: 1rem;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
}

.article-body,
.article-content {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.article-body.section,
.article-content.section {
  padding-top: 0;
  padding-bottom: 2rem;
}

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

.article-body section:first-child,
.article-content section:first-child {
  margin-top: 0;
}

.article-body h2,
.article-content h2,
.blog-article .prose h2,
.article-page .prose h2 {
  max-width: 100%;
  margin: 2rem 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

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

.article-body h3,
.article-content h3,
.blog-article .prose h3,
.article-page .prose h3 {
  max-width: 100%;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-medium);
  line-height: 1.5;
}

.article-body p,
.article-content p,
.article-body ul,
.article-content ul,
.article-body ol,
.article-content ol {
  margin-block: 0 1rem;
}

.article-body li + li,
.article-content li + li {
  margin-top: 0.375rem;
}

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

.article-body code,
.article-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.article-body :not(pre) > code,
.article-content :not(pre) > code {
  padding: 0.125em 0.3em;
  border-radius: var(--r-small);
  background: var(--bg-panel);
  color: var(--text);
}

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

.article-body pre code,
.article-content pre code {
  white-space: pre;
  overflow-wrap: normal;
}

.article-body blockquote,
.article-content blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-small);
  background: var(--bg-panel);
  color: var(--text-muted);
}

.article-body blockquote p:last-child,
.article-content blockquote p:last-child {
  margin-bottom: 0;
}

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

.article-body table,
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.article-body th,
.article-body td,
.article-content th,
.article-content td {
  min-width: 7em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

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

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

.article-download {
  margin-block: 2rem 0;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
}

.article-download h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

.article-download p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.article-download .cta-row,
.article-download .article-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

#related-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  max-width: min(100%, 820px);
  margin: 2.5rem auto 0;
}

#related-posts > h2 {
  grid-column: 1 / -1;
  margin: 0 0 0.25rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

#related-posts .post-card {
  padding: 1.25rem;
}

#related-posts .post-card h3 {
  font-size: 1.125rem;
}

#related-posts .post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

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

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

#post-nav .post-nav-card {
  display: block;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-window);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

#post-nav .post-nav-card:hover {
  border-color: var(--accent);
}

.post-nav-card--prev {
  grid-column: 1;
}

.post-nav-card--next {
  grid-column: 2;
}

.post-nav-label {
  display: block;
  margin-bottom: 0.625rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.post-nav-title {
  display: block;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

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

@media (max-width: 640px) {
  .blog-main {
    padding-top: 1.25rem;
    padding-bottom: 3rem;
  }

  .blog-hero {
    padding: 1.75rem 1.25rem;
  }

  .blog-hero h1 {
    font-size: clamp(1.5rem, 5vw, 1.875rem);
  }

  .blog-intro {
    font-size: 1rem;
  }

  .blog-library {
    padding-top: 2rem;
  }

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

  .blog-post-grid .post-card {
    padding: 1.25rem;
  }

  .article-hero h1 {
    font-size: 1.5rem;
  }

  .article-download {
    padding: 1.25rem;
  }

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

  .post-nav-card--prev,
  .post-nav-card--next {
    grid-column: 1;
  }
}