/* ============================================================
   Personal Website — Blog Page
   Joel Evert Patreksson Thomas
   Markdown-rendered blog with glass-morphism cards.
   ============================================================ */

.blog-header {
  padding: 140px 0 60px;
  text-align: center;
  position: relative;
}

.blog-header h1 {
  font-family: var(--font-heading);
  font-size: var(--step-4);
  color: var(--light);
  margin-bottom: 16px;
}

.blog-header p {
  font-size: var(--step-0);
  color: var(--text-mid);
  max-width: 48ch;
  margin: 0 auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  padding-bottom: 80px;
}

.blog-card {
  background: var(--surface-glass);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.blog-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--maroon-glow), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.blog-card:hover::before {
  opacity: 0.6;
}

.blog-card-date {
  font-size: var(--step--1);
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.blog-card h2 {
  font-family: var(--font-heading);
  font-size: var(--step-2);
  color: var(--light);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  line-height: 1.25;
}

.blog-card p.excerpt {
  font-size: var(--step-0);
  color: var(--text-mid);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.blog-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: var(--step--1);
  color: var(--light-dim);
  font-weight: 600;
  position: relative;
  z-index: 1;
  transition: color 0.2s ease;
}

.blog-card:hover .read-more {
  color: var(--light);
}

.blog-card .read-more::after {
  content: "→";
  font-size: 1.1em;
  transition: transform 0.2s ease;
}

.blog-card:hover .read-more::after {
  transform: translateX(4px);
}

/* Single post view */
.blog-post {
  max-width: 720px;
  margin: 0 auto;
  padding: 140px 0 100px;
}

.blog-post .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step--1);
  color: var(--text-soft);
  margin-bottom: 32px;
  transition: color 0.2s ease;
}

.blog-post .back-link:hover {
  color: var(--light);
}

.blog-post .back-link::before {
  content: "←";
}

.blog-post .post-date {
  font-size: var(--step--1);
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.blog-post h1 {
  font-family: var(--font-heading);
  font-size: var(--step-3);
  color: var(--light);
  margin-bottom: 40px;
  line-height: 1.15;
}

.blog-post .post-body {
  font-size: var(--step-0);
  color: var(--text-mid);
  line-height: 1.85;
}

.blog-post .post-body h2 {
  font-family: var(--font-heading);
  font-size: var(--step-2);
  color: var(--light);
  margin: 48px 0 16px;
}

.blog-post .post-body h3 {
  font-family: var(--font-heading);
  font-size: var(--step-1);
  color: var(--light-dim);
  margin: 36px 0 12px;
}

.blog-post .post-body p {
  margin-bottom: 20px;
}

.blog-post .post-body strong {
  color: var(--light);
  font-weight: 600;
}

.blog-post .post-body ul,
.blog-post .post-body ol {
  margin: 16px 0 24px;
  padding-left: 24px;
}

.blog-post .post-body li {
  margin-bottom: 8px;
}

.blog-post .post-body code {
  background: var(--surface-strong);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--light-dim);
}

.blog-post .post-body pre {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
}

.blog-post .post-body pre code {
  background: none;
  padding: 0;
}

.blog-post .post-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.blog-post .post-body blockquote {
  border-left: 3px solid var(--maroon);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-mid);
  font-style: italic;
}

.blog-post .post-body a {
  color: var(--light-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post .post-body a:hover {
  color: var(--light);
}

.blog-post .post-body img {
  border-radius: 16px;
  margin: 32px 0;
}

/* Loading / empty states */
.blog-empty {
  text-align: center;
  padding: 80px 0;
}

.blog-empty p {
  font-size: var(--step-1);
  color: var(--text-soft);
}

/* Responsive */
@media (max-width: 768px) {
  .blog-header {
    padding: 120px 0 40px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-post {
    padding: 120px 0 80px;
  }

  .blog-post h1 {
    font-size: var(--step-2);
  }
}
