* {
    box-sizing: border-box;
}

/* Default Light */
:root {
    color-scheme: light;
    --main-bg-color: #eaeaea;
    --bg-image: url("/assets/img/teapot_bg_light.png");
    --page-bg-color: #fafafa;
    --page-text-color: #222;
    --code-bg-color: #434343;
    --code-text-color: #ccc;
    --nav-bg-color: #393939;
    --nav-text-color: #d0d0d0;
    --border-color: #000;
    --brightness: brightness(1);
    --light-element-display: none;
    --dark-element-display: initial;
}

/* Alternate Dark */
:root.alternate {
    color-scheme: dark;
    --main-bg-color: #3e3e3e;
    --bg-image: url("/assets/img/teapot_bg_dark.png");
    --page-bg-color: #303030;
    --page-text-color: #ddd;
    --code-bg-color: #1f1f1f;
    --code-text-color: #bbb;
    --nav-bg-color: #222;
    --nav-text-color: #ddd;
    --border-color: #ccc;
    --brightness: brightness(.9);
    --light-element-display: initial;
    --dark-element-display: none;
}

@media (prefers-color-scheme: dark) {

    /* Default Dark */
    :root {
        color-scheme: dark;
        --main-bg-color: #3e3e3e;
        --bg-image: url("/assets/img/teapot_bg_dark.png");
        --page-bg-color: #303030;
        --page-text-color: #ddd;
        --code-bg-color: #1f1f1f;
        --code-text-color: #bbb;
        --nav-bg-color: #222;
        --nav-text-color: #ddd;
        --border-color: #ccc;
        --brightness: brightness(.9);
        --light-element-display: initial;
        --dark-element-display: none;
    }

    /* Alternate Light */
    :root.alternate {
        color-scheme: light;
        --main-bg-color: #eaeaea;
        --bg-image: url("/assets/img/teapot_bg_light.png");
        --page-bg-color: #fafafa;
        --page-text-color: #222;
        --code-bg-color: #434343;
        --code-text-color: #ccc;
        --nav-bg-color: #393939;
        --nav-text-color: #d0d0d0;
        --border-color: #000;
        --brightness: brightness(1);
        --light-element-display: none;
        --dark-element-display: initial;
    }
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: normal;
    background-color: var(--page-bg-color);
}

.bg {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 0;
    background-size: 30rem;
    background-image: none;
}

.pageContainer {
    min-height: 100%;
    position: relative;
    padding-bottom: 36px;
}

button:hover {
    cursor: pointer;
}

a,
a:visited {
    text-underline-offset: 3px;
    color: var(--page-text-color);
}

nav {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--nav-bg-color);
    color: var(--nav-text-color);
    align-items: center;
}

header {
    height: 50px;
    width: 100%;
    display: flex;
    flex-direction: row;
}

header .logo {
    display: flex;
    margin: 0 auto;
    align-items: center;
    text-decoration: none;
    color: black;
}

header .logo img {
    height: 45px;
    padding: .5rem;
}

header .logo_text {
    font-size: 1rem;
    letter-spacing: 1px;
    color: var(--nav-text-color);
}

header button {
    height: 50px;
    width: 60px;
    border: none;
    background-color: var(--nav-bg-color);
    color: var(--nav-text-color);
    text-align: center;
}

main {
    background-color: var(--page-bg-color);
    padding-bottom: 2rem;
    color: var(--page-text-color);
    /*width: 800px;*/
    margin: 0 auto;
    border-radius: 5px;
}

.wrap {
    width: 90%;
    margin: 0 auto;
    padding: 2rem 0;
}

main h1, main h2, main h3, main h4 {
    text-align: center;
    font-weight: normal;
}

main h1 {
    font-size: 1.4rem;
}

main h2 {
    font-size: 1.2rem;
}

main h3 {
    font-size: 1rem;
}

main h4 {
    font-size: .8rem;
}

/* Underlines for the headings */
main h1::after,
main h2::after,
main h3::after,
main h4::after {
    content: "";
    display: block;
    width: 12rem;
    height: 1px;
    background-color: var(--page-text-color);
    margin: .5rem auto;
}

main h2::after {
    width: 9rem;
}

main h3::after {
    width: 8rem;
}

main h4::after {
    width: 6rem;
}

main a {
    color: var(--page-text-color);
}

main p {
    line-height: 1.3rem;
}

.center_text {
    text-align: center;
}

main img {
    display: block;
    width: 100%;
}

main .page_link {
    display: block;
    padding: .5rem 0;
    text-align: center;
    font-size: 1.1rem;
    width: max-content;
    margin: 0 auto;
}

.code_block {
    overflow: auto;
    color: var(--code-text-color);
    background-color: var(--code-bg-color);
    border-radius: 5px;
    margin: 1.5rem 0;
}

.code_block > pre {
    margin: 1rem;
}

.link_list_item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.link_icon {
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.link_icon:hover {
    cursor: pointer;
}

.light_link_icon {
    display: var(--dark-element-display);
}

.dark_link_icon {
    display: var(--light-element-display);
}

footer {
    position: absolute;
    bottom: 0;
    height: 36px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

.footer_link {
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding: 1rem 0;
}

.themeButtonContainer {
    display: flex;
    flex-direction: row;
    justify-content: end;
    height: 36px;
}

#setThemeButton {
    height: 36px;
    width: 50px;
    background: none;
    border: none;
    padding: .5rem;
}

.lightThemeIcon,
.darkThemeIcon {
    width: 20px;
}

.lightThemeIcon {
    display: var(--dark-element-display);
}

.darkThemeIcon {
    display: var(--light-element-display);
}

/* Cookie */
.cookieBanner {
    display: flex;
    justify-items: center;
    align-items: center;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 125px;
    background-color: #292929;
    z-index: 100;
}
.cookieBannerText {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 20px;
    width: 55%;
    height: 75px;
    color: #ddd;
}
.cookieButton {
    height: 40px;
    width: 100px;
    margin: 0 auto;
    color: #ddd;
    background-color: #292929;
    border: 1px solid #ddd;
}

.remove {
    display: none;
}
/* End Cookie */

/* MEDIA QUERIES */
@media only screen and (min-width: 900px) {

    .wrap {
        max-width: 750px;
    }

    header .logo_text {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    nav {
        flex-direction: row;
        max-width: 800px;
        margin: 0 auto;
        border-radius: 0 0 10px 10px;
    }

    main {
        max-width: 800px;
        border-radius: 10px;
        margin: 2rem auto;
    }

    .bg {
        background-image: var(--bg-image);
        background-color: var(--main-bg-color);
    }
}