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

* {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

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

    /* Neutral colors */
    --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%);

    /* Font */
    --primary-font: "Inter";
    --fs: 1rem; /* Default font size */
    --extra-bold: 800;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    min-height: 100vh;
    padding: 4rem 0;
    font-family: var(--primary-font);
    background-color: var(--off-white);
}

body:has(.sidemenu.open) {
    overflow: hidden;
}

header, main {
    width: clamp(1190px, 80vw, 1280px);
}

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

ul {
    list-style-type: none;
}

header ul {
    display: flex;
    gap: 40px;
}

ul a {
    font-size: var(--fs);
    text-decoration: none;
    transition: .2s ease-in;
}

header ul a {
    color: var(--dark-grayish-blue);
}

header ul a:hover {
    color: var(--soft-red);
}

header button {
    display: none;
    cursor: pointer;
}

main {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: min-content;
    gap: 4rem 2rem;
}

.top-story {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    grid-column: 1 / -2;
}

.top-story img:first-of-type {
    height: 330px;
    object-fit: cover;
}

.top-story img:last-of-type {
    display: none;
}

.info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.top-story h1 {
    font-size: 60px;
    font-weight: var(--extra-bold);
    line-height: 1;
    color: var(--very-dark-blue);
}

.top-story .details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.top-story p {
    font-size: var(--fs);
    line-height: 1.6;
    color: var(--dark-grayish-blue);
}

.top-story button {
    padding: 1rem 2rem;
    font-size: 14px;
    font-weight: var(--extra-bold);
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--very-dark-blue);
    background-color: var(--soft-red);
    cursor: pointer;
    transition: .2s ease-in;
}

.top-story button:hover {
    color: var(--off-white);
    background-color: var(--very-dark-blue);

}

.latest-stories {
    padding: 2rem 28px;
    background-color: var(--very-dark-blue);
}

.latest-stories > h1 {
    font-size: 44px;
    color: var(--soft-orange);
}

.latest-stories .story {
    padding: 2rem 0;
}

.latest-stories .story:last-child {
    padding-bottom: 0;
}

.latest-stories .story:has(+ .story) {
    border-bottom: 1px solid var(--dark-grayish-blue);
}

.latest-stories .story > h1 {
    font-size: 22px;
    color: var(--off-white);
    cursor: pointer;
    transition: 0.2s ease-in;
}

.latest-stories .story > h1:hover {
    color: var(--soft-orange);
}

.latest-stories .story p {
    margin-top: 10px;
    font-size: var(--fs);
    line-height: 1.6;
    color: var(--dark-grayish-blue);
}

.top-stories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(375px, 1fr));
    grid-auto-rows: 125px;
    grid-column: 1 / -1;
    gap: 2rem;
}

.top-stories .story {
    display: flex;
    gap: 24px;
}

.top-stories img {
    width: auto;
    object-fit: contain;
}

.top-stories .details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.top-stories h1 {
    color: var(--soft-red);
}

.top-stories h2 {
    font-size: 18px;
    font-weight: var(--extra-bold);
    color: var(--very-dark-blue);
    cursor: pointer;
    transition: .2s ease-in;
}

.top-stories h2:hover {
    color: var(--soft-red);
}

.top-stories p {
    font-size: var(--fs);
    line-height: 1.6;
    color: var(--dark-grayish-blue);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    background-color: hsla(240, 100%, 5%, .5);
    transition: opacity .2s ease-in;
}

.sidemenu {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 20;
    padding: 2rem;
    width: min(75vw, 400px);
    transform: translateX(100%);
    background-color: var(--off-white);
    transition: transform 0.2s ease-in, opacity 0.2s ease-in;
}

.close-btn {
    display: flex;
    justify-content: flex-end;
}

.close-btn button {
    cursor: pointer;
    background-color: transparent;
}

.sidemenu ul {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 4rem;
}

.sidemenu ul a {
    color: var(--very-dark-blue);
}

.sidemenu ul a:hover {
    color: var(--soft-red);
}

@media (max-width: 1300px) {
    header, main {
        width: 90vw;
    }

    .top-story {
        justify-content: flex-start;
        gap: 2rem;
    }

    .info {
        display: block;
    }

    .top-story h1 {
        font-size: 52px;
    }

    .top-story .details {
        display: block;
        margin-top: 1rem;
    }

    .top-story button {
        margin-top: 1rem;
    }
}

@media (max-width: 1020px) {
    header, main {
        width: min(90vw, 640px);
    }

    header nav {
        display: none;
    }

    header button {
        display: block;
    }

    .sidemenu.open {
        transform: translateX(0);
    }

    .sidemenu.open + .overlay {
        opacity: 1;
        visibility: visible;
    }

    main {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .top-story img:first-of-type {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

@media (max-width: 560px) {
    body {
        gap: 2rem;
        padding: 3rem 0;
    }

    .top-story img:first-of-type {
        display: none;
    }

    .top-story img:last-of-type {
        display: block;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .latest-stories {
        padding: 28px 24px;
    }

    .latest-stories .story {
        padding: 28px 0;
    }

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

@media (max-width: 420px) {
    :root {
        --fs: 14px;
    }

    .top-story h1 {
        font-size: 3rem;
    }

    .latest-stories > h1 {
        font-size: 36px;
    }

    .latest-stories .story > h1 {
        font-size: 20px;
    }

    .top-stories .story {
        gap: 1rem;
    }

    .top-stories h1 {
        font-size: 28px;
    }

    .top-stories h2 {
        font-size: 1rem;
    }
}

@media (max-width: 340px) {
    .top-stories {
        grid-auto-rows: 100px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}