/*
Author: Valerio Maggio < @leriomaggio >
Code: https://github.com/leriomaggio/notexbook-jupyter-theme
License: Apache License 2.0
*/

/*
    =================
    Code Editor Theme
    =================
*/
div.output_error pre,
div.output_result pre,
div.output_stream pre {
    color: var(--code-text-color) !important;
}

.cm-s-ipython.CodeMirror,
.cm-s-jupyter.CodeMirror {
    background: var(--code-background-color);
    color: var(--code-text-color);
}

.cm-s-ipython div.CodeMirror-selected,
.cm-s-jupyter div.CodeMirror-selected {
    cursor: pointer;
    background: var(--selection-background-color);
}

.cm-s-ipython .CodeMirror-gutters,
.cm-s-jupyter .CodeMirror-gutters {
    background: var(--gutter-background);
    border-right: 0;
}

.cm-s-ipython .CodeMirror-linenumber,
.cm-s-jupyter .CodeMirror-linenumber {
    color: var(--line-numbers);
}

.cm-s-ipython .CodeMirror-cursor,
.cm-s-jupyter .CodeMirror-cursor {
    border-left: 1px solid var(--cursor) !important;
}

.cm-s-ipython span.cm-bracket,
.cm-s-jupyter span.cm-bracket {
    /*color: #828282;*/
    color: var(--bracket);
}

span.CodeMirror-matchingbracket {
    text-decoration: underline !important;
    text-decoration-color: var(--matching-bracket) !important;
    color: var(--matching-bracket) !important;
}

.cm-s-ipython span.cm-keyword,
.cm-s-jupyter span.cm-keyword {
    color: var(--keywords);
    font-weight: 400;
}

.cm-s-ipython span.cm-variable,
.cm-s-jupyter span.cm-variable {
    color: var(--variables);
}

.cm-s-ipython span.cm-variable-2,
.cm-s-jupyter span.cm-variable-2 {
    color: var(--variables2);
}

.cm-s-ipython span.cm-def,
.cm-s-jupyter span.cm-def {
    color: var(--def);
}

.cm-s-ipython span.cm-property,
.cm-s-jupyter span.cm-property {
    color: var(--property);
}

.cm-s-ipython span.cm-meta,
.cm-s-jupyter span.cm-meta {
    color: var(--meta);
}

.cm-s-ipython span.cm-attribute,
.cm-s-jupyter span.cm-attribute {
    color: var(--attribute);
}

.cm-s-ipython span.cm-builtin,
.cm-s-jupyter span.cm-builtin {
    color: var(--builtin)
}

.cm-s-ipython span.cm-string,
.cm-s-jupyter span.cm-string {
    color: var(--strings);
}

.cm-s-ipython span.cm-string-2,
.cm-s-jupyter span.cm-string-2 {
    color: var(--strings2);
}

.cm-s-ipython span.cm-comment,
.cm-s-jupyter span.cm-comment {
    color: var(--comments);
    font-style: normal;
}

.cm-s-ipython span.cm-operator,
.cm-s-jupyter span.cm-operator {
    color: var(--operator);
    font-weight: 400;
}

.cm-s-ipython span.cm-number,
.cm-s-jupyter span.cm-number {
    color: var(--numbers);
}

.cm-s-ipython span.cm-type,
.cm-s-jupyter span.cm-type {
    color: var(--types);
}

/*
==============================
Markdown MathJax Customisation
==============================
*/

/*This customisation only applies to Math Display showing the font bigger than normal*/
.MathJax_Display {
    font-size: 2rem;
}

.MathJax_Display .mjx-char {
    font-family: var(--txbk-content-font-family) !important;
}

.MathJax_Display, .MathJax span {
    color: var(--code-text-color) !important;
}

.MathJax span[style*="STIXMathJax_Normal"],
.MathJax span[style*="STIXMathJax_Normal-italic"],
.MathJax span[style*="STIXMathJax_Main"],
.MathJax span[style*="STIXMathJax_Variants"] {
    font-family: var(--txbk-content-font-family) !important;
}


/*
    Pygments CSS (replacement) for HTML export
    ===========================================

    Original Pygments CSS rewrite thanks to @rubik
    https://github.com/jupyter/nbconvert/issues/447#issuecomment-270766965
*/

.highlight .hll, div.highlight > pre {
    background-color: var(--code-background-color);
    color: var(--code-text-color);
    font-family: var(--txbk-code-font-family);
    font-size: var(--txbk-code-font-size);
    line-height: var(--txbk-code-line-height);
}

/* Comment */
.highlight .c {
    color: var(--comments);
}

/* Error */
.highlight .err {
    color: #960050;
    background-color: #1e0010;
}

/* Keyword */
.highlight .k {
    color: var(--keywords);
    font-weight: 400;
}

/* Literal */
.highlight .l {
    color: var(--numbers);
}

/* Name */
.highlight .n {
    color: var(--code-text-color);
}

/* HACK:
fix Interpreter mismatch pygments vs codemirror
mpl.rcParams <- rcParams will be highlighted as property (as in codemirror)
*/
.highlight .o + .n {
    color: var(--property);
}

/* Operator */
.highlight .o {
    color: var(--code-text-color);
    font-weight: 400;
}

/* Punctuation */
.highlight .p {
    color: var(--code-text-color);
}

/* Comment.Multiline */
.highlight .cm {
    color: var(--comments);
    font-style: normal;
}

/* Comment.Preproc */
.highlight .cp {
    color: var(--meta);
    font-style: normal;
}

.highlight .cpf {
    color: var(--meta);
    font-style: normal;
}

/* Comment.Single */
.highlight .c1 {
    color: var(--comments);
    font-style: normal;
}

/* Comment.Special */
.highlight .cs {
    color: var(--comments);
    font-style: normal;
}

/* @ Generic.Deleted */
.highlight .gd {
    color: var(--red);
}

/* Generic.Emph */
.highlight .ge {
    font-style: italic
}

/* @ Generic.Inserted */
.highlight .gi {
    color: #a6e22e
}

/* Generic.Strong */
.highlight .gs {
    font-weight: 500 !important;
}

/* @ Generic.Subheading */
.highlight .gu {
    color: #75715e
}

/* */

/* Keyword.Constant */
.highlight .kc {
    color: var(--keywords);
    font-weight: 400;
}

/* Keyword.Declaration */
.highlight .kd {
    color: var(--keywords);
    font-weight: 400;
}

/* Keyword.Namespace */
.highlight .kn {
    color: var(--keywords);
    font-weight: 400;
}

/* Keyword.Pseudo */
.highlight .kp {
    color: var(--keywords);
    font-weight: 400;
}

/* Keyword.Reserved */
.highlight .kr {
    color: var(--keywords);
    font-weight: 400;
}

/* Keyword.Type */
.highlight .kt {
    color: var(--types);
    font-weight: 400;
}

/* Literal.Date */
.highlight .ld {
    color: var(--numbers)
}

/* Literal.Number */
.highlight .m {
    color: var(--numbers);
}

/* Literal.String */
.highlight .s {
    color: var(--string);
}

/* Name.Attribute */
.highlight .na {
    color: var(--property);
}

/* Name.Builtin */
.highlight .nb {
    color: var(--builtin);
}

/* Name.Class */
.highlight .nc {
    color: var(--def);
    font-weight: normal !important;
}

/* @ Name.Constant */
.highlight .no {
    color: var(--variables2);
}

/* Name.Decorator */
.highlight .nd {
    color: var(--builtin);
}

/* @ Name.Entity */
.highlight .ni {
    color: var(--variables2);
}

/* Name.Exception */
.highlight .ne {
    color: var(--code-text-color);
    font-weight: normal !important;
}

/* Name.Function */
.highlight .nf, .highlight .fm {
    color: var(--def);
}

/* @ Name.Label */
.highlight .nl {
    color: var(--comments);
}

/* Name.Namespace */
.highlight .nn {
    color: var(--code-text-color);
    font-weight: normal !important;
}

/* @ Name.Other */
.highlight .nx {
    color: var(--code-text-color);
}

/* @ Name.Property */
.highlight .py {
    color: var(--property);
}

/* @ Name.Tag */
.highlight .nt {
    color: var(--tag);
}

/* @ Name.Variable */
.highlight .nv {
    color:  var(--variables);
}

/* Operator.Word */
.highlight .ow {
    color: var(--operator);
    font-weight: 400;
}

/* @ Text.Whitespace */
.highlight .w {
    color: var(--code-background-color);

}

/* Literal.Number.Bin */
/* Literal.Number.Float */
/* Literal.Number.Hex */
/* Literal.Number.Integer */
/* Literal.Number.Oct */
.highlight .mb,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo {
    color: var(--numbers);
}

/* Literal.String.Backtick */
.highlight .sb {
    color: var(--strings2);
}

.highlight .sc,  /* Literal.String.Char */
.highlight .sd,  /* Literal.String.Doc */
.highlight .s2,  /* Literal.String.Double */
.highlight .sh,  /* Literal.String.Heredoc */
.highlight .si,  /* Literal.String.Interpol */
.highlight .sx,  /* Literal.String.Other */
.highlight .sr,  /* Literal.String.Regex */
.highlight .s1,  /* Literal.String.Single */
.highlight .ss  /* Literal.String.Symbol */
{
    color: var(--strings);
    font-style: normal;
}

/* Literal.String.Escape */
.highlight .se {
    color: var(--red);
}

/* Name.Builtin.Pseudo */
.highlight .bp {
    color: var(--variables2);
}

/* Name.Variable.Class */
.highlight .vc {
    color: var(--variables);
}

/* Name.Variable.Global */
.highlight .vg {
    color: var(--variables2);
}

/* Name.Variable.Instance */
.highlight .vi {
    color: var(--code-text-color);
}

/* Literal.Number.Integer.Long */
.highlight .il {
    color: var(--numbers);
}

/*
    Dataframe Colors
    ----------------
    Adapt Dataframe table to comply with the theme
*/

table.dataframe {
    color: var(--dataframe) !important;
}

table.dataframe tbody tr th {
    background-color: var(--df-bg);
}

table.dataframe tbody tr:hover {
    background-color: var(--df-tr-hover);
}

table.dataframe td, table.dataframe th {
    border: 1px solid var(--df-border);
}

table.dataframe > th:not(:empty) {
    background-color: var(--df-th-bg);
}

table.dataframe tr:nth-child(2) th:empty,
table.dataframe tr:nth-child(2) th:empty {
    border-right: 1px dotted var(--df-border-right);
}

table.dataframe thead tr th:not(:empty) {
    color: var(--df-thead);
    border-bottom:  1px solid var(--df-thead-border);
}

/* =======================================
              ANSI colors
    (stdout / stderr color customisation)
   =======================================
*/

span.ansi-green-fg {
    color: var(--ansi-green) !important;
}

span.ansi-green-intense-fg{
    color: var(--ansi-green-intense) !important;
}

span.ansi-red-fg {
    color: var(--ansi-red) !important;
}

span.ansi-cyan-fg {
    color: var(--ansi-cyan) !important;
}

span.ansi-blue-fg {
    color: var(--ansi-blue) !important;
}

span.ansi-bold {
    font-weight: 500 !important;
}

/* ----------------------------------- */

/*
    ======================
    Markdown Editor Theme
    ======================
*/

div.text_cell.unrendered pre {
    color: var(--editor-text) !important;
}

span.cm-header {
    color: var(--header) !important;
    font-weight: 500;
}

span.cm-quote {
    color: var(--quote) !important;
}

span.cm-string.cm-url {
    color: var(--link) !important;
}

span.cm-string {
   color: var(--strings) !important;
}
/* Sometimes useful in Mono code Highlighting*/
span.cm-string-2 {
    color: var(--strings2) !important;
}

span.cm-link {
    color: var(--link) !important;
}

span.cm-attribute {
    color: var(--attribute) !important;
}

span.cm-tag {
    color: var(--tag) !important;
}

span.cm-delimiter {
    color: var(--delimiter) !important;
}

span.cm-comment {
    color: var(--comments) !important;
}