@import './normalize.css';

:root {
    /* sininen teksti linkeissä */
    --a-standard-text-color: #2772b0;
    /* vaaleanruskea teksti linkeissä */
    --a-text-color: #8b5e3c;
    /* valkoinen linkin tausta */
    /* --a-background-color: gray; */
    /* keskiruskea teksti */
    /* --p-text-color:#764C29; */
    /* tumma teksti mökkisivulla */
    /* --p-text-color: #603813; */
    /* musta teksti */
    --p-text-color: black;
    /* valkoinen leipätekstin tausta */
    --p-background-color: white;
    /* keltainen pääkappaleen leipätekstin tausta */
    --p-main-paragraph-background-color: #f8f0b6;
    /* harmaa marginaali */
    --main-border-color: #f1eee6;
    /* keltainen tausta */
    /* --main-background-color: #f8f0b6; */
    --main-background-color: white;
    /* vihreät pääotsikot */
    --h1-text-color: #8cc63f;
    /* tosi tummanharmaa 2-tason otsikko */
    --h2-text-color: rgb(17, 17, 17);
    /* tummanharmaa 3-tason otsikko */
    --h3-text-color: rgb(37, 37, 37);
    /* harmaa sidebar tausta */
    --sidebar-background-color: #e7e1d7;
    /* valkoinen sidebar reunus */
    --sidebar-border-color: #fff;
}
html {
    box-sizing: border-box;
    background-color: var(main-border-color);
    margin: 0;
    padding: 0;
    height: 100%;
}
*,
*:before,
*:after {
    box-sizing: inherit;
}
@font-face {
    font-family: 'Myriad Pro Regular';
    font-style: normal;
    font-weight: normal;
    src: local('Myriad Pro Regular'), url('./myriadpro-regular.woff') format('woff');
    /*  swap tells the browser that text using the font should be displayed immediately using a system font. */
    font-display: swap;
}
@font-face {
    font-family: 'Myriad Pro Light';
    font-style: normal;
    font-weight: normal;
    src: local('Myriad Pro Light'), url('./myriadpro-light.woff') format('woff');
    /*  swap tells the browser that text using the font should be displayed immediately using a system font. */
    font-display: swap;
}

/* PAGE CONTENT */
body {
    margin: 0;
    padding: 0;
    font-family: Myriad Pro Regular, sans-serif;
    text-size-adjust: auto;
    /* height: 100%; */
    /* overflow-x: hidden; */
}

/* GRID STYLE content container for main content */
.container {
    display: grid;
    /* grid-template-rows: auto; */
    /* grid-template-columns: auto; */
    /* grid-template-rows: repeat(auto-fit, minmax(30px, 1fr)); */
    grid-template-areas:
        'side'
        'content';
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-gap: 0;
}

/* GRID MAIN CONTENT */
main {
    grid-area: content;
    background-color: var(main-background-color);
}
.page-content {
    /* max-width: 1200px; */
    /* margin-top: 1vh; */
    margin-top: 10px;
    margin-bottom: 10px;
    /* margin-left: 8vw;
    margin-right: 8vw; */
    /* color: var(--p-text-color); */
}
.main-picture-container {
    width: 1vw;
    height: 1vh;
    position: relative;
}
.main-picture {
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    position: relative;
}
h1 {
    /* font-family: Myriad Pro Light, sans-serif;
    letter-spacing: 0.15vw;
    font-size: calc(24px + 45 * ((100vw - 320px) / 1280));
    margin: 0.4em 0;
    float: left; */
    color: var(--h1-text-color);
    text-align: center;
    /* display: none; */
    /* Centered text inside main image container */
    position: absolute;
    top: 50%;
    left: 50%;
}
p {
    /* font-size: 1.4em; */
    font-size: 1em;
    color: --p-text-color;
    background-color: var(--p-background-color);
}
.main-paragraph {
    background-color: var(--p-main-paragraph-background-color);
    padding: 1em;
    position: absolute;
}
a {
    color: var(--a-text-color);
}

.iframe-container {
    overflow: hidden;
    /* Calculated from the aspect ratio of the content (in case of 16:9 it is 9/16= 0.5625) */
    padding-top: 56.25%;
    position: relative;
}
.iframe-container iframe {
    border: 0;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

/* GRID SIDEBAR */
aside {
    grid-area: side;
    margin: 0;
    background-color: var(--sidebar-background-color);
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: space-between;
}
/* this is a hack to make aside stick to top of screen i.e. div is fixed, not aside around it */
/* aside div {
	position: fixed;
}*/

/* FLEXBOX SIDEBAR ITEMS */
.aside-item {
    /* aside > div is first child div, same as .aside-item */
    /* height: 3vh; */
    height: calc(30px + 10 * ((100vh - 200px) / 1000));
    /* width: auto; */
    /* width: 50vw; */
    /* width: calc(70px + 250 * ((100vw - 200px) / 1400)); */
    width: calc(70px + 250 * (100vw / 1600));
    text-decoration: none;
    border: #fff;
    border-style: solid;
    position: relative;
    flex-grow: 1;
    flex-shrink: 1;
}
.aside-item:hover {
    background-color: var(--main-background-color);
}
.aside-selected {
    background-color: var(--main-background-color);
}
a.normal-link {
    color: var(--a-standard-text-color);
    /* background-color: --a-background-color; */
    /* color: #8b5e3c; */
    /* text-decoration: none; */
}
.aside-link {
    position: absolute;
    height: 100%;
    width: 100%;
    font-size: calc(12px + 25 * ((100vmin - 200px) / 1400));
    color: --a-text-color;
    text-decoration: none; /* Remove underline from link */
    white-space: nowrap; /* Prevent link text from wrapping to next line */
}
.centered {
    /* text-align: center; EI TOIMI */
    /* Hack to make text in the middle both horizontal and vertical
	+ remember to put the next line to parent:
	position: relative;
	*/
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hidden-in-mobile {
    /* visibility: hidden; */
    display: none;
}
/* Footer */
.footer-text {
    text-align: center;
    font-size: 0.7em;
    color: var(--a-text-color);
}

/* MOBILE FLEXBOX CONTAINS ALL IMAGES ON TOP OF EACH OTHER - do nothing */

/* DESKTOP HAS TEXT AND IMAGES SIDE BY SIDE */
/* MEDIA QUERY FOR DESKTOP SIZES*/
@media only screen and (min-width: 1024px) {
    html {
        margin: 0 10%;
    }
    /* The main (yellow background) content container */
    .container {
        /* grid-template-columns: 4fr 1fr; */
        /* grid-template-columns: minmax(auto, 1600px) minmax(300px, auto); */
        /* grid-template-rows: auto; */
        grid-template-areas: 'content side';
        grid-template-columns: 4fr 1fr;
        grid-template-rows: auto;
        /* grid-gap: 0; */
        /* height: 100vh; */
        justify-content: center;
        align-items: stretch;
    }
    main {
        grid-area: content;
        /* max-width: 1600px; */
        margin: 0;
        /* background-color: #faf0b6; */
        background-color: var(--main-background-color);
    }
    .page-content {
        margin-top: 2em;
        /* margin-bottom: 50vh; */
        /* margin-left: 8vw;
        margin-right: 8vw; */
    }
    h1.sub-page-title {
        font-family: Myriad Pro Light, sans-serif;
        letter-spacing: 0.15vw;
        font-size: calc(24px + 45 * ((100vw - 320px) / 1280));
        /* color: var(--h1-text-color); */
        margin: 0.4em 0;
        float: left;
        text-align: center;
        display: initial;
    }
    /* Page content rows and columns of FLEX */
    .row {
        display: flex;
    }
    .cols-of-1-or-2 {
        flex: 50%;
        /* flex-wrap: nowrap; */
        padding: 20px 20px 0 0;
    }
    .cols-of-1-or-3 {
        flex: 33.33%;
        margin-top: 20px;
        margin-bottom: 20px;
        margin-right: 20px;
    }
    .cols-of-1-or-3:last-child {
        margin-top: 20px;
        margin-bottom: 20px;
        margin-right: 0;
    }
    /* Footer */
    .footer-text {
        font-size: 1em;
    }

    /* DESKTOP SIDEBAR */
    aside {
        /* the next one did not work in making asside sticky to the top of page */
        /* position: -webkit-sticky;
		position: sticky;
		top: 0; */
        grid-area: side;
        flex-direction: column;
        justify-content: space-around;
        /* width: 330px; */
        /* width: 20vw; */
        /* min-width: 400px; */
        margin: 0;
        background-color: var(--sidebar-background-color);
        display: block;
    }
    .aside-item {
        /* height: 100px; */
        /* the next hack to make aside stick to top does not work */
        /* position: -webkit-sticky;
		position: sticky;
		top: 0; */
        height: 6vh;
        min-height: 30px;
        /* width: auto; */
        text-decoration: none;
        align-items: center;
        border: var(--sidebar-border-color);
        border-style: solid;
        position: relative;
    }
    .hidden-in-mobile {
        /* visibility: visible; */
        display: grid;
    }
}
