:root {
  --blog-fs-meta: 0.8125rem;
  --blog-fs-title: clamp(2rem, 1.5rem + 2vw, 3rem);
  --blog-fs-article-title: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --blog-fs-lead: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  --blog-fs-h2: 1.5rem;
  --blog-fs-h3: 1.25rem;
  --blog-weight: 400;
  --blog-line-title: 1.32;
  --blog-line-body: 1.8;
  --blog-line-lead: 1.7;
  --blog-line-heading: 1.45;
  --blog-line-meta: 1.6;
  --blog-breadcrumb-link-opacity: 0.68;
  --blog-breadcrumb-separator-opacity: 0.35;
  --blog-rule: 1px solid var(--border);
  --blog-focus: 2px solid var(--accent-dark);
}

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

.blog-list-hero {
  padding-block: 1.5rem 2.5rem;
  border-bottom: var(--blog-rule);
}

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--blog-fs-meta);
  line-height: var(--blog-line-meta);
}

.blog-list-hero h1 {
  display: block;
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-fs-title);
  font-weight: var(--blog-weight);
  line-height: var(--blog-line-title);
}

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

.blog-catalog {
  padding-block: 2rem;
}

.blog-catalog-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.blog-filter {
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  border: var(--blog-rule);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--blog-weight);
  line-height: var(--blog-line-meta);
  cursor: pointer;
}

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

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

.blog-status {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--blog-fs-meta);
  line-height: var(--blog-line-meta);
}

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

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

.blog-post-card,
.related-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.75rem;
  border: var(--blog-rule);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-panel);
  color: var(--text);
}

.blog-post-card h2,
.related-card h3 {
  display: block;
  max-width: 100%;
  margin: 1rem 0 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-fs-h3);
  font-weight: var(--blog-weight);
  line-height: var(--blog-line-heading);
  overflow-wrap: break-word;
}

.blog-post-card .post-meta,
.related-card .post-meta,
.article-meta,
.article-hero .post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 1rem;
  color: var(--text-muted);
  font-size: var(--blog-fs-meta);
  line-height: var(--blog-line-meta);
}

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

.blog-post-card .tag,
.related-card .tag {
  max-width: 100%;
  padding: 0.25rem 0.625rem;
  border: var(--blog-rule);
  border-radius: var(--r-pill);
  background: var(--bg-panel-2);
  color: var(--text-muted);
  font-size: var(--blog-fs-meta);
  white-space: normal;
  overflow-wrap: anywhere;
}

.blog-title-link,
.article-body .blog-title-link {
  color: var(--text);
  text-decoration: none;
}

.blog-title-link:hover,
.article-body .blog-title-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.blog-post-summary {
  margin: 1rem 0 1.5rem;
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: var(--blog-line-body);
}

.blog-post-card .post-link,
.related-card .post-link {
  align-self: flex-start;
  margin-top: auto;
  padding-block: 0.375rem;
  color: var(--accent-dark);
  font-size: var(--fs-sm);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

.blog-post-card .post-link:hover,
.related-card .post-link:hover {
  text-decoration: underline;
}

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

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

.blog-skip {
  position: fixed;
  top: 0.5rem;
  left: 1rem;
  z-index: 100;
  transform: translateY(-200%);
  padding: 0.75rem 1rem;
  border: var(--blog-rule);
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
}

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

.blog-filter:focus-visible,
.blog-skip:focus-visible,
.blog-post-card a:focus-visible,
.related-card a:focus-visible,
#post-nav a:focus-visible,
.blog-breadcrumb a:focus-visible,
nav.breadcrumb a:focus-visible,
nav.breadcrumbs a:focus-visible {
  outline: var(--blog-focus);
  outline-offset: 4px;
}

main.reading:has(> nav:first-child [aria-current="page"]) {
  padding-top: 2rem;
}

main.reading > nav:first-child:has([aria-current="page"]) {
  min-width: 0;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: var(--blog-fs-meta);
  line-height: var(--blog-line-meta);
}

main.reading > nav:first-child > p {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin: 0;
  min-width: 0;
}

main.reading > nav:first-child > p > a,
main.reading > nav:first-child > p > [aria-hidden="true"] {
  flex: 0 0 auto;
}

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

.article-page,
.article-main {
  min-width: 0;
  padding-top: 0;
}

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

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-width: 0;
  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: var(--blog-fs-meta);
  line-height: var(--blog-line-meta);
  white-space: nowrap;
}

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

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

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

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

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

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

.article-hero h1,
.article-header h1,
main.reading > header h1,
main.reading > article > header h1 {
  display: block;
  max-width: 100%;
  margin: 1rem 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-fs-article-title);
  font-weight: var(--blog-weight);
  line-height: var(--blog-line-title);
  overflow-wrap: break-word;
}

.article-lead,
.article-hero .lead,
.article-header .lead {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: var(--blog-fs-lead);
  line-height: var(--blog-line-lead);
}

.article-body {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--blog-line-body);
  overflow-wrap: break-word;
}

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

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

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

.article-body h2,
.article-body h3 {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: var(--blog-weight);
  line-height: var(--blog-line-heading);
}

.article-body h2 {
  margin: 2rem 0 1rem;
  font-size: var(--blog-fs-h2);
}

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

.article-body h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: var(--blog-fs-h3);
}

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

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

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

.article-body a:not([class*="btn"]):not([class*="button"]):not(.blog-title-link):not(.post-nav-card) {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-body code {
  padding: 0.125rem 0.3rem;
  border-radius: var(--r-xs);
  background: var(--bg-panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.article-body pre {
  max-width: 100%;
  margin-block: 1.25rem;
  padding: 1.25rem;
  overflow-x: auto;
  border: var(--blog-rule);
  border-radius: var(--r-md);
  background: var(--bg-panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--blog-line-lead);
  white-space: pre;
  overflow-wrap: normal;
}

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

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

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

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

.article-body table {
  display: block;
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.article-body .table-scroll > table {
  display: table;
  min-width: 100%;
  margin: 0;
}

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

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

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

.article-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-block: 2rem;
  padding: 1.5rem;
  border: var(--blog-rule);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-panel);
}

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

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

.article-download p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: var(--blog-line-lead);
}

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

#related-posts {
  min-width: 0;
  margin-block: 2rem;
  padding-block: 1.5rem 0;
  border-top: var(--blog-rule);
}

#related-posts .related-heading {
  display: block;
  margin: 0 0 1.25rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-fs-h2);
  font-weight: var(--blog-weight);
  line-height: var(--blog-line-heading);
}

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

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

#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;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  padding: 1.25rem;
  border: var(--blog-rule);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
}

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

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

.post-nav-label {
  color: var(--text-muted);
  font-size: var(--blog-fs-meta);
  line-height: var(--blog-line-meta);
}

.post-nav-title {
  color: var(--text);
  font-size: var(--fs-body);
  line-height: var(--blog-line-lead);
  overflow-wrap: break-word;
}

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

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

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

  .blog-index-main {
    padding-top: 1.5rem;
  }

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

  .blog-list-hero h1 {
    font-size: var(--fs-mobile-h1);
  }

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

  .blog-post-card {
    padding: 1.25rem;
  }

  .blog-catalog-tools {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

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