.blog-main {
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.blog-skip {
  position: fixed;
  top: 0.75rem;
  left: 1.25rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  transform: translateY(-180%);
}

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

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

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

.blog-hero h1 {
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  font-weight: var(--weight-normal);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

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

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

.blog-filters button {
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  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.875rem;
  font-weight: var(--weight-normal);
  line-height: 1.5;
  cursor: pointer;
  transition: background var(--time-fast) var(--ease-out),
    color var(--time-fast) var(--ease-out),
    border-color var(--time-fast) var(--ease-out);
}

.blog-filters button:hover {
  background: var(--bg-panel);
  color: var(--text);
}

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

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

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

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

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

.blog-post-grid .post-card,
#related-posts .post-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--text);
}

.blog-post-grid .post-card:hover,
#related-posts .post-card:hover {
  background: var(--bg-panel);
}

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

.post-card__meta time {
  font-family: var(--font-mono);
}

.post-card__meta .badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.blog-post-grid .post-card h2,
#related-posts .post-card h3 {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-normal);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.blog-post-grid .post-card h2 a,
#related-posts .post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

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

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

.blog-post-grid .post-card__link,
#related-posts .post-card__link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--link);
  font-size: 0.875rem;
  line-height: 1.6;
  text-decoration: none;
}

.post-card__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

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

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

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding-block: 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);
  opacity: 0.65;
  text-decoration: none;
}

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

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

.has-article-fab main.wrap.reading {
  padding-top: 2rem;
}

.has-article-fab main.section,
.has-article-fab .article-page.section {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

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

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

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

.article-hero h1,
.has-article-fab main h1 {
  max-width: 100%;
  margin-block: 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: var(--weight-normal);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

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

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

.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,
.has-article-fab .prose h2 {
  margin: 2rem 0 0.875rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 0.7vw, 1.5rem);
  font-weight: var(--weight-normal);
  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,
.article-body section > h2:first-child,
.has-article-fab .prose > h2:first-of-type {
  margin-top: 0;
}

.article-body h3,
.has-article-fab .prose h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-normal);
  line-height: 1.55;
  scroll-margin-top: calc(var(--nav-h) + 1.25rem);
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body .table-scroll {
  margin-block: 1rem;
}

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

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

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

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

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

.article-body pre {
  max-width: 100%;
  min-width: 0;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 2;
}

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

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

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

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

.article-body .table-scroll,
.has-article-fab .prose .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.article-body table,
.has-article-fab .prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.article-body th,
.article-body td,
.has-article-fab .prose th,
.has-article-fab .prose td {
  min-width: 7em;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

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

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-block: 1.5rem;
  border-radius: var(--r-md);
}

.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-lg);
  background: var(--bg-panel);
  color: var(--text);
}

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

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

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

.article-download .button-row,
.article-download__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

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

#related-posts .related-heading {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-normal);
  line-height: 1.5;
}

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

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

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

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

#post-nav .post-nav__link {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

#post-nav .post-nav__link:hover {
  background: var(--bg-panel);
}

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

.post-nav__label {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.post-nav__title {
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

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

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

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

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

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

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

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

  .article-hero h1,
  .has-article-fab main h1 {
    font-size: 1.5rem;
  }

  .article-download {
    align-items: stretch;
    padding: 1.25rem;
  }

  .article-download .button-row,
  .article-download__actions {
    width: 100%;
  }

  .article-download .button-row > a,
  .article-download__actions > a {
    flex: 1 1 8rem;
  }

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

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

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