/*
 * Terminal / editor-style code blocks for Lexxy (WYSIWYG + published posts).
 * Matches the shell editor's .code-editor palette.
 */

.lexxy-content {
  --lexxy-font-mono: var(--font-mono);

  /* VS Code dark syntax on #1e1e1e */
  --lexxy-color-code-token-att: #c586c0;
  --lexxy-color-code-token-comment: #6a9955;
  --lexxy-color-code-token-function: #dcdcaa;
  --lexxy-color-code-token-operator: #d4d4d4;
  --lexxy-color-code-token-property: #9cdcfe;
  --lexxy-color-code-token-punctuation: #d4d4d4;
  --lexxy-color-code-token-selector: #ce9178;
  --lexxy-color-code-token-variable: #9cdcfe;
}

/* Inline code — light Notion-style chip on the white page */
.lexxy-content :not(pre) > code {
  background-color: rgba(135, 131, 120, 0.15);
  border-radius: var(--radius-sm);
  color: #c7254e;
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.35em;
}

/* Block code — dark editor surface */
.lexxy-content pre,
.lexxy-content > code[data-language] {
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #d4d4d4;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow: hidden;
  tab-size: 2;
}

.lexxy-content pre {
  margin-block: 0 var(--lexxy-content-margin, 1rem);
  padding: 0;
}

.lexxy-content pre code {
  background: transparent;
  border-radius: 0;
  color: inherit;
  display: block;
  font-size: inherit;
  line-height: inherit;
  padding: 1rem 1.125rem;
}

.lexxy-content > code[data-language] {
  display: block;
  hyphens: none;
  margin-block: 0 var(--lexxy-content-margin, 1rem);
  overflow-x: auto;
  padding: 1rem 1.125rem;
  white-space: pre;
}

/* Language label — Notion-style header strip */
.lexxy-content pre code[data-language]::before,
.lexxy-content > code[data-language]::before {
  background: #252526;
  border-bottom: 1px solid #2d2d2d;
  color: #8b939e;
  content: attr(data-language);
  display: block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin: -1rem -1.125rem 0.75rem;
  padding: 0.4375rem 1.125rem;
  text-transform: uppercase;
}

/* Selection inside code blocks */
.lexxy-content pre ::selection,
.lexxy-content code[data-language] ::selection {
  background: rgba(38, 79, 120, 0.99);
  color: #fff;
}
