/* Base Variables inspired by the main site */
:root {
  --bg-color: #0f1115; /* Dark background */
  --surface-color: #1a1d24; /* Card background */
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --accent-color: #8b5cf6; /* Indigo/purple accent */
  --accent-hover: #a78bfa;
  --border-color: #334155;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body.blog-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover, a:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.blog-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  background-color: rgba(15, 17, 21, 0.9);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-list a:hover, .nav-list a.active {
  color: var(--text-main);
}

/* Main Content */
.blog-main {
  padding: 3rem 0;
  min-height: 70vh;
}

/* Blog Index */
.blog-index-header {
  margin-bottom: 3rem;
  text-align: center;
}

.blog-index-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.blog-index-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.articles-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .articles-grid, .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Article Card */
.article-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.card-image-link img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 1.5rem;
}

.card-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.card-title {
  margin: 0.5rem 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent-hover);
}

.card-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Single Post */
.post-article {
  max-width: 720px;
  margin: 0 auto;
}

.breadcrumbs {
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
}

.breadcrumbs li::after {
  content: ">";
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.breadcrumbs li:last-child::after {
  content: "";
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--text-main);
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-category {
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.post-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

.post-description {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.meta-separator {
  color: var(--border-color);
}

.post-featured-image {
  margin: 0 0 3rem;
}

.post-featured-image img {
  width: 100%;
  border-radius: 8px;
  height: auto;
}

.post-featured-image figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.post-content h2, .post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content p, .post-content ul, .post-content ol {
  margin-bottom: 1.25rem;
}

.post-content img {
  max-width: 100%;
  border-radius: 6px;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: var(--text-muted);
  font-style: italic;
  background-color: var(--surface-color);
  border-radius: 0 4px 4px 0;
}

.post-content pre {
  background-color: #0d0d12;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

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

.post-tags {
  margin-top: 3rem;
}

.post-tags h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.post-tags ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background-color: var(--surface-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

.section-divider {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
  margin: 4rem 0;
}

.related-posts-section h3 {
  margin-bottom: 1.5rem;
}

.related-posts-grid {
  display: grid;
  gap: 1.5rem;
}

/* Footer */
.blog-footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}
