:root {
    font-family: "Inter", "Zen Kaku Gothic", "JetBrainsMono", Arial, Helvetica, sans-serif;
}

* {
    /* background-color: var(--bg-secondary); */
    color: var(--text-primary);

    scrollbar-color: var(--scrollbar);
    /* scrollbar-width: thin; */
    scroll-behavior: smooth;
    /* transition: var(--sidebarAnim); */
    font-size: 18px;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    height: 100vh;
    width: 100vw;
    max-height: 100%;
    max-width: 100%;
    overflow: hidden;
}

a {
    color: var(--text-link);
    text-decoration: none;
    font-size: inherit;
}

a:link,
a:visited {
    color: var(--text-link);
}

a:hover,
a:active {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.loading-overlay {
    position: absolute;
    width: 100vw;
    height: 100vh;
    margin: -35px;
    z-index: 600;
    background-color: var(--bg-under);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 100vh;
}

.external {
    border: 3px solid var(--border);
    background-color: var(--bg-secondary);
    position: fixed;
}

.layoutElem {}

.layoutElem a {
    color: var(--text-primary);
}

.layoutElem a:hover {
    color: var(--text-primary);
}

main {
    background-color: var(--bg-primary);
    /* background-image: var(--gradient); */
    overflow: auto;
    /* position: fixed; */
    padding: 35px;
    /* padding-top: calc(15% + 3px); */
    /* padding-left: calc(15% + 3px); */
    /* width: calc(auto - 33px); */
    width: auto;
    /* margin-left: 33px; */
    text-align: center;
    height: calc(100vh - 70px);
}

main.sdml {
    height: calc(100vh - 147px);
}

.force-whole-page {
    min-height: calc(100% + 25px);
}

.mono-font {
    font-family: "JetBrainsMono", "FiraCodeNerdFont", monospace;
    font-weight: 600;
}

.mono {
    font-family: "JetBrainsMono", "FiraCodeNerdFont", monospace;
    font-weight: 600;
    white-space: pre;
}


.no-liga {
    font-feature-settings: "liga" 0;
    font-variant-ligatures: none;
}

h1 {
    width: fit-content;
    font-size: 4rem;
    color: var(--accent-primary);
    clear: both;
    margin: auto;
    text-align: center;
}

h2 {
    width: fit-content;
    font-size: 2.5rem;
    color: var(--accent-secondary);
    clear: both;
    margin: auto;
}

h3 {
    color: var(--accent-tertiary);
    font-size: 1.5rem;
    padding: 0;
    margin: 0;
    /* padding-top: 15px */
}

h4 {
    color: var(--accent-four);
}

h5 {
    color: var(--accent-five);
}

h6 {
    color: var(--accent-six);
}

h4,
h5,
h6 {
    padding: 0;
    margin: 0;
}

hr {
    color: var(--border);
    border: 1px solid var(--border);
    width: 100%;
}

.vr {
    color: var(--border);
    border-left: 1px solid var(--border);
}


tr:nth-child(odd) {
    background-color: var(--table-even);
}

tr:hover {
    background-color: var(--bg-highlight);
}

thead,
thead tr,
thead th,
thead td {
    background-color: var(--table-head);
}

table {
    /* border-spacing: 0px; */
    border-collapse: collapse;
}

th,
td {
    padding: 5px;
}

.searchbar {
    margin: auto;
    margin-top: 15px;
    width: 35%;
    font-size: 24px;
    background-color: var(--bg-secondary);
    border: 3px solid var(--border);
}

.itemGrid {
    /* margin: 0 10vw; */
    display: inline-block;
    text-align: center;
    width: 100%;
    /* margin: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(720px, 1fr));
    grid-auto-columns: auto;
    gap: 50px;
    justify-content: center; */
}

.item {
    /* scroll-margin-top: 3rem; */
    margin: 10px;
    padding: 10px;
    display: inline-block;
    text-align: center;
    border-radius: 15px;
    background-color: var(--bg-secondary);
    border: 3px solid var(--border);
    width: 420px;
    position: relative;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.item:hover {
    background-color: var(--bg-highlight);
    border: 3px solid var(--border);
}

/* .theme-light_default .item:hover {
    background-color: var(--bg-secondary);
    border: 3px solid var(--accent-primary);
} */

.item-lift {
    transition: 0.2s ease;
    /*         transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease; */
}

.item-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.item-shadow {
    transition: 0.2s ease;
    /*         transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease; */
}

.item-shadow:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal {
    /* scroll-margin-top: 3rem; */
    margin: 10px;
    padding: 10px;
    display: inline-block;
    border-radius: 15px;
    background-color: var(--bg-secondary);
    border: 3px solid var(--border);
    position: relative;
}

.item-name {
    color: var(--accent-secondary);
    width: 100%;
    text-align: center;
    margin: 0 auto;
    margin-right: 2vw;
    padding-right: 5px;
    padding-left: 5px;
    border-radius: 5px;
    /* font-family: 'Consolas', monospace; */
    font-weight: bolder;
    font-size: 1.5rem;
    /* font-size: 40px; */
    margin: 0;
    padding: 0;
}


/* also includes yt preview */
.item-image-preview {
    width: 400px;
    height: 225px;
    border-radius: 10px;
    object-fit: cover;
}


.sidebyside {
    display: flex;
}

.sidebyside>*:first-child {
    margin: 5px;
}

.sidebyside>* {
    flex: auto;
    /* flex: 1; */
}

/* https://stackoverflow.com/a/12540590 */
.clearfix:after {
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
}

.clearfix {
    display: inline-block;
}

html[xmlns] .clearfix {
    display: block;
}

* html .clearfix {
    height: 1%;
}

.underlay {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-under);
    z-index: 300;
    position: fixed;
}

blockquote {
    background-color: var(--bg-highlight);
    border-left: var(--blockquote-border) 5px solid;
    padding-left: 5px;
}

.unset {
    all: unset;
}

.inherit-all {
    all: inherit;
}



.input-generic,
input[type="text"],
input[type="number"],
input[type="password"],
textarea {
    background-color: var(--bg-secondary);
    border: 3px solid var(--border);
    display: block;
    font-size: 24px;
}

input:not([type="checkbox"]):focus,
textarea:focus,
.input-generic:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus {
    outline: none;
    background-color: var(--bg-primary);
}

input.input-generic,
textarea.input-generic {
    width: calc(100% - 10px);
}

textarea.input-generic {
    resize: vertical;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.checkbox-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 50px;
    height: 25px;
    background-color: var(--bg-secondary);
    position: relative;
    transition: background-color 300ms ease;
    vertical-align: top;
    border: 3px solid var(--border);

    &::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 23%;
        transform: translate(-50%, -50%);
        height: 20px;
        width: 20px;
        background-color: var(--disable);
        transition: left 300ms ease;
    }

    &:checked {
        &::after {
            left: 77%;
            background-color: var(--enable);
        }

        transition: ease-in-out;
    }
}

.checkbox-check {
    border: 1px solid var(--border);
    appearance: none;
    -webkit-appearance: none;
    width: 25px;
    height: 25px;
    background-color: var(--bg-primary);
    position: relative;
    transition: background-color 300ms ease;
    vertical-align: top;

    &::after {
        content: '';
        position: absolute;
        height: calc(100% - 1px);
        vertical-align: middle;
        width: calc(100% - 1px);
        text-align: center;
        /* content: "✖"; */
        color: var(--disable);
        /* background-color: var(--border); */
    }

    &:checked {
        background-color: var(--bg-secondary);

        &::after {
            width: 100%;
            text-align: center;
            content: "✔";
            color: var(--enable);
            /* background-color: #67ff67; */
        }
    }
}

select {
    background-color: var(--bg-secondary);
    border: 3px solid var(--border);
    font-size: 24px;
}

.button-decor {
    border: 3px solid var(--border);
    background-color: var(--bg-secondary);
}

.button-decor:hover {
    background-color: var(--bg-highlight);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.button-decor:active {
    background-color: var(--enable);
}

.button-decor-2 {
    background-color: var(--bg-secondary);
    display: inline-block;
    width: fit-content;
    border: 1px solid var(--border);
    font-size: 1rem;
    padding: 0.5em 1em;
    border-radius: 8px;
}

.button-decor-2:hover {
    cursor: pointer;
    background-color: var(--bg-highlight);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.button-animated {
    border-radius: 5px;
    border: 3px solid var(--border);
    background-color: var(--bg-secondary);
    transition: 0.2s ease;
}

.button-animated:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.button-animated:active {
    transform: translateY(-3px);
    background-color: var(--bg-highlight);
}

.centre-page {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-direction: column;
    width: 1000px;
    max-width: 80vw;
    list-style-position: inside;
    margin: 15px auto;
    padding: 15px;
    text-align: left;
}

.centre-page.stylised {
    background-color: var(--bg-secondary);
    border: 3px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.aside-sticky {
    top: 50%;
    transform: translateY(-25%);
    right: 0;
    height: 250px;
    width: 250px;
    position: fixed;
    z-index: 300;
    height: calc(100% - 75px);
    padding: 1em;
}

/* if sticky aside is invis show this elem */
.aside-sticky-replacer {
    display: none;
}

.aside-sticky-item {
    display: block;
    width: 100%;
    color: var(--text-secondary);
}

.highlight-glow {
    text-shadow: 0;
    transition: 0.3s ease;
}

.highlight-glow:hover {
    color: #fff;
    /* background-color: var(--bg-highlight); */
    text-shadow: var(--glow-text);
    -webkit-filter: drop-shadow(var(--glow));
    -moz-filter: drop-shadow(var(--glow));
    -ms-filter: drop-shadow(var(--glow));
    -o-filter: drop-shadow(var(--glow));
    filter: drop-shadow(var(--glow));
}

.centre-page-item {
    border-radius: 1rem;
    border: 3px solid var(--border);
    margin: 12px auto;
    overflow: hidden;
    text-align: left;
}

.as-p {
    display: block;
    margin-top: 1em;
    margin-bottom: 1em;
    margin-left: 0;
    margin-right: 0;
}

code {
    background-color: var(--code-bg);
    color: var(--code);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "JetBrainsMono", "Lucida Console", monospace;
    font-size: 0.95em;
}

mark {
    color: var(--mark-text);
    background-color: var(--mark-bg);
}

@keyframes jump {
    0% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(2px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes opacInOut {
    0% {
        opacity: 100;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 100;
    }
}

@keyframes opacIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 100;
    }
}

@keyframes opacOut {
    from {
        opacity: 100;
    }

    to {
        opacity: 0;
    }
}

@keyframes grow {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes shrink {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(0);
    }
}

@keyframes opacgrow {
    from {
        opacity: 0;
        transform: rotateX(-10deg) scale(0.9);
    }

    to {
        opacity: 1;
        transform: rotateX(0deg) scale(1);
    }
}

@keyframes opacshrink {
    from {
        opacity: 1;
        transform: rotateX(0deg) scale(1);
    }

    to {
        opacity: 0;
        transform: rotateX(-10deg) scale(0.95);
    }
}




.jump-on-click {
    transition: transform 0.2s ease;
}

.jump-active {
    animation: jump 0.4s ease;
}

.switch-dim {
    animation: opacInOut 0.5s ease;
}

.code-table {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.95em;
    font-family: "JetBrainsMono", "Lucida Console", monospace;
}

.code-table * {
    text-align: left;
}

.code-table th {
    color: var(--codeTableHeader);
}

.code-table td {
    color: var(--codeTableCell);
}

.sidebutton {
    position: absolute;
    top: 50%;
    z-index: 700;
}

.sidebutton.right {
    right: 15px;
}

.sidebutton.left {
    left: 15px;
}

@media only screen and (max-width: 1150px) {
    .aside-sticky {
        display: none;
    }

    .aside-sticky-replacer {
        display: block
    }
}

@media only screen and (max-width: 600px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) {
    h1 {
        width: fit-content;
        font-size: 3rem;
        clear: both;
        margin: auto;
        text-align: center;
    }

    h2 {
        width: fit-content;
        font-size: 2rem;
        clear: both;
        /* margin: auto; */
    }

    main {
        padding-left: 15px;
    }

    .item {
        width: 275px;
        height: auto;
    }

    .item-image-preview {
        width: 275px;
        height: auto;
    }

    .item-name {
        overflow-wrap: anywhere;
    }
}

.layout-forced-special-buttons {
    text-align: left;
    width: 100%;
}

sup>*,
sub>*,
sup,
sub {
    font-size: 0.8rem;
    display: inline;
}

sup {
    vertical-align: super;
}

sub {
    vertical-align: sub;
}