:root {
  --blog-size-crumb: 13px;
  --blog-size-list-title: clamp(1.5rem, 1.1rem + 2vw, 3rem);
  --blog-size-article-title: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --blog-size-lead: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  --blog-size-h2: 24px;
  --blog-size-h3: 20px;
  --blog-leading-title: 1.32;
  --blog-leading-copy: 1.7;
  --blog-card-space: 1.5rem;
  --blog-chapter-space: 2rem;
  --blog-crumb-link-opacity: 0.7;
  --blog-crumb-separator-opacity: 0.35;
}

.blog-list-main {
  padding-bottom: var(--section-space);
}

.blog-list-hero {
  padding-block: 3rem 2.5rem;
  text-align: center;
}

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

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

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

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.blog-filters button {
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--clear);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-small);
  line-height: var(--leading-body);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

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

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

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

.blog-filters button:focus-visible,
.post-card a:focus-visible,
.post-nav-card:focus-visible,
.blog-skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  box-shadow: var(--focus-ring);
}

.blog-count {
  margin: 1.75rem 0 1rem;
  color: var(--text-muted);
  font-size: var(--size-small);
}

.blog-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--blog-card-space);
}

.blog-catalog .post-card,
#related-posts .post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: auto;
  padding: var(--blog-card-space);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

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

.post-card .post-meta {
  margin-bottom: 1rem;
}

.post-card .badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  background: var(--bg-panel);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
}

.blog-post-grid .post-card h2,
#related-posts .post-card h3 {
  display: block;
  margin: 0;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: var(--blog-size-h3);
  font-weight: var(--weight-display);
  line-height: 1.5;
  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);
}

.post-card .post-summary {
  margin: 1rem 0 1.5rem;
  color: var(--text-muted);
  font-size: var(--size-body);
  line-height: var(--blog-leading-copy);
  overflow-wrap: anywhere;
}

.post-card .post-read {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent);
  font-size: var(--size-small);
  line-height: var(--leading-body);
  text-decoration: none;
}

.post-card .post-read:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

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

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

.blog-skip {
  position: absolute;
  z-index: 100;
  top: 0.5rem;
  left: var(--gutter);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--accent);
}

.blog-skip:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs,
.article-with-fab main > nav:first-child > p {
  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;
  white-space: nowrap;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--blog-size-crumb);
  line-height: var(--leading-body);
}

.blog-breadcrumb a,
nav.breadcrumb a,
nav.breadcrumbs a,
.article-with-fab main > nav:first-child > p > a {
  flex: 0 0 auto;
  color: var(--text-muted);
  opacity: var(--blog-crumb-link-opacity);
  text-decoration: none;
}

.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"],
.article-with-fab main > nav:first-child > p > [aria-hidden="true"] {
  flex: 0 0 auto;
  opacity: var(--blog-crumb-separator-opacity);
}

.blog-breadcrumb [aria-current="page"],
nav.breadcrumb [aria-current="page"],
nav.breadcrumbs [aria-current="page"],
.article-with-fab main > nav:first-child [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  opacity: 1;
}

.article-main,
.article-page main,
.article-with-fab main {
  padding-top: 24px;
}

.article-with-fab main > nav:first-child,
.article-with-fab main > nav:first-child > p {
  margin-top: 0;
}

.article-main.section,
.article-page main.section,
.article-with-fab main.section {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

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

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

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

.article-hero h1,
.article-with-fab main > header h1 {
  display: block;
  max-width: 100%;
  margin: 1rem 0 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-size-article-title);
  font-weight: var(--weight-display);
  line-height: var(--blog-leading-title);
  letter-spacing: var(--tracking-title);
  overflow-wrap: anywhere;
}

.article-hero h1 .word,
.article-with-fab main > header h1 .word {
  white-space: normal;
}

.article-hero .article-lead,
.article-hero .lead,
.article-hero .article-summary,
.article-hero > h1 + p {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: var(--blog-size-lead);
  line-height: var(--blog-leading-copy);
}

.article-main .prose,
.article-page .prose,
.article-with-fab .prose {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--blog-leading-copy);
  overflow-wrap: anywhere;
}

.article-main .prose.section,
.article-page .prose.section,
.article-with-fab .prose.section {
  padding-block: 0;
}

.article-main .prose section,
.article-page .prose section,
.article-with-fab .prose section {
  margin: 0;
  padding-block: 0;
}

.article-main .prose section + section,
.article-page .prose section + section,
.article-with-fab .prose section + section {
  margin-top: var(--blog-chapter-space);
}

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

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

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

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

.prose > p:first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose blockquote {
  margin-block: 0 1.25rem;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.5rem;
}

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

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

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

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.prose :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text);
}

.prose pre {
  max-width: 100%;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-panel);
  color: var(--text);
  line-height: var(--leading-body);
}

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

.prose blockquote {
  padding: 0.75rem 1.25rem;
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-muted);
}

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

.prose img,
.prose svg {
  max-width: 100%;
}

.article-download {
  margin: 2rem 0 0;
  padding: 1.75rem;
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  color: var(--text);
}

.prose .article-download h2 {
  margin: 0 0 1rem;
}

.article-download p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  line-height: var(--blog-leading-copy);
}

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

.article-download > a {
  margin-inline-end: 0.5rem;
  margin-bottom: 0.5rem;
}

#related-posts {
  margin-top: 2.5rem;
}

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

#related-posts .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: 1rem;
  margin-top: 2rem;
}

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

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

.post-nav-caption {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: var(--size-small);
}

.post-nav-title {
  display: block;
  color: var(--text);
  font-size: var(--size-body);
  font-weight: var(--weight-display);
  line-height: var(--blog-leading-copy);
  overflow-wrap: anywhere;
}

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

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

.article-with-fab {
  padding-bottom: 5.5rem;
}

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

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

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

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

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

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

  .blog-filters {
    justify-content: flex-start;
  }
}

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