/* ============================================================
   Blog styles — extends the main site theme (style.css).
   Uses the same CSS variables: --bg, --accent, --card, etc.
   ============================================================ */

.blog-hero { padding-top: 7rem; }

.nav__links a.active { color: var(--accent); }

/* --- Post grid --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.blog-empty {
  color: var(--muted);
  font-family: var(--font-mono);
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 0;
}

/* --- Post card --- */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -12px rgba(249, 115, 22, .35);
}

.post-card__bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.post-card__file {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
}

.post-card__body { padding: 1.4rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }

.post-card__date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
}
.post-card__title {
  font-size: 1.25rem;
  line-height: 1.3;
  color: #fff;
  margin: 0;
}
.post-card__excerpt {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
  margin: 0;
}

.post-card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.post-tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .18rem .5rem;
}

.post-card__more {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--accent);
  margin-top: auto;
  padding-top: .5rem;
}

/* --- Single post view --- */
.post-view { max-width: 760px; margin: 0 auto; padding-top: 7rem; }

.post-back {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1.5rem;
  transition: color .2s ease;
}
.post-back:hover { color: var(--accent); }

.post-view__head { margin-bottom: 2.5rem; }
.post-view__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  color: #fff;
  margin: .6rem 0 1rem;
}

/* --- Post content typography --- */
.post-content { color: #cbd5e1; font-size: 1.05rem; line-height: 1.8; }
.post-content h2 {
  color: #fff;
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  padding-top: .5rem;
}
.post-content h3 { color: #fff; font-size: 1.3rem; margin: 2rem 0 .8rem; }
.post-content p { margin: 0 0 1.3rem; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content ul, .post-content ol { margin: 0 0 1.3rem 1.4rem; }
.post-content li { margin-bottom: .5rem; }
.post-content img { max-width: 100%; border-radius: 10px; margin: 1.5rem 0; border: 1px solid var(--border); }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: .5rem 0 .5rem 1.2rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}
.post-content pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .88rem;
  margin: 1.5rem 0;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .4rem;
}
.post-content pre code { background: none; border: none; padding: 0; }

.post-view__foot {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* --- Category filter bar (blog + portfolio) --- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin: 2rem 0 2.5rem; }
.filter-pill {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.filter-pill:hover { border-color: var(--accent); color: #fff; }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #0B1120; font-weight: 600; }

/* --- Post card meta row + cover --- */
.post-card__meta { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.post-card__cover { aspect-ratio: 16/9; overflow: hidden; border-bottom: 1px solid var(--border); }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover { width: 100%; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 2rem; }
a.post-tag { text-decoration: none; }
