/* by Berry Nieskens */
/* www.nieskens.nl */


/**************/
/* VARIABLES */ 
/************/

:root {
    color-scheme: light dark;
    /* vars for light and dark mode */
    --highlight: hsl(35, 100%, 50%);
    --borderRadius: 1rem;
    --padding-left: 2em;
    --preferred-color-scheme: dark;
}


/* DARK MODE variables */
@media screen and (prefers-color-scheme: dark) {
    :root {
        --preferred-color-scheme: dark;
        --primary: hsl(213, 100%, 92%); /* text color */
        --secondary: hsl(213, 50%, 10%); /* sections bg */
        --body-bg: hsl(213, 50%, 15%); /* body bg */
        --shadow: 0px 3px 5px 0px hsl(0, 0%, 5%); /* cards shadow */   
    }
}

/* LIGHT MODE variables */
@media screen and (prefers-color-scheme: light) {
    :root {
        --preferred-color-scheme: light;
        --primary: hsl(213, 100%, 15%); /* text color */
        --secondary: hsl(213, 50%, 93%); /* sections bg */
        --body-bg: hsl(213, 20%, 97%); /* body bg */
        --shadow: 0px 3px 5px 0px hsl(0, 0%, 67%); /* cards shadow */
    }
}

/* PRINT MODE variables*/
@media print {
    :root {
        --preferred-color-scheme: grayscale;
        --primary: hsl(0, 0%, 0%);
        --secondary: hsl(0, 0%, 100%);
        --body-bg: none;
        --highlight: hsl(35, 100%, 40%);
        --shadow: none;  
    }
}

/* DESKTOP */

@media screen and (min-width: 801px) {
    footer ul li:first-of-type {
        display: none;
    }

    main {
        display: flex;
    }

    main section {
        padding-left: 2.5em;
    }
    aside {
        width: 20em;
        background-color: var(--secondary);
        padding-top: 7em;
        padding-right: 1em;
        margin-left: 0em;
    }

    section#links ul {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: end;
        gap: 0em;
    }

    footer {
        position: fixed;
        bottom: 0;
    }

    footer ul li.hamburger button {
        height: 3em;
    }
}


/**********/
/* FONTS */
/********/

/* BODY font */
@font-face {
    font-family: Open Sans Regular;
    src: url(fonts/OpenSans/OpenSans-Regular.ttf);
}

/* H1 font */
@font-face { 
    font-family: Press Start Regular;
    src: url(fonts/Press_Start_2P/PressStart2P-Regular.ttf);
}

/* H2 & H3 font */
@font-face {
    font-family: Open Sans Bold;
    src: url(fonts/OpenSans/OpenSans-Bold.ttf);
}

/* H4 en medai-name font */
@font-face{
    font-family: Open Sans Light Italic;
    src: url(fonts/OpenSans/OpenSans-LightItalic.ttf);
}

/* Creative Commons font */
@font-face {
    font-family: 'CC-ICONS';
    font-style: normal;
    src: url('fonts/cc-icons.ttf') format('truetype');
}


/*********/
/* BODY */
/*******/

/* by Jen Simmons */
*, *::before, *::after {
    box-sizing: border-box;
  }
/* github.com/jensimmons/cssremedy */

body {
    color-scheme: light dark;
    font-family: Open Sans Regular;
    background-color: var(--body-bg);
    color: var(--primary);
    line-height: 1.7em;
    margin: 0 0;
    /* hide horizontal scroll bar */
    overflow-x: hidden;
}

main {
    padding-bottom: 2em;

}
/************/
/* ANCHORS */
/***********/

a {
    display: block;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary);
    border-bottom: 2px solid var(--highlight);
    width: max-content;
    padding: .2em .1em .2em .1em;
    transition: all .1s ease-in;
}

a:hover, a:focus {
    color: var(--secondary);
    background-color: var(--primary);
    border-bottom: 2px solid var(--highlight);
}

a:active {
    background-color: var(--highlight);
    padding: unset;
}

p a {
    display: unset;
    font-size: unset;
    font-style: unset;
    font-weight: unset;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--highlight);
    border-bottom: unset;
    color: var(--primary);
    padding: unset;
    text-underline-offset: .3em;

}

article p a:hover, article p a:focus {
    color: var(--highlight);
    background-color: unset;
    padding: unset;
}


/***********/
/* HEADER */
/*********/

header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .2em;
    padding: .5em 2em 1em 2em;
    margin-bottom: 2em;
    /* position: sticky; */
    /* top: 0; */
    color: var(--primary);
    text-align: center;
    border-top: 2px solid var(--highlight);
    background-color: var(--secondary);
}

h1 {
    font-family: Press Start Regular;
    font-size: 1.2em;
    line-height: 1.6em;
    letter-spacing: .1em;
}

header p {
    margin: -1em 0 0 0;
    font-size: 1em;
    font-weight: 500;
    letter-spacing: .1em;
    color: var(--highlight);
    text-align: center;
}

header ul {
    display: flex;
    justify-items: center;
}



/*********/
/* ASIDE */
/*********/

main aside {
    text-align: end;
}

/* Nav external links */
main aside section li {
    margin-bottom: 1em;
}

/* nav buttons */
nav button {
    cursor: pointer;
    padding: .6em 1.2em;
    color: var(--primary);
    background: var(--secondary);
    border: 1px solid var(--highlight);
    border-radius: 1.5em;
    text-transform: uppercase;
    font-weight: bold;
}

nav button:hover {
    background-color: var(--highlight);
    color: var(--primary);
}

nav button:active {
    background-color: var(--highlight);
}


/************/
/* SECTION */
/**********/

section {
    padding: 1em 1.5em;
    margin: 0;
    background-color: var(--secondary);
}

section.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 20px;
    padding-bottom: 4em;
}

h2 {
    grid-column: 1 / -1;
    margin: .5em 0 0 0;
    padding: 0 0 0 .6em;
    font-family: Open Sans Bold;
    font-weight: 500;
    font-size: 1.4rem;
    line-height: 1.4em; 
    border-left: 2px solid var(--highlight);
}



/************/
/* ARTICLE */
/**********/

article {
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    background-color: var(--body-bg);
    padding: 3em 2em 3em 3em;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

h3 {
    font-family: Open Sans Bold;
    font-weight: 400;
    line-height: 1.3em;
}

.media-name {
    font-family: Open Sans Light Italic;
    margin-bottom: 0.1em;
    margin-top: -1em;
}

ul {
    list-style-type: none;
    padding: 0px;
}

article p:last-of-type {
    margin-bottom: 2em;
}

article a {
    margin-top: auto;
    align-self: end;
}


/************/
/* FOOTER */
/**********/

footer {
    padding: 0 2em .5em 2em;
    width: 100vw;
    background-color: var(--secondary);
    border-top: 2px solid var(--highlight);
}

footer a {
    text-decoration: none;
    border: none;
}

footer ul {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: .5em;
    letter-spacing: 0.2em;
}

footer ul li.creativeCommons {
    font-family: 'CC-ICONS';
    font-size: 1.4rem;
    line-height: 1em;
    letter-spacing: 0.1em;
}   

/* HAMBURGER MENU BUTTON */
/* based on code by Sanne 't Hooft */
/* https://codepen.io/shooft/pen/dymRMBZ */

footer ul li.hamburger {
    padding-right: 1em;
    margin-right: auto;
}   

footer ul li.hamburger button {
    height: 3em;
    text-indent: 150%; /* hide menu text */
    overflow: hidden; /* hide menu text */
    border: none;
    background-color: var(--secondary);
    cursor: pointer;
    color: var(--primary);
    font-size: .75em;
    display: grid;
    grid-template-rows: 1fr min-content;
    
}

footer ul li.hamburger button span {
    grid-row-start: 1;
    grid-column-start: 1;
    place-self: end center;
    width: 1.4rem;
    height: .1rem;
    background-color: var(--highlight);
    transition-duration: .5s;
}

footer ul li.hamburger button span:nth-of-type(1) {
    transform:translateY(-.8rem);
}

footer ul li.hamburger button span:nth-of-type(2) {
    transform:translateY(-.4rem);
}

footer ul li.hamburger button span:nth-of-type(3) {
    /* staat op de juiste plek */

}

footer ul li.hamburger button.menuOpen span:nth-of-type(1) {
    transform: translateY(-.4rem) rotate(45deg) scalex(1.25);
}

footer ul li.hamburger button.menuOpen span:nth-of-type(2) {
    opacity: 0;
}

footer ul li.hamburger button.menuOpen span:nth-of-type(3) {
    transform: translateY(-.4rem) rotate(-45deg) scalex(1.25);
}


/**************/
/* RESPONSIVE */
/**************/

/* MOBILE */

@media screen and (max-width: 800px) {
    aside {
        display: block;
        position: fixed;
        padding-bottom: 1em;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        border-top: 2px solid var(--highlight);
        background-color: var(--secondary);
        transform: translateY(100%);
        transition: .3s ease-in-out;
    }

    aside nav {
        display: flex;
        justify-content: space-evenly;
        background-color: var(--secondary);
    }
    aside nav section {
        padding-left: 1em;
        text-align: start;
    }

    aside.openNav {
        transform: translateY(-3em);
    }

    section#links ul {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: start;
        gap: 0;
    }

    footer {
        position: fixed;
        bottom: 0;
        border-top: 2px solid var(--highlight);
        transition: .1s;
    }

    footer.noTopBorder {
        border-top: 2px solid var(--secondary);
    }

}



/* https: //a11y-guidelines.orange.com/en/articles/accessible-hiding/ */
.visually-hidden {
    position: absolute;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
/* External-link icon (inline SVG, replaces Font Awesome) */
.icon-external {
    width: 0.75em;
    height: 0.75em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: baseline;
}
