@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /*Primary color*/
    --Soft-orange: hsl(35, 77%, 62%);
    --Soft-red: hsl(5, 85%, 63%);
    /*Neutral color*/
    --Off-white: hsl(36, 100%, 99%);
    --Grayish-blue: hsl(233, 8%, 79%);
    --Dark-grayish-blue: hsl(236, 13%, 42%);
    --Very-dark-blue: hsl(240, 100%, 5%);
}

html, body {
    height: 100vh;
}

body {
    font-family: 'Inter', sans-serif, system-ui;
    background-color: var(--Off-white);
    padding: 0px 10px 10px 10px;
    overflow: hidden;
    position: relative;
    font-size: 1rem;
    font-weight: 400;
    color: var(--Dark-grayish-blue);
}

h2, h3, a, button {
    cursor: pointer;
    transition: all 0.3s ease;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    font-family: inherit;
    font-size: 1.2rem;
}

header {
    height: 64px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

header img {
    width: 32px;
}

header > img {
    width: 10%;
    max-width: 64px;
}

header button {
    border: 0;
    padding: 0;
    background: transparent;
}

header .overlay {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.5);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
}

header.open .overlay {
    visibility: visible;
    opacity: 1;
}

header nav {
    position: fixed;
    z-index: 3;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    padding: 20px;
    background-color: var(--Off-white);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    translate:  100% 0;
    visibility: hidden;
    transition: all 0.3s ;
}

header.open nav {
    translate: 0 0;
    visibility: visible;
}

nav img {
    margin-bottom: 70px;
}

ul {
    width: 100%;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

a:hover,
a:focus {
    color: var(--Soft-red);
}

a:focus-visible{
    outline: solid 1px var(--Soft-red);
}

main {
    height: calc(100% - 64px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.top-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.top-section img {
    width: 100%;
    object-fit: cover;
}

.top-section h1 {
    color: var(--Very-dark-blue);
}

.top-section div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.top-section button {
    border: none;
    text-transform: uppercase;
    font-weight: 700;
    padding: 10px 20px;
    letter-spacing: 2px;
    background-color: var(--Soft-red);
}

.top-section button:hover, 
.top-section button:focus {
    background-color: var(--Very-dark-blue);
    color: var(--Off-white);
    font-weight: inherit;
}

.news-section {
    background-color: var(--Very-dark-blue);
    color: var(--Grayish-blue);
    padding: 20px;
}

.news-section h2, 
.news-section h3:hover,
.news-section h3:focus
 {
    color: var(--Soft-orange)
}

.news-section h3:focus-visible{
    outline: solid 1px var(--Soft-orange);
}

.news-section h2 {
    margin-bottom: 30px;
}

.news-section h3 {
    color: var(--Off-white);
    margin-bottom: 10px;
}

.news-section hr {
    margin: 30px 0;
    border: solid 1px var(--Dark-grayish-blue);
}

.articles-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.articles-section article{
    display: flex;
    gap: 20px;
}

article img {
    width: 30%;
}

article div {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

article div h2 {
    color: var(--Soft-red);
}

article div h3 {
    color: var(--Very-dark-blue);
}

article div h3:hover,
article div h3:focus {
    color: var(--Soft-red);
}

article div h3:focus-visible{
    outline: solid 1px var(--Soft-red);
}


@media screen and (min-width: 500px) {
    .overlay {
        display: none;
    }

    header button {
        display: none;
    }

    header nav {
        position: static;
        translate: 0 0;
        width: auto;
        height: fit-content;
        padding: 0;
        visibility: visible;
    }

    ul {
        flex-direction: row;
    }

    a {
        font-size: inherit;
    }

    .articles-section {
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .articles-section article {
        width: 45%;
    }
}

@media screen and (min-width: 1000px) {

    header, main {
        max-width: 1100px;
        margin: 0 auto;
    }

    main {
        display: grid;
        grid-template-areas: 
        'top-section top-section news'
        'article article article';
    }

    .top-section {
        grid-area: top-section;
        
    }

    .top-section > div {
        flex-direction: row;
        justify-content: space-between;
    }


    .top-section > div div {
        height: 100%;
        justify-content: space-between;
    }

    .news-section {
        grid-area: news;
    }

    .articles-section {
        grid-area: article;
    }

    .articles-section article {
        width: 32%;
    }
}