/* Blog index */
.blog-hero { padding-bottom: 40px; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.blog-card-img {
  width: calc(100% + 48px);
  margin: -24px -24px 4px;
  aspect-ratio: 940 / 650;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}

.blog-card-date {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.blog-card-desc {
  font-size: 0.925rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.blog-card-read {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 8px;
}

.blog-empty {
  color: var(--muted);
  text-align: center;
  padding: 64px 0;
}

/* Blog post */
.blog-post {
  padding: 64px 0 80px;
  --shell: 900px;
}

.blog-post .shell {
  margin-left: auto;
  margin-right: auto;
}

.post-back {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 32px;
}

.post-back:hover { color: var(--text); }

.post-date {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.post-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 16px;
}

.post-lead {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

/* Post body typography */
.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 1.75em 0 0.5em;
}

.post-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 1.5em 0 0.4em;
}

.post-content p { margin: 0 0 1.4em; }

.post-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content a:hover { opacity: 0.7; }

.post-content ul,
.post-content ol {
  margin: 0 0 1.4em;
  padding-left: 1.5em;
}

.post-content li { margin-bottom: 0.4em; }

.post-content strong { font-weight: 600; }

.post-content code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.post-content blockquote {
  border-left: 3px solid var(--border);
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 1.25em;
  color: var(--muted);
  font-style: italic;
}

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5em 0;
}

.post-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* Table of contents */
.post-toc {
  margin: 0 0 32px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.post-toc-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.post-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-toc li {
  margin-bottom: 0.4em;
}

.post-toc a {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text);
}

.post-toc a:hover {
  text-decoration: underline;
}

/* FAQ section */
.post-faq {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.post-faq h2 { margin-top: 0; }

.post-faq h3 {
  font-size: 1.05rem;
}

/* Hero image */
.post-hero {
  margin: 0 0 32px;
}

.post-hero img {
  width: 100%;
  height: auto; /* overrides the img's height="650" attribute (kept for CLS
    prevention) — without this, the fixed attribute height wins over
    aspect-ratio at any width other than exactly 940px, rendering tall. */
  aspect-ratio: 940 / 650;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.post-hero-credit {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

.post-hero-credit a {
  color: var(--muted);
}

/* In-article CTA */
.post-cta {
  margin: 56px 0;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.post-cta-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.post-cta-body {
  color: var(--muted);
  margin: 0 0 20px;
}

/* Related posts */
.post-related {
  margin-top: 56px;
}

.post-related-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.post-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.post-related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.post-related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.post-related-card img {
  width: 100%;
  aspect-ratio: 940 / 650;
  object-fit: cover;
  display: block;
}

.post-related-card-title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  padding: 0 12px 12px;
}

@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-post { padding: 40px 0 60px; }
  .post-lead { margin-bottom: 32px; padding-bottom: 32px; }
  .post-cta { padding: 24px; }
}
