/* ============================================
   FOURYR — Blog Page & Single Post
   ============================================ */

/* ── Listing section ───────────────────────── */
.blog-section {
  padding: var(--space-16) 0 var(--space-20);
}

/* ── Listing grid ──────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

/* ── Loading / Empty ───────────────────────── */
.blog-loading,
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-16) 0;
  color: var(--gray-400);
  font-size: 1rem;
}

/* ── Card ──────────────────────────────────── */
.blog-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.blog-card__cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--gray-100);
}

.blog-card__cover-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card__cover-placeholder svg {
  width: 36px;
  height: 36px;
  color: #818cf8;
  opacity: 0.5;
}

.blog-card__body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.blog-card__date {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
}

.blog-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__excerpt {
  color: var(--gray-500);
  font-size: 0.875rem;
  line-height: 1.65;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__read {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: var(--space-3);
  border-top: 1px solid var(--gray-100);
  transition: gap 0.2s;
}

.blog-card__read svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.blog-card:hover .blog-card__read { gap: 10px; }

/* ═══════════════════════════════════════════ */
/* Single post page                            */
/* ═══════════════════════════════════════════ */

.post-hero {
  padding: var(--space-16) 0 var(--space-12);
  border-bottom: 1px solid var(--gray-100);
}

.post-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  margin-bottom: var(--space-6);
  transition: color 0.15s;
}

.post-hero__back svg { width: 16px; height: 16px; }
.post-hero__back:hover { color: var(--blue); }

.post-hero__date {
  font-size: 0.85rem;
  color: var(--gray-400);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.post-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--gray-900);
  margin: 0 0 var(--space-5);
  line-height: 1.2;
  max-width: 760px;
}

.post-hero__excerpt {
  font-size: 1.125rem;
  color: var(--gray-500);
  line-height: 1.7;
  max-width: 680px;
  margin: 0;
}

/* ── Cover image ───────────────────────────── */
.post-cover {
  padding: var(--space-10) 0 0;
}

.post-cover__img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

/* ── Post content ──────────────────────────── */
.post-content-section {
  padding: var(--space-12) 0 var(--space-20);
}

.post-content-layout {
  max-width: 720px;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-700);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}

.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.05rem; }

.post-content p { margin: 0 0 1.25em; }

.post-content ul,
.post-content ol {
  margin: 0 0 1.25em;
  padding-left: 1.5em;
}

.post-content li { margin-bottom: 0.4em; }

.post-content a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content blockquote {
  border-left: 3px solid var(--blue);
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  background: #eff6ff;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--gray-600);
}

.post-content code {
  font-family: monospace;
  font-size: 0.9em;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-content pre {
  background: var(--gray-900);
  color: #e2e8f0;
  padding: var(--space-5);
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
}

.post-content img {
  max-width: 100%;
  border-radius: 10px;
}

/* ── Post not found ────────────────────────── */
.post-not-found {
  padding: var(--space-20) 0;
  text-align: center;
}

.post-not-found h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0 0 var(--space-4);
}

.post-not-found p {
  color: var(--gray-500);
  margin: 0 0 var(--space-8);
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .post-hero__title {
    font-size: 1.75rem;
  }
}
