/* 
Page color palette
 #F7F1E8 "cream", :   Page background?
 #2E261C "cast iron", Body?
 #A8570C "cacao",     Link Hovor, headings
 #FFF9F1 "paper",     Main?, signin-browse button text color,
 #888 "ash",          Main border
 #8B5E34 "oak",       Links, signin-browse button, underline for profile name
 #FFF pure white      Article?
*/

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

html {
    font-family: "Nunito", Arial, Helvetica, sans-serif;
    background-color: #F7F1E8;
    font-size: 18px;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    background-color: #FFF9F1;
    border: 1px solid #888;
    border-radius: 40px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.title-section {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 2px solid #8B5E34;
}

nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

nav ul {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

nav form {
    padding-top: 0.25rem;
}

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

article {
    background-color: #FFF;
    box-shadow: 0px 2px 4px #888;
    border-radius: 8px;
}

ul {
    list-style-type: none;
}

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

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

body {
    color: #2E261C;
    font-size: 18px;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
}

main h1 {
    font-size: 180%;
}


main form label {
    font-size: 125%;
}

h1 {
    font-family: "Playwrite US Trad", cursive;
    font-size: 125%;
    color: #A8570C;
}

h2 {
    font-family: "Playwrite US Trad", cursive;
    color: #A8570C;
}

h3 {
    font-family: "Playwrite US Trad", cursive;
    color: #A8570C;
}


dl {
    display: flex;
    flex-direction: column;
    row-gap: 0.25rem;
}

dt {
    font-weight: 600;
}

.recipe-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}

.recipe-title input {
    width: auto;
    font-size: 180%;
    color: #A8570C;
    font-family: "Playwrite US Trad", cursive;
    font-weight: bold;
}

.edit-step-ingredients {
    list-style: circle;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding-top: .25rem;
    margin-left: 1rem;
}

.edit-step-ingredients div {
    display: flex;
    flex-direction: row;
    gap: .25rem;
}

.edit-textarea {
    width: 100%;
    resize: vertical;
}

.recipe-time {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipe-time dt {
    /* Note to self if I need to do this again, this width calc was hard to figure out
    https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Values_and_Units/Using_CSS_math_functions 
    this was helpful in realizing that width can take calc() and got help from Piazza
    Gap = Total width - 0.5rem = 100% - 0.5rem
    Label Column is 25% of that
    Value column is 75% of that
    EDIT: A new note about this, Lecture on 9/11/2025 will help in with remembering how to use calc. 
    Changed the decimal to fraction, it makes it easier to read.
    */
    width: calc((100% - 0.5rem) * (1 / 4));
}

.recipe-time dd {
    width: calc((100% - 0.5rem) * (3 / 4));
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .25rem;
}

.recipe-image-time {
    display: flex;
    flex-direction: column;
    width: calc((100% - 1rem) * (1 / 3));
}

.signin-browse-buttons {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding-top: 1rem;
    justify-content: center;
}

.signin-browse-buttons a {
    border-radius: 18px;
    padding: .5em 1em;
    color: #FFF9F1;
    background-color: #8B5E34;
}

.cards {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding: 0 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cards .card {
    width: calc((100% - 1rem) * (.3));
}

.cards .card article {
    padding: 0.5rem;
}

.cards .card article img {
    max-width: 100%;
}

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

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

.recipe-info {
    line-height: 1.25;
    width: calc((100% - 1rem) * (2 / 3));
}

.recipe-img {
    transform: rotate(2deg);
    border: 5px solid #FFF;
    border-radius: 3px;
    padding-bottom: 0.5rem;
    max-width: 100%;
}

.visually-hidden {
    display: none;
}

.recipe-description {
    padding-bottom: 2rem;
    display: flex;
    flex-direction: row;
    gap: 1rem;

}

.recipe-ingredients-and-steps {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.page-header {
    display: flex;
    flex-direction: column;
}

input[type=number][size] {
    /* This causes an error in rule error with visual studio, I am ignoring it */
    width: calc(attr(size type(<number>)) * 1ch + 2rem);
}

.error-output ul {
    color: rgb(226, 0, 0);
}

.edit-input {
    padding: 0.25rem;
}

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

.recipe-meta ul {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.ingredients-list {
    width: calc((100% - 1rem) * (1 / 3));
}

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

.steps-list {
    width: calc((100% - 1rem) * (2 / 3));
}

.steps-list ol {
    padding-left: 1em;
    line-height: 1.25;
}

.steps-list ol>li {
    padding-bottom: 1rem;
}

.steps-list textarea {
    vertical-align: top;
}

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

.profile-meta img {
    width: 5rem;
    height: 5rem;
}

.profile-meta ul {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.login-form div {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.login-form button {
    width: 50%;
    min-width: 200px;
    font-size: 125%;
}

@media (max-width: 700px) {
    .login-form {
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .cards .card {
        width: calc((100% - 1rem) * (.5));
    }
}

@media (max-width: 500px) {
    .recipe-description {
        flex-direction: column;
        gap: 2rem;
    }

    .recipe-ingredients-and-steps {
        flex-direction: column;
        gap: 2rem;
    }

    html {
        padding: 0;
    }

    main {
        border-left: 0;
        border-right: 0;
    }

    .page-header .title-section {
        padding: 0.5rem 0.5rem 0 0.5rem;
    }

    .page-header nav {
        padding: 0 0.5rem 0.5rem 0.5rem;
    }

    .login-form div {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: baseline;
    }

    .login-form div input {
        width: 80%;
    }
}

@media (max-width: 400px) {
    .cards .card {
        width: calc((100% - 1rem) * (1));
    }
}