* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --cream: #f7f1e8;
    --cast-iron: #2e261c;
    --cacao: #a8570c;
    --paper: #fff9f1;
    --ash: #888;
    --oak: #8b5e34;
    --pure-white: #fff;
}

html {
    display: flex;
    justify-content: center;
    font-size: 18px;
}
body {
    font-family: "Nunito", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;

    background-color: var(--cream);

    width: 100%;
    max-width: 700px;
    padding: 0.5rem;
}
input {
    padding: 0.25rem;
}

@media (max-width: 500px) {
    body {
        padding: 0;
    }
}

h1,
h2,
h3,
h4 {
    font-size: 125%;
}

h1 {
    font-family: "Playwrite US Trad", serif;
    color: var(--oak);
}

h2,
h3,
h4,
h2 input {
    font-family: "Playwrite US Trad", serif;
    color: var(--cacao);
}

h2 {
    font-size: 180%;
}
h2 input {
    font-size: 100%;
}
header ul {
    list-style: none;
}

img {
    width: 100%;
}

#header-top {
    display: flex;
    gap: 0.5rem;
    align-items: end;
    justify-content: end;
}
#header-top h1 {
    margin-right: auto;
}

@media (max-width: 500px) {
    #header-top {
        padding: 0.5rem;
    }
}

nav {
    display: flex;
}
nav ul {
    display: flex;
    gap: 1rem;
}
nav form {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}
nav form button {
    padding: 0.25rem;
}

@media (max-width: 500px) {
    nav {
        padding: 0.5rem;
    }
}

#login-form * {
    font-size: 125%;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
#login-form div {
    display: flex;
    align-items: baseline;
}
#login-form label {
    flex: 1 1 25%;
    font-size: 100%;
}
#login-form #show-password-checkbox-label {
    font-size: 60%;
}
#login-form #show-password-checkbox {
    justify-self: left;
    flex: 0 1 auto;
}

#login-form input, #show-password-checkbox-cont {
    flex: 1 1 75%;
}
#login-form button {
    align-self: center;
    width: 50%;
    min-width: 200px;
}
@media (max-width: 700px) {
    #login-form div {
        flex-direction: column;
        gap: 0;
    }
    #login-form input {
        width: 100%;
    }
}

#recipe-metadata {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
}
#recipe-metadata ul {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5rem;
}

dl {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
dl div {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}
dt {
    font-weight: 600;
    flex: 1 1 25%;
}
dd {
    flex: 2 1 75%;
}

#description-section,
#ingredients-section li,
#steps-section li {
    line-height: 1.25;
}

#ingredients-section ul {
    padding-left: 1rem;
    text-indent: -1rem;
}

#ingredients-section li {
    list-style: none;
}

#steps-section ol {
    padding-left: 1em;
}

#sidebar-section img {
    transform: rotate(2deg);
    border: solid 5px var(--pure-white);
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

#sidebar-section, 
#ingredients-section {
    width: calc((100% - 1rem) * 0.33);
    margin-bottom: 2rem;
    margin-right: 1rem;
}

#description-section,
#steps-section {
    width: calc((100% - 1rem) * 0.67);
}

#recipe-sections-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

@media (max-width: 500px) {
    #recipe-sections-container {
        flex-direction: column;
        gap: 2rem;
    }
    #recipe-sections-container section {
        width: auto;
        margin: 0;
    }
}

a {
    color: var(--oak);
    text-decoration: none;
}
a:hover {
    color: var(--cacao);
    text-decoration: underline;
}

main {
    border: solid 1px var(--ash);
    border-bottom: none;
    border-radius: 25px;
    background-color: var(--paper);
    
    margin-top: 3rem;
    padding: 1rem;
}
@media (max-width: 500px) {
    main {
        border: none;
    }
}

main header {
    margin-bottom: 2rem;
}

hr {
    background-color: var(--oak);
    height: 2px;
    border: none;
    
    margin-bottom: 0.25rem;
}

#index-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

#index-buttons a {
    padding: 0.5em 1em;
    border-radius: 1em;
    color: var(--cream);
    background-color: var(--oak);
}
#index-buttons a:hover {
    color: var(--paper);
    background-color: var(--cacao);
}

.recipe-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
}
@media (max-width: 500px) {
    .recipe-cards-container {
        margin: 0;
    }
}

.recipe-cards-container > li {
    background-color: var(--pure-white);
    border-radius: 10px;
    box-shadow: 0 3px 3px var(--ash);
    padding: 0.5rem;
    width: calc((100% - 2rem) / 3);
    height: fit-content;
}

@media (max-width: 600px) {
    .recipe-cards-container > li {
        width: calc((100% - 1rem) / 2);
    }
}
@media (max-width: 400px) {
    .recipe-cards-container > li {
        width: 100%;
    }
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5rem;
}
.tag-list li {
    text-wrap: nowrap;
}

.recipe-cards-container,
.tag-list {
    list-style: none;
}

.tag-list li::before {
    content: "#";
    color: var(--oak);
}

.visually-hidden {
    display: none;
}

#sign-in-header {
    color: var(--oak);
}

#main-search-bar input {
    width: 100%;
}

#profile-header {
    display: flex;
    gap: 1rem;
}
#profile-header div {
    flex: 1 1 100%;
}
#profile-header img {
    flex: 1 0 auto;
    height: 5rem;
    width: 5rem;
}
#profile-metadata {
    display: flex;
    gap: 2rem;
}

#profile-description {
    margin-bottom: 3rem;
}

/* align edit/save button to top right */
h2 {
    display: flex;
    justify-content: space-between;
    align-items: start;
}
h2 input {
    width: 80%;
}
#recipe-controls {
    display: flex;
    gap: 0.5rem;
}

textarea {
    width: 100%;
    resize: vertical;
}

.step-description {
    vertical-align: top;
}

input[type=number][size] { width: calc(attr(size ch) + 2rem); }

.step-ingredient-list {
    padding-left: 20px;
}
.step-ingredient-list li {
    padding-top: 0.25rem;
}

.step {
    padding-bottom: 1rem;
}

.edit-recipe-error {
    color: red;
}

#makepublic-form {
    display: none;
}