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

:root {
    --clr-primary-orange: hsl(35, 77%, 62%);
    --clr-primary-red: hsl(5, 85%, 63%);
    --clr-neutral-off-white: hsl(36, 100%, 99%);
    --clr-neutral-light-gray: hsl(233, 8%, 79%);
    --clr-neutral-gray: hsl(236, 13%, 42%);
    --clr-neutral-dark-blue: hsl(240, 100%, 5%);

    --ff: 'Inter', sans-serif;
}

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

body {
    font-family: var(--ff);
    background-color: var(--clr-neutral-off-white);
    color: var(--clr-neutral-gray);
    line-height: 1.5;
}

img {
    display: inline-block;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--clr-neutral-dark-blue);
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    font-size: 1rem;
}

.title {
    font-weight: 800;
    line-height: 1;
}

.title.dark {color: var(--clr-neutral-dark-blue);}
.title.light {color: var(--clr-primary-orange);}

.home {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--clr-neutral-off-white);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    font-weight: 500;
}
nav a:hover {
    color: var(--clr-primary-red);
    transition: color 0.3s ease-in-out;
}

main {
    max-width: 1000px;
    margin: auto;
    align-items: center;
    display: flex;
    flex-direction: column;
}

section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;;
}

.flex-group {
    display: flex;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    justify-items: center;
}

.content {
    margin-top: 2rem;

    .desc {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    button {
        background-color: var(--clr-primary-red);
        font-size: 1rem;
        padding: 1rem 1.75rem;
        border: none;
        outline: none;
        text-transform: uppercase;
        color: var(--clr-neutral-dark-blue);
        font-weight: 700;
        letter-spacing: 1px;
        cursor: pointer;
        transition: all 0.3s ease-in-out;
    }

    button:hover {
        background-color: var(--clr-neutral-dark-blue);
        color: var(--clr-neutral-off-white);
    }
}

.new {
    color: var(--clr-neutral-off-white);
    background-color: var(--clr-neutral-dark-blue);
    padding: 1.75rem;
}

.new div {
    padding: 1rem 0;
    font-size: 1rem;

    > h3 {
        font-size: 1.2rem;
        line-height: 1.5;
        padding-bottom: .8rem;
        cursor: pointer;
    }

    > h3:hover{
        color: var(--clr-primary-orange);
        transition: color 0.3s ease-in-out;
    }
}

.new div:nth-child(3) {
    border-bottom: 1px solid var(--clr-neutral-light-gray);
    border-top: 1px solid var(--clr-neutral-light-gray);
}

.open-navbar {
    display: none;
    background: var(--clr-neutral-off-white);
    border-radius: 10px;
    position: fixed;
    border: none;
    padding: 1em;
    right: 0;
    cursor: pointer;
}

.close-navbar {
    margin-left: auto;
    display: none;
    background: none;
    border: none;
    padding: 1em;
    cursor: pointer;
}

.top-articles {
    gap: 1.5rem;
    margin: 4rem 0;

    div > p {
        font-size: 0.875rem;
        line-height: 1.25;
    }

    div > h3 {
        font-size: 1.2rem;
        color: var(--clr-neutral-dark-blue);
        line-height: 1.2;
        padding: .5rem 0;
        cursor: pointer;
    }

    div > h3:hover {
        color: var(--clr-primary-red);
        transition: color 0.3s ease-in-out;
    }

    .numbered-list {
        line-height: 0.8;
        font-weight: 800;
        color: var(--clr-primary-orange);
    }
}

.top-articles img {
    height: 160px;
    width: 140px;
    object-fit: cover;
}

#overlay {
    background: rgb(0, 0, 0, 0.5);
    position: fixed;
    inset: 0;
    z-index: 9;
    display: none;
    transition: all 0.3s ease-in-out;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .open-navbar,
    .close-navbar {
        display: block;
    }

    .close-navbar {
        margin-bottom: 3rem;
    }

    .navbar {
        font-size: 1.2rem;
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: min(15em, 100%);
        z-index: 10;
        flex-direction: column;
        gap: 1rem;
        background-color: var(--clr-neutral-off-white);
        padding: 1.5rem;
        transition: right 0.3s ease-in-out;
    }

    .navbar.show {
        right: 0;
    }
    
    .navbar.show ~ #overlay {
        display: block;
    }
    main {
        padding: 1rem;
    }

    section {
        grid-template-columns: 1fr;

        .grid {
            grid-template-columns: 1fr;;
        }
    }

    .flex-group {
        flex-direction: column;
    }

}



