@import url('https://fonts.googleapis.com/css2?family=Playwrite+US+Trad&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

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

html {
    background-color: #F6EFE5;
    font-size: 18px;
    padding: 0 0.5rem;
}

body {
    max-width: 700px;
    color: #2E261C;
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    justify-content: center;
}

textarea {
    width: 100%;
    resize: vertical;
    vertical-align: top;
    box-sizing: border-box;
}

input[type=number][size] {
    width: calc(attr(size number) * 1ch + 2rem);
}

/*=== Typography ===*/

.logo {
    font-family: "Playwrite US Trad", serif;
    font-size: 22.5px;
}

h1 {
    color: #8B5E34;
    font-family: "Playwrite US Trad", serif;
    font-size: 32.4px;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

h1>input[type="text"] {
    flex: 1;
    min-width: 0;
    font: inherit;
    color: inherit;
}

h1>button {
    margin-left: auto;
}


h2,
h3,
h4,
h5,
h6 {
    color: #8B5E34;
    font-family: "Playwrite US Trad", serif;
    font-size: 22.5px;
}

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

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

/*=== Header ===*/

header {
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
    padding-bottom: .5em;
}

header .top-row {
    display: flex;
    justify-content: space-between;
}

header .bottom-row {
    border-top: 3px solid #8B5E34;
    display: flex;
    gap: 0.25rem;
    justify-content: space-between;
    padding: 0.25rem;
    padding-top: 0.25rem;
}


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

/*=== Page layout ===*/

.profile-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-bottom: 2rem;
}

.profile-logo {
    height: 5rem;
    width: 5rem;
}

.welcome-section {
    padding-bottom: 1rem;
}

article {
    background-color: #fbf5ed;
    border: 1px solid #000000;
    border-radius: 10px;
    gap: 1rem;
    margin-bottom: 10px;
    padding: 1rem;
}

article>article {
    background-color: #fffaf4;
}

.recipe-photo {
    border: 5px solid #FFFFFF;
    border-radius: 3px;
    display: block;
    margin-bottom: 0.5rem;
    margin-right: 1rem;
    transform: rotate(2deg);
    width: 100%;
}

/*=== label pairs ===*/

main dl {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
}

main dt {
    flex: 0 0 calc(25% - 0.5rem);
    font-weight: 600;
}

main dd {
    flex: 0 0 calc(75% - 0.5rem);
}

/*=== Recipe columns ===*/

.left-side {
    display: inline-block;
    width: calc(33% - 0.5rem);
}

.right-side {
    display: inline-block;
    width: calc(67% - 0.5rem);
}

.left-side,
.right-side {
    vertical-align: top;
}

.description-container,
.recipe-sections-container {
    display: flex;
    gap: 1rem;
}

main section ul,
main section ol,
main section p {
    line-height: 1.25;
}

/*=== Lists / menus ===*/


menu {
    color: #8B5E34;
    display: flex;
    gap: 1rem;
    list-style: none;
}

.tags li:before {
    content: "# ";
}

.tags {
    color: #8B5E34;
    list-style: none;
}

/*=== Recipe-specific pieces ===*/

.recipe-section {
    margin-bottom: 2rem;
}


.form-errors li {
    color: red;
}

.ingredients li {
    color: #000;
    margin-left: 1rem;
    text-indent: -1rem;
    list-style: none;
}

/* bullets + indent under each step */
.edit-ingredient {
    padding-top: .25rem;
}

.edit-ingredient li {
    padding: .25rem 0;
}

.edit-ingredient-row {
    display: grid;
    grid-template-columns: 0.2fr 0.3fr 0.5fr;
    column-gap: .5rem;
    align-items: center;
}

.edit-ingredient-row input {
    width: 100%;
    padding: .25rem .25rem;
}

.steps>li {
    margin-bottom: 1rem;
}

/*=== Forms / Buttons ===*/

.login-form {
    border: 2px solid #2E261C;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 1em;
}

.login-form label,
.login-form textarea {
    align-items: baseline;
    font-size: 22.5px;
}

.form-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row label {
    flex: 0 0 20%;
}

.form-row input {
    flex: 1 1 80%;
    padding: 0.25rem;
    min-width: 200px;
}

.login-form h1 {
    margin-bottom: 2rem;
}

.login-form button {
    font-size: 22.5px;
    margin: 0rem auto 0rem auto;
    width: 50%;
}

.button-index {
    background: #8B5E34;
    border-radius: 100px;
    color: #F6EFE5;
    padding: .5em 1em;
    text-decoration: none;
}

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

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

/*=== Recipe grid ===*/

.recipe-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 0 1rem;
}

.recipe-grid>article {
    padding: 0.5rem;
}

@media (min-width: 700px) {
    .recipe-grid {
        grid-template-columns: 200px 200px 200px;
    }
}

.recipe-grid img {
    display: block;
    width: 100%;
    max-width: 100%;
}

.recipe-grid .tags {
    flex-direction: row;
    flex-wrap: wrap;
    display: flex;
    text-wrap: nowrap;
}

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

.about-me {
    margin-bottom: 2rem;
}

/*=== Metadata / tags ===*/

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

.recipe-meta .tags {
    display: flex;
    gap: 0.5rem;
}

.recipe-tags-section {
    display: flex;
    gap: 0.5rem;
}

.tags li {
    margin-right: 0.5rem;
}

.visually-hidden {
    display: none;
}

/*=== Media queries ===*/

@media (max-width: 500px) {

    html {
        padding: 0;
    }

    article {
        gap: 2rem;
    }

    header {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        box-sizing: border-box;
    }

    header .bottom-row {
        width: calc(100% + 1rem);
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        box-sizing: border-box;
    }

    .left-side,
    .right-side {
        display: block;
        width: 100%;
    }

    .description-container {
        flex-direction: column;
        gap: 2rem;
    }

    .recipe-section {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .recipe-sections-container {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 700px) {
    .form-row {
        display: block;
    }

    .form-row label {
        width: 100%;
        margin-bottom: 0;
    }

    .form-row input {
        width: 100%;
        min-width: 0;
        margin-top: 0;
    }

    .form-row+.form-row label {
        margin-top: 1rem;
    }
}

@media (max-width: 600px) {
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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