/* ═══════════════════════════════════════════
   MyClaw Blog — Dark Premium Theme
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #09090b;
  --bg-raised: #111113;
  --fg: #fafafa;
  --muted: #18181b;
  --muted-fg: #71717a;
  --border: #27272a;
  --border-subtle: #1e1e21;
  --green: #22c55e;
  --blue: #3b82f6;
  --purple: #a78bfa;
  --amber: #f59e0b;
  --radius: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }


/* ═══════════ NAV ═══════════ */

nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9,9,11,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.logo-text { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted-fg); transition: color 0.15s; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-actions { display: flex; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  border: none; font-family: inherit;
}
.btn-ghost { background: transparent; color: var(--muted-fg); }
.btn-ghost:hover { color: var(--fg); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(167,139,250,0.3); }


/* ═══════════ BLOG HERO (index page) ═══════════ */

.blog-hero {
  padding: 140px 32px 60px;
  text-align: center;
  position: relative;
}
.blog-hero::before {
  content: '';
  position: absolute;
  top: 60px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 400px;
  background: radial-gradient(ellipse, rgba(167,139,250,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.section-label {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--purple);
  margin-bottom: 12px;
}
.blog-hero h1 {
  font-size: 48px; font-weight: 900; letter-spacing: -2px;
  line-height: 1.1; margin-bottom: 16px;
}
.blog-hero p {
  font-size: 17px; color: var(--muted-fg);
  max-width: 520px; margin: 0 auto;
  line-height: 1.7;
}


/* ═══════════ CATEGORY PILLS ═══════════ */

.categories {
  display: flex; gap: 10px; justify-content: center;
  padding: 0 32px 48px; flex-wrap: wrap;
}
.cat-pill {
  padding: 8px 18px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
  background: var(--muted); color: var(--muted-fg);
  border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 0.15s;
}
.cat-pill:hover, .cat-pill.active {
  color: var(--fg); border-color: var(--purple);
  background: rgba(167,139,250,0.08);
}


/* ═══════════ BLOG GRID ═══════════ */

.blog-grid-wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 0 32px 100px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}


/* ═══════════ ARTICLE CARD ═══════════ */

.article-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s;
  display: flex; flex-direction: column;
}
.article-card:hover {
  border-color: var(--border);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.card-thumb {
  width: 100%; height: 200px;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  background: var(--muted);
  position: relative;
}
.card-thumb.t1 { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%); }
.card-thumb.t2 { background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%); }
.card-thumb.t3 { background: linear-gradient(135deg, #14532d 0%, #166534 50%, #15803d 100%); }
.card-thumb.t4 { background: linear-gradient(135deg, #431407 0%, #7c2d12 50%, #c2410c 100%); }
.card-thumb.t5 { background: linear-gradient(135deg, #3b0764 0%, #581c87 50%, #7e22ce 100%); }
.card-thumb.t6 { background: linear-gradient(135deg, #1c1917 0%, #292524 50%, #44403c 100%); }

.thumb-icon {
  font-size: 48px; opacity: 0.5;
}

.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.card-tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--purple);
  padding: 3px 8px; border-radius: 6px;
  background: rgba(167,139,250,0.1);
}
.card-tag.green  { color: var(--green); background: rgba(34,197,94,0.1); }
.card-tag.blue   { color: var(--blue); background: rgba(59,130,246,0.1); }
.card-tag.amber  { color: var(--amber); background: rgba(245,158,11,0.1); }
.card-tag.purple { color: var(--purple); background: rgba(167,139,250,0.1); }

.card-date { font-size: 12px; color: var(--muted-fg); }
.card-title {
  font-size: 18px; font-weight: 800; letter-spacing: -0.3px;
  line-height: 1.3; margin-bottom: 10px; color: var(--fg);
}
.card-excerpt {
  font-size: 14px; color: var(--muted-fg); line-height: 1.6; flex: 1;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.card-author { display: flex; align-items: center; gap: 8px; }
.card-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}
.card-author-name { font-size: 13px; font-weight: 600; }
.card-read-time { font-size: 12px; color: var(--muted-fg); }

.read-more {
  font-size: 13px; font-weight: 600; color: var(--purple);
  display: inline-flex; align-items: center; gap: 4px;
  transition: gap 0.2s;
}
.article-card:hover .read-more { gap: 8px; }


/* ═══════════ NEWSLETTER CTA ═══════════ */

.newsletter {
  max-width: 680px; margin: 0 auto 100px;
  padding: 48px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  text-align: center;
}
.newsletter h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.newsletter p { font-size: 15px; color: var(--muted-fg); margin-bottom: 24px; }
.newsletter-form {
  display: flex; gap: 12px; max-width: 420px; margin: 0 auto;
}
.newsletter-input {
  flex: 1; padding: 12px 16px; border-radius: 10px;
  background: var(--muted); border: 1px solid var(--border-subtle);
  color: var(--fg); font-size: 14px; font-family: inherit; outline: none;
}
.newsletter-input:focus { border-color: var(--purple); }
.newsletter-input::placeholder { color: var(--muted-fg); }
.newsletter-btn {
  padding: 12px 24px; border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white; font-size: 14px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.newsletter-btn:hover { opacity: 0.9; }


/* ═══════════ BLOG DEPLOY CTA ═══════════ */

.blog-cta {
  max-width: 680px; margin: 0 auto;
  padding: 48px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-cta::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
}
.blog-cta-icon {
  font-size: 40px; margin-bottom: 16px;
}
.blog-cta h2 {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.blog-cta p {
  font-size: 15px; color: var(--muted-fg);
  margin-bottom: 24px; line-height: 1.7;
}
.blog-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 36px; border-radius: 14px;
  font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  transition: all 0.2s;
}
.blog-cta-btn:hover {
  opacity: 0.9; transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(167,139,250,0.3);
}


/* ═══════════ ARTICLE HEADER (show page) ═══════════ */

.article-hero {
  padding: 140px 32px 48px;
  max-width: 780px; margin: 0 auto;
  text-align: center;
  position: relative;
}
.article-hero::before {
  content: '';
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 400px;
  background: radial-gradient(ellipse, rgba(167,139,250,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted-fg);
  margin-bottom: 32px; transition: color 0.15s;
}
.back-link:hover { color: var(--purple); }
.article-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--purple);
  padding: 4px 12px; border-radius: 6px;
  background: rgba(167,139,250,0.1);
  margin-bottom: 16px;
}
.article-hero h1 {
  font-size: 44px; font-weight: 900; letter-spacing: -2px;
  line-height: 1.1; margin-bottom: 20px;
}
.article-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
}
.meta-author { display: flex; align-items: center; gap: 8px; }
.meta-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}
.meta-name { font-size: 14px; font-weight: 600; }
.meta-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-fg); }
.meta-date, .meta-read { font-size: 14px; color: var(--muted-fg); }


/* ═══════════ COVER IMAGE ═══════════ */

.article-cover {
  max-width: 900px; margin: 40px auto 0;
  padding: 0 32px;
}
.cover-img {
  width: 100%; height: 400px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 80px; opacity: 0.8;
  border: 1px solid var(--border-subtle);
}


/* ═══════════ ARTICLE BODY (rendered markdown) ═══════════ */

.article-body {
  max-width: 720px; margin: 0 auto;
  padding: 56px 32px 80px;
}
.article-body p {
  font-size: 16px; color: #b4b4bd;
  line-height: 1.9; margin-bottom: 24px;
}
.article-body h2 {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  margin-top: 56px; margin-bottom: 20px; color: var(--fg);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.article-body h3 {
  font-size: 20px; font-weight: 700;
  margin-top: 36px; margin-bottom: 14px; color: var(--fg);
}
.article-body h4 {
  font-size: 17px; font-weight: 700;
  margin-top: 28px; margin-bottom: 10px; color: var(--fg);
}
.article-body strong { color: var(--fg); font-weight: 600; }
.article-body em { font-style: italic; }
.article-body a {
  color: var(--purple); text-decoration: underline;
  text-underline-offset: 3px; transition: color 0.15s;
}
.article-body a:hover { color: var(--blue); }
.article-body hr {
  border: none; border-top: 1px solid var(--border-subtle);
  margin: 40px 0;
}

.article-body ul, .article-body ol {
  margin-bottom: 24px; padding-left: 24px;
}
.article-body li {
  font-size: 16px; color: #b4b4bd; line-height: 1.8;
  margin-bottom: 8px;
}
.article-body li strong { color: var(--fg); }

.article-body blockquote {
  border-left: 3px solid var(--purple);
  padding: 12px 20px; margin-bottom: 24px;
  background: rgba(167,139,250,0.04);
  border-radius: 0 10px 10px 0;
}
.article-body blockquote p {
  font-size: 15px; margin-bottom: 8px;
}
.article-body blockquote p:last-child { margin-bottom: 0; }


/* ═══════════ CODE BLOCKS ═══════════ */

.code-block {
  background: #0d0d0f;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 28px;
  overflow: hidden;
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--muted);
  border-bottom: 1px solid var(--border-subtle);
}
.code-lang {
  font-size: 12px; font-weight: 600; color: var(--muted-fg);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.code-copy {
  font-size: 12px; font-weight: 600; color: var(--muted-fg);
  background: none; border: none; cursor: pointer;
  font-family: inherit; transition: color 0.15s;
}
.code-copy:hover { color: var(--purple); }

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: #c9d1d9;
  margin: 0;
}
.code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* Inline code */
.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: var(--muted);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--purple);
}
/* Don't double-style code inside code blocks */
.code-block code {
  background: none; padding: 0; border-radius: 0; color: inherit;
}


/* ═══════════ CALLOUTS (Obsidian-compatible) ═══════════ */

.callout {
  padding: 20px 24px;
  border-radius: 14px;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.7;
  display: flex; gap: 14px;
}
.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.callout-body { color: #b4b4bd; }
.callout-body strong { color: var(--fg); }
.callout-body p { font-size: 14px; margin-bottom: 8px; }
.callout-body p:last-child { margin-bottom: 0; }

.callout.tip {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.15);
}
.callout.warning {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
}
.callout.info {
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.15);
}
.callout.note {
  background: rgba(167,139,250,0.06);
  border: 1px solid rgba(167,139,250,0.15);
}


/* ═══════════ STEP MARKERS ═══════════ */

.step-marker {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 4px; margin-top: 56px;
}
.step-num {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white;
  flex-shrink: 0;
}
.step-label {
  font-size: 13px; font-weight: 700; color: var(--purple);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.step-marker + h2 {
  margin-top: 12px;
}


/* ═══════════ TABLE OF CONTENTS ═══════════ */

.toc {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 40px;
}
.toc-title {
  font-size: 14px; font-weight: 700; color: var(--fg);
  margin-bottom: 14px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.toc ol {
  padding-left: 20px; margin: 0;
}
.toc li {
  font-size: 14px; color: var(--muted-fg);
  line-height: 2; margin-bottom: 0;
}
.toc a { color: var(--muted-fg); text-decoration: none; transition: color 0.15s; }
.toc a:hover { color: var(--purple); }


/* ═══════════ MERMAID DIAGRAMS ═══════════ */

.mermaid {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 32px 24px;
  margin-bottom: 28px;
  text-align: center;
  overflow-x: auto;
}


/* ═══════════ ARTICLE IMAGES ═══════════ */

.article-image {
  margin-bottom: 28px;
}
.article-image img {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}
.article-image figcaption {
  font-size: 13px;
  color: var(--muted-fg);
  text-align: center;
  margin-top: 10px;
}


/* ═══════════ ARTICLE CTA ═══════════ */

.article-cta {
  text-align: center;
  padding: 56px 32px;
  margin-top: 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}
.article-cta h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 10px; }
.article-cta p { font-size: 15px; color: var(--muted-fg); margin-bottom: 24px; }
.article-cta .btn-primary {
  padding: 16px 36px; font-size: 16px; border-radius: 14px; font-weight: 700;
}


/* ═══════════ RELATED POSTS ═══════════ */

.related-section {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 32px 100px;
}
.related-section > h2 {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 32px; text-align: center;
}
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.related-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.25s;
}
.related-card:hover {
  border-color: var(--border);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.related-tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--purple);
  margin-bottom: 10px;
}
.related-tag.green  { color: var(--green); }
.related-tag.blue   { color: var(--blue); }
.related-tag.amber  { color: var(--amber); }
.related-title { font-size: 16px; font-weight: 800; line-height: 1.3; margin-bottom: 8px; }
.related-excerpt { font-size: 13px; color: var(--muted-fg); line-height: 1.6; }


/* ═══════════ TABLES ═══════════ */

.legal-table-wrap {
  overflow-x: auto; margin-bottom: 28px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}
.legal-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.legal-table th {
  background: var(--muted); text-align: left;
  padding: 12px 16px; font-weight: 700; color: var(--fg);
  border-bottom: 1px solid var(--border-subtle);
}
.legal-table td {
  padding: 12px 16px; color: #b4b4bd;
  border-bottom: 1px solid var(--border-subtle);
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table tr:hover td { background: rgba(167,139,250,0.03); }


/* ═══════════ FOOTER ═══════════ */

footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 32px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-left { font-size: 13px; color: var(--muted-fg); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--muted-fg); }
.footer-links a:hover { color: var(--fg); }


/* ═══════════ EMPTY STATE ═══════════ */

.blog-empty {
  text-align: center; padding: 80px 32px;
  color: var(--muted-fg); font-size: 16px;
}


/* ═══════════ RESPONSIVE ═══════════ */

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-hero h1 { font-size: 36px; }
  .article-hero h1 { font-size: 32px; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .newsletter { margin: 0 20px 80px; padding: 32px 24px; }
  .blog-cta { margin: 0 20px; padding: 32px 24px; }
  .newsletter-form { flex-direction: column; }
  .related-grid { grid-template-columns: 1fr; }
  .cover-img { height: 240px; border-radius: 14px; }
  .article-body { padding: 40px 20px 60px; }
  .article-body h2 { font-size: 24px; margin-top: 40px; }
}
@media (min-width: 600px) and (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
