/* Blog + tutorials (web/blog/*, web/tutorials/*). Same rationale as
   legal.css: long-form reading is easier in styles.css's light "workspace"
   palette than in landing.html's neon-terminal one, so these pages reuse
   that base and legal.css's prose rules instead of landing.css. This file
   adds what legal.css doesn't need — index/hub card grids, code blocks,
   post metadata, tag pills, and an inline CTA banner — for content whose
   job is to convert a reader, not just inform one. */

body.article {
  background: var(--bg);
  min-height: 100vh;
}

.article-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.article-header a.logo-badge {
  text-decoration: none;
}

.article-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 16px;
}

.article-header nav a:hover {
  color: var(--fg);
}

.article-header nav a.current {
  color: var(--fg);
  font-weight: 600;
}

/* ── Hub pages (index.html for /blog and /tutorials) ────────────────── */

.article-kicker {
  color: var(--cta);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.article-shell h1 {
  font-size: 1.7rem;
  margin: 0 0 10px;
}

.article-hub-intro {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 58ch;
  margin: 0 0 36px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-card {
  display: block;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.article-list .article-card:last-child {
  border-bottom: 1px solid var(--line);
}

.article-card-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 6px;
}

.article-card:hover .article-card-title {
  color: var(--cta);
}

.article-card-dek {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 8px;
  max-width: 60ch;
}

.article-card-meta {
  color: var(--dim);
  font-size: 0.78rem;
}

/* ── Individual post/tutorial pages ──────────────────────────────────── */

.article-content .article-updated {
  color: var(--dim);
  font-size: 0.82rem;
  margin: 0 0 32px;
}

.article-content h2 {
  font-size: 1.15rem;
  margin: 36px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.article-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.article-content h3 {
  font-size: 1rem;
  margin: 24px 0 8px;
}

.article-content p,
.article-content li {
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.7;
}

.article-content ul,
.article-content ol {
  padding-left: 22px;
  margin: 10px 0;
}

.article-content li + li {
  margin-top: 6px;
}

.article-content a {
  color: var(--cta);
}

.article-content a:hover {
  color: var(--cta-hover);
}

.article-content code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  font-size: 0.88em;
}

.article-content pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 14px 0;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--fg);
}

.article-content blockquote {
  margin: 18px 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--cta);
  color: var(--muted);
  font-style: italic;
}

.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -20px 0 32px;
}

.article-tag {
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.article-cta {
  margin-top: 44px;
  padding: 22px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.article-cta p {
  margin: 0 0 14px;
}

.article-cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.article-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.8rem;
}

.article-footer a {
  color: var(--muted);
}

@media (max-width: 640px) {
  .article-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Inline code must be allowed to break (epic:localization #117).
   In Latin text an inline <code>.adoc</code> almost always finds a space
   to wrap at. In Chinese and Japanese there are no spaces, so the browser
   has no break opportunity before it and the token is pushed past the
   right edge — measured at 390px, where it took the whole page with it.
   Block code (<pre>) keeps its own horizontal scroll and is unaffected. */
.article-content :not(pre) > code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
