/* ═══════════════════════════════════════════════════════════
   TaskZilla Blog — Shared Post Styles
   ═══════════════════════════════════════════════════════════ */

:root {
  --dark: #1A1A2E;
  --muted: #6B7280;
  --purple: #7C3AED;
  --purple-light: #EDE9FE;
  --purple-bg: #F5F3FF;
  --bg: #FFFFFF;
  --border: #E5E7EB;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'Space Mono', 'Fira Code', monospace;
  --green: #16A34A;
  --green-bg: #F0FDF4;
  --amber: #D97706;
  --amber-bg: #FFFBEB;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --blue: #2563EB;
  --blue-bg: #EFF6FF;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--dark);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}
.topbar a { color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.topbar a:hover { color: var(--purple); text-decoration: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
}

/* ── Article ── */
.article {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: var(--purple-light);
  color: var(--purple);
}
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.blue  { background: var(--blue-bg);  color: var(--blue);  }
.tag.red   { background: var(--red-bg);   color: var(--red);   }
.date { font-size: 0.8125rem; color: var(--muted); }
.reading-time { font-size: 0.8125rem; color: var(--muted); }
.reading-time::before { content: "·"; margin-right: 0.5rem; }

.article h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.article .lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 2.5rem;
  border-left: 3px solid var(--purple);
  padding-left: 1.25rem;
}
.article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}
.article h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.article p { margin-bottom: 1.25rem; color: #374151; }
.article ul, .article ol {
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
  color: #374151;
}
.article li { margin-bottom: 0.5rem; }
.article strong { color: var(--dark); }

/* ── Blockquote ── */
.article blockquote {
  border-left: 3px solid var(--purple);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--purple-bg);
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.9375rem;
}
.article blockquote p { margin-bottom: 0.5rem; color: #4B5563; }
.article blockquote p:last-child { margin-bottom: 0; }
.article blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: normal;
}

/* ── Code ── */
.article code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: #F3F4F6;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  color: var(--purple);
}
.article pre {
  background: #1E1E2E;
  color: #CDD6F4;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}
.article pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Research card ── */
.research-card {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  transition: border-color 0.2s;
}
.research-card:hover { border-color: var(--purple); }
.research-card .paper-id {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.research-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.research-card .paper-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.625rem;
}
.research-card p { font-size: 0.9375rem; margin-bottom: 0; }
.research-card .applied {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  color: var(--green);
  font-weight: 500;
}

/* ── Info box ── */
.info-box {
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.info-box.purple { background: var(--purple-bg); border: 1px solid #DDD6FE; }
.info-box.green  { background: var(--green-bg);  border: 1px solid #BBF7D0; }
.info-box.amber  { background: var(--amber-bg);  border: 1px solid #FDE68A; }
.info-box.blue   { background: var(--blue-bg);   border: 1px solid #BFDBFE; }
.info-box h4 { font-size: 0.9375rem; margin-bottom: 0.5rem; }
.info-box p { font-size: 0.9375rem; margin-bottom: 0; }

/* ── Table ── */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.article th, .article td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.article th {
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #F9FAFB;
}
.article td { color: #374151; }

/* ── Diagram ── */
.diagram {
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  margin: 1.5rem 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
  color: var(--dark);
}

/* ── Author ── */
.author-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.author-info .name { font-weight: 600; font-size: 0.9375rem; }
.author-info .bio { font-size: 0.8125rem; color: var(--muted); }

/* ── Bottom nav ── */
.bottom-nav {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.bottom-nav a {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s;
  color: var(--dark);
}
.bottom-nav a:hover { border-color: var(--purple); text-decoration: none; }
.bottom-nav .nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.bottom-nav .nav-title { font-weight: 600; font-size: 0.9375rem; }

/* ── Footer ── */
.blog-footer {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .article { padding: 1.5rem 1rem 3rem; }
  .article h1 { font-size: 1.75rem; }
  .article h2 { font-size: 1.25rem; }
  .topbar { padding: 1.25rem 1rem 0; }
  .bottom-nav { flex-direction: column; }
  .bottom-nav a { min-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   TaskZilla bridge layer · v2.15.27
   Visual + voice components shared with desk.taskzilla.ai/docs
   so a reader moving between the blog and the docs sees one brand.
   ═══════════════════════════════════════════════════════════ */

/* TaskZilla 🦖 mascot in the brand mark */
.brand .zilla {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(124,58,237,.18));
}

/* TaskZilla voice bubble — inline first-person aside inside an article.
   Mirrors .tz-bubble on the desk side; visually distinct from .info-box
   so readers know "this is TaskZilla speaking, not the author". */
.tz-bubble {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start;
  background: var(--purple-bg); border: 1px solid #DDD6FE;
  border-radius: 14px; padding: 14px 18px 14px 14px;
  margin: 1.75rem 0; position: relative; font-size: 0.9375rem;
}
.tz-bubble::before {
  content: ""; position: absolute; left: 28px; top: -7px;
  width: 14px; height: 14px; background: var(--purple-bg);
  border-left: 1px solid #DDD6FE; border-top: 1px solid #DDD6FE;
  transform: rotate(45deg); border-top-left-radius: 3px;
}
.tz-bubble .av {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #6D28D9 0%, #A855F7 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 4px 14px rgba(124,58,237,.28); flex-shrink: 0;
}
.tz-bubble .said { line-height: 1.55; color: #374151; }
.tz-bubble .said .who {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--purple); margin-bottom: 4px;
}

/* "Go deeper in the docs" CTA — single bridge link from a blog post
   to its corresponding deep dive on desk.taskzilla.ai/docs. */
.go-deeper {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 2.5rem 0 1.5rem; padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--purple) 0%, #A855F7 100%);
  color: #fff; border-radius: 0.75rem;
  text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.go-deeper:hover {
  transform: translateY(-2px); text-decoration: none; color: #fff;
  box-shadow: 0 10px 28px rgba(124,58,237,.3);
}
.go-deeper .gd-text { display: flex; flex-direction: column; gap: 2px; }
.go-deeper .gd-eye {
  font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; opacity: 0.85;
}
.go-deeper .gd-title { font-weight: 700; font-size: 1rem; }
.go-deeper .gd-arrow {
  font-size: 1.25rem; font-weight: 700; flex-shrink: 0;
  transition: transform .2s;
}
.go-deeper:hover .gd-arrow { transform: translateX(4px); }

/* Brand stripe — gradient line under the topbar for visual continuity
   with the docs nav. Off by default; opt-in with class on .topbar. */
.topbar.brand-stripe {
  border-bottom: 1px solid var(--border);
  position: relative;
}
.topbar.brand-stripe::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(135deg, #6D28D9 0%, #A855F7 100%);
  opacity: 0.85;
}
