/* ==========================================================================
   TSARTSARIS BLOG PREMIUM - Syntax Highlighting
   Custom token colors for Prism.js and Code Block Pro
   ========================================================================== */

/* ---- Comments & Documentation ---- */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #5a5a70;
  font-style: italic;
}

/* ---- Keywords & Tags ---- */
.token.keyword,
.token.tag,
.token.selector,
.token.important,
.token.atrule {
  color: #ff7a00;
  font-weight: 500;
}

/* ---- Strings & Attribute Values ---- */
.token.string,
.token.attr-value,
.token.char,
.token.inserted {
  color: #00d68f;
}

/* ---- Numbers & Booleans ---- */
.token.number,
.token.boolean,
.token.constant,
.token.symbol {
  color: #ff9a33;
}

/* ---- Functions & Class Names ---- */
.token.function,
.token.class-name,
.token.builtin {
  color: #e8e8ed;
  font-weight: 500;
}

/* ---- Properties ---- */
.token.property,
.token.attr-name,
.token.namespace {
  color: #9a9ab0;
}

/* ---- Operators & Punctuation ---- */
.token.operator,
.token.punctuation,
.token.entity {
  color: #5a5a70;
}

/* ---- Variables & Deleted ---- */
.token.variable,
.token.deleted {
  color: #ff3d71;
}

/* ---- Regex ---- */
.token.regex {
  color: #ffcc00;
}

/* ---- URLs ---- */
.token.url {
  color: #00d68f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Bold & Italic ---- */
.token.bold {
  font-weight: 700;
}

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

/* ---- Line Numbers ---- */
.line-numbers .line-numbers-rows {
  border-right: 1px solid var(--color-border, #2a2a3a);
  padding-right: 0.75rem;
  margin-right: 1rem;
}

.line-numbers .line-numbers-rows > span::before {
  color: #5a5a70;
  font-size: 0.85em;
}

/* Code Block Pro line numbers */
.code-block-pro .line-number,
.cbp-line-number {
  color: #5a5a70;
  border-right: 1px solid var(--color-border, #2a2a3a);
  padding-right: 0.75rem;
  margin-right: 1rem;
  user-select: none;
  min-width: 2.5em;
  text-align: right;
  display: inline-block;
}

/* ---- Highlighted Lines ---- */
.line-highlight,
.highlight-line,
.code-block-pro .highlight,
.cbp-highlight {
  background-color: rgba(255, 122, 0, 0.1);
  display: block;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  border-left: 3px solid rgba(255, 122, 0, 0.5);
}

/* ---- Copy Button (Code Block Pro) ---- */
.code-block-pro button.copy-button,
.wp-block-code .copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: var(--color-bg-surface, #22222e);
  border: 1px solid var(--color-border, #2a2a3a);
  border-radius: var(--radius-sm, 4px);
  color: var(--color-text-muted, #5a5a70);
  padding: 0.25rem 0.5rem;
  font-family: var(--font-code, 'JetBrains Mono', monospace);
  font-size: 0.7rem;
  cursor: pointer;
  transition:
    color 0.3s ease,
    border-color 0.3s ease;
  z-index: 1;
}

.code-block-pro button.copy-button:hover,
.wp-block-code .copy-btn:hover {
  color: var(--color-primary, #ff7a00);
  border-color: rgba(255, 122, 0, 0.3);
}

/* ---- Language Badge ---- */
.code-block-pro .code-language,
pre[data-language]::before {
  position: absolute;
  top: 0;
  right: 3rem;
  font-family: var(--font-code, 'JetBrains Mono', monospace);
  font-size: 0.7rem;
  color: var(--color-text-muted, #5a5a70);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  background-color: var(--color-bg-tertiary, #1a1a25);
  border-radius: 0 0 var(--radius-sm, 4px) var(--radius-sm, 4px);
}

/* ---- Inline Code in Light Mode ---- */
html.light-mode .token.comment,
html.light-mode .token.prolog,
html.light-mode .token.doctype,
html.light-mode .token.cdata {
  color: #8a8aa0;
}

html.light-mode .token.operator,
html.light-mode .token.punctuation {
  color: #8a8aa0;
}

html.light-mode .token.function,
html.light-mode .token.class-name,
html.light-mode .token.builtin {
  color: #1a1a2e;
}

html.light-mode .token.property,
html.light-mode .token.attr-name {
  color: #4a4a6a;
}
