/* Blog Layout */
.blog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.blog-sidebar {
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.blog-sidebar .sidebar-header {
  margin-bottom: 2rem;
}

.blog-sidebar .back-link {
  display: inline-block;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.blog-sidebar .back-link:hover {
  color: var(--gray-900);
}

.blog-sidebar h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
}

/* Post list in sidebar */
.blog-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-link {
  display: block;
  padding: 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.post-link:hover {
  background: white;
}

.post-link.active {
  background: var(--gray-900);
}

.post-link .post-title {
  display: block;
  color: var(--gray-800);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
}

.post-link.active .post-title {
  color: white;
}

.post-link .post-date {
  display: block;
  color: var(--gray-500);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.post-link.active .post-date {
  color: var(--gray-400);
}

.no-posts {
  color: var(--gray-500);
  font-size: 0.875rem;
  font-style: italic;
}

/* Blog content area */
.blog-content {
  background: white;
  overflow-y: auto;
}

.blog-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 3rem;
}

.loading {
  color: var(--gray-500);
  font-style: italic;
}

/* Landing page styles */
.blog-landing h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.blog-intro {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 3rem;
}

.no-posts-message {
  color: var(--gray-500);
  font-style: italic;
}

.post-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.post-card:hover {
  border-color: var(--gray-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.post-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.post-card time {
  display: block;
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
}

.post-card p {
  color: var(--gray-700);
  line-height: 1.6;
}

/* Single post styles */
.blog-post {
  font-family: 'Source Serif 4', Georgia, serif;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.back-to-posts {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.back-to-posts:hover {
  color: var(--gray-900);
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.post-header time {
  color: var(--gray-500);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

/* Post content typography */
.post-content {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--gray-800);
}

.post-content h1,
.post-content h2,
.post-content h3 {
  color: var(--gray-900);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content h1 {
  font-size: 2rem;
}

.post-content h2 {
  font-size: 1.5rem;
}

.post-content h3 {
  font-size: 1.25rem;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
}

.post-content a:hover {
  color: var(--gray-900);
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--gray-600);
  font-style: italic;
}

.post-content pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
}

.post-content p code,
.post-content li code {
  background: var(--gray-100);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--gray-800);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 3rem 0;
}

/* Error state */
.error {
  color: var(--gray-600);
  text-align: center;
  padding: 3rem;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }

  .blog-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .post-link {
    padding: 0.5rem 0.75rem;
  }

  .post-link .post-date {
    display: none;
  }
}

@media (max-width: 640px) {
  .blog-container {
    padding: 2rem 1.5rem;
  }

  .blog-landing h1 {
    font-size: 2rem;
  }

  .post-header h1 {
    font-size: 1.75rem;
  }

  .post-content {
    font-size: 1rem;
  }
}
