* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #F7F1E8;
    color: #2E261C;
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

body {
    flex-shrink: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 700px;
    gap: 3rem;
}

@media (min-width: 500px) {
    body {
        padding: 0.5rem;
    }
}

@media (max-width: 500px) {

    header section,
    nav {
        padding: 0.5rem;
    }
}

/* ----------------------- Header ---------------- */
header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.25rem;
}

header section {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: end;
    border-bottom: 2px solid #8B5E34;
}

header nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

header nav menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

header nav form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
}

/* ----------------------- Main ---------------- */
main {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    background-color: #FFF9F1;
    border: 1px solid #8B5E34;
    border-radius: 20px;
}

.heading-area {
    padding-bottom: 1rem;
}

h1,
h2 {
    font-family: 'Playwrite US Trad', serif;
    color: #A8570C;
    font-size: 125%;
}

main h1 {
    font-size: 180%;
}

main section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

main section menu {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
}

/* ------------------------- Cards ----------------------------- */
.recipe-list {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: start;
    gap: 1rem;
    flex-wrap: wrap;
}

.recipe-card {
    flex: 1 1 calc(33.333% - 1rem);
    display: flex;
    flex-direction: column;
    border: 1px solid #8B5E34;
    border-radius: 10px;
    padding: 0.5rem;
    gap: 0.5rem;
    max-width: calc(33.333% - 0.66rem);
    min-width: 150px;
    background-color: #FFF;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.recipe-card h2 {
    font-size: 100%;
}

.card-tags {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    text-wrap: nowrap;
    justify-content: left;
    column-gap: 0.5rem;
}

/* ---------------------- Recipe --------------------------- */
#error-list {
    color: black;
    background-color: #ffdae0;
    margin-bottom: 1rem;
    padding: 0.5rem 1.75rem;
    border: 3px solid red;
    border-radius: 10px;
    list-style-type: disc;
    overflow-wrap: break-word;
}
.metadata-list {
    display: flex;
    flex-direction: row;
    justify-content: left;
    flex-wrap: wrap;
    column-gap: 1.5rem;
}

.metadata-list ul {
    display: flex;
    flex-direction: row;
    justify-content: left;
    column-gap: 0.5rem;
}

@media (min-width: 500px) {
    .recipe-row {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.recipe-row {
    gap: 2rem;
}

.recipe-summary {
    flex: 1;
}

.recipe-description {
    flex: 2;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-content: stretch;
}
.heading-area h1{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start
}
.heading-area input {
    font-family: 'Playwrite US Trad', serif;
    color: #A8570C;
    font-size: 125%;
    width: calc(100% - 1rem);
}
#recipe-buttons, #recipe-buttons form {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
}
.step-description ul, .new-step-description ul {
    list-style-type: circle;
    display: flex;
    flex-direction: column;
}
.step-description div {
    width: 100%;
}
textarea {
    width: 100%;
    resize: vertical;
}
.step-list {
    counter-reset: step;
    list-style: none;
}
.step-description, .new-step-description {
    padding-bottom: 0.75rem;
    counter-increment: item;
    display: flex;
    align-items: flex-start;
    position: relative;
    vertical-align: top;
}
.step-description::before, .new-step-description::before {
    content: counter(item) ".";
    position: absolute;
    left: -1em;
    top: 0;
}
.step-description li {
    padding-bottom: 0.25rem;
}
.i-1 {
    width: calc(0.17 * (100% - 1rem));
}
.i-2 {
    width: calc(0.23 * (100% - 1rem));
}
.i-3 {
    width: calc(0.6 * (100% - 1rem));
}

.recipe-summary section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0.1rem;
}

.recipe-summary dl {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recipe-summary dl div {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.recipe-photo {
    transform: rotate(2deg);
    border: 5px solid #FFF;
    border-radius: 3px;
    height: auto;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.ingredients {
    flex: 1;
    gap: 0.5rem;
}

.steps {
    flex: 2;
    gap: 0.5rem;
}

.ingredients ul {
    padding-left: 1rem;
    text-indent: -1rem;
}

.steps ol, .steps ul {
    padding-left: 1rem;
}

/* ---------------------- Login ----------------------------- */
.login-form {
    font-size: 125%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 700px) {
    .login-form div {
        display: flex;
        flex-direction: row;
        justify-content: end;
        align-items: baseline;
    }

    .login-form input {
        margin-left: 1rem;
        width: 80%;
    }
}

@media (max-width: 699px) {
    .login-form div {
        display: flex;
        flex-direction: column;
    }

    .login-form input {
        width: 100%;
    }
}

.login-form input {
    font-size: 125%;
}

.login-form button {
    align-self: center;
    flex-shrink: 1;
    width: calc(50%);
    max-width: calc(50%);
    min-width: 200px
}

#show_password_div {
    display: flex;
    flex-direction: row;
    justify-content: center;

    align-items: baseline;
}
#show_password_label {
    font-size: 1rem;
}
#show_password_box {
    width: auto;
}

/* ---------------------- Profile --------------------------- */
.profile-heading-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1rem;
}

.profile-heading-area div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.profile-picture {
    width: 5rem;
    height: 5rem;
    border-radius: 1rem;
}

/* ---------------------- Search ---------------------------- */
.searchbar {
    display: flex;
    flex-direction: row;
    font-size: 125%;
}

.searchbar input {
    flex-grow: 1;
}

/* ----------------------- Etc ------------------------------- */
dt {
    font-weight: 600;
}

section {
    line-height: 1.25;
}

a {
    color: #8B5E34;
    text-decoration: none;
}

a:hover {
    color: #A8570C;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

menu {
    list-style-type: none;
}

.button {
    background-color: #8B5E34;
    color: #F7F1E8;
    padding: .5em 1em;
    border-radius: 18px;
}

.button:hover {
    background-color: #A8570C;
    color: #FFF;
    text-decoration: none;
}

form input,
form button {
    padding: 0.25rem;
}

ul {
    list-style-type: none;
}

.tag::before {
    content: "#";
    color: #888;
}

.visually-hidden {
    display: none;
}