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

.blog-index main,
.article-page main {
  min-width: 0;
}

.blog-skip {
  position: absolute;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1rem;
  transform: translateY(-200%);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

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

.blog-hero {
  padding-block: 3rem 2rem;
  border-bottom: 1px solid var(--border);
}

.blog-hero .eyebrow {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.blog-hero h1 {
  max-width: 100%;
  margin: 0;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.25rem + 2vw, 3rem);
  font-weight: var(--weight-normal);
  line-height: 1.3;
}

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

.blog-shelf {
  padding-block: 2rem var(--space-section);
}

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

.blog-shelf__head h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-normal);
  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: 2.75rem;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
  line-height: 1.4;
  cursor: pointer;
}

.blog-filter:hover {
  background: var(--bg-panel2);
}

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

.blog-filter:focus-visible,
.post-card a:focus-visible,
.post-nav__link: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.5rem;
}

.blog-post-grid > *,
#related-posts > * {
  min-width: 0;
}

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

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

.post-card__meta {
  margin-bottom: 1rem;
}

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

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

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

.blog-post-grid .post-card__summary,
#related-posts .post-card__summary {
  margin: 1rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.85;
}

.post-card .post-card__link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--link);
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

.post-card .post-card__link:hover {
  text-decoration: underline;
}

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

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  max-width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  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: 0.6;
  text-decoration: none;
}

.blog-breadcrumb a:hover,
nav.breadcrumb a:hover,
nav.breadcrumbs a:hover {
  color: var(--accent);
  opacity: 1;
  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.35;
}

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

.article-page main > .section:first-child,
.article-page main.section,
.article-page .section:has(> .blog-breadcrumb),
.article-page .section:has(> nav.breadcrumb),
.article-page .section:has(> nav.breadcrumbs) {
  padding-top: 1.5rem;
  padding-bottom: 0;
}

.article-page .section > .blog-breadcrumb,
.article-page .section > nav.breadcrumb,
.article-page .section > nav.breadcrumbs {
  margin-top: 0;
}

.article-hero,
.article-page .article-hero.section {
  padding-block: 0.5rem 1.75rem;
}

.article-hero .article-meta,
.article-hero .article-hero__meta,
.article-hero .post-meta {
  margin-top: 0;
  margin-bottom: 1rem;
}

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

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

.article-body,
.article-page .prose {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

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

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

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

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

.article-body h2,
.article-page .prose h2 {
  max-width: 100%;
  margin: 2rem 0 1rem;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

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

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

.article-body ul,
.article-body ol,
.article-page .prose ul,
.article-page .prose ol {
  margin-block: 0.75rem 1.25rem;
  padding-left: 1.5rem;
}

.article-body li + li,
.article-page .prose li + li {
  margin-top: 0.5rem;
}

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

.article-body code,
.article-page .prose code {
  padding: 0.125em 0.35em;
  border-radius: var(--r-inner);
  background: var(--bg-panel2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.article-body pre,
.article-page .prose pre {
  max-width: 100%;
  margin: 1.25rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-panel2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  white-space: pre;
  overflow-wrap: normal;
}

.article-body pre code,
.article-page .prose pre code {
  padding: 0;
  border: 0;
  background: var(--clear);
  color: inherit;
  font-size: inherit;
  white-space: inherit;
  overflow-wrap: normal;
}

.article-body blockquote,
.article-page .prose blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--border);
  border-radius: var(--r-inner);
  background: var(--bg-panel2);
  color: var(--text-muted);
}

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

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

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

.article-body table,
.article-page .prose table {
  display: block;
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.article-body .table-scroll table,
.article-page .prose .table-scroll table {
  display: table;
  width: 100%;
  margin: 0;
}

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

.article-body th,
.article-page .prose th {
  background: var(--bg-panel2);
  color: var(--text);
  font-weight: var(--weight-bold);
}

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

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

.article-download h2,
.article-body .article-download h2,
.article-page .prose .article-download h2 {
  margin: 0 0 0.625rem;
  font-size: 1.5rem;
}

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

.article-download__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.article-related {
  margin-block: 2rem;
}

.article-related > h2 {
  margin: 0 0 1.25rem;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-normal);
  line-height: 1.5;
}

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

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

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

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

.post-nav__link:hover {
  background: var(--bg-panel2);
}

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

.post-nav__label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.post-nav__title {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: var(--weight-medium);
  line-height: 1.7;
  overflow-wrap: break-word;
}

@media (max-width: 767px) {
  .blog-hero {
    padding-block: 2rem 1.5rem;
  }

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

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

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

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

  .article-download {
    align-items: flex-start;
    flex-direction: column;
    padding: 1.25rem;
  }

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

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