/* Shared article styling — matches the dark theme used on index.html / 404.html.
   New articles use this stylesheet on its own. Legacy posts load it after
   Tailwind (which they still use for their image-gallery layout). */

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

:root {
  --bg: #0f172a;
  --text: #cbd5e1;
  --heading: #f1f5f9;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #a855f7;
  --border: rgba(51, 65, 85, 0.6);
  --panel: rgba(30, 41, 59, 0.5);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

/* Top nav — back to home */
.article-nav {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}
.article-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.article-nav a:hover { color: var(--accent); }

/* Article shell */
.article {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Header */
.article-header { margin-bottom: 2.5rem; }
.article-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.article-header h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.01em;
}
.article-meta {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--faint);
}
.article-meta .draft {
  color: var(--accent);
  background: rgba(168, 85, 247, 0.1);
  padding: 0.1rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

/* Body typography */
.article-body { font-size: 1.05rem; }
.article-body > * + * { margin-top: 1.25rem; }
.article-body p { color: var(--text); }
.article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--heading);
  margin-top: 2.5rem;
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading);
  margin-top: 2rem;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(168, 85, 247, 0.4);
  transition: text-decoration-color 0.2s;
}
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body strong { color: var(--heading); font-weight: 600; }
.article-body em { color: #e2e8f0; }

.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li { margin-top: 0.5rem; }
.article-body li::marker { color: var(--accent); }

.article-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--muted);
  font-style: italic;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}
.article-body figure { margin: 1.75rem 0; }
.article-body figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--faint);
  text-align: center;
}

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

/* Code */
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: rgba(168, 85, 247, 0.1);
  color: #e9d5ff;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}
.article-body pre {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #cbd5e1;
}
.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Footer */
.article-footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}
.article-footer a {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.article-footer a:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: var(--accent);
}

@media (min-width: 640px) {
  .article-header h1 { font-size: 2.4rem; }
}
