/* ── Blog Shared Styles ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Accessibility ────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
  z-index: 10000; background: var(--accent); color: #fff; padding: 12px 24px;
  font-size: 14px; font-weight: 600; border-radius: 0 0 8px 0; text-decoration: none;
}
.skip-link:focus { left: 0; top: 0; width: auto; height: auto; overflow: visible; }
:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg-page: #0a0a0f;
  --bg-card: #141419;
  --bg-card-hover: #1a1a22;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text-0: #f0f0f5;
  --text-1: #a0a0b0;
  --text-2: #606070;
  --accent: #6c63ff;
  --accent-glow: rgba(108,99,255,0.15);
  --accent-2: #00d4aa;
  --code-bg: #1e1e2a;
  --tag-bg: rgba(255,255,255,0.06);
  --tag-text: #b0b0c0;
}

body {
  font-family: var(--font);
  color: var(--text-0);
  background: var(--bg-page);
  line-height: 1.7;
  font-size: 17px;
}

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

/* ── Header ──────────────────────────────────────────────────────── */
.blog-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  background: var(--bg-page);
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-0);
  text-decoration: none;
}
.blog-header nav a {
  margin-left: 1.5rem;
  color: var(--text-1);
  font-size: 0.9rem;
  text-decoration: none;
}
.blog-header nav a:hover, .blog-header nav a.active {
  color: var(--accent);
}

/* ── Blog Container ──────────────────────────────────────────────── */
.blog-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Hero ────────────────────────────────────────────────────────── */
.blog-hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}
.blog-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.blog-hero p {
  font-size: 1.05rem;
  color: var(--text-1);
  max-width: 560px;
  margin: 0 auto;
}

/* ── Blog List ───────────────────────────────────────────────────── */
.blog-posts { list-style: none; }
.post-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.post-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.post-card a {
  display: block;
  padding: 1.5rem 1.75rem;
  text-decoration: none;
  color: inherit;
}
.post-meta {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}
.post-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.post-excerpt {
  color: var(--text-1);
  font-size: 0.92rem;
  line-height: 1.5;
}
.post-tags { margin-top: 0.75rem; }
.post-tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-right: 0.4rem;
}

/* ── Article Page ────────────────────────────────────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-1);
}
.back-link:hover { color: var(--accent); }

.post-header { margin-bottom: 2rem; }
.post-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.post-header .meta {
  color: var(--text-2);
  font-size: 0.85rem;
}
.post-header .tags { margin-top: 0.75rem; }

/* ── Post Content ────────────────────────────────────────────────── */
.post-content h2 {
  font-size: 1.45rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-0);
}
.post-content h3 {
  font-size: 1.15rem;
  margin: 1.8rem 0 0.5rem;
  color: var(--text-0);
}
.post-content p { margin-bottom: 1rem; color: var(--text-0); }
.post-content ul, .post-content ol {
  margin: 0.75rem 0 1rem 1.5rem;
  color: var(--text-0);
}
.post-content li { margin-bottom: 0.4rem; }
.post-content strong { font-weight: 600; }
.post-content em { color: var(--text-1); }

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

.post-content code {
  background: var(--code-bg);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--accent-2);
}
.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text-0);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}
.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
}
.post-content th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-0);
}
.post-content td { color: var(--text-1); }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-1);
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
}

/* ── Images (130% zoom for readability) ──────────────────────────── */
.post-content img {
  width: 130%;
  max-width: 130%;
  margin-left: -15%;
  height: auto;
  border-radius: 8px;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── Callout ─────────────────────────────────────────────────────── */
.callout {
  background: var(--accent-glow);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  color: var(--text-0);
}
.callout.teal { border-color: var(--accent-2); background: rgba(0,212,170,0.08); }

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

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .blog-hero h1 { font-size: 1.6rem; }
  .blog-container { padding: 1.5rem 1rem 3rem; }
  .post-header h1 { font-size: 1.4rem; }
  .post-content img {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
}
