/* ============================================================
   blog.css — Blog layout and article typography
   Shared across blog index and individual posts.
   ============================================================ */

/* ---------- Blog Index ---------- */
.blog-hero {
  padding: 140px 0 60px;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.blog-hero .blog-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 8px;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--faint);
  margin-bottom: 32px;
  transition: color 0.2s;
}
.blog-back:hover { color: var(--teal); opacity: 1; }

/* ---------- Post Cards (Index) ---------- */
.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 100px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.post-card:hover {
  border-color: rgba(45,212,191,0.3);
  transform: translateY(-3px);
  box-shadow: var(--glow);
  opacity: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--faint);
}

.post-card-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(45,212,191,0.08);
  border: 1px solid rgba(45,212,191,0.2);
  border-radius: 100px;
  padding: 2px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--teal);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.post-card h2 {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
}

.post-card-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  font-family: var(--mono);
}

/* ---------- Article Layout ---------- */
.article-header {
  padding: 140px 0 48px;
  max-width: 720px;
  margin: 0 auto;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--faint);
}

.article-header h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.article-header .article-lede {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- Article Body ---------- */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 100px;
}

.article-body h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  letter-spacing: -0.3px;
  margin: 56px 0 20px;
  padding-top: 8px;
}

.article-body h3 {
  font-size: 1.15rem;
  margin: 40px 0 14px;
  color: var(--text);
}

.article-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 20px;
}

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

.article-body em {
  color: var(--text);
}

.article-body a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(45,212,191,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.article-body a:hover {
  text-decoration-color: var(--teal);
  opacity: 1;
}

.article-body ul, .article-body ol {
  margin: 0 0 20px 24px;
  color: var(--muted);
}

.article-body li {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 6px;
}

.article-body blockquote {
  border-left: 3px solid var(--teal);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(45,212,191,0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body blockquote p {
  color: var(--text);
  font-style: italic;
  margin-bottom: 0;
}

/* Code blocks */
.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(45,212,191,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--teal);
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 1em;
}

/* Timeline in articles */
.article-timeline {
  margin: 32px 0;
  border-left: 2px solid var(--border);
  padding-left: 24px;
}

.article-timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 4px;
}

.article-timeline-item::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.article-timeline-item.incident::before {
  background: var(--red);
}

.article-timeline-time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  margin-bottom: 4px;
}

.article-timeline-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Callout / lesson boxes */
.article-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}

.article-callout.warning {
  border-left-color: var(--amber);
}

.article-callout.danger {
  border-left-color: var(--red);
}

.article-callout-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal);
  font-family: var(--mono);
  margin-bottom: 8px;
}

.article-callout.warning .article-callout-label { color: var(--amber); }
.article-callout.danger .article-callout-label { color: var(--red); }

.article-callout p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Stat inline */
.article-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(45,212,191,0.06);
  border: 1px solid rgba(45,212,191,0.15);
  border-radius: 8px;
  padding: 4px 12px;
  margin: 4px 0;
}

.article-stat-value {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--teal);
  font-size: 1.1em;
}

.article-stat-label {
  font-size: 0.8rem;
  color: var(--faint);
}

/* Diagram / architecture boxes */
.article-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 32px 0;
  text-align: center;
}

.article-diagram-label {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.tier-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tier-node {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  min-width: 100px;
}

.tier-node-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.tier-node-desc {
  font-size: 0.68rem;
  color: var(--faint);
  font-family: var(--mono);
}

.tier-arrow {
  color: var(--faint);
  font-size: 1.2rem;
}

/* ---------- Article Footer ---------- */
.article-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0 80px;
  border-top: 1px solid var(--border);
}

.article-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.article-footer-link {
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--faint);
  transition: color 0.2s;
}
.article-footer-link:hover { color: var(--teal); opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .article-header { padding: 120px 0 36px; }
  .article-body pre { padding: 14px 16px; font-size: 0.8rem; }
  .post-card { padding: 24px; }

  .tier-chain { flex-direction: column; }
  .tier-arrow { transform: rotate(90deg); }
}
