/* ============================================================
   Syntax highlight — Visual Studio 2022 (light/dark)
   T-SQL override: SQL Server Management Studio (SSMS)
   ============================================================ */

/* Reset global de tokens — remove qualquer background/padding herdado
   (pode vir de temas Prism ou estilos externos) */
code[class*="language-"] .token,
pre[class*="language-"] .token {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ── Base layout (tema-neutro) ───────────────────────────── */
code[class*="language-"],
pre[class*="language-"] {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: .875em;
    line-height: 1.65;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    tab-size: 4;
    hyphens: none;
}
pre[class*="language-"] {
    border-radius: 0;
    padding: .9rem 1.1rem;
    margin: 0;
}
/* inline code dentro de pre: sem bg proprio, e SEM font-size proprio
   (evita dupla aplicacao de .875em: pre ja tem .875em, code herdaria .875 * .875) */
pre[class*="language-"] > code[class*="language-"] {
    background: none !important;
    padding: 0;
    border-radius: 0;
    font-size: 1em;   /* herda do <pre> — mesma font do .line-numbers-rows */
    line-height: 1.65;
}

/* ── Visual Studio 2022 — Light ──────────────────────────── */
:root[data-theme="light"] pre[class*="language-"],
:root[data-theme="light"] :not(pre) > code[class*="language-"] {
    background: #F8F8F8;
    color: #000000;
    border: none;
}
:root[data-theme="light"] .token.comment,
:root[data-theme="light"] .token.prolog,
:root[data-theme="light"] .token.doctype,
:root[data-theme="light"] .token.cdata        { color: #008000; font-style: italic; }
:root[data-theme="light"] .token.punctuation  { color: #000000; }
:root[data-theme="light"] .token.keyword,
:root[data-theme="light"] .token.boolean,
:root[data-theme="light"] .token.atrule,
:root[data-theme="light"] .token.important    { color: #0000FF; }
:root[data-theme="light"] .token.string,
:root[data-theme="light"] .token.char,
:root[data-theme="light"] .token.inserted     { color: #A31515; }
:root[data-theme="light"] .token.number,
:root[data-theme="light"] .token.deleted      { color: #098658; }
:root[data-theme="light"] .token.function     { color: #795E26; }
:root[data-theme="light"] .token.class-name   { color: #267F99; }
:root[data-theme="light"] .token.builtin      { color: #267F99; }
:root[data-theme="light"] .token.variable     { color: #001080; }
:root[data-theme="light"] .token.operator,
:root[data-theme="light"] .token.entity,
:root[data-theme="light"] .token.url          { color: #000000; }
:root[data-theme="light"] .token.regex        { color: #811F3F; }
:root[data-theme="light"] .token.decorator    { color: #267F99; }
/* markup */
:root[data-theme="light"] .token.tag          { color: #800000; }
:root[data-theme="light"] .token.attr-name    { color: #FF0000; }
:root[data-theme="light"] .token.attr-value   { color: #0000FF; }
:root[data-theme="light"] .token.selector     { color: #800000; }
:root[data-theme="light"] .token.property     { color: #FF0000; }

/* ── SSMS — T-SQL (language-sql / language-tsql) ─────────── */
/* Colocado APOS o VS para ganhar na mesma especificidade */
:root[data-theme="light"] pre.language-sql .token.string,
:root[data-theme="light"] pre.language-tsql .token.string   { color: #FF0000; }  /* SSMS vermelho */
:root[data-theme="light"] pre.language-sql .token.number,
:root[data-theme="light"] pre.language-tsql .token.number   { color: #000000; }  /* SSMS preto */
:root[data-theme="light"] pre.language-sql .token.function,
:root[data-theme="light"] pre.language-tsql .token.function { color: #FF00FF; }  /* SSMS magenta */
:root[data-theme="light"] pre.language-sql .token.operator,
:root[data-theme="light"] pre.language-tsql .token.operator { color: #808080; }  /* SSMS cinza */

/* ── Visual Studio 2022 — Dark ───────────────────────────── */
:root[data-theme="dark"] pre[class*="language-"],
:root[data-theme="dark"] :not(pre) > code[class*="language-"] {
    background: #1E1E1E;
    color: #D4D4D4;
    border: none;
}
:root[data-theme="dark"] .token.comment,
:root[data-theme="dark"] .token.prolog,
:root[data-theme="dark"] .token.doctype,
:root[data-theme="dark"] .token.cdata        { color: #6A9955; font-style: italic; }
:root[data-theme="dark"] .token.punctuation  { color: #D4D4D4; }
:root[data-theme="dark"] .token.keyword,
:root[data-theme="dark"] .token.boolean,
:root[data-theme="dark"] .token.atrule,
:root[data-theme="dark"] .token.important    { color: #569CD6; }
:root[data-theme="dark"] .token.string,
:root[data-theme="dark"] .token.char,
:root[data-theme="dark"] .token.inserted     { color: #CE9178; }
:root[data-theme="dark"] .token.number,
:root[data-theme="dark"] .token.deleted      { color: #B5CEA8; }
:root[data-theme="dark"] .token.function     { color: #DCDCAA; }
:root[data-theme="dark"] .token.class-name   { color: #4EC9B0; }
:root[data-theme="dark"] .token.builtin      { color: #4EC9B0; }
:root[data-theme="dark"] .token.variable     { color: #9CDCFE; }
:root[data-theme="dark"] .token.operator,
:root[data-theme="dark"] .token.entity,
:root[data-theme="dark"] .token.url          { color: #D4D4D4; }
:root[data-theme="dark"] .token.regex        { color: #D16969; }
:root[data-theme="dark"] .token.decorator    { color: #4EC9B0; }
/* markup */
:root[data-theme="dark"] .token.tag          { color: #569CD6; }
:root[data-theme="dark"] .token.attr-name    { color: #9CDCFE; }
:root[data-theme="dark"] .token.attr-value   { color: #CE9178; }
:root[data-theme="dark"] .token.selector     { color: #D7BA7D; }
:root[data-theme="dark"] .token.property     { color: #9CDCFE; }

/* ── SSMS dark — T-SQL ────────────────────────────────────── */
:root[data-theme="dark"] pre.language-sql .token.function,
:root[data-theme="dark"] pre.language-tsql .token.function  { color: #C586C0; }  /* SSMS roxo */
