/* GENERAL CSS STYLING */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    font-family: 'Nunito', 'Arial', sans-serif;
    background-color: #F7F1E8;
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0 0.5rem;
}

@media screen and (max-width: 500px) {
    html {
        padding: 0;
    }

    html main {
        border-width: 0px;
    }
}

body {
    display: flex;
    flex-direction: column;
    max-width: 700px;
    width: 100%;
}

main {
    background-color: #FFF9F1;
    border: 1px #2E261C solid;
    border-bottom: none;
    border-top-right-radius: 32px;
    border-top-left-radius: 32px;
    width: 100%;
    padding: 1rem;
}

header {
    text-align: right;
    max-width: 700px;
    width: 100%;
    margin-bottom: 3rem;
    vertical-align: bottom;
    padding: 0.5rem;
}

.header-top {
    border-bottom: 2px #8B5E34 solid;
}

.header-top div {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    vertical-align: bottom;
    gap: 0.5rem;
}

header section,
header nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

header nav ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 1rem;
}

header nav li {
    display: inline;
    text-wrap: nowrap;
}

h1,
h1 a,
h2,
h3 {
    font-family: 'Playwrite US Trad', 'Brush Script MT', cursive;
    font-size: 22.5px;
    color: #A8570C;
}

em {
    font-style: normal;
    color: #888;
}

ul {
    list-style-type: none;
}

dl dt,
#login-input-container {
    font-weight: 600;
}

form input,
form button {
    margin-top: 0.25rem;
    padding: 0.25rem;
}

a,
header a {
    text-decoration: none;
    color: #8B5E34;
}

a:hover {
    text-decoration: underline;
    color: #A8570C;
}

.heading {
    margin-bottom: 2rem;
}

.recipe-title-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.recipe-title {
    font-size: 32.4px;
}

div.edit-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.heading .title-input {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 90%;
}

.heading .title-input {
    font-weight: normal;
    font-size: 14px;
}

/* title input */
#recipe-body #title {
    font-size: xx-large;
    font-family: "Playwrite US Trad", cursive;
    color: #A8570C;
}

.visually-hidden {
    display: none;
}

.button {
    align-self: right;
}

/* LOGIN PAGE CSS STYLING*/

#login-input-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: 22.5px;
}

#login-input-container section {
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

#password-input,
#username-input {
    font-size: 22.5px;
    text-align: left;
    width: 80%;
    margin: auto;
}

#login-input-container button {
    font-size: 22.5px;
    font-weight: normal;
    width: 50%;
    min-width: 200px;
    margin: auto;
}

#login-input-container .pass-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    margin-top: -20px;
    margin-left: 6.75rem;
    font-size: 0.75rem;
}

@media screen and (max-width: 700px) {
    #login-input-container section {
        flex-direction: column;
    }

    #password-input,
    #username-input {
        width: 100%;
    }
}

/* RECIPE PAGE CSS */
.errors ul {
    padding-bottom: 1rem;
}

.errors li {
    color: rgb(222, 0, 0);
}

#recipe-body .metadata {
    display: flex;
    flex-direction: row;
    column-gap: 1.5rem;
    flex-wrap: wrap;
}

#recipe-body .metadata-tags,
#recipe-body .metadata div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 0.5rem;
}

#recipe-body .metadata-tags li {
    display: inline;
}

#recipe-container {
    display: flex;
    flex-direction: column;
    row-gap: 2rem;
}

#recipe-container>div {
    display: flex;
    flex-direction: row;
    column-gap: 1rem;
}

textarea {
    width: 100%;
    resize: vertical;
}


#recipe-ingredients-container h3,
#recipe-steps-container h3 {
    margin-bottom: 0.5rem;
}

#recipe-photo-container,
#recipe-ingredients-container {
    /* subtract (column-gap)/2 -> 1rem/2 */
    max-width: calc(33.3% - 0.5rem);
}

#recipe-description-container,
#recipe-steps-container {
    /* subtract (column-gap)/2 -> 1rem/2 */
    width: calc(66.6% - 0.5rem);
}

#recipe-description-container,
#recipe-ingredients-container,
#recipe-steps-container {
    line-height: 1.25;
}

#recipe-photo-container dl {
    display: flex;
    flex-direction: column;
    gap: 0.25rem 0;
}

#recipe-photo-container dl div {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

#recipe-photo-container dl dt {
    /* subtract the (column-gap)/2 */
    width: 2rem;
    margin-right: 1.5rem;
}

#recipe-photo-container dl dd {
    /* subtract the (column-gap)/2 */
    width: calc(75% - 0.25rem);
    margin-left: 0.25rem;
}

#recipe-photo-container dl.time-input input {
    input[type=number][size] {
        width: calc(attr(size number) * 1ch);
    }
}

#recipe-container .recipe-image {
    transform: rotate(2deg);
    border: 5px white solid;
    border-radius: 3px;
    width: 100%;
    margin-bottom: 0.5rem;
}

#recipe-ingredients-container li {
    padding-left: 1rem;
    text-indent: -1rem;
}

#recipe-steps-container textarea {
    vertical-align: top;
}

#recipe-steps-container #description {
    vertical-align: top;
}

#recipe-steps-container li ul.ingredient-input-list {
    list-style-type: circle;
    margin-bottom: 1rem;
}

#recipe-steps-container .ingredient-input-list li {
    margin-left: 1.25rem;
}

#recipe-steps-container h3 {
    display: flex;
    flex-direction: column;
    align-items: start;
}

#recipe-steps-container ol {
    padding-left: 1em;
}

#recipe-input {
    width: 100%;
}

/* #recipe-cards {
    row-gap: 1rem;
} */

@media screen and (max-width: 500px) {
    #recipe-container {
        display: flex;
        flex-direction: column;
        row-gap: 2rem;
    }

    #recipe-body div {
        display: flex;
        flex-direction: column;
        width: 100%;
        row-gap: 2rem;
    }

    #recipe-body .recipe-title-container {
        gap: 0;
        flex-direction: row;
    }

    #recipe-photo-container,
    #recipe-description-container,
    #recipe-steps-container,
    #recipe-ingredients-container {
        width: 100%;
    }
}

/*INDEX PAGE CSS STYLING */

#index-buttons {
    display: flex;
    text-align: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

#index-buttons a {
    color: #F7F1E8;
    background-color: #8B5E34;
    border-radius: 15px;
    padding: .5em 1em;
}

#index-buttons a:hover {
    text-decoration: none;
    background-color: #A8570C;
    color: #FFF9F1
}

/* PROFILE PAGE CSS STYLING */

#profile-heading {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    column-gap: 1rem;
}

#profile-metadata {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 1rem;
}

#profile-logo {
    width: 5rem;
    height: 5rem;
}

/* SEARCH PAGE CSS STYLING */

#search-body form input {
    width: 100%;
}

/* CARD CSS STYLING */

.card-container li article {
    background-color: #FFFDFA;
    border-radius: 12px;
    box-shadow: 0.5px 2px 3px #888;
}

.card-container .card h3 a {
    font-size: 18px;
    color: #A8570C;
    width: 100%;
}

.card-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-top: 2.5rem;
}

#index-cards .card-container {
    margin-top: 0;
}

.card-container .card {
    /* subtract (column-gap)/2 -> 3rem/2 */
    width: calc(33.333% - 0.6667rem);
    /* looks weird, but accounts for leftover items being different size */
    max-width: calc(33.333% - 0.6667rem);
}

.card-container .card article {
    padding: 0.5rem;
}

.card-container article img {
    width: 100%;
}

.tag-container {
    text-wrap: nowrap;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 0.5rem;
    margin-left: 0;
}

.tag-container li {
    text-wrap: nowrap;
}

@media screen and (max-width: 600px) {
    .card-container .card {
        /* subtract (column-gap)/2 -> 2rem/2 */
        width: calc(50% - 0.5rem);
        /* looks weird, but accounts for leftover items being different size */
        max-width: calc(50% - 0.5rem);
    }
}

@media screen and (max-width: 400px) {
    .card-container .card {
        width: 100%;
        max-width: 100%;
    }
}