* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    max-width: 700px;
    flex-shrink: 1;
    font-size: 18px;
    justify-content: center;
    margin: auto;
}

body {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    background-color: #F7F1E8;
}

header {
    display: flex;
    flex-direction: column;
    font-family: "Nunito", sans-serif;
    color: #2E261C;
}

header section {
    display: flex;
    flex-direction: row;
    align-items: bottom;
    justify-content: space-between;
}

nav ul {
    display: flex;
    flex-direction: row;
    gap: 1rem;

}

main {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 2rem;
    font-family: "Nunito", sans-serif;
    color: #2E261C;
    background-color: #FFF9F1;
    border: 1px solid #2E261C;
    border-radius: 20px;
}

h1,
h2,
h3,
h4 {
    font-family: "Playwrite US Trad", sans-serif;
    font-size: 125%;
}

h2,
h3,
h4 {
    color: #A8570C;
}

h2 {
    font-size: 180%;
}

h2 input {
  font-size: inherit;
  font-family: inherit;
  color: inherit;
  font-weight: inherit;
}

a {
    color: #8B5E34;
    text-decoration: none;
}

a:hover {
    color: #A8570C;
    text-decoration: underline;
}

.login form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.login label {
    display: flex;
    flex-direction: row;
    font-size: 125%;
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
    align-items: baseline;
}

label[for="showPassword"] {
    display:flex;
    white-space: nowrap;
    justify-content: center;

}

#showPassword {
    width: fit-content;
}

.login button {
    font-size: 125%;
    width: 50%;
    min-width: 200px;
}

.login input {
    font-size: 125%;
    width: 80%;
    padding: 0.25rem;
}

article h2{
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

article h2 div{
    display: flex;
    flex-direction: column;
    align-items: end;
    width: max-content;
    height: max-content;
    gap: 0;
    margin: 0;
}

article h2 div button{
    display: flex;
}

article h2 form input{
    flex: 1 1 auto; 
}

article h2 form button{
    margin: 0;
    flex: 0 0 auto;   
    padding: 0.25rem;          
}

dt {
    font-weight: 600;
}

.recipe {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    line-height: 1.5;   
}

.recipe section{
    width: 75%;
}

textarea{
    width: 100%;
    resize: vertical;
    overflow: auto;
}

.recipe section ol{
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recipe ol li {
  vertical-align: top;
}

.recipe ol li textarea {
  display:inline-block;
  vertical-align: top;
}

.recipe li input[type=number]{
    width: 5ch;
}

.recipe ol ul {
    display: flex;
    flex-direction: column;
    gap:0.25rem;
}

.recipe ol ul li{
    display: flex;
    padding-left: 0.25rem;
    gap:0.25rem;
    list-style-type: circle;
    list-style-position: inside;
}

section .specialButton {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0 0 0;
}

.specialButton a {
    padding: .5em 1em;
    border-radius: 20px;
    background-color: #8B5E34;
    color: #F7F1E8;
}

.specialButton a:hover {
    background-color: #A8570C;
    color: #FFF9F1;
}

.recipeImg img {
    transform: rotate(2deg);
    border: 5px solid white;
    border-radius: 3px;
    width: 100%;
    height: auto;
    padding-bottom: 0.5rem;
}

nav {
    display: flex;
    flex-direction: row;
    align-items: start;
    justify-content: space-between;
    border-top: 3px solid #8B5E34;
    padding: 0.25rem 0 0
}

ul {
    list-style-type: none;
}

ul ol {
    list-style-type: decimal;
}

article div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
}

article ul label {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

section {
    display: flex;
    flex-direction: column;
}

section article {
    background-color: #FFF;
    border-radius: 20px;
    box-shadow: -3px 3px 5px #888;
    padding: 0.5rem;
}

.profileLinks {
    display: flex;
    align-items: end;
    gap: 0.25rem;

}

section article img {
    max-width: 100%;
    height: 100%;
}

.recipeList {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    justify-content: center;
}

.recipeList>li {
    align-items: center;
    max-width: calc((100% - 3rem) / 3);
}

.recipeList li ul{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;

}

li article div ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    text-wrap: nowrap;
    gap: 0.5rem;
}

article ul li:before {
    content: "#";
    color: #888;
}

section aside ul {
    padding-left: 1rem;
    text-indent: -1rem;
}

section ol {
    padding-left: 1em;

}

nav button {
    padding: 0.25rem;
}

nav input {
    padding: 0.25rem;
}

dl {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-wrap: wrap;
}

dl div {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

dl input{
    width: 5ch;
}

div dt {
    width: calc(25%);
}

div dd {
    display:flex;
    width: calc(75%);
}

.recipeSearch {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recipeSearch input {
    padding: 0.25rem;
    width: 100%;
}

.profileHead {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;

}

.profileHead img {
    height: 5rem;
    width: 5rem;
}

.profileData {
    display: flex;
    flex-direction: column;
}

.profileData div {
    display: flex;
    gap: 2rem;
}

.recipeData {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.recipeData section {
    width: calc(100% / 3);
}

.recipeData .description {
    width: calc((100% / 3) * 2);
}

.recipe aside {
    padding-left: 2em;
    text-indent: -2em;
}

.visually-hidden {
    display: none;
}

#errors{
    color: red;
    list-style-type: disc;
    padding-left: 5rem;
    
}

@media (max-width: 700px) {
    .login label {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 600px) {
    .recipeList>li {
        max-width: calc((100% - 3rem) / 2);
    }
}

@media (max-width: 500px) {
    html {
        padding: 0;
    }

    main {
        border-left: none;
        border-right: none;
        gap: 2rem;
    }

    header {
        padding: 0.5rem;
    }

    .recipe {
        flex-direction: column;
        gap: 2rem;
    }

    .recipeData {
        flex-direction: column;
        gap: 2rem;
    }

    .recipeData .description {
        width: 100%
    }

    .recipeData section {
        width: 100%;
        gap: 2rem;
    }
}

@media(max-width: 400px) {
    .recipeList {
        flex-direction: column;
    }

    .recipeList>li {
        max-width: 100%;
    }

}