/* enhance-code.css — integrazione Prism + Mermaid nello stile dark di alextech
 *
 * Alinea Prism (code blocks) e Mermaid (diagrammi SVG) alle variabili del tema
 * (--surface, --brand, --font-mono...). Il tema base prism-tomorrow resta la
 * base; questi override lo fondono con il design del sito.
 */

/* Prism: sfondo del code block coerente con --surface (non blu #2d2d2d) */
.post-content pre[class*="language-"],
.post-content code[class*="language-"] {
  background: var(--surface);
  color: #e6edf3;
  text-shadow: none;
}

/* bordo e spaziatura coerenti con gli altri pre del post */
.post-content pre[class*="language-"] {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
}

/* token Prism ereditano colori funzionanti sul fondo scuro */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #8b949e; }
.token.punctuation { color: #e6edf3; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #f47067; }
.token.boolean, .token.number { color: #d2a8ff; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #a5d6ff; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #e6edf3; }
.token.atrule, .token.attr-value, .token.keyword { color: #ff7b72; }
.token.function, .token.class-name { color: #d2a8ff; }
.token.regex, .token.important, .token.variable { color: #ffa657; }
.token.comment { font-style: italic; }

/* ── Mermaid ── */
.mermaid-code-block {
  margin: 1.5rem 0;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  text-align: center;
}
.mermaid-code-block .mermaid-rendered {
  display: flex;
  justify-content: center;
}
.mermaid-code-block svg {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
/* il blocchetto originale ```mermaid viene sostituito lato client; se il parse
   fallisce e il blocco non è stato processato, resta il sorgente in chiaro */
pre code.language-mermaid {
  display: block;
}
