/* =================================================================
   Blog: index + article pages. Loaded after home.css (tokens live there).
   ================================================================= */

/* ---------- Index ---------- */
.blog-head { padding-bottom: clamp(16px, 2vw, 24px); }
.blog-head .lead { max-width: 680px; }
.blog-featured { padding-block: clamp(8px, 1.5vw, 16px) clamp(24px, 3vw, 40px); }
.blog-section { padding-block: clamp(40px, 5vw, 72px); }
.blog-section + .blog-section { padding-top: 0; }
.blog-section .section-head { margin-bottom: clamp(20px, 2.5vw, 32px); }
.blog-section .section-head h2 { font-size: clamp(24px, 2.6vw, 32px); }

.post-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(16px, 2vw, 28px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.post-grid--featured { grid-template-columns: 1fr; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.post-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.post-card__media { display: block; aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t-slow) var(--ease-out); }
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--brand-100), var(--bg-soft)); }
.post-card__body { display: flex; flex-direction: column; gap: 10px; padding: clamp(16px, 2vw, 22px); flex: 1; }
.post-card__cat {
  align-self: flex-start;
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
  color: var(--accent); background: var(--brand-100);
  border-radius: var(--r-pill); padding: 4px 10px;
}
.post-card__title { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.3; margin: 0; }
.post-grid--featured .post-card__title { font-size: clamp(22px, 2.4vw, 30px); }
.post-card__excerpt {
  font-size: 15px; line-height: 1.6; color: var(--ink-500);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__meta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-400); }
.post-card__meta svg { width: 15px; height: 15px; }

@media (min-width: 761px) {
  .post-grid--featured .post-card__link { flex-direction: row; }
  .post-grid--featured .post-card__media { flex: 0 0 56%; aspect-ratio: 16 / 9; }
  .post-grid--featured .post-card__body { justify-content: center; padding: clamp(24px, 3vw, 40px); }
}

/* ---------- Article ---------- */
.post__head { padding-top: clamp(28px, 4vw, 48px); }
.post__head .container { max-width: 860px; }
.post__cat {
  display: inline-block; margin-bottom: var(--sp-3);
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--brand-100); border-radius: var(--r-pill); padding: 5px 12px;
}
.post__head h1 { font-size: clamp(30px, 4vw, 46px); margin-bottom: var(--sp-4); }
.post__head .lead { max-width: 760px; }
.post__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: var(--sp-5); font-size: 14px; color: var(--ink-400);
}
.post__meta svg { width: 15px; height: 15px; vertical-align: -3px; margin-inline-end: 4px; }

.post__shell { max-width: 860px; padding-bottom: clamp(40px, 5vw, 64px); }
.post__hero { margin: clamp(24px, 3vw, 36px) 0 clamp(28px, 3.5vw, 44px); }
.post__hero img {
  width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}

.post__toc {
  margin: 0 0 clamp(28px, 3.5vw, 40px);
  padding: 18px 22px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 15px;
}
.post__toc strong { display: block; margin-bottom: 8px; color: var(--ink-900); }
.post__toc ol { margin: 0; padding-inline-start: 20px; columns: 2; column-gap: 28px; }
.post__toc li { margin-bottom: 6px; break-inside: avoid; }
.post__toc a { color: var(--ink-700); }
.post__toc a:hover { color: var(--accent); }
@media (max-width: 640px) { .post__toc ol { columns: 1; } }

.post__body { max-width: 760px; }
.post__body h2 {
  font-size: clamp(23px, 2.4vw, 29px);
  margin-top: clamp(36px, 4.5vw, 56px); margin-bottom: var(--sp-3);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.post__body h3 { font-size: clamp(18px, 1.7vw, 21px); margin-top: var(--sp-6); margin-bottom: var(--sp-2); }
.post__body p, .post__body ul, .post__body ol { font-size: 17.5px; line-height: 1.8; color: var(--ink-700); margin-bottom: var(--sp-4); text-wrap: pretty; }
.post__body ul, .post__body ol { padding-inline-start: var(--sp-6); }
.post__body li { margin-bottom: 8px; list-style: disc; }
.post__body ol li { list-style: decimal; }
.post__body li::marker { color: var(--accent); font-weight: 700; }
.post__body a { color: var(--accent); border-bottom: 1px solid rgba(125,135,245,.35); }
.post__body a:hover { color: var(--accent-hover); border-color: var(--accent-hover); }
.post__body strong { color: var(--ink-900); }

.post__tip, .post__quote {
  margin: clamp(24px, 3vw, 32px) 0;
  padding: 18px 22px 18px 22px;
  border-radius: var(--r-md);
}
.post__tip { background: var(--brand-100); border-inline-start: 4px solid var(--accent-fill); }
.post__tip p { margin: 0; color: var(--ink-900); }
.post__quote { background: var(--bg-soft); border-inline-start: 4px solid var(--border-strong); font-style: italic; }
.post__quote p { margin: 0; }

.post__cta {
  margin-top: clamp(40px, 5vw, 64px);
  padding: clamp(24px, 3vw, 36px);
  background: linear-gradient(135deg, #2a2f6b, #3F47B0 55%, #5B63E0);
  color: #fff; border-radius: var(--r-lg);
  display: grid; gap: 20px;
  box-shadow: var(--shadow-md);
}
.post__cta h2 { color: #fff; font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 8px; }
.post__cta p { color: rgba(255,255,255,.86); line-height: 1.65; margin: 0; max-width: 60ch; }
.post__cta-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.post__cta .btn--primary { background: #fff; color: var(--accent); }
.post__cta .btn--primary:hover { background: var(--brand-100); }
.post__cta .btn--secondary { border-color: rgba(255,255,255,.45); color: #fff; background: transparent; }
.post__cta .btn--secondary:hover { background: rgba(255,255,255,.1); border-color: #fff; }
@media (min-width: 761px) {
  .post__cta { grid-template-columns: 1.4fr 1fr; align-items: center; }
  .post__cta-btns { justify-content: flex-end; }
}

.post-related .section-head { margin-bottom: clamp(20px, 2.5vw, 32px); }
.post-related .section-head h2 { font-size: clamp(24px, 2.6vw, 32px); }
