/* ═══════════════════════════════════════════════
   HYPRSWARM — Blog Typography & Layout
   Dark theme consistent with dashboard style.css
   Uses same CSS vars: --bg-dark, --cyan-glow, etc.
   ═══════════════════════════════════════════════ */

/* ─── Site Header (blog pages) ───────────────── */

.blog-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.blog-site-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ─── Blog Nav ───────────────────────────────── */

.blog-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.blog-nav-cta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 6px;
}

@media (max-width: 480px) {
  .blog-nav-cta { display: none; }
  .blog-nav { gap: 16px; }
}

/* ─── Main Layout ────────────────────────────── */

.blog-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ─── Blog Index ─────────────────────────────── */

.blog-index-header {
  margin-bottom: 48px;
}

.blog-index-title {
  font-family: 'Geist', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.blog-index-desc {
  font-family: 'Geist', sans-serif;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Post Cards (index) ─────────────────────── */

.blog-post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.post-card-dot {
  color: rgba(255, 255, 255, 0.20);
}

.post-card-title {
  font-family: 'Geist', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.post-card-title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-title a:hover {
  color: var(--cyan-glow);
}

.post-card-desc {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  margin-bottom: 14px;
}

.post-card-link {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan-glow);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease;
}

.post-card-link:hover {
  opacity: 0.75;
  color: var(--cyan-glow);
}

/* ─── Article Header ─────────────────────────── */

.blog-header {
  margin-bottom: 36px;
}

.blog-header--page {
  margin-bottom: 32px;
}

.blog-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.blog-meta-dot {
  color: rgba(255, 255, 255, 0.20);
}

.blog-title {
  font-family: 'Geist', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.blog-description {
  font-family: 'Geist', sans-serif;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
  font-weight: 400;
}

.blog-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 40px;
}

/* ─── Article Body ───────────────────────────── */

.blog-body {
  font-family: 'Geist', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-main);
}

/* Headings */
.blog-body h1,
.blog-body h2,
.blog-body h3,
.blog-body h4 {
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 2.4em;
  margin-bottom: 0.6em;
}

.blog-body h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.blog-body h2 { font-size: 1.4rem; }
.blog-body h3 { font-size: 1.15rem; }
.blog-body h4 { font-size: 1rem; color: rgba(255, 255, 255, 0.80); }

/* First heading after divider — no extra top margin */
.blog-body > h1:first-child,
.blog-body > h2:first-child,
.blog-body > h3:first-child {
  margin-top: 0;
}

/* Paragraphs */
.blog-body p {
  margin-bottom: 1.35em;
}

.blog-body p:last-child {
  margin-bottom: 0;
}

/* Links */
.blog-body a {
  color: var(--cyan-glow);
  text-decoration: underline;
  text-decoration-color: rgba(245, 197, 66, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.blog-body a:hover {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

/* Strong & Em */
.blog-body strong {
  font-weight: 700;
  color: #fff;
}

.blog-body em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.80);
}

/* Horizontal rule */
.blog-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Lists */
.blog-body ul,
.blog-body ol {
  padding-left: 1.6em;
  margin-bottom: 1.35em;
}

.blog-body ul {
  list-style: none;
}

.blog-body ul li {
  position: relative;
  margin-bottom: 0.5em;
}

.blog-body ul li::before {
  content: '—';
  position: absolute;
  left: -1.4em;
  color: var(--cyan-glow);
  font-weight: 700;
  opacity: 0.7;
}

.blog-body ol {
  list-style: decimal;
}

.blog-body ol li {
  margin-bottom: 0.5em;
  padding-left: 0.3em;
}

.blog-body ol li::marker {
  color: var(--cyan-glow);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
}

/* Nested lists */
.blog-body ul ul,
.blog-body ol ol,
.blog-body ul ol,
.blog-body ol ul {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}

/* Blockquotes */
.blog-body blockquote {
  border-left: 3px solid var(--cyan-glow);
  margin: 1.8em 0;
  padding: 12px 20px;
  background: rgba(245, 197, 66, 0.04);
  border-radius: 0 8px 8px 0;
}

.blog-body blockquote p {
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
  margin-bottom: 0;
}

/* Inline code */
.blog-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84em;
  color: var(--cyan-glow);
  background: rgba(245, 197, 66, 0.08);
  border: 1px solid rgba(245, 197, 66, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Code blocks */
.blog-body pre {
  background: rgba(10, 13, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 1.8em 0;
}

.blog-body pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  color: var(--text-main);
  background: none;
  border: none;
  padding: 0;
  white-space: pre;
}

/* Tables */
.blog-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}

.blog-body thead {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.blog-body th {
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.40);
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
}

.blog-body td {
  font-family: 'Geist', sans-serif;
  color: var(--text-main);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.blog-body tbody tr:last-child td {
  border-bottom: none;
}

.blog-body tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ─── Back Link ──────────────────────────────── */

.blog-back {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.blog-back-link {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.blog-back-link:hover {
  color: var(--cyan-glow);
}

/* ─── Footer ─────────────────────────────────── */

.blog-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.blog-footer-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.blog-footer-disclaimer {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  line-height: 1.6;
  max-width: 500px;
  text-align: center;
}

.blog-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-footer-link {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.30);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-footer-link:hover {
  color: rgba(255, 255, 255, 0.70);
}

.blog-footer-sep {
  color: rgba(255, 255, 255, 0.15);
  font-size: 11px;
}

/* ─── Light Theme Overrides ──────────────────── */

[data-theme="light"] .blog-body {
  color: var(--text-main);
}

[data-theme="light"] .blog-body h1,
[data-theme="light"] .blog-body h2,
[data-theme="light"] .blog-body h3,
[data-theme="light"] .blog-body h4,
[data-theme="light"] .blog-body strong,
[data-theme="light"] .blog-title {
  color: var(--text-main);
}

[data-theme="light"] .blog-body em {
  color: rgba(0, 0, 0, 0.70);
}

[data-theme="light"] .blog-body blockquote {
  background: rgba(0, 0, 0, 0.04);
  border-left-color: rgba(0, 0, 0, 0.20);
}

[data-theme="light"] .blog-body blockquote p {
  color: rgba(0, 0, 0, 0.65);
}

[data-theme="light"] .blog-body code {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .blog-body pre {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .blog-body pre code {
  color: var(--text-main);
}

[data-theme="light"] .blog-body td {
  color: var(--text-main);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .blog-body th {
  color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .blog-body thead {
  border-bottom-color: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .blog-body tbody tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .blog-description {
  color: rgba(0, 0, 0, 0.55);
}

[data-theme="light"] .post-card-title a {
  color: var(--text-main);
}

[data-theme="light"] .post-card-desc {
  color: rgba(0, 0, 0, 0.55);
}

[data-theme="light"] .blog-index-title {
  color: var(--text-main);
}

[data-theme="light"] .blog-body ul li::before {
  color: var(--text-muted);
}

[data-theme="light"] .blog-body ol li::marker {
  color: var(--text-muted);
}

[data-theme="light"] .blog-body a {
  color: var(--text-main);
  text-decoration-color: rgba(0, 0, 0, 0.30);
}

[data-theme="light"] .blog-body a:hover {
  color: var(--text-main);
  text-decoration-color: rgba(0, 0, 0, 0.60);
}

/* ─── Responsive ─────────────────────────────── */

@media (max-width: 640px) {
  .blog-main {
    padding: 32px 18px 60px;
  }

  .blog-site-header-inner {
    padding: 14px 18px;
  }

  .blog-body {
    font-size: 15px;
  }

  .blog-body pre {
    padding: 16px;
    border-radius: 8px;
  }

  .blog-body table {
    font-size: 13px;
  }

  .blog-body th,
  .blog-body td {
    padding: 10px 12px;
  }
}
