/* Blog standalone stylesheet — matches Runhooks site design without Vuetify */

/* ── Reset & base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables ───────────────────────────────────── */
:root {
  --bg:             #0B0D11;
  --surface:        #12151C;
  --surface-variant:#1A1E28;
  --text:           #E8EAF0;
  --text-muted:     #8B92A5;
  --text-faint:     #4A5168;
  --border:         #2A2F3C;
  --primary:        #8B5CF6;
  --primary-dark:   #6D28D9;
  --accent:         #F97316;
  --success:        #22C55E;
  --error:          #EF4444;
  --warning:        #F59E0B;
  --info:           #6366F1;
  --link:           #8B5CF6;
  --link-hover:     #A78BFA;
  --code-bg:        #1A1E28;
  --code-border:    #2A2F3C;
  --blockquote-border: #8B5CF6;
  --tag-bg:         rgba(139, 92, 246, 0.12);
  --tag-text:       #A78BFA;
}

[data-theme="light"] {
  --bg:             #FAFBFC;
  --surface:        #FFFFFF;
  --surface-variant:#F4F5F7;
  --text:           #1A1D26;
  --text-muted:     #5F6B7A;
  --text-faint:     #A0AAB8;
  --border:         #E2E5EB;
  --primary:        #7C3AED;
  --primary-dark:   #6D28D9;
  --accent:         #EA580C;
  --success:        #16A34A;
  --error:          #DC2626;
  --warning:        #D97706;
  --info:           #4F46E5;
  --link:           #7C3AED;
  --link-hover:     #6D28D9;
  --code-bg:        #F4F5F7;
  --code-border:    #E2E5EB;
  --blockquote-border: #7C3AED;
  --tag-bg:         rgba(124, 58, 237, 0.08);
  --tag-text:       #7C3AED;
}

/* ── Body ────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────── */
.blog-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.blog-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px;
}
.blog-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  gap: 8px;
}
.blog-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #8B5CF6, #F97316);
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-logo-icon svg {
  width: 17px;
  height: 17px;
  fill: #fff;
}
.blog-logo-name {
  font-size: 1.125rem;
  font-weight: 700;
}
.header-spacer { flex: 1; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-nav a,
.header-nav button {
  font-size: 0.8125rem;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.header-nav a:hover,
.header-nav button:hover {
  background: var(--surface-variant);
}
.btn-outlined {
  border: 1px solid var(--border) !important;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0 !important;
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: var(--text);
}

/* ── Main content area ───────────────────────────────── */
.blog-main {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Article header ──────────────────────────────────── */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.article-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  text-transform: lowercase;
}
.article-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

/* ── Article body ────────────────────────────────────── */
.article-body h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 36px 0 12px;
}
.article-body h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 28px 0 8px;
}
.article-body p {
  margin: 0 0 20px;
  line-height: 1.75;
}
.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover {
  color: var(--link-hover);
}
.article-body ul,
.article-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.article-body li {
  margin-bottom: 8px;
  line-height: 1.75;
}
.article-body li::marker {
  color: var(--text-muted);
}
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
  border: 1px solid var(--border);
}
.article-body blockquote {
  border-left: 3px solid var(--blockquote-border);
  padding: 12px 20px;
  margin: 0 0 20px;
  background: var(--surface-variant);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}
.article-body blockquote p {
  margin: 0;
}
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ── Code ────────────────────────────────────────────── */
.article-body code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 2px 6px;
  border-radius: 4px;
}
.article-body pre {
  margin: 0 0 24px;
  padding: 20px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
}

/* ── Tables ──────────────────────────────────────────── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 0.9375rem;
}
.article-body th,
.article-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.article-body th {
  background: var(--surface-variant);
  font-weight: 600;
}

/* ── Footer ──────────────────────────────────────────── */
.blog-footer {
  border-top: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
}
.blog-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.blog-footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.blog-footer-links a:hover {
  color: var(--primary);
}
.blog-footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── highlight.js dark theme ─────────────────────────── */
.hljs { color: #E8EAF0; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: #C084FC; }
.hljs-string, .hljs-attr { color: #86EFAC; }
.hljs-number, .hljs-literal { color: #FCD34D; }
.hljs-comment, .hljs-quote { color: #4A5168; font-style: italic; }
.hljs-function .hljs-title, .hljs-title.function_ { color: #93C5FD; }
.hljs-type, .hljs-title.class_ { color: #FCA5A5; }
.hljs-variable, .hljs-template-variable { color: #F9A8D4; }
.hljs-meta { color: #8B92A5; }
.hljs-punctuation { color: #8B92A5; }
.hljs-addition { color: #86EFAC; background: rgba(34, 197, 94, 0.1); }
.hljs-deletion { color: #FCA5A5; background: rgba(239, 68, 68, 0.1); }

/* ── highlight.js light theme ────────────────────────── */
[data-theme="light"] .hljs { color: #1A1D26; }
[data-theme="light"] .hljs-keyword,
[data-theme="light"] .hljs-selector-tag,
[data-theme="light"] .hljs-built_in { color: #7C3AED; }
[data-theme="light"] .hljs-string,
[data-theme="light"] .hljs-attr { color: #16A34A; }
[data-theme="light"] .hljs-number,
[data-theme="light"] .hljs-literal { color: #D97706; }
[data-theme="light"] .hljs-comment,
[data-theme="light"] .hljs-quote { color: #A0AAB8; font-style: italic; }
[data-theme="light"] .hljs-function .hljs-title,
[data-theme="light"] .hljs-title.function_ { color: #2563EB; }
[data-theme="light"] .hljs-type,
[data-theme="light"] .hljs-title.class_ { color: #DC2626; }
[data-theme="light"] .hljs-variable,
[data-theme="light"] .hljs-template-variable { color: #DB2777; }
[data-theme="light"] .hljs-meta { color: #5F6B7A; }
[data-theme="light"] .hljs-punctuation { color: #5F6B7A; }
[data-theme="light"] .hljs-addition { color: #16A34A; background: rgba(22, 163, 74, 0.08); }
[data-theme="light"] .hljs-deletion { color: #DC2626; background: rgba(220, 38, 38, 0.08); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .article-title {
    font-size: 1.625rem;
  }
  .blog-main {
    padding: 32px 16px 60px;
  }
  .blog-logo-name {
    display: none;
  }
  .header-auth {
    display: none;
  }
}
