* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    display: flex;
    font-size: 18px;
    color: #2E261C;
    background: #FFF9F1;
    max-width: 700px;
    align-content: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.nunito- {
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.nunito- {
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 0;
    font-style: italic;
}

.playwrite-us-trad- {
    font-family: "Playwrite US Trad", cursive;
    font-optical-sizing: auto;
    font-weight: 100;
    font-style: normal;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 3rem;
    /*Font settings*/
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    font-weight: 400;
    font-style: normal;
    /*Color setting*/
    color: #2E261C;
    background: #FFF9F1;
}

.header-row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    line-height: 1.1;
}

.header-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid #A8570C;
    padding-top: 0.25rem;
}

header nav {
    display: flex;
    gap: 1rem;
}

header form {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.25rem;
    gap: 0.5rem;
    text-align: right;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 2rem;
    margin-bottom: 2rem;
}

img {
    width: 100%;
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Playwrite US Trad", cursive;
    font-weight: 100;
    font-style: normal;
    color: #A8570C;
}

h1 {
    font-size: 1.8em;
}

h2, h3, h4, h5, h6 {
    font-size: 1.25em;
}

a {
    color: #8B5E34;
    text-decoration: none;
}

    a:visited {
        color: #8B5E34;
    }

    a:hover {
        color: #A8570C;
        text-decoration: underline;
    }

    a:focus {
        color: #A8570C;
        text-decoration: underline;
    }

dl {
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    font-weight: 600;
    font-style: normal;
}

#description {
    line-height: 1.25;
    margin-bottom: 2rem;
}

    #description img {
        width: 100%;
        height: auto;
        margin-bottom: 0.5rem;
        box-sizing: border-box;
    }

#steps {
    line-height: 1.25;
}

#ingredients {
    line-height: 1.25;
}

a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5em 1em;
    gap: 1rem;
    margin-top: 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: #F7F1E8;
    background: #8B5E34;
}

    a.btn:hover {
        color: #A8570C;
        background: #FFF9F1;
    }

.card-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 1rem;
    padding: 0 1rem;
    max-width: 700px;
    width: 100%;
    box-sizing: border-box;
}


.card {
    flex: 1 1 calc((100% - 1rem) / 3);
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    border: 2px solid #888;
    border-radius: 12px;
    text-decoration: none;
    white-space: normal;
    text-wrap: wrap;
    overflow: hidden;
}


    .card img {
        display: block;
        width: 100%;
        height: auto;
    }

    .card h3 {
        margin: 0.5rem 0 0;
    }

.hashtag {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0;
    margin-top: 0.5rem;
    white-space: nowrap;
    text-wrap: nowrap;
}

#description img {
    display: block;
    box-sizing: border-box;
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
    transform: rotate(2deg);
    border-style: solid;
    border-color: white;
    border-width: 5px;
}

#description dl {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
}

#description dt {
    flex: 0 0 calc(25% - 0.25rem);
    font-weight: 600;
}

#description dd {
    flex: 0 0 calc(75% - 0.25rem);
}

section {
    border-style: solid;
    border-color: #888;
    border-width: 2px;
    border-radius: 15px;
}

.metadata {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 0;
    gap: 1.5rem;
}

    .metadata ul {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        list-style: none;
        text-decoration: none;
    }

.tags {
    display: flex;
    gap: 0.5rem;
}


#ingredients ul {
    padding-left: 1rem;
    text-indent: -1rem;
    list-style: none;
}

#steps {
    padding-left: 1rem;
}

.searchbar {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

    .searchbar h1 {
        margin-bottom: 0.5rem;
    }

    .searchbar form {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .searchbar input[type="search"] {
        flex: 1;
        padding: 0.25rem;
        margin: 0.25rem;
        border: .5px solid #888;
        border-radius: 10px;
        font-size: 1rem;
    }

    .searchbar button {
        padding: 0.25rem 0.75rem;
        margin: 0.25rem;
        font-size: 1rem;
        border: 1px solid #888;
        border-radius: 10px;
        background: #8B5E34;
        color: #F7F1E8
    }

        .searchbar button:hover {
            background: #FFF9F1;
            color: #A8570C;
        }

.pageTitle {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 700px;
    width: 100%;
    margin-bottom: 1rem;
}

.aboutMe {
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 700px;
}

.profilePic {
    width: 5rem;
    height: 5rem;
    justify-content: flex-start;
}

.recipe-row {
    display: flex;
    gap: 1rem;
    max-width: 700px;
    width: 100%;
    margin-bottom: 1rem;
}

.col-1 {
    flex: 1;
    min-width: 0;
}

.col-2 {
    flex: 2;
    min-width: 0;
}

form label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

form input {
    flex: 0 0 80%;
    padding: 0.25rem;
    text-align: right;
}

form button {
    display: block;
    width: 50%;
    min-width: 200px;
    margin: 1rem auto 0;
    padding: 0.5rem 1rem;
    border: 1px solid #888;
    -moz-border-radius: inherit;
    -webkit-border-radius: inherit;
    border-radius: inherit;
    background: #8B5E34;
    color: #F7F1E8;
    text-align: center;
}

    form button:hover {
        background: #FFF9F1;
        color: #A8570C;
    }

.ThreeCards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1rem;
}

    .ThreeCards article {
        flex: 1 1 calc(33% - 1rem);
        padding-left: 0.5rem;
        box-sizing: border-box;
    }

    .ThreeCards img {
        width: 100%;
        height: auto;
    }

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.edit-title-wrap {
    position: relative;
    display: block;
}

.recipe-title-input {
    width: 100%;
    font-family: "Playwrite US Trad", cursive;
    font-weight: 100;
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.1;
    border: none;
    border-bottom: 2px solid #888;
    padding-right: 8rem;
}

    .recipe-title-input:focus {
        outline: none;
        border-color: #A8570C;
    }

.recipe-head .edit-save-btn {
    position: absolute;
    top: 0;
    right: 0;
    transform: translateY(20%);
    width: auto !important;
    min-width: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.block-textarea {
    width: 100%;
    resize: vertical;
}

.steps-list .step-desc {
    vertical-align: top;
}

.step-ingredients {
    margin-left: 2rem;
    padding-left: 1rem;
    list-style: disc;
}

.step-item {
    margin-bottom: 1rem;
}

.step-ingredient-row {
    padding: 0.25rem 0;
}

.form-errors {
    color: #b00020;
    margin: 1rem 0;
}

    .form-errors ul {
        margin: 0;
        padding-left: 1.25rem;
    }

input[type="number"][size] {
    width: calc(attr(size number) * 1ch + 2rem);
}

.site-bar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
}

.header-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

    .header-row-top h1 {
        margin: 0;
        line-height: 1.1;
        font-size: clamp(1.25rem, 4vw + 0.25rem, 2.25rem);
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.userbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    margin: 0;
    flex: 0 0 auto;
}

    .userbar .who {
        min-width: 0;
        max-width: clamp(12ch, 28vw, 32ch);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .userbar a {
        white-space: nowrap;
    }

.header-row-bottom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

    .header-row-bottom nav {
        grid-column: 1;
        justify-self: start;
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .header-row-bottom .site-search {
        grid-column: 2;
        justify-self: center;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .header-row-bottom .site-search input[type="search"] {
            width: min(48ch, 55vw);
        }

@media (max-width: 420px) {
    .userbar .who {
        display: none;
    }
}



@media (max-width:500px) {
    html {
        padding: 0;
    }

    .header-row-bottom {
        border-top: 1px solid #A8570C;
        padding-top: 0.25rem;
        margin: 0;
    }

    section {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    header {
        width: 100%;
        margin-left: calc(50%- width/2);
        margin-left: calc(50%- width/2);
        box-sizing: border-box;
        padding: 0.5rem;
    }

    .recipe-row {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    #description img {
        order: 1;
    }

    .metadata {
        order: 2;
    }

    form div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    form input {
        width: 100%;
    }

    #username {
        margin-bottom: 1rem;
    }

    .searchbar form {
        display: flex;
        gap: 0.5rem;
        width: 100%;
    }
}

@media (max-width:600px) {

    .ThreeCards article {
        flex: 1 1 calc(50% - 1rem);
    }
}

@media (max-width:400px) {
    .ThreeCards article {
        flex: 1 1 100%;
    }
}

.show-password-row {
    flex-direction: row; 
    align-content:flex-start;
    align-items:flex-start;
    gap: 0.35em;
    margin-top: 0.5em;
}

    .show-password-row input[type="checkbox"] {
        margin: 0;
    }

    .show-password-row label {
        display: inline-flex; 
        margin: 0; 
        white-space: nowrap; 
    }