@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/static/Inter-Regular.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/static/Inter-Bold.ttf') format('truetype');
    font-weight: 700;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/static/Inter-ExtraBold.ttf') format('truetype');
    font-weight: 800;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:root {
    --soft-orange: hsl(35, 77%, 62%);
    --soft-red: hsl(5, 85%, 63%);

    --off-white: hsl(36, 100%, 100%);
    --grayish-blue: hsl(233, 8%, 79%);
    --dark-grayish-blue: hsl(236, 13%, 42%);
    --very-dark-blue: hsl(240, 100%, 5%);

    --menu-width: 300px;
}

body {
    font-size: 15px;
    font-family: 'Inter';
    max-width: 1144px;
    padding: 1em;
    margin-inline: auto;
}


p{
    color: var(--dark-grayish-blue);
    line-height: 1.5;
}

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

img {
    max-inline-size: 100%;
}

.hidden{
    display: none;
}

main {
    display: grid;
    grid-template-areas:
        "featured"
        "new"
        "popular";
    grid-gap: 3.5em;
    margin-block-start: 1rem;
}

header{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header > img{
    max-block-size: 2rem;
}

.featured {
    grid-area: featured;
}

.new {
    grid-area: new;
    background-color: var(--very-dark-blue);
    color: var(--grayish-blue);
    padding: 1em;
}

ul, ol{
    margin:0;
    padding:0;
    list-style: none;
}

.new>header {
    color: var(--soft-orange);
    font-size: 2rem;
    font-weight: 700;
}

.new li {
    padding-block: 1.25em;
}

.new li:last-of-type{
    padding-block-end: 0;
}

.new p{
    color: var(--grayish-blue);
}

.new a:hover, .new a:focus-visible{
    color: var(--soft-orange);
}

.new li:nth-of-type(even){
    border-block-color: var(--dark-grayish-blue);
    border-block-width: 1px;
    border-block-style: solid;
}

.new article header {
    color: var(--off-white);
    font-size: 1.25rem;
    font-weight: 600;
    margin-block-start: 1.5em;
}

.popular {
    grid-area: popular;
}

@media screen and (min-width: 50rem) {
    main {
        grid-template-columns: repeat(3, 1fr);
        grid-template-areas:
            "featured featured new"
            "popular popular popular";
        gap: 2.5rem;
    }
}

body.with-overlay{
    width: 100vw;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

body.with-overlay::before{
    content: '';
    background-color: rgba(0,0,0,.25);
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.menu-btn{
    border: none;
    background-color: transparent;
    z-index: 1;
}

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

@media screen and (min-width: 40rem) {
    nav{
        min-height: initial;
        flex-direction: row;
        position:initial;
        gap: 2.5rem;
        width: initial;
    }
}

.featured{
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.featured picture{
    order: -1;
}

.featured header{
    font-size: 2.5rem;
    font-weight: 800;
    margin-block-start: .5em;
    line-height: 1;
}

a.button{
    padding-inline: 2em;
    padding-block: 1em;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    align-self: flex-start;
    background-color: var(--soft-red);
    color: var(--off-white);
    margin-block-start: .5em;
}

a.button:hover, a.button:focus-visible{
    background-color: var(--very-dark-blue);

}

@media screen and (min-width: 40rem) {
    .featured{
        display: grid;
        grid-template-columns: subgrid;
        row-gap: 2em;
    }

    .featured picture{
        grid-column: span 2;
    }

    .featured header{
        grid-row: span 2;
        text-wrap: balance;
        font-size: 3.5rem;
        margin-block-start: initial;
    }

    a.button{
        width: fit-content;
    }
}

.popular{
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1/-1;
    row-gap: 1em;
}

.popular .featured-article{
    color: var(--grayish-blue);
    font-size: 2em;
    font-weight: 700;
}

.popular article{
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1em;
    align-content: space-between;
}

.popular img{
    grid-row: 1/span 3;
    height: 100%;
    object-fit: cover;
}

.popular p{
    margin: 0;
}

.popular header{
    font-weight: 700;
    font-size: 1.25em;
}

.popular ol{
    display: flex;
    flex-direction: column;
    gap: 2.5em;
}

@media screen and (min-width: 50rem) {
    .popular ol{
        display: contents;
    }
}

.menu-btn[aria-expanded=true] + nav{
    visibility: visible;
}

.menu-btn[aria-expanded=true] .menu-open{
    display: none;
}

.menu-btn[aria-expanded=false] .menu-close{
    display: none;
}

nav{
    background-color: var(--off-white);
    min-height: 100vh;
    position: absolute;
    right: 0;
    top: 0;
    width: var(--menu-width);
    padding-block: 1rem;
    visibility: collapse;
}

nav ul{
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-inline: 1em;
}

@media screen and (min-width: 40rem){
    nav{
        visibility: visible;
        min-height: initial;
        position: initial;
        width: initial;
    }

    nav ul{
        flex-direction: row;
        gap: 2.5em;
    }

    .menu-btn{
        display: none;
    }
}