@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');

:root 
{
    --cream: #f7f1e8;
    --castiron: #2e261c;
    --cacao: #A8570c;
    --paper: #FFF9F1;
    --ash: #888;
    --oak: #8B5E34;
    --white: #FFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body{
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    color: var(--castiron);
    background-color: #f7f1e8;
    display:flex;
    flex-direction: column;
    flex-wrap: wrap;
    max-width: 700 px;
    padding-left: .5rem;
    padding-right: .5rem;
}

html{
    font-size: 18 px;
}

header{
    margin-bottom: 3rem;
    display:flex;
    flex-direction: column;
}

header p{
    text-align: right;
}

header form{
    text-align: right;
}

header input{
    margin-top:.25rem;
    padding:.25rem;
}

header button{
    padding:.25rem;
}

header nav{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

header ul{
    display:flex;
    flex-direction: row;
    gap: 1rem;
}

main{
    padding: 1rem;
}
main h1{
    padding-bottom: 2rem;
}

strong{
    font-weight: 600;
}

a{
    color: var(--oak);
    text-decoration: none;
}
a:hover{
    color: var(--cacao);
    text-decoration: underline;
}

:is(h1,h2,h3,h4,h5,h6){
    font-family: 'Playwrite US Trad', cursive;
    color: var(--cacao);
}

h1{
    font-size: calc(18px * 1.80);
    position: relative;
    padding-right: 6rem;
}

h1 form[action*="/edit"]{
    position: absolute;
    top: 0;
    right: 0;
}

h1 input[type = "text"]{
    font-family: 'Plawrite US Trad', cursive;
    font-size: 3rem;
    border: 1px solid #ccc;
    padding: .25 rem;
    width: 100%;
    box-sizing: border-box;
}

h1 label[for="save"]{
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-100%);
}

textarea{
    width: 100%;
    resize:vertical;
    font-family: inherit;
    padding: 0.5 rem;
    border: 1px solid #ccc;
}

input{
    border: 1px solid black;
    border-radius: 3px;
}

main{
    background-color: var(--white);
    border: 1px solid var(--castiron);
    border-radius: 30px;
}

nav ul{
    list-style-type: none;
}

dl{
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

dt{
    flex: 0 0 calc((100% - .5) * .25);
    max-width: calc((100% - .5) * .25);
}
dd{
    flex: 1 1 calc((100% - .5rem) * .75);
}

main input{
    width:100%;
    padding: .25rem;
}

input[type="number"], input[type="text"]{
    padding: .25 rem;
    border: 1px solid #ccc;
}

:is(h2,h3,h4,h5,h6){
    font-size: calc(18px * 1.25);
}

.recipeInfo{
    line-height: 1.25;
}

.recipeInfo > ul{
    list-style-type: none;
}

.linkButton{
    background-color: var(--oak);
    color:var(--cream);
    padding: .5em 1em;
    border-radius: 15px;
}

.visually-hidden{
    display:none;
    overflow:hidden;
}

.tag{
    list-style-type: none;
}

.headerTopRow{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: end;
    border-bottom: 3px solid var(--oak);
}

.headerTopRow p{
    margin-left: auto;
    padding-right: .5rem;
}

.headerBottomRow{
    display: flex;
    flex-direction: row;
    justify-content: start;
}

.recipeMeta{
    display:flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-content: flex-start;
}

.recipeMeta ul{
    display:flex;
    flex-direction:row;
    gap:.5rem;
}

.recipeImg{
    max-width: 100%;
    margin-bottom: .5rem;
    padding: 1rem .5rem;
}

.pair{
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    gap: .5rem;
}

.cardGrid{
    display:flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    list-style-type: none;
    align-items: start;
}

.card{
    padding: .5rem;
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 0;
}

.card img{
    width: 100%;
    height: auto;
}

.card ul{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .5rem;
    line-height: 1;
    list-style-type: none;
}    
.card li{
    text-wrap: nowrap;
}
.loginPair{
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: baseline;
}
.loginPair input{
    width: 80%;
    padding: .25rem;
    margin-bottom: 1rem;
}

.step-ingredients {
    margin-left: 2rem;
    margin-top: .5rem;
    list-style-position: inside;
}

.step-ingredients li {
    padding: .25 rem 0;
    display: flex;
    gap: .5rem;
    align-items:center;
}

.step-ingredients li::before{
    content: "◦";
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.step-ingredients input[type="number"]{
    width: 4rem;
}
.step-ingredients input[type="text"]:nth-of-type(1){
    width: 8rem;
}
.step-ingredients input[type="text"]:nth-of-type(2){
    width: 10rem;
    flex-grow: 1;
}

.error-list {
  color: #a94442;                
  background-color: #fbeaea;     
  border-left: 4px solid #d9534f; 
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  font-family: "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.error-list h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  color: #d9534f;
}

.error-list ul {
  margin: 0;
  padding-left: 1.2rem;
}

.error-list li {
  margin: 0.25rem 0;
}

#prep_time, #cook_time, #serves {
    width: 4rem;
}

#indexButtons{
    display:flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

#loginForm{
    font-size: calc(18px * 1.25);
}

#recipeImg{
    transform:rotate(2deg);
    border: 5px solid var(--white);
    border-radius: 3px;
}

#recipeDescription{
    margin-bottom: 2rem;
}

#recipeIngredients li{
    padding-left: 1rem;
    text-indent: -1rem;
}

#recipeSteps ol{
    padding-left: 1rem;
}

#recipeSteps > ol > li{
    padding-bottom: 1rem;
}

#recipeSteps li > textarea {
    vertical-align: top;
}

#photoDescription {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

#infoSteps{
    display: flex;
    flex-direction: row;
    gap: 1rem;

}

#photoMeta,#recipeIngredients{
    flex: 1;
}

#recipeDescription, #recipeSteps{
    flex: 2;
}

#loginHeader{
    border-bottom: 3px solid var(--oak);
    height: 25px;
    margin-bottom: 15px;
}

#loginMain{
    background-color: var(--paper);
    border: 1px solid var(--castiron);
    border-radius: 10px;
}

#loginButton{
    display: block;
    width: 50%;
    min-width: 200px;
    margin: 1rem auto;

}

#profileMeta{
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

#profileMeta h1{
    padding: 0;
}

#profileMeta img{
    height: 5rem;
    width: 5rem;
}

@media (max-width: 500px){
    #photoDescription{
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    #infoSteps{
        flex-direction: column;
        gap: 2rem;
    }

    dl, #recipeDescription, #recipeIngredients, #recipeSteps{
        max-width: 100%;
        flex: none;
    }

    main{
        padding: 0;
        border-left: none;
        border-right: none;
    }

    header{
        padding: .5rem;
    }
}

@media (max-width: 700px){
    .loginPair{
        flex-direction: column;
        gap: 0;
        
    }
}

@media(max-width: 600px){
    .card{
        flex: 1 1 calc(50% - 1rem);
    }
}

@media(max-width: 400px){
    .card{
        flex: 1 1 100%;
    }
}


