/*
 * Blog layer — editorial layout on top of the marketplace design system.
 *
 * Loaded only by blog.zetimagine.com, after assets/site.css. site.css owns
 * tokens, header, footer, buttons and cards; this file owns the reading
 * experience — measure, rhythm, and the small set of components that only
 * exist on a post.
 *
 * Deliberately not shipped to the marketing site, which has no blog.
 */

/* ---- tokens -------------------------------------------------------------- */

.mk-page.bg-page {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #0e1726;
  --ink-2: #47566b;
  --ink-3: #6b7a90;
  --line: #e3e9f2;
  --brand-600: #0c87ea;
}

/* ---- masthead ------------------------------------------------------------ */

.bg-mast {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 300px at 12% -40%, rgba(12, 135, 234, 0.12), transparent 70%),
    var(--surface);
  padding: 72px 0 56px;
}

.bg-mast__kicker {
  font: 600 12px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin: 0 0 14px;
}

.bg-mast h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  max-width: 18ch;
}

.bg-mast p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0;
}

.bg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.bg-tags a,
.bg-tags span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
}

.bg-tags a:hover {
  border-color: var(--brand-600);
  color: var(--brand-600);
}

.bg-tags__count {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---- post list ----------------------------------------------------------- */

.bg-list {
  padding: 56px 0 88px;
}

.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bg-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.bg-card:hover {
  border-color: rgba(12, 135, 234, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -18px rgba(14, 23, 38, 0.45);
}

.bg-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
}

.bg-card__tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(12, 135, 234, 0.1);
  color: var(--brand-600);
  font-weight: 600;
}

.bg-card h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0;
}

.bg-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.bg-card h2 a::after {
  /* Whole card is the hit target, not just the title. */
  content: '';
  position: absolute;
  inset: 0;
}

.bg-card {
  position: relative;
}

.bg-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---- article ------------------------------------------------------------- */

.bg-post {
  padding: 48px 0 80px;
}

.bg-post__head {
  max-width: 720px;
  margin: 0 auto 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.bg-post__head h1 {
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 12px 0 14px;
}

.bg-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-3);
}

.bg-prose {
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.72;
  color: #1b2637;
}

.bg-prose > * + * {
  margin-top: 22px;
}

.bg-prose h2 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-top: 48px;
  padding-top: 4px;
}

.bg-prose h3 {
  font-size: 20px;
  line-height: 1.3;
  margin-top: 36px;
}

.bg-prose p {
  margin: 0;
}

.bg-prose ul,
.bg-prose ol {
  margin: 0;
  padding-left: 24px;
}

.bg-prose li + li {
  margin-top: 10px;
}

.bg-prose strong {
  color: var(--ink);
  font-weight: 600;
}

.bg-prose a {
  color: var(--brand-600);
}

.bg-prose code {
  font: 500 0.88em/1.5 ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  background: #eef2f8;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}

.bg-prose pre {
  margin: 0;
  padding: 18px 20px;
  background: #0e1726;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.bg-prose pre code {
  background: none;
  border: 0;
  padding: 0;
  color: #d7e3f4;
  font-size: inherit;
}

.bg-note {
  max-width: 720px;
  margin: 44px auto 0;
  padding: 20px 22px;
  border-left: 3px solid var(--brand-600);
  background: rgba(12, 135, 234, 0.06);
  border-radius: 0 12px 12px 0;
  font-size: 16px;
  line-height: 1.65;
  color: #1b2637;
}

.bg-note p {
  margin: 0;
}

.bg-more {
  max-width: 720px;
  margin: 56px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.bg-more h2 {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}

.bg-more ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.bg-more li {
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.bg-more time {
  flex: 0 0 auto;
  font: 500 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-3);
}

.bg-more a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.bg-more a:hover {
  color: var(--brand-600);
}

/* ---- empty state --------------------------------------------------------- */

.bg-empty {
  padding: 64px 0;
  text-align: center;
  color: var(--ink-3);
}

@media (max-width: 640px) {
  .bg-mast {
    padding: 48px 0 40px;
  }

  .bg-prose {
    font-size: 16.5px;
  }
}