@import url('reset.css');

/* outfit-regular - latin */
@font-face {
    font-display: swap;
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400;
    src: url('assets/fonts/outfit-v15-latin-regular.woff2') format('woff2');
}

/* outfit-600 - latin */
@font-face {
    font-display: swap;
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    src: url('assets/fonts/outfit-v15-latin-600.woff2') format('woff2');
}

/* outfit-700 - latin */
@font-face {
    font-display: swap;
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    src: url('assets/fonts/outfit-v15-latin-700.woff2') format('woff2');
}

/* young-serif-regular - latin */
@font-face {
    font-display: swap;
    font-family: 'Young Serif';
    font-style: normal;
    font-weight: 400;
    src: url('assets/fonts/young-serif-v2-latin-regular.woff2') format('woff2');
}

:root {
    --white: hsl(0, 0%, 100%);
    --stone-100: hsl(30, 54%, 90%);
    --stone-150: hsl(30, 18%, 87%);
    --stone-600: hsl(30, 10%, 34%);
    --stone-900: hsl(24, 5%, 18%);
    --brown-800: hsl(14, 45%, 36%);
    --rose-800: hsl(332, 51%, 32%);
    --rose-50: hsl(330, 100%, 98%);
    --paragraph: 1rem;
}

body {
    background-color: var(--stone-100);
    color: var(--stone-600);
}

.main {
    background: var(--white);
    margin: auto;
    max-width: 375px;
    overflow: hidden;
}

.main__header {
    position: relative;
    overflow: hidden;
}

.main__image {
    width: 100%;
    height: 171px;
    object-fit: cover;
    object-position: center;
}

.main__attribution {
    font-family: 'Outfit';
    font-size: clamp(.75rem, .5rem + 1dvh, 1rem);
    position: fixed;
    z-index: 10;
    color: var(--stone-600);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    background-color: var(--stone-100);
    padding-inline: .75rem;
    padding-block: .25rem;
    backdrop-filter: blur(2px);
    border-bottom-left-radius: .75rem;
    border-bottom-right-radius: .75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .2s ease;
}

.main__attribution a {
    text-decoration: none;
    color: var(--stone-900);
    font-weight: 500;
    font-family: 'Outfit', monospace;
    transition: cubic-bezier(0.215, 0.610, 0.355, 1);
}

.card {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card__header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card__title {
    font-family: 'Young Serif', serif;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--stone-900);
}

.card__description {
    font-size: var(--paragraph);
    font-family: 'Outfit', sans-serif;
    line-height: 1.5rem;
    color: var(--stone-600);
}

.preparation {
    font-family: 'Outfit';
    background: var(--rose-50);
    border-radius: var(--paragraph);
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.preparation__title {
    color: var(--rose-800);
    font-size: 1.25rem;
}

.preparation__ul {
    list-style: none;
    padding-left: .5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.preparation__list {
    position: relative;
    padding-left: 2rem;
}

.preparation__list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.25rem;
    height: 0.25rem;
    background-color: var(--rose-800);
    border-radius: 50%;
}

.preparation__list span {
    font-weight: 600;
}

.ingredients {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    font-family: 'Outfit';
    font-weight: 400;
}

.ingredients__title {
    font-family: 'Young Serif', sans-serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--brown-800);
}

.ingredients__ul {
    list-style: none;
    padding-left: .5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.ingredients__list {
    position: relative;
    padding-left: 2rem;
}

.ingredients__list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.25rem;
    height: 0.25rem;
    background-color: var(--rose-800);
    border-radius: 50%;
}

.instructions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    font-family: 'Outfit';
    font-weight: 400;
}

.instructions__title {
    font-family: 'Young Serif', sans-serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--brown-800);
}

.instructions__ol {
    list-style: none;
    counter-reset: step;
    padding-left: .5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.instructions__list {
    counter-increment: step;
    position: relative;
    padding-left: 2rem;
}

.instructions__list::before {
    content: counter(step) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    color: var(--rose-800);
}

.instructions__item span {
    font-weight: 600;
}

.nutrition {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    font-family: 'Outfit';
    font-weight: 400;
}

.nutrition__title {
    font-family: 'Young Serif', sans-serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--brown-800);
}

.nutrition__description {
    font-size: var(--paragraph);
    font-family: 'Outfit', sans-serif;
    line-height: 1.5rem;
    color: var(--stone-600);
}

.nutrition__table {
    border-collapse: collapse;
}

.nutrition__table tr {
    border-bottom: 1px solid var(--stone-100);
}

.nutrition__table tr:last-child {
    border: none;
}

.nutrition__table tr td {
    padding-block: .75rem;
}

.nutrition__table tr td:first-child {
    padding-left: 1.75rem;
}

.nutrition__table tr td:last-child {
    padding-inline: 1rem;
    font-weight: 600;
    color: var(--brown-800);
}

hr {
    border: 0;
    border-top: 1px solid var(--stone-100);
}

@media (min-width: 768px) {
    .main {
        margin-block: 7.75rem;
        max-width: 738px;
        border-radius: 1.25rem;
    }

    .main__header {
        padding-inline: 2.5rem;
        padding-top: 2.5rem;
    }

    .main__image {
        border-radius: .75rem;
        height: auto;
    }

    .card {
        padding-inline: 2.5rem;
    }

    .main__attribution {
        width: auto;
        position: absolute;
        inset-inline: 2.5rem;
        top: 36px;
        border-radius: .75rem;
        transform: translateX(0);
        bottom: 0;
        background-color: rgba(0, 0, 0, .4);
        backdrop-filter: blur(2px);
        color: var(--white);
        pointer-events: none;
        opacity: 0;
    }

    .main__attribution a {
        font-weight: 600;
        color: var(--rose-50);
    }

    .main__header:hover .main__attribution {
        opacity: 1;
        pointer-events: auto;
    }
}