/**
 * Prism.js Forensic Theme
 * 
 * Custom syntax highlighting theme for the Forensic Code Block.
 * Based on the Material/Nordic dark aesthetic.
 * 
 * @package Nivalis
 * @since 1.0.0
 */

/* ==========================================================================
   JetBrains Mono Font Face
   ========================================================================== */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Base Token Styles
   ========================================================================== */
code[class*="language-"],
pre[class*="language-"] {
    color: #e6edf3;
    background: none;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', ui-monospace, monospace;
    font-size: 14px;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.6;
    tab-size: 4;
    hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
    padding: 1em;
    margin: 0;
    overflow: auto;
}

/* Inline code */
:not(pre)>code[class*="language-"] {
    padding: 0.1em 0.3em;
    border-radius: 0.3em;
    white-space: normal;
}

/* ==========================================================================
   Syntax Highlighting Tokens
   ========================================================================== */

/* Comments */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #8b949e;
    font-style: italic;
}

/* Punctuation */
.token.punctuation {
    color: #8b949e;
}

/* Namespace */
.token.namespace {
    opacity: 0.7;
}

/* Properties, Tags, Booleans, Numbers, Constants, Symbols */
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #79c0ff;
}

/* Selectors, Strings, Characters, Attributes, Regex, Templates */
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #a5d6ff;
}

/* Operators, Entities, URLs */
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #ff7b72;
}

/* At-rules, Keywords */
.token.atrule,
.token.attr-value,
.token.keyword {
    color: #ff7b72;
}

/* Functions, Classes */
.token.function,
.token.class-name {
    color: #d2a8ff;
}

/* Regex, Important, Variable */
.token.regex,
.token.important,
.token.variable {
    color: #ffa657;
}

/* Important, Bold */
.token.important,
.token.bold {
    font-weight: 600;
}

/* Italic */
.token.italic {
    font-style: italic;
}

/* Entity */
.token.entity {
    cursor: help;
}

/* ==========================================================================
   Line Numbers Plugin
   ========================================================================== */
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 #30363d;
    user-select: none;
}

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

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

/* ==========================================================================
   Line Highlight Plugin
   ========================================================================== */
pre[data-line] {
    position: relative;
}

.line-highlight {
    position: absolute;
    left: 0;
    right: 0;
    padding: 0;
    margin-top: 20px;
    background: rgba(236, 89, 66, 0.15);
    pointer-events: none;
    line-height: inherit;
    white-space: pre;
}

/* Hide line number badges in forensic block */
.fcb .line-highlight::before,
.fcb .line-highlight[data-end]::after {
    display: none;
}

/* Line numbers + Highlight adjustment */
.line-numbers .line-highlight {
    margin-top: 0;
}

/* ==========================================================================
   Additional Language Enhancements
   ========================================================================== */

/* JSON */
.language-json .token.property {
    color: #79c0ff;
}

/* YAML */
.language-yaml .token.key {
    color: #79c0ff;
}

/* Bash */
.language-bash .token.function {
    color: #d2a8ff;
}

/* CSS */
.language-css .token.selector {
    color: #7ee787;
}

.language-css .token.property {
    color: #79c0ff;
}

/* PHP */
.language-php .token.variable {
    color: #79c0ff;
}

/* TypeScript/JSX specific */
.language-tsx .token.tag,
.language-jsx .token.tag {
    color: #7ee787;
}

.language-tsx .token.attr-name,
.language-jsx .token.attr-name {
    color: #79c0ff;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {

    code[class*="language-"],
    pre[class*="language-"] {
        text-shadow: none;
    }
}