/* AgentGate — blog (/blog and /blog/:slug). Builds on site.css.

   The index is a grid of .card links; an article is a narrow column with the
   body in article.prose. Article bodies are generated HTML, so the rules under
   "Article body" style bare elements rather than classes. */

/* ── Index ─────────────────────────────────────────────────────────────────── */

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.blog-card .h4 {
  text-wrap: balance;
  overflow-wrap: break-word;
}

.blog-card .h4 + p {
  margin-top: 0;
}

.blog-card-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.blog-card .meta-row {
  margin-top: auto;
  padding-top: 14px;
}

.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: clamp(32px, 5vw, 56px);
}

.blog-pagination .chip {
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  font-family: var(--font-mono);
}

.blog-pagination .gap {
  color: var(--ink-3);
}

.blog-empty {
  display: grid;
  gap: 14px;
  justify-items: start;
  max-width: 640px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--r-l);
  border: 1px dashed var(--line-2);
}

/* ── Article ───────────────────────────────────────────────────────────────── */

.blog-crumb a:hover {
  color: var(--ink);
}

.blog-title {
  overflow-wrap: break-word;
}

.blog-article {
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  padding-bottom: calc(var(--section) * 0.62);
}

/* one measure for the text, the tags and the closing card */
.blog-article > * {
  min-width: 0;
  max-width: 72ch;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-tags .tag {
  white-space: normal;
  overflow-wrap: anywhere;
}

.blog-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.blog-cta {
  display: grid;
  gap: 14px;
  justify-items: start;
}

/* ── Article body (generated HTML inside article.prose) ────────────────────── */

.blog-article .prose {
  overflow-wrap: break-word;
}

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

.blog-article .prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.blog-article .prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

/* the call-to-action block the article generator appends */
.blog-article .prose .cta-block {
  margin-top: 2.4em;
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--r-l);
  border: 1px solid var(--line-2);
  background: var(--panel);
}

.blog-article .prose .cta-block > * + * {
  margin-top: 0.8em;
}

.blog-article .prose .cta-block h2,
.blog-article .prose .cta-block h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.blog-article .prose a.cta-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  background: var(--inverse);
  color: var(--inverse-ink);
  font-weight: 560;
  text-decoration: none;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  /* thumb-sized share buttons */
  .blog-share .btn-sm {
    min-height: 44px;
    padding-inline: 16px;
  }
}
