/* Global variables */
:root {
    --bg: rgba(1, 1, 19, 0.4);
    --primary-text: #F5E8D8;
    --accent-one: #8888ec;
    --accent-two: #2E2E42;
    --hover: #40404A;
    --background-image: url("../static/img/ui/stars_bg.gif")
}

/* Box sizing snippet */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Remove background from the code snippets */
.codehilite {
    background-color: transparent;
    overflow-x: auto;
}

/* === Styles of global elements ===*/
html {
    height: 100vh;
}

a { color: var(--accent-one); }
a:hover { color: var(--hover); }
p { margin: 10px 0 10px 0; font-size: large;  }
h1 { margin-top: 0; }

body {
    /* systemfont stack */
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;
    color: var(--primary-text);

    height: 100vh;

    background-image: var(--background-image);
    background-position: center;
    background-repeat: repeat;
    background-size: contain;
    background-size: 100% 100%;
    background-attachment: fixed; 
}

.wrapper {
    width: 900px;
    margin: auto;

    background-color: var(--bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 4px solid var(--bg);
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

header {
    display: flex;
    justify-content: left;
    letter-spacing: 4px;

    margin-bottom: 10px;
    font-size: 30px;
}

main {
    min-height: 100vh;
    display: flex;
}

/* === Custom horizontal rule === */
.ui-hr {
    width: 100%;
    height: 2px;
    margin: auto;
    margin-bottom: 10px;
    background-color: var(--accent-two);
}

/* === Navbar === */
.navbar {
    display: flex;
    flex-direction: column;
    max-width: 200px;


    position: sticky;
    top: 10px;
    height: fit-content;
    /* padding: 10px; */
    gap: 10px;

    flex: 0 0 auto;
}

.navbar ul {
    margin: 0;
}

.navbar fieldset {
    display: flex;
    flex-direction: column;
    gap: 10px; 
    margin: 0;
    padding: 5px;
    max-height: 150px;
    overflow: auto;

    border: 2px solid var(--accent-two);
}

.navbar fieldset legend {
    font-size: 18px;
    font-weight: bold;
}

.site-updates-list {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 10px;
    list-style: none;
}

.nav-list {
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 10px; 
    padding: 0;
    list-style: none;
    letter-spacing: 4px;
    font-weight: normal;
}

/* === Footer === */
footer {
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr;
}

.badges {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 5px;
    padding: 5px;
    border: 2px solid var(--accent-two);
}

.badges legend {
    font-size: 18px;
    font-weight: bold;
}

/* === Content section === */
.content-section {
    flex: 1 1 auto;
    margin: 0 0 0 20px;
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: start;
}

/* === Homepage styles === */
.articles-heading {
    margin-bottom: 5px;
}

.articles-list p {
    margin: 5px 0 5px 0;
}

.articles-list {
    margin: 0;
    width: 100%;
    padding-left: 0;

    list-style-type: circle;
}

.articles-list h3 {
    margin: 0;
}

.articles-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;

    list-style-type: none;
    background-image: url("./img/ui/ul-image.png");
    background-repeat: no-repeat;
    background-size: 12px 12px;
    background-position: 0 50%;
    padding-left: 20px;
}

.articles-list time {
    margin-top: 5px;
}

/* === Past articles === */
.archive p {
    margin: 0;
}

.archive li {
    margin-bottom: 5px;
}

/* === Topics styles === */
.topics-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 25px;
    row-gap: 10px;
    width: fit-content;

    margin-top: 10px;
}

.topics-container figure img {
    width: 100px;
    flex-grow: 1;
    object-fit: contain;
}

.topics-container figure {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.topics-container figure, h3 {
    margin: 0;
    flex-shrink: 0;
    text-align: center;
}

.topics-container a {
    width: fit-content;
    padding: 5px;
    border: 2px solid var(--accent-two);
}

/* === Single topic styles === */
.single-topic-figure {
    margin: 0;
    margin-bottom: 10px;
    margin-top: 10px;
    width: fit-content;
}

.single-topic-figure img {
    width: 200px;
}

.single-topic-figure h2 {
    margin: 0;
    text-align: start;
}

/* === WWW badge === */

#www {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    margin-top: 20px;
}

#www-icon {
    width: 70px;
}


/* ======================================= */
/* === MOBILE PHONE STYLES === */
/* ======================================= */


@media screen and (max-width: 899px) {
    /* === Styles of global elements ===*/
    html {
        height: auto; 
    }

    a { color: var(--accent-one); }
    a:hover { color: var(--hover); }
    p { margin: 1% 0 1% 0; font-size: large;  }
    h1 { margin-top: 0; }

    body {
        /* systemfont stack */
        font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;
        color: var(--primary-text);

        height: auto;

        background-image: var(--background-image);
        background-position: top left;
        background-repeat: no-repeat;
        background-size: 100% 100%;
        background-attachment: fixed; 
    }

    .wrapper {
        width: 96%;
        margin: auto;

        background-color: var(--bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);

        border: 2% solid var(--bg);
        padding: 3%;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    }

    header {
        display: flex;
        justify-content: center;
        letter-spacing: 0.25rem;

        margin-bottom: 3%;
        font-size: 1.8rem;
    }

    main {
        min-height: auto;
        display: flex;
        flex-direction: column;
        padding-bottom: 15%;
    }

    /* === Custom horizontal rule === */
    .ui-hr {
        width: 100%;
        height: 0.25vh;
        margin: auto;
        margin-bottom: 2%;
        background-color: var(--accent-two);
    }

    /* === Navbar === */
    .navbar {
        display: flex;
        flex-direction: column;
        max-width: 100%;


        position: static;
        top: 1px;
        height: auto;
        /* padding: 10px; */
        gap: 10px;

        flex: 0 0 auto;
    }

    .navbar ul {
        margin: 0;
    }

    .navbar fieldset {
        display: flex;
        flex-direction: column;
        gap: 2%; 
        margin: 0;
        padding: 2%;
        overflow: auto;

        border: 2px solid var(--accent-two);
    }

    .navbar fieldset legend {
        font-size: 1.1rem;
        font-weight: bold;
    }

    .site-updates-list {
        display: flex;
        flex-direction: column;
        padding: 0;
        gap: 10px;
        list-style: none;
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        justify-content: start;
        gap: 10px; 
        padding: 0;
        list-style: none;
        letter-spacing: 4px;
        font-weight: normal;
    }

    /* === Footer === */
    footer {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .badges {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        column-gap: 0%;
        padding: 1%;
        padding-bottom: 2%;
        border: 2px solid var(--accent-two);
        justify-content: space-evenly;
    }

    .badges legend {
        font-size: 1.1rem;
        font-weight: bold;
    }

    .badges a {
        display: flex;
        justify-content: center;
    }

    /* === Content section === */
    .content-section {
        flex: 1 1 auto;
        margin: 0;
        margin-top: 4%;
        min-width: 0;

        display: flex;
        flex-direction: column;
        align-items: start;
    }

    /* === Homepage styles === */
    .articles-heading {
        margin-bottom: 2%;
    }

    .articles-list p {
        margin: 1% 0 1% 0;
    }

    .articles-list {
        margin: 0;
        width: 100%;
        padding-left: 0;

        list-style-type: circle;
    }

    .articles-list h3 {
        margin: 0;
        text-align: left;
    }

    .articles-list li {
        display: flex;
        flex-direction: column;
        align-items: start;
        justify-content: space-between;
        margin-bottom: 3%;

        list-style-type: none;
        background-image: url("./img/ui/ul-image.png");
        background-repeat: no-repeat;
        background-size: 12px 12px;
        background-position: 0% 20%;
        padding-left: 6%;
    }

    .articles-list time {
        margin-top: 5px;
    }

    /* === Past articles === */
    .archive p {
        margin: 0;
    }

    .archive li {
        margin-bottom: 5px;
    }

    /* === Topics styles === */
    .topics-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;

        column-gap: 5%;
        row-gap: 5%;
        justify-content: space-evenly;

        margin-top: 2%;
    }

    .topics-container figure img {
        width: 65%;
        flex-grow: 1;
        object-fit: contain;
    }

    .topics-container figure {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }

    .topics-container figure, h3 {
        margin: 0;
        flex-shrink: 0;
        text-align: center;
    }

    .topics-container a {
        width: fit-content;
        padding: 5%;
        border: 2px solid var(--accent-two);
    }

    /* === Single topic styles === */
    .single-topic-figure {
        margin: 0;
        margin-bottom: 5%;
        margin-top: 5%;
        margin-left: 6%;
        width: fit-content;
    }

    .single-topic-figure img {
        width: 100%;
    }

    .single-topic-figure h2 {
        margin: 0;
        text-align: start;
    }

    /* === WWW badge === */

    #www {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0;
        margin-top: 20px;
    }

    #www-icon {
        width: 70px;
    }
}