/* ===== BLOG STYLES ===== */
/* Extends style.css — must load AFTER style.css */

/* ── Blog nav active state ── */
.nav-link.active { color: var(--accent); background: rgba(0,255,106,0.07); }

/* ── Breadcrumb ── */
.breadcrumb {
  max-width: 780px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text); }

/* ── Article layout ── */
.blog-article {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Post header ── */
.post-header { margin-bottom: 2rem; }

.post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0,255,106,0.1);
  border: 1px solid rgba(0,255,106,0.2);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 1rem;
}

.post-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  margin-bottom: 1.75rem;
}
.post-meta strong { color: var(--text); }
.post-meta .dot { opacity: 0.3; }

/* ── Hero image ── */
.post-hero {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

/* ── Post body typography ── */
.post-body { font-size: 1.05rem; line-height: 1.75; }

.post-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 2.5rem 0 0.9rem;
  color: var(--text);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.post-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
  color: var(--accent);
}

.post-body p { margin-bottom: 1.1rem; }

.post-body ul,
.post-body ol {
  margin: 0.75rem 0 1.25rem 1.4rem;
}
.post-body li { margin-bottom: 0.45rem; }

.post-body strong { color: var(--text); font-weight: 600; }
.post-body em { color: var(--accent); font-style: normal; font-weight: 600; }

.post-body a { color: var(--accent); }
.post-body a:hover { text-decoration: underline; }

/* ── In-body image ── */
.post-img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  margin: 1.75rem 0;
  border: 1px solid var(--border);
}
.post-img-caption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -1.25rem;
  margin-bottom: 1.5rem;
}

/* ── Comparison / data table ── */
.post-table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; }
.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.post-table th {
  background: var(--bg3);
  color: var(--accent);
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 2px solid rgba(0,255,106,0.25);
  white-space: nowrap;
}
.post-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
}
.post-table tr:last-child td { border-bottom: none; }
.post-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* ── CTA box ── */
.post-cta {
  background: linear-gradient(135deg, rgba(0,255,106,0.08), rgba(0,204,85,0.04));
  border: 1px solid rgba(0,255,106,0.25);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin: 2.25rem 0;
}
.post-cta .cta-headline {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.post-cta .cta-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.post-cta .cta-code {
  display: inline-block;
  background: rgba(0,255,106,0.12);
  border: 1px dashed rgba(0,255,106,0.4);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 0.3rem 1.2rem;
  border-radius: 6px;
  margin-bottom: 1.1rem;
}

/* ── Callout / tip box ── */
.callout {
  display: flex;
  gap: 0.9rem;
  background: var(--bg3);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.callout-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1.5; }
.callout p { margin: 0; color: var(--text); }

/* ── FAQ in post ── */
.post-faq { margin: 0.5rem 0; }
.post-faq details {
  border-bottom: 1px solid var(--border);
  padding: 0.1rem 0;
}
.post-faq summary {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 0.9rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 400;
  flex-shrink: 0;
}
.post-faq details[open] summary::after { content: '−'; }
.post-faq details[open] summary { color: var(--accent); }
.post-faq .faq-answer {
  font-size: 0.93rem;
  color: var(--text-muted);
  padding: 0 0 1rem;
  line-height: 1.7;
}

/* ── Blog index grid ── */
.blog-header {
  max-width: 1100px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}
.blog-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.blog-header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
}

.blog-grid-wrap {
  max-width: 1100px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
}

/* Featured post */
.blog-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-featured:hover { border-color: rgba(0,255,106,0.35); box-shadow: 0 8px 32px rgba(0,0,0,0.4); text-decoration: none; }
.blog-featured-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.blog-featured-body {
  padding: 2rem 2rem 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.blog-featured-body .post-category { margin-bottom: 0.75rem; }
.blog-featured-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  border: none;
  padding: 0;
}
.blog-featured-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.blog-featured-body .post-meta { border: none; padding: 0; margin: 0; }

@media (max-width: 700px) {
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured-body { padding: 1.25rem; }
}

/* Post card grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover { border-color: rgba(0,255,106,0.3); transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.blog-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.blog-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-body .post-category { margin-bottom: 0.6rem; }
.blog-card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}
.blog-card-body p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1rem;
}
.blog-card-body .post-meta { border: none; padding: 0; margin: 0; font-size: 0.78rem; }

/* ── Article footer / related ── */
.post-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 2rem;
}
.post-footer h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.related-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  transition: border-color 0.2s;
  display: block;
}
.related-card:hover { border-color: rgba(0,255,106,0.3); text-decoration: none; }
.related-card .post-category { margin-bottom: 0.5rem; }
.related-card p {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
