:root{
    --backgroundBody- : #f8f8f8;
    --backgroundHtml-: #000000;
    --colorBorderH1-: #b61a1f;
    --colorLinkNav-: #000000;
    --colorSpanH2-: #b61a1f;
    --backgroundFigcaption-: rgba(183, 26, 31, 0.5);
    --colorFigcaption-: #f8f8f8;
    --borderAside-:rgba(183, 26, 31);
    --colorLinkAside-: rgb(7, 7, 201);
    --colorBorderFooter-: #b61a1f;
}

*{
    box-sizing: border-box;
}

body, header, main, h1, h2, h3, nav, footer, span, figure, figcaption, i, img, aside, section, a{
    margin: 0;
}

html{
    background-color: var(--backgroundHtml-);
}

body{
    font-family: 'Open Sans', sans-serif;
    background-color: var(--backgroundBody-);
    width: 1100px;
    margin: auto;
    padding: 0 100px;
}

.wrapper{
    flex-direction: column;
}

.wrapper, 
header, 
main, 
h1::after, 
footer, 
footer::before{
    width: 100%;
}

.wrapper, 
h1, 
nav, 
nav section:last-of-type, 
main section + section figure, 
main section + section + div, 
main section + section + div > section, 
main section + section + div section > div:nth-child(1),
.secondFourPicture, 
.lastPictures{
    display: flex;
}

.wrapper, 
h1, 
nav, 
main section + section figure{
    align-items: center;
}

h1, 
main section + section figure{
    justify-content: center;
}

nav section:last-of-type img, 
main section + section figure, 
main section + section img, 
.firstPictures img, 
.secondFourPicture img, 
.lastPictures img{
    width: 100%;
    height: 100%;
}


nav section:last-of-type img, 
main section + section img, 
.firstPictures img, 
.secondFourPicture img, 
.lastPictures img{
    object-fit: cover;
}

a{
    text-decoration: none;
}

a:hover{
    text-decoration: underline;
}

a, 
h2 span{
    font-weight: bold;
}

h1,
nav, 
main section + section{
    margin-bottom: 15px;
}

h1, 
main section + section, 
footer{
    position: relative;
}

h1::after, 
footer::before{
    content: "";
    height: 1px;
}

h1::after,
main section figcaption, 
footer::before{
    position: absolute;
}

h1, 
main section figcaption{
    padding: 10px;
}

/* ----------------------- HEADER ---------------------- */
/* -------- CONFIG H1 -------------*/
h1::after{
    bottom: 0;
    background-color: var(--colorBorderH1-);
}

h1 img{
    display: inline;
    width: 125px;
}

/* --------- CONFIG NAV ------------ */
nav{
    justify-content: space-between;
}

nav section:first-of-type a{
    color: var(--colorLinkNav-);
    margin-right: 10px;
    font-size: 0.9rem;
}

nav section:last-of-type figure{
    height: 25px;
    width: 25px;
    margin-left: 10px;
}
/* ------------------------------------------------ END HEADER ------------------------------------------------------ */

/* --------------------------------------------- MAIN ------------------------------------------------------ */
/* -------- SECTION PRESENTATION ------------*/
h2 span{
    color: var(--colorSpanH2-);
}

/* ---------SECTION IRON MAN ----------------*/
main section figcaption{
    top: 0;
    left: 0;
    background-color: var(--backgroundFigcaption-);
    color: var(--colorFigcaption-);
    font-weight: 900;
    font-size: 1.7rem;
}

/* -------- SECTION PICTURE HERO ------------- */
main section + section + div > section {
    flex-direction: column;
    width: 612px;
}

/* ---------CONTAINER FIRST 5 PICTURES------ */
.firstPictures figure, .secondFourPicture, .lastPictures{
    flex-wrap: wrap;
}

.secondFourPicture, .lastPictures{
    gap: 10px;
}

/* FIRST PICTURE */
.firstPictures {
    margin-right: 10px;
}

.firstPictures figure{
    width: 300px;
    height: 300px;
}

/* PICTURE 2 to 4*/
.secondFourPicture figure, 
.lastPictures figure{
    width: 145px;
    height: 145px;
}

/* PICTURES FOLLOWING */
.second-picture-widow, 
.second-picure-hawkeye, 
.second-picure-captain-america, 
.second-picure-thor, 
.second-picure-hulk{
    display: none;
}

.lastPictures{
    margin-top: 10px;
}

/* --------- SECTION ASIDE ---------------- */
aside {
    width: 270px;
    border: 1px var(--borderAside-) solid;
    height: 300px;
    padding: 15px;
    margin-left: 15px;
    font-size: 0.9rem;
}

aside a{
    color: var(--colorLinkAside-);
}

aside a:first-of-type{
    margin-bottom: 25px;
    display: block;
}

/*----------------------------------------------- footer ------------------------------------------------------*/
footer{
    margin-top: 25px;
}

footer::before{
    top: 0;
    background-color: var(--colorBorderFooter-);
}

footer p{
    text-align: center;
}

/*---------------------------------------------- media queries ---------------------------------------------------*/
@media screen and (max-width: 1599px) and (min-width: 960px) {
    body{
        width: 960px;
        padding: 25px;
    }

    .first-picture-widow, .first-picure-hawkeye{
        display: none;
    }

    .second-picture-widow, .second-picure-hawkeye{
        display: block;
    }

    main section + section + div > section {
        width: 500px;
    }

    aside{
        width: auto;
    }
}

@media screen and (max-width: 959px){
    .second-picture-widow, .second-picure-hawkeye{
        display: block;
    }

    .first-picture-widow, .first-picure-hawkeye{
        display: none;
    }
}

@media screen and (max-width: 959px) and (min-width: 768px) {
    body{
        width: 768px;
        padding: 25px;
    }

    main section + section + div section > div:nth-child(1){
        flex-direction: column;
    }

    main section + section + div > section {
        width: 340px;
    }

    .firstPictures {
        margin-right: 0;
        margin-bottom: 10px;
    }

    aside{
        height: 350px;
    }
}

@media screen and (max-width: 767px){
    body, 
    main section + section + div section, 
    aside{
        width: 100%;
    }
    
    body{
        padding: 25px;
    }

    main section + section + div {
        flex-direction: column-reverse;
        align-items: center;
    }

    h1 span, 
    main section + section + div section > div:nth-child(1){
        display: none;
    }

    .second-picure-captain-america, .second-picure-thor, .second-picure-hulk{
        display: block;
    }

    .lastPictures{
        justify-content: center;
    }

    .lastPictures figure{
        width: 49%;
        height: auto;
    }

    aside{
        display: flex;
        padding: 10px;
        height: auto;
        margin-left: 0;
        margin-bottom: 15px;
    }

    aside div{
        width: 50%;
    }

    aside div:first-of-type{
        padding-right: 25px;
    }

    aside div:last-of-type{
        padding-left: 25px;
    }
}

@media screen and (max-width: 570px){
    .lastPictures figure{
        width: 100%;
        height: auto;
    }

    main section figcaption{
        font-size: 0.9rem;
    }


    aside{
        flex-direction: column;
    }

    aside div{
        width: 100%;
    }

    aside div:last-of-type{
        padding-right: 25px;
        padding-left: 0;
    }
}