:root {
  --blog-text-crumb: 13px;
  --blog-list-h1: clamp(1.875rem, 3.4vw, 3rem);
  --blog-article-h1: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --blog-lead: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  --blog-h2: 1.5rem;
  --blog-h3: 1.25rem;
  --blog-focus-width: 3px;
  --blog-crumb-opacity: 0.65;
  --blog-separator-opacity: 0.35;
  --blog-card-min: 300px;
  --blog-header-gap: 1.5rem;
}

.blog-index {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.blog-skip {
  position: absolute;
  top: 0.5rem;
  left: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--panel);
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.blog-skip:focus {
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

.blog-list-hero {
  padding-block: 3.5rem 3rem;
  background: var(--bg);
  color: var(--text);
}

.blog-list-hero .eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.blog-list-hero h1 {
  display: block;
  margin: 0;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: var(--blog-list-h1);
  font-weight: var(--weight-display);
  line-height: 1.3;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.blog-list-lead {
  margin: 1.25rem 0 0;
  max-width: var(--reading);
  font-size: var(--text-lead);
  line-height: 1.75;
}

.blog-list-section {
  padding-block: 2.5rem 5rem;
  background: var(--panel);
  color: var(--text);
}

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

.blog-filters button {
  position: relative;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

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

.blog-filters button[aria-pressed="true"] {
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: var(--shadow-hard);
}

.blog-filters button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0.75rem 0.3rem;
  height: 3px;
  background: var(--accent);
}

.blog-count {
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

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

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

.blog-post-grid .post-card,
#related-posts .post-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-hard);
  overflow-wrap: anywhere;
}

.blog-post-grid .post-card:nth-child(3n + 2) {
  background: var(--panel-2);
  color: var(--text);
}

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

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

.post-meta .tag,
.article-meta .tag {
  max-width: 100%;
  padding: 0.2rem 0.6rem;
  border: var(--bw-thin) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--text);
  font-size: var(--blog-text-crumb);
  white-space: normal;
  overflow-wrap: anywhere;
}

.blog-post-grid .post-card h2,
#related-posts .post-card h3 {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--blog-h3);
  font-weight: var(--weight-bold);
  line-height: 1.55;
}

.post-card h2 a,
.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover,
.post-card h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}

.post-summary {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.8;
}

.post-card .post-link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.3em;
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 1rem 0;
  line-height: 1.8;
  color: var(--muted);
}

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs,
main.reading > nav:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--blog-header-gap);
  margin-bottom: 1.25rem;
  padding-block: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--blog-text-crumb);
  line-height: 1.6;
}

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

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

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

.blog-breadcrumb [aria-current="page"],
nav.breadcrumb [aria-current="page"],
nav.breadcrumbs [aria-current="page"],
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;
  color: var(--muted);
  opacity: 1;
}

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

main.reading:has(> nav:first-child) {
  padding-top: 32px;
}

main.reading > nav:first-child {
  margin-top: 0;
  margin-bottom: 20px;
}

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

main.reading > nav:first-child a {
  flex: 0 0 auto;
  opacity: var(--blog-crumb-opacity);
  text-decoration: none;
}

main.reading > nav:first-child [aria-current="page"] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.article-hero .article-meta,
.article-hero .post-meta,
main.reading > article > header .post-meta {
  margin: 0 0 14px;
}

.article-hero h1,
main.reading > article > header h1 {
  display: block;
  max-width: 100%;
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: var(--blog-article-h1);
  font-weight: var(--weight-display);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.article-hero .article-lead,
.article-hero .lead,
.article-hero .article-summary,
main.reading > article > header .lead {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: var(--blog-lead);
  line-height: 1.7;
}

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

.article-body.section {
  padding-top: 0;
  padding-bottom: 2rem;
}

.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;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: 1.5;
}

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

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

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

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

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

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

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

.article-body code {
  padding: 0.1em 0.3em;
  border-radius: var(--r-sm);
  background: var(--code);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.article-body pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1.25rem;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--code);
  color: var(--text);
  line-height: 1.7;
}

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

.article-body blockquote {
  padding: 0.75rem 1.25rem;
  border-inline-start: var(--bw) solid var(--ink);
  background: var(--panel-2);
  color: var(--text);
}

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

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

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

.article-body table,
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  color: var(--text);
}

.article-body th,
.article-body td,
.prose th,
.prose td {
  min-width: 7em;
  padding: 0.75rem 1rem;
  border: var(--bw-thin) solid var(--rule);
  text-align: start;
  vertical-align: top;
}

.article-body th,
.prose th {
  background: var(--panel-2);
  color: var(--text);
}

.article-download {
  margin-block: 2rem;
  padding: 1.75rem;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--text);
  box-shadow: var(--shadow-hard);
}

.article-download h2 {
  margin: 0 0 0.75rem;
  font-size: var(--blog-h2);
}

.article-download p {
  margin: 0.75rem 0 1.25rem;
}

.article-download .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

#related-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--blog-card-min)), 1fr));
  gap: 1.5rem;
  margin-block: 2.5rem;
}

#related-posts .related-heading {
  grid-column: 1 / -1;
  display: block;
  margin: 0;
  color: var(--text);
  font-size: var(--blog-h2);
  line-height: 1.5;
}

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

#post-nav .post-nav-card {
  display: block;
  padding: 1.25rem;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-hard);
  overflow-wrap: anywhere;
}

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

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

.post-nav-title {
  display: block;
  font-size: var(--text-base);
  line-height: 1.7;
}

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

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

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

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

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

  .blog-list-hero h1 {
    font-size: 1.875rem;
  }

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

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

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

@media (max-width: 640px) {
  #related-posts,
  #post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .article-download .cta > .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}