* {
    margin: 0; padding: 0; border: 0; box-sizing: border-box;
}

body {
    background-color: #456;
    color: #eee;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

h1 {
    text-align: center;
    text-decoration: underline;
    font-size: 14pt;
    font-weight: normal;
    color: #89a;
    margin-top: 20px;
}

nav {
    display: flex;
    list-style-type: none;
    justify-content: space-evenly;
    margin-top: 20px;
    gap: 12px;
    flex-flow: row wrap;
    margin-left: 20px;
    margin-right: 20px;
}

nav > a {
    background-color: yellow;
    padding: 12px 16px; 
    flex: 0 0 auto;  
    text-align: center;
    text-decoration: none;
    color: #222;
    font-weight: bold;
}

main {
    /* min-height: 400px; */
    position: absolute; top: 50%; width: 100%;
    transform: translatey(-50%);
    display: flex;
    flex-flow: row wrap;
    justify-content: space-evenly;
}

/* child selector */

main > div {
    background-color: pink;
    flex: 0 0 30%;
    aspect-ratio: 1/1;
}

#featured {
   position: relative;
   background-color: transparent;
}

#featured > div {
    width: 45%;
    height: 45%;
    background-color: yellow;
    position: absolute;
}

#featured > div:nth-child(1) {
    top: 0; left: 0;
}

#featured > div:nth-child(2) {
    top: 0; right: 0;
}

#featured > div:nth-child(3) {
    bottom: 0; left: 0;
}

#featured > div:nth-child(4) {
    bottom: 0; right: 0;
}

/* styles for mobile devices */

@media screen and (max-width: 750px) {

    nav > a {
        flex: 0 0 40%;
    }

    main {
        /* min-height: 400px; */
        position: static; /*reverts back to default*/
        transform: translatey(0%);
        padding-top: 40px;
    }
    
    /* child selector */
    
    main > div {
        flex: 0 0 90%;
        
    }
    
    #featured {
       position: relative;
       background-color: transparent;
       margin-top: 40px;
    }
    
    #featured > div {
        width: 45%;
        height: 45%;
        background-color: yellow;
        position: absolute;
    }
    
    #featured > div:nth-child(1) {
        top: 0; left: 0;
    }
    
    #featured > div:nth-child(2) {
        top: 0; right: 0;
    }
    
    #featured > div:nth-child(3) {
        bottom: 0; left: 0;
    }
    
    #featured > div:nth-child(4) {
        bottom: 0; right: 0;
    }

}

/* end of mobile styles================================================ */
