/* Blog-specific styles keep the landing page's established design untouched. */
.article-library { border-top: 1px solid var(--line); padding-top: 2rem; }
.article-library-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 2rem; margin-bottom: 2rem; }
.article-library-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.025em; }
.article-library-heading p { margin: 0; color: var(--muted); font-size: 0.875rem; }
.article-carousel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; }
.carousel-btn { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 1.1rem; cursor: pointer; transition: border-color 150ms ease, background 150ms ease, opacity 150ms ease; }
.carousel-btn:hover:not(:disabled) { border-color: #8e8e8e; background: var(--surface); }
.carousel-btn:disabled { opacity: 0.35; cursor: default; }
.carousel-viewport { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.carousel-viewport::-webkit-scrollbar { display: none; }
.article-grid { display: flex; gap: 1.5rem; }
.post-card { flex: 0 0 calc((100% - 3rem) / 3); min-width: 0; }
.carousel-counter { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.post-card-link { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color 150ms ease; }
.post-card-link:hover { border-color: #8e8e8e; }
.post-card-link:focus-visible { outline-offset: 5px; }
.post-card-cover { aspect-ratio: 16 / 11; min-height: 17rem; overflow: hidden; flex-shrink: 0; }
.post-card-cover:has(> .post-cover) { aspect-ratio: auto; }
.post-card-cover .post-cover { min-height: 17rem; height: auto; }
.post-card-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-cover { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; width: 100%; height: 100%; padding: 1.75rem; background: #f1f1f1; color: var(--ink); }
.cover-category { font-size: 0.875rem; }
.cover-title { max-width: 16ch; font-size: clamp(1.7rem, 2.5vw, 2.4rem); line-height: 1.13; letter-spacing: -0.045em; font-weight: 400; overflow-wrap: anywhere; }
.cover-caption { font-size: 0.75rem; color: #646464; }
.cover-dark { background: #242424; color: #fff; }
.cover-dark .cover-caption { color: #bfbfbf; }
.cover-mid { background: #dedede; }
.post-card-copy { display: flex; flex-direction: column; flex: 1; padding: 1.75rem; }
.post-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin: 0 0 1.2rem; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.draft-label { padding: 0.25rem 0.5rem; border: 1px solid var(--line); border-radius: 4px; font-size: 0.75rem; }
.post-card h3 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 400; line-height: 1.25; letter-spacing: -0.035em; }
.post-card h3, .post-card-meta, .post-summary, .post-card .cover-category { overflow-wrap: anywhere; }
.post-summary { margin: 0 0 1.75rem; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.post-read { margin-top: auto; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 0.3em; }

.article-main { width: min(calc(100% - var(--page-pad) * 2), var(--content)); margin-inline: auto; padding-block: 3rem 5rem; }
.article-heading { max-width: 54rem; margin-inline: auto; padding-bottom: 2.5rem; }
.article-back { display: inline-block; margin-bottom: 3rem; padding-block: 0.5rem; color: var(--muted); font-size: 0.875rem; text-decoration: underline; text-underline-offset: 0.3em; }
.article-back:hover { color: var(--ink); }
.article-category { margin-bottom: 1.25rem; color: var(--muted); font-size: 0.9375rem; }
.article-heading h1 { max-width: none; margin-bottom: 1.5rem; font-size: clamp(2.5rem, 5.2vw, 4.5rem); font-weight: 400; line-height: 1.08; letter-spacing: -0.055em; }
.article-deck { max-width: 44rem; margin-bottom: 2rem; color: var(--muted); font-size: 1.2rem; line-height: 1.6; }
.article-metadata { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; margin: 0; padding-block: 1.5rem; border-top: 1px solid var(--line); }
.article-metadata div { min-width: 8rem; }
.article-metadata dt { margin-bottom: 0.2rem; color: var(--muted); font-size: 0.875rem; }
.article-metadata dd { margin: 0; font-size: 0.9375rem; }
.article-draft-notice { margin: 0; padding: 1rem 1.25rem; border-left: 2px solid #777; background: var(--surface); color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.article-draft-notice strong { display: block; margin-bottom: 0.2rem; color: var(--ink); font-weight: 500; }
.article-cover { width: min(100%, 60rem); margin: 0 auto 4rem; overflow: hidden; border-radius: 12px; }
.article-cover > img { display: block; width: 100%; height: auto; }
.article-cover .post-cover { min-height: 24rem; padding: clamp(2rem, 4vw, 3.5rem); }
.article-cover .cover-title { max-width: 15ch; font-size: clamp(2.5rem, 5vw, 4.25rem); }
.article-content { max-width: 44rem; margin-inline: auto; font-size: 1.0625rem; line-height: 1.85; }
.article-content h2 { margin-bottom: 1.25rem; font-size: clamp(1.6rem, 2.5vw, 2rem); font-weight: 500; line-height: 1.25; letter-spacing: -0.035em; }
.article-content h3 { margin-block: 2rem 1rem; font-size: 1.3rem; font-weight: 500; line-height: 1.35; letter-spacing: -0.025em; }
.article-content p { margin-bottom: 1.5rem; color: #4f4f4f; }
.article-content ul, .article-content ol { padding-left: 1.3rem; }
.article-content li + li { margin-top: 0.75rem; }
.article-content a:not(.button) { text-decoration: underline; text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.article-content blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 2px solid #777; color: var(--muted); }
.article-takeaways { margin-bottom: 3.5rem; padding: 2rem; border-radius: 10px; background: var(--surface); }
.article-takeaways h2 { font-size: 1.25rem; letter-spacing: -0.02em; }
.article-takeaways ul { margin: 0; }
.article-takeaways .takeaway-note { font-size: 0.875rem; color: var(--muted); }
.article-section { margin-bottom: 3rem; }
.article-figure { margin: 2rem 0; }
.article-figure > img {
  display: block; width: auto; max-width: 100%; margin-inline: auto;
  max-height: min(720px, 130vh); height: auto;
  border: 1px solid var(--line); border-radius: 4px;
}
.article-figure figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.article-references { padding-top: 2rem; border-top: 1px solid var(--line); }
.article-references h2 { font-size: 1.25rem; }
.article-references p, .article-references li { font-size: 0.9375rem; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.article-nav-link { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem 1.5rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color 0.15s ease, background 0.15s ease; }
.article-nav-link:hover { border-color: var(--line-strong); background: var(--surface); }
.article-nav-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.article-nav-label::before { content: "\2190"; font-size: 1rem; }
.article-nav-next { text-align: right; align-items: flex-end; }
.article-nav-next .article-nav-label { flex-direction: row-reverse; }
.article-nav-next .article-nav-label::before { content: none; }
.article-nav-next .article-nav-label::after { content: "\2192"; font-size: 1rem; }
.article-nav-title { font-size: 1.0625rem; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.article-nav-empty { border: none; }
.article-end { padding-top: 2rem; }
@media (max-width: 1050px) {
  .post-card { flex-basis: calc((100% - 1.5rem) / 2); }
}
@media (max-width: 700px) {
  .blog-index { padding-block: 2rem 3rem; }
  .blog-index .blog-intro { padding-bottom: 1.75rem; }
  .blog-index .blog-intro h1 { margin-bottom: 1rem; font-size: 2.25rem; line-height: 1.15; letter-spacing: 0; }
  .blog-index .blog-deck { margin-top: 1rem; font-size: 1rem; line-height: 1.6; }
  .blog-index .article-library { padding-top: 1.5rem; }
  .blog-index .article-library-heading { gap: 0.5rem; margin-bottom: 1.25rem; }
  .blog-index .article-library-heading p { line-height: 1.5; }
  .blog-index .article-carousel { grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; gap: 1rem; }
  .blog-index .carousel-viewport { grid-area: 1 / 1 / 2 / 4; min-width: 0; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .blog-index .carousel-prev { grid-area: 2 / 1; }
  .blog-index .carousel-next { grid-area: 2 / 3; }
  .blog-index .carousel-counter { grid-area: 2 / 2; position: static; width: auto; height: auto; clip: auto; overflow: visible; margin: 0; text-align: center; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .blog-index .article-grid { display: flex; gap: 1.5rem; }
  .blog-index .post-card { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
  .blog-index .post-card-link { border-radius: 8px; }
  .blog-index .post-card-link:focus-visible { outline-offset: -3px; }
  .blog-index .post-card-cover { aspect-ratio: auto; min-height: 0; }
  .blog-index .post-card-cover:has(> img) { aspect-ratio: 16 / 9; }
  .blog-index .post-cover { min-height: 12rem; height: auto; gap: 1rem; padding: 1.25rem; }
  .blog-index .cover-category { font-size: 0.75rem; line-height: 1.4; overflow-wrap: anywhere; }
  .blog-index .cover-title { max-width: none; font-size: 1.75rem; line-height: 1.2; letter-spacing: 0; }
  .blog-index .post-card-copy { padding: 1.25rem; }
  .blog-index .post-card-meta { margin-bottom: 0.75rem; font-size: 0.8125rem; overflow-wrap: anywhere; }
  .blog-index .post-card h3 { margin-bottom: 0.75rem; font-size: 1.25rem; line-height: 1.4; letter-spacing: 0; overflow-wrap: anywhere; }
  .blog-index .post-summary { margin-bottom: 1.25rem; font-size: 0.9375rem; line-height: 1.6; overflow-wrap: anywhere; }
  .article-main { padding-top: 1.5rem; }
  .article-back { margin-bottom: 2rem; }
  .article-heading h1 { font-size: clamp(2.4rem, 8vw, 3.5rem); }
  .article-deck { font-size: 1.0625rem; }
  .article-metadata { gap: 1.25rem 2rem; }
  .article-cover { margin-bottom: 2.5rem; }
  .article-cover .post-cover { min-height: 19rem; }
  .article-takeaways { padding: 1.5rem; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-next { text-align: left; align-items: flex-start; }
  .article-nav-next .article-nav-label { flex-direction: row; }
  .article-nav-next .article-nav-label::before { content: "\2192"; }
  .article-nav-next .article-nav-label::after { content: none; }
}
