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

:root {
    --cream: #F7F1E8;
    --cast: #2E261C;
    --cacao: #A8570C;
    --paper: #FFF9F1;
    --ash: #888;
    --oak: #8B5E34;
    --white: #FFF;
}

html {
    font-size: 18px;
}

body {
    font-family: "Nunito", Arial, sans-serif;
    background-color: var(--cream);
    color: var(--cast);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-inline: 0.5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Playwrite US Trad", cursive;
    font-size: 1.25em;
}

h2, h3, h4, h6 {
    color: var(--cacao);
}

h6 {
    margin: 0;
}

.main-title {
    font-size: 1.8em;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.main-title form {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.less-bold-text {
    font-weight: 600;
}

.recipe-line-spacing {
    line-height: 1.25;
}

a {
    color: var(--oak);
    text-decoration: none;
}

a:hover {
    color: var(--cacao);
    text-decoration: underline;
}

.brownish-button {
    display: inline-block;
    background-color: var(--oak);
    color: var(--cream);
    padding: .5em 1em;
    border-radius: 999px;
}

.brownish-button:hover {
    background-color: var(--cacao);
    color: var(--paper);
    text-decoration: none;
}

.recipe-photo {
    transform: rotate(2deg);
    border-radius: 3px;
    border: 5px solid var(--white);
    max-width: 100%;
    height: auto;
    margin-bottom: .5rem;
}

hr {
    background-color: var(--oak);
    height: 2px;
    border: none;
}

ul {
    list-style: none;
}

.hashtag {
    color: var(--ash);
}

main {
    background-color: var(--paper);
    border: 1px solid gray;
    border-radius: 50px;
    padding: 1rem;
}

.header-width,
.main-width,
header:not(.header-width),
main:not(.main-width) {
    max-width: 700px;
    width: 100%;
}

.header-width {
    width: 750px;
}

.visually-hidden {
    display: none;
}

.input-width {
    width: 100%;
    padding: .25rem;
    font-size: 125%;
}

.profile > p {
    margin: 0;
}

.profile img {
    display: block;
}

.food-list {
    border: 1px solid #e6e0d7;
    border-radius: 10px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1);
    padding: .5rem;
}

.food-list img {
    max-width: 100%;
    height: auto;
    display: block;
}

.list-margin {
    margin-bottom: 10px;
}

.login-form {
    font-size: 125%;
}

.login-form input {
    font-size: 125%;
}

.login-form button {
    font-size: 100%;
}

header {
    margin-bottom: 3rem;
}

.description {
    margin-bottom: 2rem;
}

.site-header {
    display: flex;
    flex-direction: column;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    text-align: right;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

.header-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0;
}

.header-nav form {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.header-nav input,
.header-nav button,
input[type="search"],
button[type="submit"] {
    padding: 0.25rem;
    font: inherit;
}

header hr {
    width: 100%;
}

.metadata {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
    row-gap: 0;
}

.tags {
    display: flex;
    gap: 0.5rem;
}

.ingredients li {
    padding-left: 1rem;
    text-indent: -1rem;
}

.steps ol {
    padding-left: 1em;
}

dl {
    display: flex;
    flex-wrap: wrap;
    column-gap: .5rem;
    row-gap: .25rem;
}

dl dt.less-bold-text {
    flex: 0 0 calc((100% - .5rem) / 4);
}

dl dd {
    flex: 0 0 calc((100% - .5rem) * 3 / 4);
}

dl dt, dl dd {
    margin: 0;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

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

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.card-tags > li {
    margin: 0 .5rem 0 0;
}

.card-tags > li:first-of-type {
    margin-left: 0;
}

.card-tags a {
    white-space: nowrap;
}

.profile-header {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 1rem;
    align-items: start;
    padding-bottom: 1rem;
}

.profile-header img {
    width: 5rem;
    height: 5rem;
}

.sidebar-pair {
    padding-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.sidebar-pair > div:first-child {
    flex: 1 1 0;
    min-width: 0;
}

.sidebar-pair > div:last-child {
    flex: 2 1 0;
    min-width: 0;
}

@media (max-width: 500px) {
    .sidebar-pair {
        display: block;
    }

    .sidebar-pair > div + div {
        margin-top: 2rem;
    }

    .sidebar-pair + .sidebar-pair {
        margin-top: 2rem;
    }
}

.login-form {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    row-gap: 1rem;
    align-items: baseline;
}

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

.login-form button {
    width: 50%;
    min-width: 200px;
    display: block;
    margin: 1rem auto 0;
    grid-column: 1 / -1;
    height: 40px;
}

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

    .login-form input {
        width: 100%;
        justify-self: stretch;
    }

    #username {
        margin-bottom: 1rem;
    }
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.main-title .edit-save-button {
    font-size: 1rem;
    font-family: "Nunito", Arial, sans-serif;
    font-weight: 500;
}

.input-title {
    font-family: "Playwrite US Trad", cursive;
    font-size: 1.8rem;
    color: var(--cacao);
    width: 85%;
    border: 1px solid var(--ash);
    border-radius: 4px;
}

.input-title:focus {
    outline: none;
}

input[type=number] {
    padding: 0.25rem;
    field-sizing: content;
    min-inline-size: 60px;
    max-inline-size: 110px;
}

dl input[type="number"] {
    font-size: 1rem;
    padding: 0.1rem 0.25rem;
    border: 1px solid var(--ash);
    border-radius: 4px;
    background-color: var(--white);
    color: var(--cast);
}

dl input[readonly] {
    background-color: var(--white);
}

.input-description {
    width: 100%;
    font-family: inherit, serif;
    font-size: 0.8rem;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
}

.steps li {
    vertical-align: top;
}

.step-ingredients {
    list-style: circle;
    padding-left: 1rem;
    margin-top: 0.25rem;
}

.step-ingredients li {
    padding-bottom: 0.25rem;
}

.step-ingredients input[type="number"],
.step-ingredients input[type="text"] {
    font-size: 1rem;
    padding: 0.3rem;
    border: 1px solid var(--ash);
    border-radius: 3px;
}

.steps li > textarea.input-description {
    display: inline-block;
    vertical-align: top;
    width: 100%;
    margin-top: 0;
}

.error-messages {
    color: red;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.error-messages ul {
    margin: 0;
    padding-left: 1.5rem;
}

.error-messages li {
    list-style-type: disc;
}

.password-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
