.blog-list-page {
  background: var(--bg);
  color: var(--text);
}

.blog-skip {
  position: fixed;
  top: 0.75rem;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--text);
  font-family: var(--font-body);
  transform: translateY(-180%);
}

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

.blog-list-hero {
  padding-block: 3.5rem 5rem;
  background: var(--bg-stage);
  color: var(--on-dark);
}

.blog-list-hero .eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
}

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

.blog-list-hero__lead {
  max-width: 42rem;
  margin: 1.25rem 0 1.75rem;
  color: var(--on-dark-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.blog-catalogue {
  position: relative;
  margin-top: -1.5rem;
  padding-top: 2.5rem;
  padding-bottom: 5rem;
  border-radius: var(--r-cut) var(--r-cut) 0 0;
  background: var(--bg);
}

.blog-catalogue__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.blog-catalogue__head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  line-height: 1.4;
}

#blog-result-count {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

.blog-filters button {
  min-height: 2.75rem;
  padding: 0.625rem 1.125rem;
  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;
  font-weight: var(--weight-medium);
  line-height: 1.4;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

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

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

.blog-filters button:focus-visible,
.post-card a:focus-visible,
#post-nav a:focus-visible,
.blog-download-modal a:focus-visible,
.blog-download-modal button:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 4px;
}

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

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

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

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

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

.post-card__title {
  margin: 0;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-bold);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.post-card__title a {
  color: var(--text);
  text-decoration: none;
}

.post-card__title a:hover {
  color: var(--accent-dark);
}

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

.post-card__more {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.25rem;
  color: var(--accent-dark);
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  line-height: 1.6;
  text-decoration: none;
}

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

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

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

.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-top: 0;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
}

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

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

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

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

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

main.reading h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  line-height: 1.3;
}

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

.article-hero,
.article-header {
  padding-block: 0 1.75rem;
  color: var(--text);
}

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

.article-meta,
.article-hero__meta,
.article-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.article-page h1,
.article-hero h1,
.article-header h1 {
  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-bold);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.article-lead,
.article-hero__lead,
.article-header__lead {
  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,
.article-page .prose {
  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,
.article-page .prose > :first-child {
  margin-top: 0;
}

.article-body section,
.article-page .prose section {
  margin-block: 2rem 0;
  padding-block: 0;
}

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

.article-body h2,
.article-page .prose h2 {
  margin-block: 2rem 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  font-weight: var(--weight-bold);
  line-height: 1.5;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

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

.article-body h3,
.article-page .prose h3 {
  margin-block: 1.5rem 0.75rem;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  font-weight: var(--weight-semibold);
  line-height: 1.55;
}

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

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

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

.article-body a:not([class*="btn"]):not([class*="button"]),
.article-page .prose a:not([class*="btn"]):not([class*="button"]) {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

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

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

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

.article-body img,
.article-page .prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-small);
}

.article-body table,
.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-block: 1.5rem;
  border-collapse: collapse;
  overflow-x: auto;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.7;
}

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

.article-body th,
.prose th {
  background: var(--bg-panel);
  font-weight: var(--weight-semibold);
}

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

.article-download__copy {
  flex: 1 1 18rem;
  min-width: 0;
}

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

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

.article-download__actions,
.dl-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

#related-posts:empty,
#post-nav:empty {
  display: none;
}

#related-posts .blog-related__heading {
  margin: 0 0 1.25rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  line-height: 1.5;
}

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

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

#related-posts .post-card__title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.65;
}

#related-posts .post-card__summary {
  margin: 0;
  color: var(--text-muted);
}

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

.blog-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-card);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

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

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

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

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

body.blog-modal-open {
  overflow: hidden;
}

.blog-download-modal {
  position: fixed;
  inset: 0;
  width: min(32rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-panel);
  background: var(--clear);
  color: var(--text);
  font-family: var(--font-body);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(0.625rem);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.blog-download-modal::backdrop {
  background: var(--veil);
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.blog-download-modal.is-open {
  opacity: 1;
  transform: translateY(0);
}

.blog-download-modal.is-open::backdrop {
  opacity: 1;
}

.blog-download-modal__panel {
  position: relative;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--bg);
  color: var(--text);
}

.blog-download-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-round);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.blog-download-modal__close:hover {
  background: var(--bg-panel);
}

.blog-download-modal__brand {
  margin: 0 3rem 1rem 0;
  color: var(--accent-dark);
  font-size: 0.875rem;
  font-weight: var(--weight-semibold);
  line-height: 1.6;
}

.blog-download-modal h2 {
  margin: 0 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  line-height: 1.4;
}

#blog-download-description {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

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

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

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

  .blog-list-hero__lead {
    font-size: 1rem;
  }

  .blog-catalogue {
    padding-top: 2rem;
    padding-bottom: 3rem;
  }

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

  .post-card {
    padding: 1.5rem;
  }

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

  .article-download,
  .article-body .dl-card,
  .article-page .prose .dl-card {
    padding: 1.25rem;
  }

  .article-download__actions,
  .dl-card__actions {
    width: 100%;
  }

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

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

  .blog-download-modal__panel {
    padding: 2rem 1.5rem;
  }
}

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

  .blog-download-modal {
    transform: none;
  }
}