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

html {
    font-family: Nunito, sans-serif;
    font-size: 18px;
    background-color: #F7F1E8;
    color: #2E261C;
}

body {
    max-width: 700px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    padding: 0 .5rem;
    margin: 0 auto;
}

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

header section {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
}

header nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

nav form {
    padding-top: .25rem;
}

nav form input, nav form button {
    padding: .25rem;
}

.meta-info {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    flex-wrap: wrap;
    text-wrap: nowrap;
    row-gap: 0;
}

ul.tags {
    display: flex;
    flex-direction: row;
    gap: .5rem;
    flex-wrap: wrap;
    text-wrap: nowrap;
    row-gap: 0;
}
nav ul {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

img {
    max-width: 100%;
    padding-bottom: .5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playwrite US Trad', cursive;
}

h2 {
    font-size: 1.8rem;
}

h1, h3, h4, h5, h6 {
    font-size: 1.25rem;
}

hr {
    border-top: 2px solid #8B5E34;
}

main {
    display: flex;
    flex-direction: column;
    background-color: #FFF9F1;
    border: 1px solid #888;
    border-radius: 20px;
    padding: 1rem;
}

main h1, main h2, main h3, main h4 {
    color: #A8570C;
}

.heading-area {
    padding: 0 0 2rem 0;
    display: flex;
    flex-direction: column;
}

.heading-area input {
    width: 100%;
    padding: .25rem;
}

.upper-profile {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding-bottom: 1rem;
    gap: 1rem;
}

.upper-profile img {
    width: 5em;
    height: 5em;
    padding: 0;
}

.recipe-list article {
    background-color: #FEFDF9;
    box-shadow: 0 1px 5px 0 #888;
    border-radius: 10px;
}

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

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

.login label, .login input, .login button, .search input {
    font-size: 1.25rem;
}

.login{
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: baseline;
}

.login div{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
}

.login input {
    padding: .25rem;
    align-items: baseline;
    width: 80%;
}

.login button {
    min-width: 200px;
    width: 50%;
    align-self: center;
}

dl {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

dl div {
    display: flex;
    flex-direction: row;
    gap: .5rem;
}

dl dt {
    font-weight: 600;
    flex-grow: 1;
}

dl dd {
    flex-grow: 3;
}

.recipe-info {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.recipe-info p {
    flex-grow: 2;
}

#ingredients {
    width: calc((100% - 1rem) * 0.33);
}

#ingredients h3, #steps h3 {
    padding-bottom: 1rem;
}

#ingredients ul {
    padding-left: 1rem;
    text-indent: -1rem;
}

#steps {
    width: calc((100% - 1rem) * 0.66);
}

#steps ol {
    padding-left: 1rem;
}

#recipe-descriptions, #ingredients, #steps {
    line-height: 1.25;
}

div.btn {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding-top: 1rem;
}

a.btn {
    background-color: #8B5E34;
    color: #F7F1E8;
    text-decoration: none;
    border-radius: 20px;
    padding: .5rem 1rem;
}

a.btn:hover {
    background-color: #A8570C;
    color: #FFF9F1;
    text-decoration: none;
}

.recipe-info img {
    height: fit-content;
    transform: rotate(2deg);
    border: 5px solid #fff;
    border-radius: 3px;
    margin-bottom: .5rem;
}

ul {
    list-style-type: none;
}

.tags li::before {
    content: "#";
    color: #888;
}


div.tags, #recipe-tags {
    display: flex;
    flex-direction: row;
    gap: .5rem;
    width: 100%;
}

header form label {
    display: none;
}

#user {
    padding-left: 5px;
}

ul.recipe-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1rem 0;
}

.recipe-list li img {
    max-width: 100%;
}

ul.recipe-list article {
    padding: .5rem;
}

.recipe-details {
    display: flex;
    flex-direction: row;
    align-items: start;
    padding-top: 2rem;
    gap: 1rem;
}

#recipe-metadata {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#steps textarea, #recipe-descriptions {
    width: 100%;
    resize: vertical;
}

.heading-btn {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: start;
}

#steps ol li textarea {
    vertical-align: top;
}

#steps ol li {
    padding: 0 0 1rem 0;
}

#steps ol li ul li:before {
    content: "◦";
}

#steps ol li ul li {
    padding: .25rem 0 0 0;
    display: flex;
    flex-direction: row;
    gap: .25rem;
}

#edit-title {
    font-family: 'Playwrite US Trad', cursive;
    font-size: 1.8rem;
    color: #A8570C;
}

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

#edit-desc {
    width: 100%;
    display: flex;
    flex-direction: column;
}

#form-errors {
    color: red;
}

#check-password {
    display: flex;
    justify-content: end;
    white-space: nowrap;
}

#check-password label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: .5rem;
    justify-content: end;
}
@media (max-width: 700px) {
    .login div {
        gap: 0;
    }
}

@media (max-width: 600px) {
    ul.recipe-list {
        grid-template-columns: 1fr 1fr;
    }
    .login div {
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    body {
        padding: 0;
    }

    header {
        padding: 0.5rem;
    }

    hr {
        align-self: center;
        width: 100vw;
    }

    main {
        border-left: 0;
        border-right: 0;
    }

    .heading-area, .recipe-info, .recipe-details {
        display: flex;
        flex-direction: column;
    }

    .recipe-info, .recipe-details {
        gap: 2rem;
    }

    #ingredients, #steps {
        width: 100%;
    }
}

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