/* =========================================
   Blog styles (uses tokens.css/base.css/components.css from parent)
   ========================================= */

/* ---------- Blog hero ---------- */
.blog-hero {
  position: relative;
  padding: clamp(140px, 16vw, 200px) 0 clamp(48px, 6vw, 80px);
  background: var(--surface-1);
  overflow: hidden;
}
.blog-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad-mesh);
  pointer-events: none;
}
.blog-hero .container { position: relative; z-index: 2; text-align: center; }
.blog-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-weight: 800;
}
.blog-hero h1 em {
  font-style: normal;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.blog-hero p {
  margin-top: 18px;
  font-size: var(--fs-lead);
  color: var(--ink-500);
  max-width: 620px;
  margin-inline: auto;
}

/* ---------- Blog grid ---------- */
.blog-list { background: var(--surface-0); padding-bottom: clamp(72px, 10vw, 140px); padding-top: clamp(40px, 6vw, 60px); }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 980px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-0);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}
.blog-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}
.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease-out);
}
.blog-card:hover .blog-card__media img { transform: scale(1.06); }
.blog-card__body {
  padding: 22px 24px 26px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  color: var(--ink-400);
  font-weight: 500;
}
.blog-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-300); }
.blog-card__title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ink-900);
}
.blog-card__excerpt {
  font-size: .94rem;
  color: var(--ink-500);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card__cta {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-700);
  font-weight: 600;
  font-size: .9rem;
  transition: gap var(--t-fast) var(--ease-out);
}
.blog-card:hover .blog-card__cta { gap: 12px; }

/* Featured (first card spans 2 cols) */
.blog-grid > .blog-card--featured {
  grid-column: span 2;
  flex-direction: row;
}
.blog-grid > .blog-card--featured .blog-card__media { aspect-ratio: auto; width: 50%; flex-shrink: 0; }
.blog-grid > .blog-card--featured .blog-card__body { padding: 36px 36px 36px; gap: 14px; }
.blog-grid > .blog-card--featured .blog-card__title { font-size: 1.6rem; line-height: 1.2; }
.blog-grid > .blog-card--featured .blog-card__excerpt {
  font-size: 1rem;
  -webkit-line-clamp: 5;
}
@media (max-width: 980px) {
  .blog-grid > .blog-card--featured { grid-column: span 2; }
}
@media (max-width: 640px) {
  .blog-grid > .blog-card--featured { grid-column: span 1; flex-direction: column; }
  .blog-grid > .blog-card--featured .blog-card__media { width: 100%; aspect-ratio: 16/10; }
}

/* ---------- Reading progress bar ---------- */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-brand);
  z-index: 60;
  transition: width 80ms linear;
}

/* ---------- Article ---------- */
.article {
  background: var(--surface-0);
  padding: clamp(120px, 14vw, 160px) 0 clamp(72px, 10vw, 120px);
  position: relative;
}
.article__back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-700);
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 24px;
  transition: gap var(--t-fast) var(--ease-out);
}
.article__back:hover { gap: 10px; }
.article__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: var(--ink-400);
  font-weight: 500;
  margin-bottom: 14px;
}
.article__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-300); }
.article__title {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  letter-spacing: -.025em;
  line-height: 1.08;
  font-weight: 800;
  color: var(--ink-900);
  max-width: 820px;
}
.article__hero {
  margin: 36px 0 8px;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}
.article__hero img { width: 100%; height: 100%; object-fit: cover; }
.article__share {
  display: flex; gap: 8px; align-items: center;
  margin: 24px 0;
  color: var(--ink-500);
  font-size: .88rem;
}
.article__share a {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-600);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.article__share a:hover { background: var(--brand-100); color: var(--brand-700); transform: translateY(-2px); }
.article__share svg { width: 18px; height: 18px; }

/* Prose */
.prose {
  max-width: 760px;
  margin: 40px auto 0;
  font-size: 1.08rem;
  line-height: var(--lh-prose);
  color: var(--ink-700);
}
.prose p { margin-bottom: 1.4em; }
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -.02em;
  line-height: 1.25;
  margin: 2.4em 0 .8em;
  color: var(--ink-900);
  scroll-margin-top: 100px;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 1.8em 0 .6em;
  color: var(--ink-900);
}
.prose strong { color: var(--ink-900); font-weight: 700; }
.prose em { color: var(--ink-700); }
.prose a {
  color: var(--brand-700);
  text-decoration: underline;
  text-decoration-color: var(--brand-200);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast);
}
.prose a:hover { text-decoration-color: var(--brand-600); }
.prose ul, .prose ol {
  margin: 0 0 1.4em 1.4em;
  padding-left: 0;
}
.prose ul { list-style: none; padding-left: 0; }
.prose ul li {
  position: relative; padding-left: 28px; margin-bottom: .6em;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px; top: .65em;
  width: 8px; height: 8px;
  border-radius: 3px;
  background: var(--brand-500);
}
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose ol li { margin-bottom: .6em; padding-left: 6px; }
.prose ol li::marker { color: var(--brand-600); font-weight: 700; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 16px 24px;
  border-left: 4px solid var(--brand-500);
  background: var(--surface-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink-800);
  font-style: italic;
}

/* Related posts */
.related {
  background: var(--surface-1);
  padding: clamp(64px, 8vw, 96px) 0;
  border-top: 1px solid var(--ink-100);
}
.related h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  margin-bottom: 28px;
}
.related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .related__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .related__grid { grid-template-columns: 1fr; } }

/* Article CTA */
.article-cta {
  margin: 60px auto 0;
  max-width: 760px;
  padding: 36px 32px;
  border-radius: var(--r-xl);
  background: var(--grad-brand);
  color: #fff;
  text-align: center;
}
.article-cta h3 { color: #fff; font-size: 1.4rem; margin-bottom: 8px; }
.article-cta p { color: rgba(255,255,255,.85); margin-bottom: 22px; font-size: .98rem; }
.article-cta .btn { background: #fff; color: var(--brand-700); }
.article-cta .btn:hover { background: var(--surface-1); }
