
/* This is my first proper css file */

/*  Sets all paddings, margins to 0 and box-sizing to border box which 
    makes padding and border included in the height and width
*/
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Body with a 100 vh(viewport height) min-height
    and set to display flex to center the content
    on homepage and cv page
*/

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    padding: 10px;
    display: flex;
}

h1 {
    margin: 30px 0;
}

/* Heading font */

h1,
h2 {
    font-family: Georgia, 'Times New Roman', Times, serif;
}

/* Paragraph font, color and background color */

p {
    font-family: Arial, Helvetica, sans-serif;
    color: rgb(24, 24, 24);
    background-color: bisque;
}

/* Link font */

a {
    font-family: Arial, Helvetica, sans-serif;
}

/* Flex container for centering content on the home and cv page with 1200px max-width*/

.container {
    max-width: 1200px;
    margin: 0 auto;
    color: white;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

/*  Navigation container on the homepage with a 700px max-width, 
    overflow: hidded prevents the nav bar from collapsing 
    when it has float child elements. This makes content
    within the parent container fit 100% of width and horizontally centres 
    the content
*/

nav {
    overflow: hidden;
    width: 100%;
    max-width: 700px;
    margin: 20px auto;
}


/* Unordered List on homepage. It specifies the type of box an element should generate
i.e. block-level flex container box that that alligns content along the main axis*/

nav ul {
    display: flex;
    justify-content: center;
}

/* List Items of Unordered List on homepage*/

nav li {
    list-style-type: none;
    float: left;
    margin: 10px;
    width: 33%;
    text-align: center;
}

/* Navigation Buttons on hompage with 2px border and 10px border-radius and smoke white background */

.link a {
    text-decoration: none;
    color: black;
    font-weight: 600;
    padding: 10px;
    display: block;
    background-color: rgb(245 245 245 / 60%);
    border: 2px solid rgb(255, 255, 255);
    border-radius: 10px;
}

/* Changes background color of nav buttons when clicked to 100% */

.link a:active {
    background-color: rgb(245 245 245 / 100%);
}


/* Centered Portfolio and Project Container with a 1000px max-width, text aligned to center, bisque background and 20px padding on top and bottom*/

.myWeek {
    margin: 0 auto;
    background-color: bisque;
    border-width: 3px;
    border-style: solid;
    border-radius: 10px;
    border-color: rbg(100, 100, 100);
    max-width: 1000px;
    text-align: center;
    padding: 20px 0;
}


/*  Sets the padding for the Portfolio and Project Container's paragraph 
    (30px on top and bottom, 20% on left and right) 
*/

.myWeek p {
    padding: 30px 20%;
}


/*  Sets the margin for the Portfolio and Project Container's Heading 3 
    (30px on top and bottom, 0 on left and right) 
*/
.myWeek h3 {
    margin: 30px 0;
}

/* Sets the apperance of the chart */

.chart {
    background-color: white;
    width: 380px;
    margin: 0 auto;
    border-width: 4px;
    border-style: solid;
    border-radius: 10px;
}


/* Homepage Textbox with aligned text, 700px max-width, transparent whitesmoke background and 30px padding*/
.textbox {
    background-color: #f5f5f599;
    margin: 0 auto;
    max-width: 700px;
    padding: 30px;
    text-align: center;
    color: black;
    display: inline-block;
}

/* sets the appearance of week 10 & 11 images of machine learning*/
#img1 {
    width: 330px;
    height: 250px;
    border-width: 4px;
    border-style: solid;
    border-radius: 10px;
    border-color: black;
    text-align: centre;
    display: flex;
    justify-content: center;
    flex-direction: column;
}
    

/* Week 1, Week 2,.. Box with 30px padding, 20px margin on top and bottom with centered text */

.blackbox {
    display: block;
    padding: 30px;
    background-color: black;
    text-align: center;
    color: white;
    margin: 20px 0;
}

/* Background apperance for all pages */

.bg {
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-attachment: fixed;
}

/* Background Image Sources */

/* Home Background Image*/

#home-bg {
    background-image: url('homepagebackground.jpg');
}

/* CV Background Image*/
#cv-bg {
    background-image: url('CVbackground.jpg');
}

/* Portfolio Background Color and transtition*/

#portfolio-bg {
    background-color: plum;
    transition: 0.5s;
}


/* Project Background Image positioned to top with a 135% size */

#project-bg {
    background-image: url('bigben.jpg');
    background-size: 135%;
    background-position: top;
}

/* CV box with black border and 100% width*/

#cv {
    border: 5px solid black;
    font-size: 0;
    width: 100%;
}

/* 3x3 Chart grid with 3 columns, 30px gap and padding*/

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

/* 2x2 Chart grid with 2 columns, 30px gap and padding*/
.chart-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

/* Removes right padding of chart */

.vega-embed.has-actions {
    padding-right: 0 !important;
}

/* Sets Chart Canvas to 100% width and height, 15px border-radius amd 10px padding*/

.marks {
    width: 100% !important;
    height: 100% !important;
    border-radius: 15px;
    padding: 10px;
    background-color: white;
}


/* These media queries apply different styles depending on the width of the screen */

/* When screen width is 1000px or smaller, the project's background will be set to cover to fill the whole screen */

@media only screen and (max-width: 1000px) {
    #project-bg {
        background-size: cover;
    }
}

/* When screen width is 768px or smaller: 
the 3x3 chart grid will be set to 2 colums and padding to 20px, font-size for h1, h2, h3, p will be reduced
*/

@media only screen and (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr 1fr;
        padding: 20px;
    }

    h1 {
        font-size: 25px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    p,
    span {
        font-size: 15px;
    }

    .myWeek p {
        padding: 20px;
    }

    .myWeek h3 {
        margin: 15px;
    }

    /* Changes the direction of the Menu on the homepage from row to column */

    ul {
        flex-direction: column;
    }

    /* Sets the hompage list items to full width and 10px margin to top and bottom */

    nav li {
        margin: 10px 0;
        width: 100%;
    }

}

/*  When screen width is 600px or smaller, 
    the 3x3 chart grid is set to 1 colums
    and the charts width to auto and 10px margin
*/

@media only screen and (max-width: 600px) {
    .chart {
        width: auto;
        margin: 10px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }
}
