* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    background-color: #F7F1E8;
    font-size: 18px;
    padding: 0 0.5rem 1rem  0.5rem;
}

body {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 700px;
    font-family: 'Nunito', sans-serif;
    color: #2E261C;
    padding: 0em 0.5rem;
}

head {
    gap: 1rem;
}

header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    border-bottom: 3px solid #A8570C;
}

header span {
    display: flex;
    flex-direction: column;
    align-items: end;
    font-family: 'Nunito', sans-serif;
    color: #2E261C;
    padding-right: 0.5em;
}

header h1 {
    font-size: 150%;
}

h1, #recipe-title input {
    font-family: 'Playwrite US Trad', serif;
    color: #A8570C;
    font-size: 180% ;
}

#recipe-steps input {
    font-size: 80%;
}

#recipe-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: start;
}

h2, h3, h4, h5, h6 {
    font-family: 'Playwrite US Trad', serif;
    color: #A8570C;
    font-size: 125%;
}

p {
    font-family: 'Nunito', sans-serif;
    color: #2E261C;
}

nav {
    display: flex;
    flex-direction: row;
    list-style-type: none;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.25rem;
}

nav ul {
    display: flex;
    flex-direction: row;
    list-style-type: none;
    gap: 1rem;
    align-items: center;
}

nav form {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: center;
}

nav button, main button {
    background: lightgray;
    border-radius: 5px;
    font-family: 'Nunito', sans-serif;
    font-size: 100%;
    padding: 0.25rem;
}

nav input{
    font-family: 'Nunito', sans-serif;
    font-size: 100%;
    padding: 0.25rem;
    border-radius: 5px;
}

main input{
    font-family: 'Nunito', sans-serif;
    font-size: 100%;
    padding: 0.25rem;
    width: 100%;
    border-radius: 5px;
}

main {
    display: flex;
    flex-direction: column;
    background-color: #FFF9F1;
    border-style: solid;
    border-color:#888;
    border-radius: 30px;
    padding: 1rem;
    gap: 2rem;
}

main section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

main div, main form div {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-around;
}

main span {
    display: flex;
    flex-direction: row;
    gap: 0 1.5rem;
    flex-wrap: wrap;
}

main section ul {
    display: flex;
    flex-direction: row;
    justify-content: left;
    gap: 0 .5rem;
    flex-wrap: wrap;
    text-wrap: nowrap;
}

main section dl {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: left;
}

main section dl span {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: nowrap;
    text-wrap: nowrap;
}

main form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-page form div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
}

#remember {
    display: flex;
    flex-direction: row;
    justify-content: left;
    gap: 1rem;
}

.checkbox {
    width: 1rem;
    height: 1rem;
    align-self: center;
}

#home-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding-top: 0.5rem;
    gap: 1rem;
}

#recipe-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
}

#recipe-bottom {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: 1rem;
}

#recipe-display {
    width: 40%;
}

#recipe-display dl input {
    width: 60px;
}

#recipe-description {
    width: 60%
}

.recipe-layout div {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    flex-wrap: wrap;
}

.recipe-layout article {
    width: 30%;
    height: fit-content;
    padding: .5rem;
}

.recipe-layout img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

#recipe-ingredients {
    width: 40%;
    flex-grow: 1;
}

#recipe-steps {
    width: 60%;
    flex-shrink: 1;
}

#recipe-ingredients ul {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
    text-indent: -1rem;
    text-wrap: wrap;
}

#profile img {
    width: 5rem;
    height: 5rem;
}

#profile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#profile span {
    display: flex;
    flex-direction: row;
    gap: 2rem;
}

#profile div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#profile div div {
    display: flex;
    flex-direction: column;
}

.show-password-control {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: start;
}

.header-search input {
    font-size: 80%;
    align-self: flex-end;
}

#show-password-checkbox {
    width: auto;
}

#recipe-steps ol {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
}

textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    padding: 0.5rem;
    max-width: 100%;
    vertical-align: top;
}

#edit-recipe-form  ol li {
    margin-bottom: 1rem;
}

#error-list {
    color: red;
    font-weight: bold;
    padding: 1em;
    border: 1px solid red;
    background-color: #fee; /* Light red background */
    margin: 1em 0;
}

#recipe-steps ol li ul {
    list-style-type: circle;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
}

#recipe-steps ol li ul li {
    padding: 0.25rem 0rem;
    margin: 0rem;
}

#recipe-steps ol li ul li input {
    margin-right: 0.25rem;
}

dl dd input[type="number"],
dl dd input[type="text"] {
    size: 5;
    text-align: right;
}

#recipe-image {
    border-radius: 20px;
    padding-bottom: 0.5em;
    width: 100%;
    height: auto;
    transform: rotate(2deg);
}

#login-button {
    width: 50%;
    min-width: 200px;
    align-self: center;
}

.login-page {
    font-size: 125%;
}

.login-page input {
    padding: 0.25rem;
    width: 80%;
}

strong {
    font-weight: 800;
}

a, a h1, a h2, a h3, a h4, a h5, a h6 {
    color: #8B5E34;
    text-decoration: none;
}

a:hover, a:hover h1, a:hover h2, a:hover h3, a:hover h4, a:hover h5, a:hover h6 {
    color: #A8570C;
    text-decoration: underline;
}

.button, .button a {
    color: #F7F1E8;
    background-color: #8B5E34;
    font-size: 100%;
    padding: .5em 1em;
    border-radius: 20px;
}

.button:hover, .button:hover a {
    color: #A8570C;
    background-color: #FFF9F1;
    padding: .5em 1em;
    border-radius: 20px;
}

.visually-hidden {
    display: none;
}

article ul, section ul {
    list-style-type: none;
    font-family: 'Nunito', sans-serif;
    padding-left: 0;
}

article ol  {
    font-family: 'Nunito', sans-serif;
}

article {
    background-color: #FFF;
    border-width: 3px 3px 3px 3px;
    border-style: solid;
    border-color:#2E261C;
    border-radius: 30px;
}

@media (max-width: 700px) {
    .login-page form div {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .login-page input {
        padding: 0.25rem;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .recipe-layout article {
        width: 45%;
    }
}

@media (max-width: 500px) {
    html, body {
        padding: 0;
    }

    body {
        gap: 1rem;
    }

    header {
        padding: 0.5rem;
    }

    nav {
        padding: 0.5rem 1rem;
    }

    main {
        border-width: thick 0 thick 0;
        border-radius: 0;
    }

    main div, main form div {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        justify-content: space-around;
    }

    #recipe-top {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        gap: 2rem;
    }

    #recipe-bottom {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        gap: 2rem;
    }

    #recipe-display {
        width: 100%;
        gap: 2rem;
    }

    #recipe-description {
        width: 100%
    }

    #recipe-ingredients {
        width: 100%;
        flex-grow: 1;
    }

        #recipe-steps {
        width: 100%;
        flex-shrink: 1;
    }
}

@media (max-width: 400px) {
    .recipe-layout article {
        width: 90%;
    }
}