.blog-index,
.article-page,
.blog-article {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
}

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

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

.blog-index {
  padding-block: 2.5rem 5rem;
}

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

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}

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

.blog-list-lead {
  margin: 1.25rem auto 0;
  max-width: 42rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.blog-browser {
  min-width: 0;
}

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

.blog-filter {
  min-height: 44px;
  padding: 0.7rem 1.125rem;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background var(--duration) var(--ease-out);
}

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

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

.blog-filter:focus-visible,
.post-card a:focus-visible,
.post-nav-card:focus-visible,
.blog-skip:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 4px;
}

.blog-count {
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.7;
  text-align: center;
}

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

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 1.75rem;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-float);
}

.post-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.6;
}

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

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

.post-meta .tag,
.article-meta .tag {
  display: inline-block;
  max-width: 100%;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: break-word;
}

.post-card h2,
.post-card h3 {
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: break-word;
}

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

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

.post-card .post-read {
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent-dark);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.7;
  text-decoration: none;
}

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

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

.blog-empty a {
  color: var(--accent-dark);
  text-underline-offset: 0.2em;
}

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  white-space: nowrap;
}

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

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

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

:is(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs) [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.article-page, .blog-article, main:has(.article-hero)).section {
  padding-top: 1.25rem;
  padding-bottom: 3rem;
}

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

main.wrap.reading {
  padding-top: 32px;
}

.article-hero,
.article-header {
  min-width: 0;
  margin: 0 0 2rem;
  padding-block: 0.5rem 1rem;
}

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

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

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

.article-lead,
.article-summary,
.article-hero .lede,
.article-header .lede {
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
}

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

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

.prose h2 {
  margin: 2rem 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.5;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

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

.prose h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.55;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.125rem;
}

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

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

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

.prose section,
.prose section.section {
  margin-block: 0 1.5rem;
  padding-block: 0;
}

.prose section + section,
.prose section.section + section.section {
  margin-top: 0;
}

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

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

.prose :not(pre) > code {
  padding: 0.125em 0.35em;
  border-radius: var(--r-xs);
  background: var(--bg-panel);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.875em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.prose pre {
  max-width: 100%;
  margin: 1.25rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: var(--code-lh);
  tab-size: 2;
}

.prose pre code {
  padding: 0;
  background: var(--clear);
  color: inherit;
  font-family: var(--font-mono);
  font-size: inherit;
  white-space: pre;
  overflow-wrap: normal;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding: 1.25rem 1.5rem;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  color: var(--text-secondary);
}

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

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

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

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.prose .table-scroll table {
  display: table;
  margin: 0;
}

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

.prose th {
  background: var(--bg-panel);
  color: var(--text);
  font-weight: 600;
}

.article-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  margin-block: 2rem 0;
  padding: 1.75rem;
  border-radius: var(--r-xl);
  background: var(--bg-panel);
  color: var(--text);
}

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

.article-download h2,
.prose .article-download h2 {
  margin: 0 0 0.625rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.5;
}

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

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

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

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

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

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

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

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

.post-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
}

.post-nav-card:hover {
  background: var(--bg-panel-2);
}

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

.post-nav-label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.post-nav-title {
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

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

@media (max-width: 680px) {
  .blog-index {
    padding-block: 1.5rem 3rem;
  }

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

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

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

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

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

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

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

  .article-download {
    padding: 1.25rem;
  }

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

  .article-download .button-row > * {
    flex: 1 1 auto;
  }
}

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