/* Marturia article + index styling — guides and blog.
   Layered on top of /docs/styles.css (reusing the design tokens).
   Built for long-form technical content: Mermaid diagrams, syntax-
   highlighted code, pull-quotes, related-post grids. */

/* ── Article wrapper ────────────────────────────────────────────────── */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.75rem 0;
}

.article-description {
  font-size: 1.15rem;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

.article-tags {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: var(--bg-soft);
  color: var(--fg-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  letter-spacing: 0.04em;
}

/* ── Body typography ────────────────────────────────────────────────── */
.article-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--fg);
}

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

.article-body h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--fg);
}
.article-body h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 2rem;
}

.article-body h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2.25rem;
  color: var(--fg);
}

.article-body h4 {
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.75rem;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-body p {
  color: var(--fg);
}

.article-body strong { color: var(--fg); font-weight: 600; }
.article-body em { color: var(--fg); font-style: italic; }

.article-body a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-decoration-color: rgba(42, 139, 83, 0.4);
  text-underline-offset: 2px;
}
.article-body a:hover { text-decoration-color: var(--accent-hi); }

.article-body ul, .article-body ol {
  padding-left: 1.5rem;
}
.article-body li { margin-bottom: 0.4rem; }
.article-body li > ul, .article-body li > ol {
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  background: rgba(26, 107, 60, 0.06);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--fg-muted);
  border-radius: 0 4px 4px 0;
}

.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-soft);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--fg);
}

.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 1.5rem 0;
}
.article-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* Pygments codehilite — matches our forest-green palette */
.highlight pre { padding: 1.25rem 1.5rem; }
.highlight .k  { color: #c08035; }            /* keyword */
.highlight .kn { color: #c08035; }            /* keyword.namespace */
.highlight .kd { color: #c08035; }
.highlight .s  { color: #a8c97a; }            /* string */
.highlight .s1 { color: #a8c97a; }
.highlight .s2 { color: #a8c97a; }
.highlight .c  { color: var(--fg-dim); font-style: italic; }
.highlight .c1 { color: var(--fg-dim); font-style: italic; }
.highlight .cm { color: var(--fg-dim); font-style: italic; }
.highlight .nc { color: #d6b67e; }            /* name.class */
.highlight .nf { color: #d6b67e; }            /* name.function */
.highlight .nn { color: #7eb6d6; }            /* name.namespace */
.highlight .mi { color: #b890d6; }            /* number */
.highlight .mf { color: #b890d6; }
.highlight .o  { color: var(--fg-muted); }    /* operator */
.highlight .p  { color: var(--fg-muted); }    /* punctuation */

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.article-body table th,
.article-body table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.article-body table th {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  background: var(--bg-soft);
}
.article-body table tr:hover { background: var(--bg-soft); }

/* ── Mermaid diagrams ───────────────────────────────────────────────── */
.article-body .mermaid {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  text-align: center;
  font-size: 0.85rem;
}

/* ── Footnotes ──────────────────────────────────────────────────────── */
.article-body .footnote {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* ── TOC (rendered by markdown's toc extension) ─────────────────────── */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.875rem;
}
.toc-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
  display: block;
}
.toc ul { padding-left: 1.25rem; margin: 0.4rem 0; }
.toc a { color: var(--fg-muted); text-decoration: none; }
.toc a:hover { color: var(--fg); }

/* ── Related posts ──────────────────────────────────────────────────── */
.related {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.related h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.related-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.12s, transform 0.12s;
}
.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.related-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--fg);
}
.related-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ── Article footer ─────────────────────────────────────────────────── */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* ── Index pages (guides + blog listings) ──────────────────────────── */
.post-index {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
.post-index-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.post-index-header h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.post-index-header p {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 60ch;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
.post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.post-card h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0.75rem 0 0.6rem;
}
.post-card p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}
.post-card .post-tags {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
}
.post-card .post-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .article-header h1 { font-size: 1.8rem; }
  .article-body { font-size: 0.95rem; }
  .article-body h2 { font-size: 1.45rem; }
  .article-body h3 { font-size: 1.15rem; }
  .post-grid { grid-template-columns: 1fr; }
}
