* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    display: flex;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    background-color: #F7F1E8;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 700px;
    padding-left: .5rem;
    padding-right: .5rem;
    width: 100%;
}




/* header design start */
header {
    display: flex;
    flex-direction: column;
    padding-bottom: 3rem;
}

header div {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#header-navlinks {
    gap: 1rem;
}

#header-form {
    display: flex;
    gap: 0.25rem;
}

#header-searchbar,
#header-searchbutton {
    margin-top: .25rem;
}

#header-searchbar {
    width: 150px;
    height: 27px;
    padding: .25rem
}

#header-searchbutton {
    width: 55px;
    height: 27px;
}

/* header design end */

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    background-color: #FFF9F1;
    border: 1px solid black;
    border-radius: 35px 35px 0 0;
    border-bottom: none;
}

header h2 {
    color: #8B5E34;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playwrite US Trad', cursive;
    font-size: 125%;
    color: #A8570C;
}

a {
    color: #8B5E34;
    text-decoration: none;
}

a:hover {
    color: #A8570C;
    text-decoration: underline;
}

h1 {
    font-size: 180%;
}

#login {
    font-size: 125%;
}

#cook-time {
    font-weight: 800;
}

.recipe-contents {
    line-height: 1.25;
}

ul {
    list-style-type: none;
}

.homepage-buttons {
    background-color: #8B5E34;
    color: #F7F1E8;
    padding: .5em 1em;
    border-radius: 25px;
}

.homepage-buttons:hover {
    background-color: #A8570C;
    color: #FFF9F1;
    text-decoration: none;
}

#heading-border {
    border-bottom: 2px solid #8B5E34;
}

.visually-hidden {
    display: none;
}

#group-of-recipe-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    background-color: #FFF;
    border-radius: 15px;
    padding-top: 7.5px;
    padding-bottom: 7.5px;
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2);
    padding: 1rem .5rem;
    width: calc((100% - 2rem) / 3); 
    flex-grow: 1;
}

.hashtags {
    display: flex;
    gap: 0 .5rem;
    flex-wrap: wrap;
    color: #8B5E34
}

.hashtags li {
    text-wrap: nowrap;
}

.content-heading {
    padding-bottom: 2rem;
}

/* recipe page design start */
#recipe-header-metadata {
    display: flex;
    column-gap: 1.5rem;
    flex-wrap: wrap;
}

#recipe-tags {
    display: flex;
    gap: 0.5rem;
    font-size: 1rem;
    align-items: center;
}

#recipe-tag-section {
    display: flex;
    gap: .5rem;
}

.hashtag {
    display: flex;
}

.hash {
    color: #92928e;
}

.word {
    color: #8B5E34;
}

#recipe-intro {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
}

#img-and-metadata-pair {
    display: flex;
    flex-direction: column;
    width: calc((100% * 1/3) - .5rem)
}

#recipe-description {
    display: flex;
    flex-direction: column;
    width: calc((100% * 2/3) - .5rem);
    line-height: 1.25;
}

#recipe-image {
    transform: rotate(2deg);
    border: 5px solid #FFF;
    border-radius: 3px;
    padding-bottom: .5rem;
}

#time-info {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0.25rem;
}

.label-value {
    display: flex;
    gap: .5rem;
}

.label-value dt {
    width: 25%;
    font-weight: bold;
}

.label-value dd {
    width: 75%;
}

#ingredients_and_steps {
    display: flex;
    flex-wrap: wrap;
    line-height: 1.25;
    gap: 1rem;
    padding-top: 2rem;
}

#ingredients_and_steps h2 {
    padding-bottom: .5rem;
}

#ingredients {
    width: calc((100% * 1/3) - .5rem)
}

#ingredients ul {
    padding-left: 1rem;
    text-indent: -1rem;
}

#steps {
    width: calc((100% * 2/3) - .5rem);
}

#steps ol {
    padding-left: 1em;
}

/* recipe page design end */

/* recipe edit page design start */

#edit_title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

#edit-make-public {
    display: flex;
    gap: 0.5rem

}

.recipe-header-buttons {
    padding: 0.25rem
}

#recipe_title {
    font-family: 'Playwrite US Trad', cursive;
    font-size: 125%;
    color: #A8570C;
}

input[type=number][size] { 
    width: calc(attr(size type(<number>)) * 1ch + 2rem); 
}

input {
    padding: 0.25rem;
}

#step_bullet {
    display: flex;
    flex-direction: column;
    gap: 0.25rem
}

#steps_edit {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style-type: decimal;
} 

.step_description_container {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.25rem;
}

#ingredient_form {
    list-style-type: circle;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#ingredient_form_element {
    margin-left: 1.1rem;
}

.error{
    color:red;
}

/* recipe edit page design end */

/* index page design start */

#pair-of-homepage-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
}

/* index page design end */

/* search page design start */

#search-page-form input {
    width: 100%;
    padding: .25rem;
}

/* search page design end */

/* profile page design start */

#profile-page-metadata {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-image {
    width: 5rem;
    height: 5rem;
}

/* profile page design end */

#login-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#login-inputs-button {
    display: flex;
    justify-content: center;
}

#login-inputs-button button {
    width: 50%;
    min-width: 200px;
    padding: 0.25rem;
}

.login-label {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    justify-content: space-between;
}

.login-label input {
    width: 80%;
    padding: .25rem;
}

#password_setting {
    display: flex;
    gap:0.5rem
}

@media (max-width: 500px) {
    body {
        padding-left: 0px;
        padding-right: 0px;
    }

    main {
        border-left: none;
        border-right: none;
    }

    header {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    #heading-border {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }

    #recipe-intro {
        padding-bottom: 0rem;
    }

    #recipe-intro p,
    #steps {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    #img-and-metadata-pair,
    #recipe-intro p,
    #ingredients,
    #steps {
        margin-bottom: 2rem;
    }

    #ingredients_and_steps {
        padding-top: 0rem;
    }
}

@media (max-width: 699px) {
    .login-label {
        flex-direction: column;
        gap: 0rem;
    }

     .login-label label {
        width: 100%;
    }
    .login-label input {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .recipe-card {
        width: calc((100% - 1rem) / 2);
    }
}


@media (max-width: 400px) {
    .recipe-card {
        width: 100%;
    }
}