/* ============================================================
   VELOCITY GTM — Blog (index grid + article)
   ============================================================ */

/* ---------- index hero ---------- */
.blog-hero { padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(24px, 3vw, 40px); }
.blog-hero .shead { max-width: 760px; }

/* ---------- category filter row ---------- */
.cat-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.8rem; }
.cat-chip {
  font-family: var(--font-mono); font-size: .76rem; font-weight: 500;
  padding: .5em .95em; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
  cursor: pointer;
}
.cat-chip:hover { border-color: var(--ink); color: var(--ink); }
.cat-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- featured lead post ---------- */
.featured {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-sm); margin-bottom: 2.4rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.featured:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: var(--line-2); }
.featured-thumb { position: relative; overflow: hidden; min-height: 300px; background: var(--surface-3); }
.featured-thumb img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.featured:hover .featured-thumb img.cover { transform: scale(1.03); }
.featured-thumb .pill {
  position: absolute; top: 16px; left: 16px;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  color: #fff; background: rgba(10,14,24,.42); border: 1px solid rgba(255,255,255,.28);
  padding: .4em .7em; border-radius: var(--r-xs); backdrop-filter: blur(4px);
}
.featured-flag {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono); font-size: .64rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: #fff; padding: .4em .7em; border-radius: var(--r-xs); box-shadow: var(--sh-sm);
}
.featured-body { padding: clamp(1.6rem, 3vw, 2.6rem); display: flex; flex-direction: column; justify-content: center; }
.featured-body .post-meta { margin-bottom: .9rem; }
.featured-body h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.18; letter-spacing: -.02em; margin-bottom: .9rem; text-wrap: pretty; }
.featured-body p { font-size: 1.02rem; color: var(--ink-2); line-height: 1.55; margin-bottom: 1.4rem; }
.featured-body .post-foot { margin-top: 0; }
@media (max-width: 800px) { .featured { grid-template-columns: 1fr; } .featured-thumb { min-height: 200px; aspect-ratio: 16/9; } }

/* ---------- card grid ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }

.post {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-xs);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.post:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--line-2); }
.post-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-3); }
.post-thumb img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.post:hover .post-thumb img.cover { transform: scale(1.04); }
.post-thumb .grad { position: absolute; inset: 0; }
.post-thumb .mesh {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 100% at 20% 0%, #000, transparent 75%);
  mask-image: radial-gradient(120% 100% at 20% 0%, #000, transparent 75%);
}
.post-thumb .glyph { position: absolute; right: 14px; bottom: 12px; color: rgba(255,255,255,.92); }
.post-thumb .glyph svg { width: 40px; height: 40px; }
.post-thumb .pill {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: .66rem; font-weight: 600; letter-spacing: .04em;
  color: #fff; background: rgba(10,14,24,.42); border: 1px solid rgba(255,255,255,.28);
  padding: .35em .65em; border-radius: var(--r-xs); backdrop-filter: blur(4px);
}
/* gradient variants */
.g-blue   { background: linear-gradient(135deg, #2A6FDB, #1B3F8F); }
.g-teal   { background: linear-gradient(135deg, #1F8A8A, #0E5E6B); }
.g-violet { background: linear-gradient(135deg, #6B4FD8, #3B2C8C); }
.g-green  { background: linear-gradient(135deg, #1F8A5B, #0E5E3C); }
.g-slate  { background: linear-gradient(135deg, #3D4350, #181B22); }
.g-amber  { background: linear-gradient(135deg, #C9802A, #8A4B1F); }

.post-body { padding: 1.3rem 1.35rem 1.45rem; display: flex; flex-direction: column; flex: 1; }
.post-meta { display: flex; align-items: center; gap: .55rem; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); margin-bottom: .7rem; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }
.post h3 { font-size: 1.18rem; line-height: 1.25; letter-spacing: -.015em; margin-bottom: .55rem; text-wrap: pretty; }
.post p { font-size: .92rem; color: var(--ink-2); line-height: 1.5; margin-bottom: 1.1rem; }
.post-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.post-read { font-size: .88rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: .4rem; }
.post-read svg { width: 14px; height: 14px; transition: transform .18s ease; }
.post:hover .post-read svg { transform: translateX(3px); }
.post-author { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--muted); }
.post-author .av { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: .58rem; flex: none; }

/* hide cards filtered out */
.post[hidden] { display: none; }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article { padding-top: clamp(32px, 4vw, 56px); }
.article-head { max-width: 760px; margin-inline: auto; text-align: center; }
.article-head .crumb { justify-content: center; }
.article-head h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; letter-spacing: -.025em; margin: 1rem 0 1.1rem; text-wrap: balance; }
.article-meta { display: inline-flex; align-items: center; gap: .7rem; font-family: var(--font-mono); font-size: .78rem; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }
.article-meta .author { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-2); font-weight: 600; }
.article-meta .av { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: .64rem; }

.article-cover { max-width: 980px; margin: clamp(28px,4vw,48px) auto 0; aspect-ratio: 21 / 9; border-radius: var(--r-lg); position: relative; overflow: hidden; box-shadow: var(--sh-md); background: var(--surface-3); }
.article-cover img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.article-cover .mesh { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 34px 34px; -webkit-mask-image: radial-gradient(120% 100% at 25% 0%, #000, transparent 78%); mask-image: radial-gradient(120% 100% at 25% 0%, #000, transparent 78%); }
.article-cover .glyph { position: absolute; right: 28px; bottom: 22px; color: rgba(255,255,255,.9); }
.article-cover .glyph svg { width: 64px; height: 64px; }

/* article body */
.prose { max-width: 720px; margin: clamp(36px,5vw,60px) auto 0; }
.prose > * + * { margin-top: 1.3rem; }
.prose p { font-size: 1.12rem; line-height: 1.72; color: var(--ink-2); }
.prose h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.02em; margin-top: 2.6rem; color: var(--ink); }
.prose h3 { font-size: 1.3rem; letter-spacing: -.015em; margin-top: 2rem; color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--accent-line); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.prose li { font-size: 1.08rem; line-height: 1.6; color: var(--ink-2); padding-left: .3rem; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1.4rem; margin-left: 0;
  font-size: 1.3rem; line-height: 1.5; font-weight: 600; color: var(--ink); letter-spacing: -.01em;
}
.prose .callout {
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-md);
  padding: 1.3rem 1.4rem; display: flex; gap: .9rem; align-items: flex-start;
}
.prose .callout svg { width: 22px; height: 22px; color: var(--accent-ink); flex: none; margin-top: 2px; }
.prose .callout p { font-size: 1rem; margin: 0; color: var(--ink-2); }
.prose .callout strong { color: var(--accent-ink); }
.prose .tldr {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1.1rem 1.3rem; margin: 0 0 1.8rem;
}
.prose .tldr .tldr-label {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent-ink); margin-bottom: .45rem;
}
.prose .tldr p { font-size: 1rem; line-height: 1.6; margin: 0; color: var(--ink-2); }
.prose .tldr strong { color: var(--ink); }
.prose figure { margin: 2rem 0; }
.prose .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.prose .stat-row .s { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.2rem; text-align: center; }
.prose .stat-row .s b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.prose .stat-row .s span { font-size: .82rem; color: var(--muted); margin-top: .4rem; display: block; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.6rem 0; }
@media (max-width: 560px) { .prose .stat-row { grid-template-columns: 1fr; } }

/* tags + share */
.article-foot { max-width: 720px; margin: 3rem auto 0; padding-top: 1.8rem; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.article-tags { display: flex; gap: .5rem; flex-wrap: wrap; }

/* related / more posts */
.more-posts { border-top: 1px solid var(--line); margin-top: clamp(48px,6vw,80px); }

/* author card */
.author-card { max-width: 720px; margin: 2.4rem auto 0; display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem 1.5rem; box-shadow: var(--sh-xs); }
.author-card .av { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 1rem; flex: none; }
.author-card b { font-size: 1rem; }
.author-card span { font-size: .9rem; color: var(--muted); display: block; margin-top: .15rem; }
