/* Syntax Highlighting — PrismJS Gruvbox-inspired theme
   Light mode: warm, muted colors on cream
   Dark mode: scoped under .dark (Tailwind darkMode: "class") */

/* ── Base code block styling ── */
code[class*="language-"],
pre[class*="language-"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  tab-size: 2;
  hyphens: none;
}

pre[class*="language-"] {
  padding: 1.25em;
  margin: 1.5em 0;
  overflow: auto;
  border-radius: 0.5rem;
}

:not(pre) > code[class*="language-"] {
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  white-space: normal;
}

/* ── Light Mode — Gruvbox Light ── */
code[class*="language-"],
pre[class*="language-"] {
  color: #3c3836;
}

pre[class*="language-"] {
  background: #f2e5bc;
  border: 1px solid #d5c4a1;
}

:not(pre) > code[class*="language-"] {
  background: #f2e5bc;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #928374;
}

.token.punctuation {
  color: #3c3836;
}

.token.namespace {
  opacity: 0.85;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #9d0006;
}

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

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

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #076678;
}

.token.function,
.token.class-name {
  color: #8f3f71;
}

.token.regex,
.token.important,
.token.variable {
  color: #b57614;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

/* Line highlighting */
.highlight-line-active {
  background-color: #d5c4a1;
  display: inline-block;
  width: calc(100% + 2.5em);
  margin-left: -1.25em;
  padding-left: 1.25em;
}

/* ── Dark Mode — Gruvbox Dark ── */
.dark code[class*="language-"],
.dark pre[class*="language-"] {
  color: #ebdbb2;
}

.dark pre[class*="language-"] {
  background: #1d2021;
  border-color: #504945;
}

.dark :not(pre) > code[class*="language-"] {
  background: #1d2021;
}

.dark .token.comment,
.dark .token.prolog,
.dark .token.doctype,
.dark .token.cdata {
  color: #928374;
}

.dark .token.punctuation {
  color: #ebdbb2;
}

.dark .token.property,
.dark .token.tag,
.dark .token.boolean,
.dark .token.number,
.dark .token.constant,
.dark .token.symbol,
.dark .token.deleted {
  color: #fb4934;
}

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

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

.dark .token.atrule,
.dark .token.attr-value,
.dark .token.keyword {
  color: #83a598;
}

.dark .token.function,
.dark .token.class-name {
  color: #d3869b;
}

.dark .token.regex,
.dark .token.important,
.dark .token.variable {
  color: #fabd2f;
}

.dark .highlight-line-active {
  background-color: rgba(131, 165, 152, 0.15);
}
