/* AT USE — Blog component styles (listing + article) */
/* Design spec: team/tasks/blog-article-template.md §Design */
/* Depends on: assets/site.css (all --var tokens defined there) */

/* ─ Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --blog-prose-max: 720px;
  --blog-card-gap:  16px;
}

/* ─ Listing page ─────────────────────────────────────────────────────────── */

.blog-grid {
  display: grid;
  gap: var(--blog-card-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  text-decoration: none;
  transition: transform .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.blog-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  background: var(--panel-2);
  text-decoration: none;
}
.blog-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.blog-card-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 700;
}

.blog-card-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.3;
}

.blog-card-date {
  display: block;
  margin: 0 0 10px;
  font-size: 12px;
  /* Use text-2, not --muted: muted (#7d889f) on panel (#131a2a) ≈ 4.0:1, below WCAG AA 4.5:1 for small text */
  color: var(--text-2);
}

.blog-card-excerpt {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  flex: 1;
  /* Clamp to ~3 lines so grid stays uniform */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  margin-top: auto;
}
.blog-card-readmore::after {
  content: '\2192';
  transition: transform .2s var(--ease);
}
.blog-card:hover .blog-card-readmore::after {
  transform: translateX(3px);
}

/* Listing page — empty state (no articles yet) */
.blog-empty {
  grid-column: 1 / -1;
  padding: 48px 28px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.blog-empty p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}

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

.blog-article-layout {
  max-width: var(--blog-prose-max);
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 64px;
}

.blog-article-back {
  margin-bottom: 24px;
}
.blog-article-back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.blog-article-back a::before {
  content: '\2190';
}
.blog-article-back a:hover { text-decoration: underline; }

.blog-article-header {
  margin-bottom: 36px;
}

.blog-article-kicker {
  display: block;
  margin: 0 0 10px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 700;
}

.blog-article-header h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--text);
}

.blog-article-date {
  display: block;
  font-size: 13px;
  color: var(--text-2);
}

/* Article body — long-form prose */
.blog-article-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-2);
}

.blog-article-body p {
  margin: 0 0 20px;
}

.blog-article-body strong {
  color: var(--text);
  font-weight: 600;
}

.blog-article-body a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(139, 216, 255, .4);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s var(--ease);
}
.blog-article-body a:hover {
  text-decoration-color: var(--accent-2);
}

/* Section headers (H2) */
.blog-article-body h2 {
  margin: 40px 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.3;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* How-to numbered steps — custom accent list */
.blog-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: blog-step;
}
.blog-steps li {
  position: relative;
  padding-left: 44px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-2);
  counter-increment: blog-step;
}
.blog-steps li::before {
  content: counter(blog-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a1224;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.blog-steps li strong {
  color: var(--text);
  font-weight: 600;
}

/* CTA box at bottom of article */
.blog-cta-box {
  margin-top: 48px;
  padding: 28px 32px;
  background: var(--panel-2);
  border: 1px solid rgba(106, 163, 255, .3);
  border-radius: var(--radius-lg);
}
.blog-cta-box h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.blog-cta-box p {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}

/* Back link focus-visible — design-fixes 2026-06-29 */
.blog-article-back a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Inline tool CTA (art-tool-cta) — design-fixes 2026-06-29 */
.art-tool-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--panel-2);
  border: 1px solid rgba(106,163,255,.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}
.art-tool-cta-label {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent-2);
}
.art-tool-cta-heading {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.art-tool-cta-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* Article body h3 and pre/code — design-fixes 2026-06-29 */
.blog-article-body h3 {
  margin: 28px 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.005em;
  line-height: 1.4;
}
.blog-article-body pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0 0 20px;
}
.blog-article-body code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-2);
  background: rgba(139,216,255,.08);
  padding: 2px 5px;
  border-radius: 4px;
}
.blog-article-body pre code {
  background: none;
  padding: 0;
  color: var(--text-2);
  font-size: 13px;
}

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

/* Tablet: 2 columns */
@media (max-width: 860px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: 1 column */
@media (max-width: 540px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card {
    padding: 18px 20px;
  }

  .blog-cta-box {
    padding: 22px 20px;
  }

  /* Ensure card touch target meets 44px min */
  .blog-card-readmore {
    min-height: 44px;
    align-items: center;
  }
}
