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

.blog-skip {
  position: absolute;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--r-small);
  background: var(--bg);
  color: var(--accent-dark);
  transform: translateY(-180%);
}

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

.blog-list-hero {
  padding-block: 3.5rem 3rem;
  background: var(--grad-glow), var(--grad-hero);
  color: var(--on-dark);
}

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--on-dark-soft);
  font-size: 0.875rem;
}

.blog-list-hero h1 {
  max-width: 100%;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1rem + 3vw, 3rem);
  font-weight: 400;
  line-height: 1.3;
}

.blog-list-intro {
  max-width: 44rem;
  margin: 1.25rem 0 0;
  color: var(--on-dark-soft);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.blog-list-section {
  padding-block: 2.5rem 4rem;
}

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

.blog-filters button {
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  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;
  line-height: 1.5;
  cursor: pointer;
}

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

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

.blog-list-status {
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

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

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

.blog-post-grid .article-card,
#related-posts .article-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

.article-meta,
.article-hero .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.7;
}

.article-meta time,
.article-hero .post-meta time {
  font-family: var(--font-mono);
}

.article-meta .chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.blog-post-grid .article-card h2,
#related-posts .article-card h3 {
  max-width: 100%;
  margin: 1rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.55;
}

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

.article-card .article-more {
  margin-top: auto;
  padding-top: 0.25rem;
  color: var(--accent-dark);
  font-size: 0.9375rem;
}

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

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

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

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

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

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

.blog-breadcrumb [aria-hidden="true"],
nav.breadcrumb [aria-hidden="true"],
nav.breadcrumbs [aria-hidden="true"] {
  flex: 0 0 auto;
  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;
}

.article-page main.section,
.has-dl-fab main.section {
  padding-block: 0 3rem;
}

main.reading {
  padding-block: 2rem 3rem;
}

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

main.reading > nav:first-child p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.article-hero .article-meta,
.article-hero .post-meta,
main.reading > article > header .article-meta {
  margin: 0 0 0.875rem;
}

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

.article-hero .article-lead,
.article-hero .lead,
.article-hero .article-summary,
.article-hero > p,
main.reading > article > header > p {
  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,
.prose {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.article-body section,
.prose section,
.article-body section.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, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
}

.article-body > h2:first-child,
.prose > h2:first-child,
.article-body > section:first-child > h2:first-child,
.prose > section:first-child > h2:first-child,
.article-body section + section > h2:first-child,
.prose section + 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;
  font-weight: 400;
  line-height: 1.5;
}

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

.article-body ul,
.article-body ol,
.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.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-dark);
  text-underline-offset: 0.2em;
}

.article-body a:not([class*="btn"]):not([class*="button"]):hover,
.prose a:not([class*="btn"]):not([class*="button"]):hover {
  text-decoration-thickness: 2px;
}

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

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

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

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

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

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

.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%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.9375rem;
}

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

.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;
  word-break: normal;
  overflow-wrap: normal;
}

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

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

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

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

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

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

#related-posts,
#related-posts.section {
  margin-block: 2rem;
  padding-block: 0;
}

#related-posts > h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.5;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 1.25rem;
}

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

#post-nav .post-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-window);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

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

.post-nav-label {
  color: var(--accent-dark);
  font-size: 0.875rem;
}

.post-nav-title {
  font-size: 1rem;
  line-height: 1.7;
}

#post-nav time {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.blog-filters button:focus-visible,
.blog-post-grid a:focus-visible,
#related-posts a:focus-visible,
#post-nav a: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;
}

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

@media (max-width: 680px) {
  .blog-list-hero {
    padding-block: 2.5rem 2rem;
  }

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

  .blog-list-section {
    padding-block: 1.75rem 3rem;
  }

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

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

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

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

  .article-download {
    padding: 1.25rem;
  }

  .article-download .btn-row {
    width: 100%;
  }
}