@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

/* General css */
body {
    font-family: 'DM Sans', sans-serif;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    height: 100vh;
}
  
main {
    display: grid;
    gap: 1rem;
    grid-template-rows: repeat(3, 1fr);
    grid-template-columns: repeat(4, 1fr);
    max-width: 1000px;
    padding: 2rem;
    height: 80vh;
}

/* Section */
.left-section {
    display: flex;
    flex-direction: column;
    grid-column: 1/2;
    grid-row: 1/4;
    gap: 25px;
    text-align: center;
    height: 100%;
    margin-bottom: 0;
}

/* Articles   */
article {
    background: white;
    color: hsl(0, 0%, 7%);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

article h1 {
    margin: 0;
    font-size: 30pt;
    font-weight: 500;
}

article h2 {
    margin: 0;
    font-size: 20pt;
    font-weight: 500;
    line-height: 0.9;
}


article h3 {
    font-size: 60px;
    margin: 0;
}

article p {
    font-size: 18px;
    margin: 0;
}

article img {
    width: 100%;
    max-width: 200px;
    margin: 20px auto;
}

/* Specific articles */
#first {
    background-color: hsl(31, 66%, 93%);
    height: 100%;
    line-height: 4;
}

#second {
    background-color: hsl(39, 100%, 71%);
    height: 100%;
}

#first h2, #second h2 {
    line-height: 1.3;
}

#third {
    background: hsl(256, 67%, 59%);
    color: hsl(0, 0%, 100%);
    text-align: center;
    grid-row: 1/2;
    grid-column: 2/4;
    height: 80%;
}

#third img{
    margin: 0;
}

#fourth {
    grid-row: 2/3;
    grid-column: 2/3;
}

#fifth { 
    background-color: hsl(39, 100%, 71%);
    grid-row: 2/3;
    grid-column: 3/4;
    overflow: hidden;
    position: relative;
}

#fifth img {
    object-fit: cover; 
}

#sixth {
    grid-row: 3/4;
    grid-column: 2/3;
}

#seventh {
    background-color: hsl(256, 67%, 59%);
    color: hsl(0, 0%, 100%);
    grid-row: 3/4;
    grid-column: 3/5;
    display: flex;
    align-items: center;
    gap: 15px;
}

#eighth {
    background-color: hsl(254, 88%, 90%);
    grid-row: 1/3;
    grid-column: 4/5;
    overflow: hidden;
    position: relative;
}

#eighth img {
    all: unset;
    height: 250px;
    object-fit: cover;
    margin: 20px 0;
}

@media (min-width: 360px) and (max-width: 640px) {
    main {
        display: flex;
        flex-direction: column;
        overflow-y: scroll;
        gap: 30px;
    }

    article h2 {
        font-size: 15pt;
    }

    .left-section {
        display: contents;
    }

    #third {
        height: fit-content;
        order: 1;
    }

    #third img {
        margin: 10px;
    }
    
    #fourth {
        order: 2;
    }

    #fifth {
        display: flex;
        height: fit-content;
        flex-direction: column;
        position: relative;
        min-height: 150px;
        order: 3;
    }

    #fifth img {
        object-fit: cover; 
    }

    #eighth {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 350px;
        order: 4;
    }
    
    #eighth img {
        all: unset;
        margin: 20px;
        width: 250px;
    }
    #seventh {
        display: block;
        text-align: center;
        order: 5;
    }
    #sixth {
        order: 6;
    }
    #first {
        height: 180px;
        order: 7;
    }
    #second {
        height: fit-content;
        order: 8;
    }
}
