/* ===== Blog layout shell (self-contained — mirrors home.css's .home-container/.section-* naming,
   but blog pages don't load home.css since that stylesheet is homepage-scoped) ===== */
.blog-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.blog-section { padding: 0; }
.blog-header { margin-bottom: 24px; }
.blog-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.blog-subtitle {
  font-size: 14px;
  color: var(--muted-fg);
  margin-top: 4px;
}

/* ===== Post grid + card ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px -16px rgba(0,0,0,.18);
}
.post-card-media {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--muted);
}
.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}
.post-card:hover .post-card-media img { transform: scale(1.05); }
.post-card-media-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}
.post-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-excerpt {
  font-size: 13px;
  color: var(--muted-fg);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.post-card-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted-fg);
}

/* ===== Sponsored badge ===== */
.post-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.post-badge--sponsored {
  background: hsl(38 92% 50% / 0.12);
  color: hsl(38 92% 35%);
  border: 1px solid hsl(38 92% 50% / 0.3);
}
.post-card-media .post-badge--sponsored {
  position: absolute;
  top: 12px;
  left: 12px;
  background: hsl(38 92% 50% / 0.92);
  color: white;
  border: none;
  backdrop-filter: blur(4px);
}
.post-detail-meta .post-badge--sponsored a { color: inherit; text-decoration: underline; }

/* ===== Pagination ===== */
.post-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}
.post-pagination-current {
  font-size: 13px;
  color: var(--muted-fg);
}

/* ===== Post detail ===== */
.post-detail {
  max-width: 760px;
  margin: 0 auto;
}
.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-fg);
  margin-bottom: 20px;
}
.post-breadcrumb a { color: var(--muted-fg); transition: color var(--transition); }
.post-breadcrumb a:hover { color: var(--primary); }
.post-breadcrumb .sep { opacity: 0.4; }
.post-breadcrumb .current { color: var(--fg); font-weight: 500; }

.post-detail-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.post-detail-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}
.post-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted-fg);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* ===== Rendered Markdown typography ===== */
.post-detail-body { font-size: 15px; line-height: 1.75; color: var(--fg); }
.post-detail-body h1,
.post-detail-body h2,
.post-detail-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 32px 0 12px;
}
.post-detail-body h1 { font-size: 26px; }
.post-detail-body h2 { font-size: 22px; }
.post-detail-body h3 { font-size: 18px; }
.post-detail-body p { margin-bottom: 16px; }
.post-detail-body a { color: var(--primary); text-decoration: underline; }
.post-detail-body ul,
.post-detail-body ol { margin: 0 0 16px 20px; }
.post-detail-body li { margin-bottom: 6px; }
.post-detail-body blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 16px;
  margin: 20px 0;
  color: var(--muted-fg);
  font-style: italic;
}
.post-detail-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-detail-title { font-size: 24px; }
  .blog-container { padding: 24px 16px 48px; }
}
