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

.blog-index,
.blog-article,
.article-body,
.article-hero,
.article-header,
.article-related,
.article-navigation,
#related-posts,
#post-nav {
  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(--accent);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--accent);
  font-family: var(--font-body);
}

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

.blog-index {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

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

.blog-kicker {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.blog-list-hero h1 {
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.15rem + 2vw, 3rem);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: break-word;
}

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

.blog-entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin-top: 1.5rem;
}

.blog-entry-links a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.blog-entry-links a:hover {
  color: var(--accent-dark);
}

.blog-list-section {
  padding-block: 0 1rem;
}

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

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

#blog-count {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

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

.blog-filters button {
  min-height: 2.75rem;
  white-space: normal;
}

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

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

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

.blog-post-grid .post-card:hover,
#related-posts .post-card:hover {
  border-color: var(--border-strong);
}

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

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

.post-meta .tag,
.article-meta .tag {
  display: inline-block;
  padding: 0.1875rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-panel-2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.6;
}

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

.blog-post-grid .post-card h3 a,
#related-posts .post-card h3 a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

.blog-post-grid .post-card .post-read,
#related-posts .post-card .post-read {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent);
  font-size: 0.875rem;
  line-height: 1.7;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.blog-post-grid .post-card .post-read:hover,
#related-posts .post-card .post-read:hover {
  color: var(--accent-dark);
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  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;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-block: 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);
  text-decoration: none;
}

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

.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;
  white-space: nowrap;
}

.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-article-page .section,
.article-page .section,
.blog-article .section {
  padding-block: 1.5rem;
}

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

.blog-article .article-hero,
.blog-article-page .article-hero,
.article-page .article-hero,
.article-hero,
.article-header {
  margin-block: 0;
  padding-block: 0.5rem 1.5rem;
}

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

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

.reading > article > header + .prose {
  padding-top: 20px;
}

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

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

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

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

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

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

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

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

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

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

.article-body h3,
.blog-article .prose h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  font-weight: 800;
  line-height: 1.5;
}

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

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

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

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

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

.article-body :not(pre) > code,
.blog-article .prose :not(pre) > code {
  padding: 0.125em 0.3em;
  border-radius: var(--radius-mark);
  background: var(--bg-panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.article-body pre,
.blog-article .prose pre {
  max-width: 100%;
  margin-block: 1.25rem;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.75;
  tab-size: 2;
}

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

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

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

.article-body img,
.blog-article .prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.article-body .table-wrap,
.blog-article .prose .table-wrap {
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.article-body table,
.blog-article .prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.article-body .table-wrap table,
.blog-article .prose .table-wrap table {
  display: table;
  margin: 0;
}

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

.article-body th,
.blog-article .prose th {
  background: var(--bg-panel-2);
  color: var(--text);
  font-weight: 700;
}

.article-body section.article-download,
.blog-article .prose section.article-download,
.article-download {
  margin-block: 2rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-sheet);
}

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

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

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

.article-related,
.article-navigation {
  margin-top: 2rem;
}

.article-related > h2,
.article-navigation > h2,
.related-heading {
  margin: 0 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.5;
}

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

#related-posts:empty,
#post-nav:empty {
  display: none;
}

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

#post-nav .post-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

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

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

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

#post-nav .post-nav-label,
#post-nav time {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

#post-nav strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.7;
  overflow-wrap: break-word;
}

#post-nav time {
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}

.blog-index a:focus-visible,
.blog-index button:focus-visible,
.blog-breadcrumb a:focus-visible,
nav.breadcrumb a:focus-visible,
nav.breadcrumbs a:focus-visible,
#related-posts a:focus-visible,
#post-nav a:focus-visible,
.article-body a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 1024px) {
  .blog-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .blog-index {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
  }

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

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

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

  .blog-list-lead {
    font-size: 1rem;
  }

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

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

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

  .article-download,
  .article-body section.article-download,
  .blog-article .prose section.article-download {
    padding: 1.25rem;
  }

  .article-body pre,
  .blog-article .prose pre {
    padding: 1rem;
    font-size: 0.8125rem;
  }
}