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

html {
    background-color: #F7F1E8;
    font-size: 18px;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-inline: .5rem;

    max-width: 700px;
    width: 100%;
}

h1 {
    font-family: Playwrite US Trad, serif, sans-serif;
    font-size: 1.80em;
    color:#A8570C;
}

h1 input {
    box-sizing: border-box;
    font-family: Playwrite US Trad, serif, sans-serif;
    font-size: 1.40em;
    color:#A8570C;
    width: 100%;
    padding: 10px;
}

h1 button {
    height: 1rem;
    padding: .8rem;
    
    }

h2{
    font-family: Playwrite US Trad, serif, sans-serif;
    font-size: 1.25em;
    color:#A8570C;
}

h3{
    font-family: Playwrite US Trad, serif, sans-serif;
    font-size: 1.00em;
    color:#A8570C;
}

header h1 {
    font-family: Playwrite US Trad, serif, sans-serif;
    font-size: 1.25em;
    color:#A8570C;
}

header {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding-bottom: 3rem;
}

main {
    border: 1px solid #888;
    border-bottom: 0px;
    border-radius: 30px 30px 0px 0px;
    
    background-color: #FFF9F1;
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    padding-inline: 1rem;

}

body {
    font-family: Nunito, serif, sans-serif;
    font-size: 18px;
}

a {
    color: #8B5E34;
    text-decoration: none;
}

form textarea {
    width: 100%;
    resize: vertical;
    vertical-align: top;

}

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

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

ul {
    list-style-type: none;
}

.errors {
    color: red;
}

.recipe-title-line {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
}

.buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2rem;
    padding-top: 1rem;
    gap: 1rem;
}

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

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

.recipe-ingredients {
    line-height: 1.25;
    padding-left: 1rem;
    text-indent: -1rem;
    gap: 1rem;
}

.header-search {
    display: flex;
    flex-direction: row;
    margin-left: auto;
    gap: .25rem;
}

.header-search input {
    padding: .25rem;
}

.recipe-title-line button {
    padding-inline: .25rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.recipe-top-row input {
    width: 7ch;
    padding: .2rem;
    line-height: 1.2;
}

.recipe-steps li {
    margin-left: 1rem;
}

.step {
    margin-bottom: 1rem;
}

.recipe-steps input {
    line-height: 1.5;
}

/* couldn't get this to work */
/*input[type=number][size] {*/
/*    width: calc(attr(size number) * 1ch + 2rem);*/
/*}*/

.recipe-amount {
    width: 3rem;
}

.recipe-steps ul {
    padding-left: 1.1rem;
    list-style-type: circle;
}

.recipe-steps ul > li {
    flex-direction: row;
    justify-content: space-between;
    padding-top: .1rem;

}

.recipe-pic {
    transform: rotate(2deg);
    border: 5px solid white;
    max-width: 100%;
    margin-bottom: .25rem;
}

.prep-row, .cook-row, .total-row, .yield-row {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

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

dt {
    width: calc(25% - .5rem);
    font-weight: 600;
}

dd {
    width: calc(75% - .5rem);
}

dl {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.cook-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.main-heading {
    padding-bottom: 2rem;
}

.total-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.yield-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.recipe-main-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.tags {
    display: flex;
    text-wrap: nowrap;
    flex-wrap: wrap;
    gap: .5rem;
    row-gap: 0;
}

.different-color {
    color: #888;
}

.card-layout {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    align-items: flex-start;
    justify-content: center;
}

.card-layout .recipe-card {
    flex: 1 1 calc((100% - 2rem) / 3);
    /* Used resource: https://stackoverflow.com/questions/48464444/how-to-display-3-items-per-row-in-flexbox   */
}

@media (max-width: 600px) {
    .card-layout .recipe-card {
        flex: 1 1 calc((100% - 2rem) / 2);
    }
}

@media (max-width: 400px) {
    .card-layout .recipe-card {
        flex: 1 1 calc(100% - 2rem);
    }
}

.recipe-card {
    border-radius: 10px;
    box-shadow: 0px 2px 3px 0px #888;
    background-color: #FEFDFA;
    border-top: 1px solid #f7f4ef;
    margin-bottom: 8px;

    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    padding: .5rem;
    max-width: 10.4rem;
}

.card-photo {
    max-width: 100%;
}

.visually-hidden {
    display: none;
}

.profile-avatar {
    width: 5rem;
    height: 5rem;
    gap: 1rem;
}

.profile-left-bottom{
    display: flex;
    gap: 1rem;
    flex-direction: row;
}

.profile-left {
    display: flex;
    flex-direction: column;
}

.profile-split {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: space-between;
}

.login-top-row input {
    height: 2.2em;
    width: 21em;
    background-color: #EAF0FD;
    border: 1.3px solid #767675;
    border-radius: 2.5px;
}

.login-top-row label {
    font-size: 1.25em;
    vertical-align: bottom;
}

.login button {
    vertical-align: bottom;
    font-size: 1.15em;
    border:1.3px solid #767675;
    border-radius: 2.5px;
}

.tag-search-bar {
    width: 100%;
    height: 2rem;
    padding: .25rem;
}

.home-photos {
    border-radius: 10px;
    box-shadow: -2px 4px 3px -2px #888;
    background-color: #FEFDFA;
    border-top: 1px solid #f7f4ef;
    margin-bottom: 0px;
}

.header-top, .header-bottom {
    display: flex;
    flex-direction: column;
    align-items: baseline;
}

.header-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    border-bottom: 2px solid #8B5E34;
}

.header-profile {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-left: auto;
}

.header-bottom {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.header-links {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-right: auto;
}

.recipe-top-row, .recipe-bottom-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.recipe-right {
    width: calc((200% - 2rem) / 3);
    display: flex;
    flex-direction: column;
}

.recipe-left {
    width: calc((100% - 1rem) / 3);
    padding: .25rem;
}

@media (max-width: 500px){
    
    .recipe-top-row, .recipe-bottom-row {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 0;
    }
    
    header {
        padding: 0.5rem;
    }
    
    .header-bottom {
        display: flex;
        flex-direction: column;
    }
    
    main {
        border-left: 0px;
        border-right: 0px;
    }

}

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

.login-username-row {
    gap: 0rem;
}

.login-username-row, .login-password-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: baseline;
}

.show-password-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: .5rem;
}

#username, #password {
    width: 80%;
    padding: .25rem;
}

#sign-in-button {
    width: 50%;
    min-width: 200px;
    display: flex;
    justify-content: center;
    align-self: center;
}

@media (max-width: 700px) {
    .login {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .login-username-row, .login-password-row {
        display: flex;
        flex-direction: column;
        align-items: baseline;
    }
    
    #username, #password {
        width: 100%;
        padding: 0.25rem;
    }
}
