/* TechSteff blog — shared by /blog/ and every post.
   Tokens, nav and footer are copied from Apps/Website/index.html (v1 brand).
   Moving the blog to another site version = replace the :root block and the nav mark in templates.mjs. */

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

:root {
  --accent:         #9b5de5;
  --accent-dim:     #7c3aed;
  --accent-bright:  #b47cf7;
  --accent-glow:    rgba(155, 93, 229, 0.35);
  --accent-faint:   rgba(155, 93, 229, 0.08);
  --bg:             #0a0a0f;
  --bg2:            #0f0f1a;
  --bg3:            #13131f;
  --border:         rgba(155, 93, 229, 0.18);
  --border-strong:  rgba(155, 93, 229, 0.35);
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --text:           #e2e2f0;
  --text-muted:     #7c7c9a;
  --text-dim:       #4a4a6a;
  --font-mono:      'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  --font-sans:      'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius:         10px;
  --radius-sm:      6px;
  --nav-h:          60px;
  --measure:        44rem;
}

html { scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(155,93,229,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,93,229,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-bright); }

/* ─── Nav (same as the home page) ─────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.nav-logo svg { display: block; height: 46px; width: auto; }

.nav-links { display: flex; gap: 2rem; list-style: none; }

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: 0;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
}

/* ─── Footer (same as the home page) ──────────────────────────────── */
#footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
.footer-logo { height: 32px; width: auto; margin-bottom: 1rem; opacity: 0.8; }
.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-family: var(--font-mono);
}
.footer-links { display: flex; justify-content: center; gap: 0.6rem; margin-top: 0.75rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-bright); }

/* ─── Shared headings ─────────────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 0.6rem;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}
.section-sub { color: var(--text-muted); font-size: 0.95rem; }

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.draft-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  border-radius: 4px;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* ─── Blog index ──────────────────────────────────────────────────── */
.blog-main,
.post-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: calc(var(--measure) + 4rem);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 4rem) 2rem 5rem;
}

.blog-head { margin-bottom: 3rem; }

.post-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }

.post-item article {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.post-item article:hover {
  border-color: rgba(155, 93, 229, 0.55);
  box-shadow: 0 8px 32px rgba(155, 93, 229, 0.18);
}

.post-item-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0.4rem 0 0.5rem;
}
.post-item-title a { color: #fff; text-decoration: none; }
.post-item-title a::after { content: ''; position: absolute; inset: 0; }
.post-item-title a:focus-visible { outline: none; }
.post-item article:focus-within { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

.post-item-summary { color: var(--text-muted); font-size: 0.93rem; }

.empty { color: var(--text-muted); }

/* ─── Post ────────────────────────────────────────────────────────── */
.draft-banner {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  margin-bottom: 2rem;
}

.post-head { margin-bottom: 2.5rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--border); }

.post-back,
.post-foot a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent-bright);
}
.post-back:hover,
.post-foot a:hover { text-decoration: underline; }

.post-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 1.25rem 0 0.75rem;
  text-wrap: balance;
}

.post-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ─── Prose ───────────────────────────────────────────────────────── */
.prose { font-size: 1.0625rem; line-height: 1.75; color: #cfcfe3; overflow-wrap: break-word; }

.prose > * + * { margin-top: 1.25rem; }

.prose h2,
.prose h3,
.prose h4 { color: #fff; line-height: 1.3; }
.prose h2 { font-size: 1.45rem; margin-top: 3rem; }
.prose h3 { font-size: 1.15rem; margin-top: 2.25rem; }
.prose h4 { font-size: 1rem; margin-top: 1.75rem; font-family: var(--font-mono); }

.prose strong { color: var(--text); }
.prose a { text-underline-offset: 3px; }
.prose a:hover { color: #fff; }

.prose ul,
.prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1.2rem;
  color: var(--text);
}
.prose blockquote > * + * { margin-top: 0.75rem; }

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--accent-faint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

.prose pre.code {
  position: relative;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
.prose pre.code[data-lang] { padding-top: 2.2rem; }
.prose pre.code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.55rem; left: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.prose pre.code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: var(--text);
  white-space: pre;
}

.prose figure { margin-top: 2rem; margin-bottom: 2rem; }
.prose figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prose figure.diagram {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.prose figure.diagram svg { display: block; width: 100%; height: auto; max-width: 34rem; margin: 0 auto; }
.prose figcaption {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

.prose .table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.prose th,
.prose td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--text); }

/* ─── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(10,10,15,0.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.85rem 2rem; font-size: 0.85rem; }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  .nav-logo svg { height: 36px; }

  .blog-main,
  .post-main { padding: calc(var(--nav-h) + 2.5rem) 1rem 3.5rem; }
  .post-item article { padding: 1.25rem; }
  .prose { font-size: 1rem; }
  .prose pre.code { margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; }
  .prose figure.diagram { padding: 0.75rem 0.25rem; margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; }
}
