/* Blog: grid of nine cards, article page and pagination.
   Uses the tokens and buttons from styles.css. */

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1200;
  padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent, #6c4cf1); outline-offset: 2px; border-radius: 4px;
}

.blog-head { padding-bottom: 24px; }
.blog-head .h-1 { margin: 12px 0 16px; }
.blog-head .lede { max-width: 640px; }
.blog-list { padding-top: 8px; }

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 700px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color .15s, transform .15s;
}
.blog-card:hover { border-color: var(--ink-2, #6b7280); transform: translateY(-2px); }
.blog-card-media {
  display: block; aspect-ratio: 16 / 9; background: var(--bg-sub);
  overflow: hidden; position: relative;
}
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 34px; font-weight: 600; color: var(--muted-2);
}
.blog-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.blog-card-title { font-size: 19px; line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
.blog-card-title a { color: var(--ink); }
.blog-card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.blog-card-excerpt { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

.blog-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--muted-2); text-transform: uppercase;
}

.blog-pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 40px;
  border-top: 1px solid var(--line); padding-top: 24px;
}
.blog-pages { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; }
.blog-pages a, .blog-pages span {
  min-width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px; color: var(--muted);
}
.blog-pages a:hover { color: var(--ink); border-color: var(--ink-2, #6b7280); }
.blog-pages .on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.blog-post-inner { max-width: 760px; }
.blog-back { font-size: 13.5px; margin: 0 0 24px; }
.blog-back a { color: var(--muted); }
.blog-back a:hover { color: var(--ink); }
.blog-draft-note {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; color: var(--muted);
}
.blog-post .h-1 { margin: 0 0 16px; }
.blog-post .blog-meta { margin-bottom: 28px; }
.blog-hero { margin: 0 0 32px; }
.blog-hero img { width: 100%; height: auto; border-radius: 14px; display: block; border: 1px solid var(--line); }

.blog-body { font-size: 17px; line-height: 1.75; color: var(--ink-2, #2c313a); }
.blog-body h2 { font-size: 26px; line-height: 1.25; margin: 44px 0 14px; letter-spacing: -0.015em; color: var(--ink); }
.blog-body h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 10px; color: var(--ink); }
.blog-body p { margin: 0 0 20px; }
.blog-body ul, .blog-body ol { margin: 0 0 20px; padding-left: 22px; }
.blog-body li { margin-bottom: 8px; }
.blog-body a { color: var(--ink); border-bottom: 1px solid currentColor; }
.blog-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0 24px; }
.blog-body blockquote {
  margin: 28px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--line); color: var(--muted); font-family: var(--serif); font-size: 19px;
}
.blog-body pre {
  background: var(--bg-sub); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; margin: 0 0 24px;
}
.blog-body code { font-family: var(--mono); font-size: 0.9em; }
.blog-body table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; }
.blog-body th, .blog-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }

.blog-tags { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 40px 0 0; }
.blog-tags a {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--muted);
}
.blog-tags a:hover { color: var(--ink); border-color: var(--ink-2, #6b7280); }

.blog-related { border-top: 1px solid var(--line); }
.blog-related .h-1 { font-size: 26px; margin-bottom: 28px; }

.blog-cta { padding-top: 0; }
.blog-cta-card {
  border: 1px solid var(--line); border-radius: 16px;
  padding: 40px; text-align: center; background: var(--bg-sub);
}
.blog-cta-card h2 { font-size: 28px; margin: 0 0 12px; letter-spacing: -0.02em; }
.blog-cta-card p { margin: 0 auto 24px; max-width: 520px; color: var(--muted); }
@media (max-width: 560px) { .blog-cta-card { padding: 28px 20px; } }
