/* ═══════════════════════════════════════════════════════════════════════════
   PRISM.JS — Dracula theme (adapted to match design tokens)

   Ghost uses Prism.js for code highlighting in the editor
   ═══════════════════════════════════════════════════════════════════════════ */

code[class*="language-"],
pre[class*="language-"] {
  color: #f8f8f2;
  background: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  tab-size: 4;
  hyphens: none;
}

pre[class*="language-"] {
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: var(--space-8) 0;
  overflow: auto;
}

/* Light mode: dark base text on light background (tokens keep Dracula colors) */
[data-theme="light"] code[class*="language-"],
[data-theme="light"] pre[class*="language-"] {
  color: #1a1918;
}


[data-theme="light"] .token.comment,
[data-theme="light"] .token.prolog,
[data-theme="light"] .token.doctype,
[data-theme="light"] .token.cdata      { color: #6a737d; }

[data-theme="light"] .token.property,
[data-theme="light"] .token.tag,
[data-theme="light"] .token.constant,
[data-theme="light"] .token.symbol,
[data-theme="light"] .token.deleted     { color: #d73a49; }

[data-theme="light"] .token.boolean,
[data-theme="light"] .token.number      { color: #005cc5; }

[data-theme="light"] .token.selector,
[data-theme="light"] .token.attr-name,
[data-theme="light"] .token.string,
[data-theme="light"] .token.char,
[data-theme="light"] .token.builtin,
[data-theme="light"] .token.inserted    { color: #22863a; }

[data-theme="light"] .token.operator,
[data-theme="light"] .token.entity,
[data-theme="light"] .token.url,
[data-theme="light"] .token.variable    { color: #1a1918; }

[data-theme="light"] .token.atrule,
[data-theme="light"] .token.attr-value,
[data-theme="light"] .token.function,
[data-theme="light"] .token.class-name  { color: #6f42c1; }

[data-theme="light"] .token.keyword     { color: #d73a49; }
[data-theme="light"] .token.regex,
[data-theme="light"] .token.important   { color: #e36209; }

[data-theme="light"] .token.punctuation { color: #1a1918; }

:not(pre) > code[class*="language-"] {
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
  background: var(--color-bg-inset);
}

/* Tokens */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata      { color: #6272a4; }
.token.punctuation { color: #f8f8f2; }
.token.namespace   { opacity: 0.7; }

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted     { color: #ff79c6; }

.token.boolean,
.token.number      { color: #bd93f9; }

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted    { color: #50fa7b; }

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable    { color: #f8f8f2; }

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name  { color: #f1fa8c; }

.token.keyword     { color: #ff79c6; }
.token.regex,
.token.important   { color: #ffb86c; }

.token.important,
.token.bold        { font-weight: bold; }
.token.italic      { font-style: italic; }
.token.entity      { cursor: help; }

/* Line numbers */
pre[class*="language-"].line-numbers {
  position: relative;
  padding-left: 3.8em;
  counter-reset: linenumber;
}

pre[class*="language-"].line-numbers > code {
  position: relative;
  white-space: inherit;
}

.line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 100%;
  left: -3.8em;
  width: 3em;
  letter-spacing: -1px;
  border-right: 1px solid var(--color-border);
  user-select: none;
}

.line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.line-numbers-rows > span::before {
  content: counter(linenumber);
  color: var(--color-fg-faint);
  display: block;
  padding-right: 0.8em;
  text-align: right;
}
