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

.blog-skip {
  position: absolute;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
}

.blog-skip:focus {
  opacity: 1;
  pointer-events: auto;
}

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

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

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

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

.blog-catalog {
  padding: 2rem;
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
}

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

.blog-catalog-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.5;
}

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

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 1.5rem 2rem;
}

.blog-filters button {
  min-height: 44px;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}

.blog-filters button:hover,
.blog-filters button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.blog-filters button[aria-pressed="true"] {
  font-weight: 700;
}

.blog-filters button:focus-visible,
.post-card a:focus-visible,
.related-card a:focus-visible,
.post-nav-card:focus-visible,
.blog-skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

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

.post-card,
.related-card {
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
}

.post-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.post-meta,
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 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-tag {
  display: inline-block;
  max-width: 100%;
  padding: 0.1875rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  line-height: 1.6;
  white-space: normal;
}

.post-card h3,
.related-card h3 {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.6;
}

.post-title-link,
.article-body .post-title-link,
.prose .post-title-link {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: break-word;
}

.post-title-link:hover,
.article-body .post-title-link:hover,
.prose .post-title-link:hover {
  color: var(--accent);
}

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

.post-read {
  display: inline-block;
  margin-top: auto;
  padding-top: 1.25rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.post-read:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem;
  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;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
}

.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);
}

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

main.reading:has(> article > .article-body) {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

main.reading:has(> article > .article-body) > nav {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

main.reading:has(> article > .article-body) > nav > p {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin: 0;
  white-space: nowrap;
}

main.reading:has(> article > .article-body) > nav a {
  flex: 0 0 auto;
  color: inherit;
}

main.reading:has(> article > .article-body) > nav [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main.reading > article:has(> .article-body) > header {
  padding-bottom: 12px;
}

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

main.reading > article:has(> .article-body) > header .sec-lead {
  margin: 1rem 0 0;
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
}

main.reading > article > header + .article-body {
  padding-top: 12px;
}

/* Compact article rhythm also catches existing page-shell class variants. */
.article-page main.section,
.blog-article main.section,
main.reading.section,
.article-shell.section,
.section:has(> .blog-breadcrumb),
.section:has(> nav.breadcrumb),
.section:has(> nav.breadcrumbs) {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

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

.article-hero .article-meta,
.article-header .article-meta,
.article-hero .post-meta,
.article-header .post-meta {
  margin: 0 0 1rem;
}

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

.article-lead,
.article-summary,
.article-hero > p:last-child,
.article-header > p:last-child {
  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 {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

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

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

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

.article-body h2,
.prose h2 {
  margin: 2rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.5;
  color: var(--text);
}

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

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

.article-body h3,
.prose h3 {
  margin: 1.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text);
}

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

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

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

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

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

.article-body :not(pre) > code,
.prose :not(pre) > code {
  padding: 0.125em 0.375em;
  border-radius: var(--radius-xs);
  background: var(--bg-panel);
  color: var(--text);
}

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

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

.article-body blockquote,
.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-muted);
}

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

.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%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

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

.article-body th,
.prose th {
  background: var(--bg-panel);
  color: var(--text);
}

.download-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem 1.5rem;
  margin-block: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}

.download-guide > div:first-child {
  flex: 1 1 17rem;
  min-width: 0;
}

.download-guide h2,
.article-body .download-guide h2,
.prose .download-guide h2 {
  margin: 0 0 0.625rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

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

.download-guide .cluster,
.download-guide .download-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#related-posts {
  min-width: 0;
  margin-top: 2rem;
}

#related-posts > h2 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  line-height: 1.5;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

.related-card h3 {
  font-size: 1.0625rem;
}

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

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

.article-body a.post-nav-card,
.prose a.post-nav-card {
  color: var(--text);
}

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

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

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

.post-nav-card strong {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.7;
  font-weight: 600;
  overflow-wrap: break-word;
}

@media (min-width: 821px) {
  .related-grid {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
  }
}

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

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

  .blog-hero h1 {
    font-size: 1.875rem;
  }

  .blog-catalog {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

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

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

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

  .blog-breadcrumb,
  nav.breadcrumb,
  nav.breadcrumbs {
    margin-top: 1.25rem;
  }

  .download-guide {
    padding: 1.25rem;
  }
}

@media (max-width: 639px) {
  .related-grid,
  #post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

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

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