@font-face {
    font-family: "Jost";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/jost.woff2") format("woff2");
}

@font-face {
    font-family: "Playfair Display";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/playfair-display.woff2") format("woff2");
}

@font-face {
    font-family: "Playfair Display";
    font-style: italic;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/playfair-display-italic.woff2") format("woff2");
}

:root {
    --color-black: #000000;
    --color-dark-grey: #232323;
    --color-error: #da0000;
    --color-grey: #555555;
    --color-light-grey: #f9f9f9;
    --color-medium-light-grey: #e6e6e6;
    --color-muted-grey: #888888;
    --color-white: #ffffff;
    --font-sans: "Jost", sans-serif;
    --font-serif: "Playfair Display", serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #fff;
    color: var(--color-dark-grey);
    font-family: var(--font-sans);
}

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

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

.social {
    display: flex;
    gap: 18px;
}

.social__link {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
}

.social__icon {
    width: 19.36px;
    height: 19.36px;
}

.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 36px 42px;
}

.navbar__toggle,
.navbar__account,
.mobile-menu__close,
.account-menu__link,
.mobile-menu__link,
.sign-out__button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
}

.navbar__toggle {
    display: none;
}

.navbar__link {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
}

.navbar__logo-image {
    width: 75px;
    height: auto;
}

.navbar__menu {
    display: grid;
    grid-template-columns: 120px minmax(120px, auto);
    justify-self: end;
    text-align: right;
}

.navbar__account {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 48px;
    font-weight: 500;
}

.account-menu {
    position: absolute;
    inset: 89px 42px auto auto;
    width: 240px;
    margin: 0;
    padding: 24px 16px;
    border: 0;
    background: var(--color-white);
    box-shadow: 0 4px 24px rgb(0 0 0 / 8%);
    color: var(--color-dark-grey);
}

.account-menu:popover-open {
    display: flex;
    flex-direction: column;
}

.account-menu__link {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.65;
}

.account-menu__link + .account-menu__link {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 0.5px solid var(--color-muted-grey);
}

.sign-out {
    width: 390px;
    max-width: 100%;
    padding: 45px 16px 32px;
    border: 0;
    background: var(--color-light-grey);
    color: var(--color-dark-grey);
    text-align: center;
}

.sign-out::backdrop {
    background: rgb(0 0 0 / 50%);
}

.sign-out__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.35;
}

.sign-out__text {
    margin: 12px 0 32px;
    font-size: 16px;
    line-height: 1.45;
}

.sign-out__button {
    width: 100%;
    height: 40px;
    background: var(--color-dark-grey);
    color: var(--color-light-grey);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.mobile-menu {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--color-dark-grey);
    color: var(--color-light-grey);
}

.mobile-menu:popover-open {
    display: flex;
    flex-direction: column;
}

.mobile-menu__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 16px;
}

.mobile-menu__close {
    justify-self: start;
}

.mobile-menu__logo {
    width: 49.29px;
    height: auto;
}

.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 32px 16px 0;
    padding-top: 8px;
    border-top: 0.5px solid var(--color-light-grey);
}

.mobile-menu__link {
    padding: 6px 0 12px;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.45;
    text-transform: uppercase;
}

.mobile-menu__link--separated {
    margin-top: 24px;
    padding-top: 10px;
    border-top: 0.5px solid var(--color-light-grey);
}

.mobile-menu__social {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    padding: 0 16px 42px;
}

.mobile-menu__heading {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.65;
}

.mobile-menu__heading--account {
    margin-top: 24px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid var(--color-light-grey);
    font-size: 14px;
}

.footer {
    display: grid;
    grid-template-columns: minmax(min-content, 1fr) repeat(3, minmax(min-content, 165px));
    grid-template-areas:
        "logo social legal help"
        "copyright copyright copyright copyright";
    align-items: start;
    column-gap: min(134.5px, 9.34vw);
    padding: 80px 42px 0;
    background: var(--color-dark-grey);
    color: var(--color-light-grey);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.65;
}

.footer__logo {
    grid-area: logo;
}

.footer__logo-image {
    width: 125px;
    max-width: none;
    height: auto;
}

.footer__social {
    grid-area: social;
}

.footer__heading {
    margin: 0 0 24px;
    white-space: nowrap;
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 24px;
    white-space: nowrap;
}

.footer__links--legal {
    grid-area: legal;
}

.footer__links--help {
    grid-area: help;
}

.footer__copyright {
    grid-area: copyright;
    margin: 80px 0 0;
    padding: 24px 0 42px;
    border-top: 1px solid var(--color-light-grey);
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
}

.link {
    display: inline-block;
    padding: 2px 0;
    border-bottom: 1px solid currentColor;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .navbar {
        padding: 16px;
    }

    .navbar__toggle {
        display: block;
        justify-self: start;
    }

    .navbar__link--discover,
    .navbar__menu {
        display: none;
    }

    .navbar__logo-image {
        width: 49.29px;
    }

    .sign-out {
        inset: auto 0 0;
        width: 100%;
        margin: 0;
    }

    .sign-out::before {
        content: "";
        position: absolute;
        top: 8px;
        left: calc(50% - 40px);
        width: 80px;
        height: 5px;
        border-radius: 3px;
        background: var(--color-medium-light-grey);
    }

    .footer {
        grid-template-columns: 1fr;
        grid-template-areas:
            "help"
            "legal"
            "social"
            "logo"
            "copyright";
        padding: 32px 16px 16px;
        font-size: 12px;
    }

    .footer__links {
        gap: 12px;
    }

    .footer__links--help {
        padding-top: 16px;
    }

    .footer__links--legal {
        margin-top: 12px;
        padding-bottom: 16px;
    }

    .footer__social {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        margin-top: 16px;
        padding: 16px 0;
        border-block: 0.5px solid var(--color-light-grey);
    }

    .footer__heading {
        margin: 0;
    }

    .footer__logo {
        justify-self: center;
        margin-top: 58px;
    }

    .footer__logo-image {
        width: 80px;
    }

    .footer__copyright {
        margin: 24px 0 0;
        padding: 0 0 42px;
        border-top: 0;
        font-size: 14px;
    }

    .link {
        font-size: 14px;
        line-height: normal;
    }
}
