/* ════════════════════════════════════════════════════════
   BLOG — shared styles for blog/index.html and blog posts
   Loaded after style.css (inherits all design tokens)
   ════════════════════════════════════════════════════════ */

/* ── BLOG LAYOUT ────────────────────────────────────────── */
.blog-main {
  padding-top: calc(var(--navbar-h) + var(--space-20));
  padding-bottom: var(--space-32);
  min-height: 100dvh;
}

/* ── BLOG PAGE HEADER ───────────────────────────────────── */
.blog-header {
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-16);
}

.blog-header__title {
  font-size: var(--text-3xl);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.blog-header__subtitle {
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 540px;
}

/* ── BLOG LIST ──────────────────────────────────────────── */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.blog-list__item {
  background: var(--bg);
  transition: background var(--t-base) var(--ease);
}
.blog-list__item:hover { background: var(--surface); }

.blog-list__link {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-8);
  padding: var(--space-8) 0;
  text-decoration: none;
}

.blog-list__image {
  width: 200px;
  height: 130px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}
.blog-list__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}
.blog-list__item:hover .blog-list__image img {
  transform: scale(1.04);
}

.blog-list__image--placeholder {
  background: linear-gradient(135deg, #0a1628 0%, #0d2137 50%, #0a1f2e 100%);
}

.blog-list__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-list__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.blog-list__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: var(--space-3);
}

.blog-list__excerpt {
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.blog-list__read {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.04em;
  transition: letter-spacing var(--t-base) var(--ease);
}
.blog-list__item:hover .blog-list__read {
  letter-spacing: 0.1em;
}

/* ── POST PAGE ──────────────────────────────────────────── */
.post-page {
  padding-top: calc(var(--navbar-h) + var(--space-20));
  padding-bottom: var(--space-32);
  min-height: 100dvh;
}

.post-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.post__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-decoration: none;
  margin-bottom: var(--space-12);
  transition: color var(--t-base) var(--ease);
}
.post__back:hover { color: var(--text-primary); }

.post__header {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}

.post__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--space-4);
}

.post__title {
  font-size: var(--text-3xl);
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.post__excerpt {
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Hero image */
.post__hero {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: var(--space-12);
  border: 1px solid var(--border);
}

/* Post body — rich text styles */
.post-body {
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-body p {
  margin-bottom: var(--space-6);
}

.post-body h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-top: var(--space-12);
  margin-bottom: var(--space-5);
}

.post-body h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.post-body strong {
  color: var(--text-primary);
  font-weight: 500;
}

.post-body em {
  font-style: italic;
  color: var(--text-secondary);
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--t-fast) var(--ease);
}
.post-body a:hover { opacity: 0.75; }

.post-body ul,
.post-body ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-6);
}
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }

.post-body li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--text-primary);
}

.post-body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: var(--space-6);
  overflow-x: auto;
  margin: var(--space-8) 0;
}
.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Images inside posts */
.post__img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: var(--space-8) 0;
}

.post__img-caption {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-8);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .blog-list__link {
    grid-template-columns: 1fr;
  }
  .blog-list__image {
    width: 100%;
    height: 160px;
  }
}
