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

.blog-skip {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-start: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1rem;
  transform: translateY(-180%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--text);
}

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

.blog-list-main {
  padding-block: 3rem 4rem;
}

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

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.blog-list-hero h1 {
  display: block;
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3.5vw, 3rem);
  font-weight: var(--weight-regular);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

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

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

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

.blog-filter[aria-pressed="true"] {
  border-color: var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
}

.blog-filter:focus-visible,
.blog-skip: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: var(--focus-ring);
  outline-offset: 4px;
}

.blog-result-count {
  min-height: 1.5em;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.post-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
  color: var(--text);
}

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

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

.post-meta .tag,
.article-meta .tag {
  max-width: 100%;
  padding: 0.2rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.post-card h2,
.post-card h3 {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-regular);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

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

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

.post-card .post-summary {
  margin: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.post-card .post-read {
  margin-top: auto;
  color: var(--accent-soft);
  font-size: 0.875rem;
  line-height: 1.6;
  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-block: 1.25rem;
  color: var(--muted);
  line-height: 1.8;
}

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

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

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

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

main.reading > nav:first-child [aria-hidden="true"],
.blog-breadcrumb [aria-hidden="true"],
nav.breadcrumb [aria-hidden="true"],
nav.breadcrumbs [aria-hidden="true"] {
  flex: 0 0 auto;
  color: var(--muted);
  opacity: 0.58;
}

main.reading > nav:first-child [aria-current="page"],
.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(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

main.reading > nav:first-child > p {
  margin-top: 0;
}

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

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

main.reading h1,
.article-hero h1,
.blog-article h1 {
  display: block;
  width: 100%;
  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: var(--weight-regular);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.article-hero .article-lead,
.article-hero .article-summary,
.article-hero > p:last-child {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
}

.article-body,
.blog-article .prose {
  min-width: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.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 {
  display: block;
  max-width: 100%;
  margin: 2rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: var(--weight-regular);
  line-height: 1.45;
}

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

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

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

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

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

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

.article-body :not(pre) > code,
.blog-article .prose :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: var(--r-xs);
  background: var(--panel-2);
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: normal;
}

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

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

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

.article-body table,
.blog-article .prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  color: var(--text);
}

.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: start;
  vertical-align: top;
}

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

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

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

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

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

.article-download p,
.article-body .article-download p,
.blog-article .prose .article-download p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

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

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

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

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

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

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

#post-nav .post-nav-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

.post-nav-label,
.post-nav-date {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.post-nav-date {
  margin-top: auto;
}

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

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

@media (max-width: 640px) {
  .blog-list-main {
    padding-block: 1.5rem 3rem;
  }

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

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

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

  .post-card {
    padding: 1.25rem;
  }

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

  .article-download {
    padding: 1.25rem;
  }

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