/*CSS animation to play game button*/
@keyframes glow-button {
    0% {
        background-color: rgb(130, 183, 130);
    }

    50% {
        background-color: rgb(39, 230, 39);
        transform: scale(1.1);
    }

    100% {
        background-color: rgb(130, 183, 130);
        transform: scale(1);
    }
}

/*Specific color to the nav menu section*/
nav > ul > li:nth-child(1) > a {
    color: rgb(133, 227, 246);
}

/*Grid styles for top part/headline*/
#headline {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 2fr 1fr;
}

/*Preventing overflow within chosen shapes*/
figure {
    overflow: hidden;
}

/*The landscape image*/
#headline > figure {
    height: 170px;
    grid-column: 1 / 6;
    grid-row: 1 / 3;
}

/*Styles for the title box*/
h1 {
    padding-bottom: 5px;
}

h1 + p,
#motivation > a {
    font-size: 1.2rem;
}

#title {
    grid-column: 2 / 5;
    grid-row: 2 / 4;
    border-radius: 10px;
    margin-bottom: 50px;
    box-shadow: 6px 6px 20px 7px rgb(72, 72, 72);
}

#title,
blockquote {
    padding: 20px;
    background-color: rgba(169, 169, 169, 0.856);
}

/*Styles for intro text and images*/
#intro figure {
    width: 25%;
}

#intro p {
    width: 65%;
}

#intro > div,
aside {
    justify-content: space-between;
}

/*Common styles for content*/
#intro,
#manny-talking {
    margin-top: 20px;
}

#intro > div > *,
#manny-talking > *,
aside > * {
    align-self: center;
}

#intro > div,
#manny-talking,
aside {
    display: flex;
    flex-wrap: wrap;
}

#intro > div,
#manny-talking,
#consequences {
    margin: 15px;
}

/*Styles for article*/
 
h1 + p,  
#consequences p, 
#motivation > a {
    text-align: center;
}

#manny-talking {
    justify-content: center;
    gap: 1rem;
}

#manny-talking figure {
    width: 37%;
}

#manny-talking p {
    width: 57%;
}

/*Common styles for article and motivation*/

#manny-talking p,
#manny-talking + p,
#motivation > p:last-of-type {
    background-color: rgb(147, 208, 219);
    padding: 30px;
}

#manny-talking p {
    border-radius: 70px 0 70px 0;
}

#manny-talking + p,
#motivation > p:last-of-type {
    border-radius: 0 70px 0 70px;
}

#manny-talking + p,
#motivation > p,
aside {
    margin: 20px 35px;
}

/*Button for game*/
#motivation > a {
    display: block;
    border-radius: 40px;
    margin: 30px auto;
    color: black;
    padding: 10px 40px;
    box-shadow: 5px 5px 7px black;
    animation: glow-button 2s infinite;
}


/*Styles for the consequence part*/
#consequences {
    margin-top: 40px;
}

#consequences figure {
    max-width: 80%;
    margin: 10px auto;
    box-shadow: 5px 5px 10px 4px rgb(72, 72, 72);
    border-radius: 30px 0 30px 0;
    margin-bottom: 10px;
}

#consequences p {
    border-bottom: 2px solid #474747;
    margin: 40px auto;
    padding-bottom: 20px;
}

#consequences figcaption {
    margin: 5px;
    font-size: .7rem;
}

/*Aside/quote styles*/
aside > figure {
    width: 30%;
    margin: 0 auto;
}

blockquote {
    border-radius: 0 30px 30px 30px;
}

/*Common size values*/
#motivation > a,
aside > div {
    width: 50%;
}

/****Adjustments for the smallest screens****/
@media screen and (max-width: 340px) {
    #intro > div {
        display: block;
    }

    #intro p {
        width: 100%;
    }

    #intro figure {
        width: 35%;
        margin: 0 auto;
    }

    #intro p {
        text-align: center;
        margin-top: 10px;
        margin-bottom: 30px;
    }

    #motivation > a {
        width: 70%;
    }
}

/****Combined layouts for smallest phones and smallest desktops****/
@media screen and (max-width: 340px), 
(min-width: 600px) and (max-width: 850px) {
    #manny-talking,
    aside {
        display: block;
    }

    #manny-talking figure {
        width: 60%;
    }

    #manny-talking p {
        width: 100%;
    }

    #manny-talking figure,
    aside > div {
        margin: 0 auto;
    }

    aside > div {
        width: 90%;
    }

    aside > div > p {
        text-align: center;
    }

    aside > figure {
        width: 45%;
    }
}

/****Desktop and ipad design****/
@media screen and (min-width: 600px){
    main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
                "head head"
                "intro article"
                "mot article"
                "quote article"
                ". article";
        grid-gap: 2rem;
    }

    h2 {
        margin: 0;
    }

    #headline {
        grid-area: head;
    }

    #intro {
        grid-area: intro;
    }

    article {
        grid-area: article;
    }

    article > h2 {
        text-align: right;
    }

    #motivation > h2 {
        text-align: left;
    }

    #motivation {
        grid-area: mot;
    }

    aside {
        grid-area: quote;
        margin-top: 60px;
    }

    #consequences figure {
        width: 70%;
        margin-bottom: 20px;
        margin-top: 25px;
    }

    #motivation > a:hover {
        background-color: rgb(209, 234, 209);
    }
}

/*Some adjustments for the largest screens*/
@media screen and (min-width: 950px) {
    main {
        grid-template-columns: 1fr 1.5fr;
    }

    #manny-talking {
        gap: 2rem;
    }

    #manny-talking figure,
    #manny-talking p {
        width: 45%;
    }

    #manny-talking p {
        align-self: center;
    }

    #consequences {
        display: grid;
        justify-content: center;
        align-content: center;
        grid-template-columns: 1fr .7fr;
    }

    #consequences > * {
        align-self: center;
    }

    #consequences figure {
        grid-column: 1 / 2;
    }

    #consequences p {
        grid-column: 2 / 3;
        border-bottom: 0;
    }

}