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

h1, h2, h3, h4, h5, h6, .card-title {
    font-family: "Playwrite US Trad", cursive;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 23px;
    color: #A8570C;
}

html {
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
    max-width: 700px;
    margin: auto;
    display: flex;
    padding-inline: .5rem;
    background-color: #F7F1E8;
}

header {
    padding-bottom: 3rem;
}

main {
    background-color: #FFF9F1;
    border: 1px solid #888;
    border-bottom: none;
    border-top-right-radius: 40px;
    border-top-left-radius: 40px;
}

#menu-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
}

#recipe-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 1rem;
    row-gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    align-items: start;
}

#top-row-page-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #8B5E34;
    align-items: end;
}

#bottom-row-page-header {
    display: flex;
    justify-content: space-between;
}

#page-header-links {
    display: flex;
    gap: 1rem;
}

#page-header-search {
    display: flex;
    padding-top: 0.25rem;
    gap: 0.25rem;
}

#main-section {
    padding: 1rem;
}

#recipe-search {
    width: 100%;
    height: 30px;
    padding: .25rem;
}

#content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 33px;
    column-gap: 1rem;
}

#recipe-title {
    font-size: 33px;
    font-family: "Playwrite US Trad", cursive;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    color: #A8570C;
    flex: 1;
}

#recipe-prep, #recipe-cook, #recipe-total, #recipe-yield {
    width: 4rem;
    padding: 0.25rem 0.4rem;
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
}

#recipe-errors {
    display: flex;
    color: red;
    padding: 1rem;
}

.step-ingredient-measure {
    width: 4rem;
    padding: 0.25rem 0.4rem;
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
    margin-bottom: 0.5rem;
}

.step-ingredient-unit {
    width: 4rem;
    padding: 0.25rem 0.4rem;
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
    margin-bottom: 0.5rem;
}

.step-ingredient-item {
    width: 12rem;
    padding: 0.25rem 0.4rem;
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
    margin-bottom: 0.5rem;
}

#content-header-section {
    padding-bottom: 2rem;
}

#recipe-main-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: start;
}

#recipe-steps-title {
    margin-inline-start: -1em;
}

#recipe-page-image {
    display: block;
    max-width: 100%;
    height: auto;
    transform: rotate(2deg);
    border: 5px solid #FFF;
    border-radius: 3px;
}

#recipe-description {
    width: calc((100% - 1rem) * 2 / 3);
}

#recipe-description-edit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: calc((100% - 1rem) * 2 / 3);
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
}

#recipe-description-text {
    width: 100%;
}

.recipe-step-description {
    width: 100%;
    resize: vertical;
    vertical-align: top;
    margin-bottom: 0.5rem;
}

#recipe-pair-bottom {
    width: 100%;
    display: flex;
    gap: 1rem;
    align-items: start;
}

#recipe-information {
    display: flex;
    flex-wrap: wrap;
    column-gap: .5rem;
    row-gap: .25rem;
    margin: 0;
    padding: 0;
}

#recipe-information dt {
    font-weight: bold;
    flex: 0 0 calc(25% - .25rem);
    min-width: 0;
}

#recipe-information dd {
    flex: 0 0 calc(75% - .25rem);
    min-width: 0;
}

#recipe-ingredients {
    display: flex;
    padding-left: 1rem;
    text-indent: -1rem;
    width: calc((100% - 1rem) / 3);
}

#recipe-steps {
    padding-left: 1em;
    width: calc((100% - 1rem) * 2 / 3);
}

#profile-info {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
}

#profile-image {
    display: block;
    max-width: 5rem;
    max-height: 5rem;
}

.header-metadata {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
    align-items: start;
}

.header-tags {
    display: flex;
    gap: 0.5rem;
    align-items: start;
}

.sign-in-label {
    font-size: 23px;
}

#sign-in-button {
    grid-column: 1/-1;
    width: 50%;
    min-width: 200px;
    justify-self: center;
}

.visually-hidden {
    display: none;
}

.card-link {
    text-decoration: none;
}

.recipe-image-and-info {
    width: calc((100% - 1rem) / 3);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    background-color: #FFF;
    box-shadow: 0 2px 5px #888;
    border-radius: 20px;
    padding: .5rem;
    gap: .5rem;
}

.recipe-card-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.recipe-card-tags {
    display: flex;
    flex-wrap: wrap;
    column-gap: .5rem;
    row-gap: 0;
    align-items: baseline;
}

.recipe-card-tags span {
    display: inline-flex;
    text-wrap: nowrap;
    white-space: nowrap;
}

.brand {
    color: #8B5E34;
}

.hashtag {
    color: #888;
}

.link {
    text-decoration: none;
    color: #8B5E34;
}

.link:hover {
    text-decoration: underline;
    color: #A8570C;
}

.button {
    background-color: #8B5E34;
    color: #F7F1E8;
    padding: .5em 1em;
    text-decoration: none;
    border-radius: 999px;
}

.button:hover {
    background-color: #A8570C;
    color: #FFF9F1;
    padding: .5em 1em;
    text-decoration: none;
    border-radius: 999px;
}

#login-form {
    display: grid;
    grid-template-columns: 20% 80%;
    row-gap: 1rem;
    align-items: baseline;
}

#login-form input {
    width: 80%;
    justify-self: end;
    padding: .25rem;
}

@media (max-width: 500px) {
    #recipe-main-section {
        display: block;
    }

    #recipe-image-and-info {
        margin-bottom: 2rem;
    }

    #recipe-description {
        margin-bottom: 2rem;
    }

    #recipe-pair-bottom {
        display: block;
    }

    #recipe-ingredients {
        margin-bottom: 2rem;
    }

    #top-row-page-header {
        padding: 0.5rem
    }

    #bottom-row-page-header {
        padding: 0.5rem
    }

    html {
        padding-inline: 0;
    }
}

@media (max-width: 700px) {
    #login-form {
        grid-template-columns: 1fr;
        row-gap: 0;
    }

    #login-form input {
        margin-bottom: 1rem;
    }
}

@media (max-width: 600px) {
    #recipe-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    #recipe-card-grid {
        grid-template-columns: 1fr;
    }
}

input[type=number][size] {
    width: calc(attr(size number) * 1ch + 2rem);
}