:root, html[data-theme = 'light'] {
    --font-color: black;
    --background-color: white;
    --border-color: black;
    --quote-color: rgb(80, 80, 80);
    --code-background: rgb(244, 242, 240);
    --definition-aside-background: rgb(250, 250, 250);
    --icon: url("dark-mode-black.svg");
    --image-filter: none;
    --function-blue: #00627A;
    --globalVar: #871094;
    --selection: #fcd6a5;
    --error: #F50000;
}

html[data-theme = 'dark'] {
    --font-color: rgb(240, 240, 240);
    --background-color: rgb(40, 40, 40);
    --border-color: rgb(145, 145, 145);
    --quote-color: rgb(210, 210, 210);
    --code-background: #282c34;
    --definition-aside-background: #3e3e3e;
    --icon: url("dark-mode-white.svg");
    --image-filter: invert(80%) hue-rotate(180deg) brightness(120%) contrast(150%);
    --function-blue: #87bcca;
    --globalVar: #a446af;
    --selection: #815b2a;
    --error: #b10000;
}

@font-face {
  font-family: "Amiri";
  src: url("fonts/Amiri/Amiri-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Amiri";
  src: url("fonts/Amiri/Amiri-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Amiri";
  src: url("fonts/Amiri/Amiri-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Amiri";
  src: url("fonts/Amiri/Amiri-BoldItalic.ttf") format("truetype");
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Code Pro";
  src: url("fonts/SourceCodePro/SourceCodePro-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Code Pro";
  src: url("fonts/SourceCodePro/SourceCodePro-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Code Pro";
  src: url("fonts/SourceCodePro/SourceCodePro-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Code Pro";
  src: url("fonts/SourceCodePro/SourceCodePro-BoldItalic.ttf") format("truetype");
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

@media only screen and (min-width: 800px) {
    img {
        width: 80%;
        border: 3px var(--border-color) solid;
        filter: var(--image-filter);
        transition: border 500ms, filter 500ms;
    }

    .quote {
        margin-left: 95px;
        margin-right: 95px;
        color: var(--quote-color);
        font-size: 27px;
        font-style: italic;
        font-weight: 400;
        transition: color 500ms;
    }

    td, th {
        padding: 10px 20px;
    }

    #visible {
        margin-bottom: 80px;
        width: 70%;
        margin-left: auto;
        margin-right: auto;
        background-color: var(--background-color);
        padding: 0 40px 20px;
        border-radius: 20px;
        transition: background-color 400ms;
    }

    h1 {
        font-size: 30px;
    }

    p {
        font-size: 20px;
    }

    tbody {
        font-size: 20px;
    }

    div span {
        font-size: 20px;
        color: var(--font-color);
        transition: color 500ms;
        line-height: 1.8;
    }

    h3 {
        font-size: 25px;
    }

    h2 {
        font-size: 28px;
    }

    code {
        font-family: "Source Code Pro";
        padding: 10px 20px 10px 40px;
        display: block;
        border-radius: 30px;
        background-color: var(--code-background);
        transition: background-color 500ms;
        overflow-x: scroll;
        font-size: 17px;
        line-height: 1.5;
    }

    code p {
        font-size: 17px;
    }

    code span {
        font-size: 17px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    code pre {
        font-size: 17px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .definition {
        margin-left: 20px;
        margin-right: 20px;
        padding: 20px 20px 30px 30px;
        background-color: var(--definition-aside-background);
        border-radius: 10px;
        line-height: 1.8;
        font-size: 20px;
        transition: background-color 500ms;
    }

    .definition .title {
        text-align: center;
        font-size: 24px;
        margin-left: auto;
        margin-right: auto;
        padding: 0;
    }

    ul, ol {
        font-size: 20px;
        padding-inline-start: 40px;
    }
}

@media only screen and (max-width: 800px) {
    ul, ol {
        padding-inline-start: 5px;
    }

    td, th {
        padding: 2px 3px;
    }

    h1 {
        font-size: 28px;
    }

    tbody, thead, table, tr, td {
        font-size: 15px;
    }

    ol, ul, li, div span {
        font-size: 16px;
        color: var(--font-color);
        line-height: 1.8;
        transition: color 500ms;
    }

    code {
        font-family: "Source Code Pro";
        padding: 10px 20px 10px 40px !important;
        display: block;
        border-radius: 30px !important;
        background: var(--code-background);
        transition: background-color 500ms;
        overflow-x: scroll;
        font-size: 13px;
        line-height: 1.5;
    }

    code p {
        font-size: 13px;
    }

    code span {
        font-size: 13px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    code pre {
        font-size: 13px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    body {
        overflow-x: hidden;
    }

    p {
        font-size: 16px;
    }

    .definition {
        margin-left: 10px;
        margin-right: 10px;
        padding: 20px 20px 30px 30px;
        background-color: var(--definition-aside-background);
        border-radius: 10px;
        line-height: 1.8;
        font-size: 16px;
        transition: background-color 500ms;
    }

    .definition .title {
        text-align: center;
        font-size: 16px;
        margin-left: auto;
        margin-right: auto;
        padding: 0;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 21px;
    }

    .indent {
        margin-left: 10px;
    }

    .quote {
        margin-left: 20px;
        margin-right: 20px;
        color: var(--quote-color);
        font-size: 18px;
        font-style: italic;
        font-weight: 400;
        transition: color 500ms;
    }

    ol, ul, li {
        margin-left: 10px !important;
        font-family: "Amiri";
        line-height: 1.8;
    }

    #visible {
        margin-bottom: 80px;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        background-color: var(--background-color);
        padding: 0 10px;
        border-radius: 20px;
        overflow-x: scroll;
        transition: background-color 400ms;
    }

    img {
        width: 90%;
        filter: var(--image-filter);
        border: 1px var(--border-color) solid;
        transition: border 500ms, filter 500ms;
    }
}

.katex, .katex span {
    font-size: 1em;
}

table, td, th {
    border: 1px solid var(--border-color);
    border-collapse: collapse;
    font-weight: normal;
    font-family: "Amiri";
    text-align: center;
    margin: auto;
    line-height: 1.8;
    color: var(--font-color);
    transition: color 500ms, border 500ms;
}

nav {
    position: sticky;
    display: block;
    background-color: var(--background-color);
    width: 100%;
    padding-top: 2px;
    padding-bottom: 2px;
    top: 0;
    z-index: 1000;
    transition: top 0.3s, color 0.3s, background-color 400ms;
    color: var(--font-color);
}

img {
    display: block;
    filter: var(--image-filter);
    margin-left: auto;
    margin-right: auto;
    transition: filter 500ms;
}

.caption {
    font-style: italic;
    text-align: center;
}

button {
    margin-left: auto;
    margin-right: auto;
    width: 150px;
    height: 50px;
    font-size: 15px;
    text-align: center;
}

aside {
    line-height: 1.8;
    margin-left: 20px;
    margin-right: 20px;
    padding: 20px 30px;
    background-color: var(--definition-aside-background);
    border-radius: 10px;
    color: var(--font-color);
    transition: color 500ms, background-color 500ms;
}

nav h1 {
    text-align: center;
    font-family: "Amiri";
    color: var(--font-color);
    transition: color 500ms;
}

nav h1:hover {
    color: burlywood;
}

a {
    color: var(--font-color);
    text-decoration: underline;
    text-decoration-color: burlywood;
    overflow-wrap: anywhere;
    transition: color 600ms;
}

a:hover, a:visited:hover {
    color: burlywood;
}

a:visited {
    color: var(--font-color);
    transition: color 600ms;
}

h1 {
    font-family: "Amiri";
    font-weight: 600;
    color: var(--font-color);
    transition: color 500ms;
}

h2 {
    font-family: "Amiri";
    font-weight: 600;
    color: var(--font-color);
    transition: color 500ms;
}

.center {
    text-align: center;
}

ul, ol {
    font-family: "Amiri";
    color: var(--font-color);
    transition: color 500ms;
}

h3 {
    font-family: "Amiri";
    color: var(--font-color);
    font-weight: 600;
    transition: color 500ms;
}

h4 {
    font-family: "Amiri";
    color: var(--font-color);
    transition: color 500ms;
    font-size: 25px;
}

h5 {
    font-family: "Amiri";
    color: var(--font-color);
    transition: color 500ms;
    font-style: normal;
    font-weight: 300;
    font-size: 25px;
    margin-block-start: 0.8em;
    margin-block-end: 0.8em;
}

em, p {
    font-family: "Amiri";
    color: var(--font-color);
    transition: color 500ms;
}

.indent {
    margin-left: 20px;
}

.italic {
    font-style: italic;
}

.bold {
    font-style: bold;
}

.codeword {
    font-family: "Source Code Pro";
    display: inline;
}

.functionBlue {
    font-family: "Source Code Pro";
    display: inline;
    color: var(--function-blue);
}

div.explanation:first-line {
    margin-top: -1em;
    line-height: 0px;
}

.explanation {
    word-wrap: break-word;
    hyphens: auto;
    white-space: pre-wrap;
}

.explanation span {
    hyphens: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.error {
    font-family: "Source Code Pro";
    color: var(--error);
    display: inline;
}

.globalVar {
    font-style: italic;
    font-family: "Source Code Pro";
    color: var(--globalVar);
    display: inline;
}

.keyword {
  font-family: "Source Code Pro";
  display: inline;
}

.identifier {
  display: inline;
}

.annotation {
  font-family: "Source Code Pro";
  display: inline;
}

.inline {
    font-family: "Source Code Pro";
    display: contents;
}

.inline + p, .inline p {
    display: inline;
}

::selection {
    background-color: var(--selection);
}

body {
    background-color: var(--background-color);
    transition: background-color 400ms;
}

#dark-mode-container {
    display: inline;
    float: right;
    margin-right: 30px;
    position: sticky;
    margin-top: 30px;
    opacity: 100%;
    font-family: "Amiri";
    height: 30px;
    width: 30px;
    transition: opacity 200ms;
}

#dark-mode-container button {
    border: none;
    color: var(--font-color);
    transition: color 200ms, background-color 400ms;
    cursor: pointer;
    padding: 5px;
    width: 25px;
    height: 25px;
    background-image: var(--icon);
    background-color: var(--background-color);
}
