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

html {
    font-size: 18px;
    display: flex;
}

/* main body */
body {
    font-family: 'Nunito';
    font-size: 18px;
    background-color: #F7F1E8;
    display: flex;
    flex-direction: column;
    padding: 0 0.5rem;
    gap: 3rem;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.content-heading {
    padding-bottom: 1rem;
}

main {
    background-color: #FFF9F1;
    border: 1px solid black;
    border-radius: 15px;
    flex-shrink: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-width: 700px;
    
}

header {
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.25rem;
}

header div,
header nav,
header nav dl {
    display: flex;
}

header nav dl {
    gap: 1rem;
}

header nav form button,
header nav form input {
    padding: 0.25rem;
}

.user-guide {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

header nav {
    justify-content: space-between;
}

h1.maintitle {
    font-size: 180%;
    font-family: 'Playwrite US Trad';
    color: #8B5E34;
}

h1,
h2,
h3 {
    font-size: 22.5px;
    font-family: 'Playwrite US Trad';
    color: #A8570C;
}

.maintitle {
    font-size: 180%;
}

dt {
    font-weight: 600;
}

section {
    line-height: 1.25;
}

a,
.sign-in {
    color: #8B5E34;
    text-decoration: none;
}

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

.button {
    background-color: #8B5E34;
    color: #F7F1E8;
    padding: .5em 1em;
    border-radius: 15px;
}

.button:hover {
    color: #FFF9F1;
    background-color: #A8570C;
}

.recipe-picture {
    transform: rotate(2deg);
    border: 5px solid white;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.mainblock {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem 0;
    align-items: start;
    max-width: 100%;
}


.mainblock>dd {
    border: 1px solid black;
    border-radius: 10px;
    background-color: #FFF;
    padding: 0.5rem;
    line-height: 1.5rem;
    max-width: 100%;
    height: auto;
}

.mainblock dd img {
    max-width: 100%;
    height: auto;
    padding-bottom: 0.5rem;
}

.mainblock dd dl {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0;
}

.mainblock dd dl dd a {
    text-wrap: nowrap;
}

.border-heading {
    border-bottom: #8B5E34 3px solid;
    width: 100%;
    justify-content: space-between;
}


.visually-hidden {
    display: none;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    row-gap: 0;
    padding-bottom: 1.5rem;
}

.recipe-meta dl {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0;
}


.ingredients dl {
    padding-left: 1rem;
}

.ingredients dl dd {
    text-indent: -1rem;
}

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


.prep {
    margin-top: 0.5rem;
}

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

}

.prep dl div {
    display: flex;
    gap: .5rem;
    flex-wrap: nowrap;
}

.prep dl dt {
    flex: 0 0 calc(25% - .25rem);
    font-weight: bold;
}

.prep dl dd {
    flex: 0 0 calc(75% - .25rem);
    margin: 0;
}

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

.search-page-text {
    width: 100%;
    padding: 0.25rem;
}

.user-tab {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.user-tab div {
    display: flex;
    flex-direction: column;
}

.user-tab img {
    width: 5rem;
    height: 5rem;
}


.ingred-steps {
    display: flex;
    margin-top: 3rem;
    gap: 1rem;
    align-items: flex-start;
}

.ingredients {
    flex: 1;
    width: calc((100% - 1rem) / 3);
}

.steps {
    flex: 2;
    width: calc(((100% - 1rem) * 2) / 3);
}

.photo-prep {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


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

@media(max-width: 500px) {

    .recipe-gap,
    .ingred-steps {
        display: block;
    }
    .photo-prep{
        padding-bottom: 1.5rem;
        width: 70%;
    }
    .photo-prep img{
        width: 200px;
        height: 200px;
    }
    .recipe-meta, .content-heading{
        padding-bottom: 0;
    }

    .ingred-steps {
        margin-top: 0px;
        gap: 2rem;
    }

    .prep {
        margin-top: 0rem;
    }

    .ingredients {
        margin-bottom: 2rem;
    }

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

    main {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        border-left: none;
        border-right: none;
    }

    body{
        padding: 0;
    }
    header {
        padding: 0.5rem;
      }

}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-label-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-line input {
    padding: 0.25rem;
    width: 80%;
}

.form-line {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.login-form button {
    width: 50%;
    min-width: 200px;
    align-self: center;
    margin-top: 1rem;
}

@media (max-width: 700px) {
    .form-line input {
        width: 100%;
    }
    .form-line {
        flex-direction: column;
        gap: 0;
      }
}

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

.prep input{
    width: 45px;
}

.edit_page_form textarea {
    width: 100%;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
}

.recipe-title-input {
    font-family: 'Playwrite US Trad';
    font-size: 2.5rem;
    color: #8B5E34;
    font-size: 22.5px;
}

.content-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.edit_steps>ol>li {
    vertical-align: top;
    padding-bottom: 1rem;
}

.edit_steps textarea{
    vertical-align: top;
}
.ingredients-list {
    margin-left: 1rem;
    gap: 1rem;
}
.ingredient-item {
    padding-bottom: 0.25rem;
}

.content-heading input{
    width: 80%;
}

.error-list {
    color: red;
    font-weight: bold;
}

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