* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 18px; 
}




body {
  font-family: "Nunito", cursive;
  font-size: 18px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Playwrite US Trad", cursive;
  font-weight: 400;             
  font-size: 22.5;                    
  color: var(--cacao);
}

:root {
  --cream:   #F7F1E8;
  --cast:    #2E261C;
  --cacao:   #A8570C;
  --paper:   #FFF9F1;
  --ash:     #888888;
  --oak:     #8B5E34;
  --white:   #FFFFFF;
}

header{
   display: flex; flex-direction: column;
   justify-content: center;
   margin-bottom: 3rem;
   padding: 0 0.5rem; 
}

.top-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end; 
}


.bot-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.header-bottom-nav {
  display: flex;
  gap: 1rem; 
}


nav{
  max-width: 700px;
}

.search-form input,
.search-form button {
  padding: 0.25rem;
}

.search-form{
  margin-top: 0.25rem;
}

body {
  background-color: var(--cream);
  color: var(--cast);      
}

body{

   display: flex; flex-direction: column;
   justify-content: center;
   padding: 0 0.5rem; 
}

main {
  background-color: var(--paper);
  border: 1px solid var(--ash); 
  border-radius:  30px;
  max-width: 700px;
  padding: 1rem;  
  
}

.heading {
  margin-bottom: 2rem;
}

#description{
  margin-bottom: 2rem;
}


.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;  
  align-items: center;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;   
}



.step {
  padding-left: 1em;
}

a {
  color: var(--oak);
  text-decoration: none;
}
a:hover {
  color: var(--cacao);           
  text-decoration: underline;
}

.button-link {
  background-color: var(--cacao);
  color: var(--paper);
  font-size: 22.5;  
  padding: .5em 1em;
  border-radius: 999px;
}

.actions {
  display: flex;
  justify-content: center; 
  gap: 1rem;               
  margin-top: 1rem;        
}

.button-link:hover {
  background-color: var(--cacao);
  color: var(--paper);
}

.recipe-photo {
  max-width: 100%;
  transform: rotate(2deg);
  border: 5px solid var(--white);
  border-radius: 3px;
  margin-bottom: 0.5 rem;
}

.recipe-facts {
  display: flex;
  flex-direction: column;     
  row-gap: 0.25rem;    
}

.recipe-facts .fact {
  display: flex;
  column-gap: 0.5rem;
}

.recipe-facts .fact > dt {
  flex: 0 0 calc((100% - 0.5rem) / 4);
}

.recipe-facts .fact > dd {
  flex: 0 0 calc((100% - 0.5rem) * 3 / 4);
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;              
  padding-block: 1rem;   
  align-items: flex-start;  

}

.card-grid >li{
  flex: 0 1 calc((100% - 2rem) / 3);
}

.card {
  border: 0.5px solid #ccc;
  border-radius: 10px;
  padding: 0.5rem;
  align-items: stretch; 
}

.card img {
  width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  .card-grid >li {
    flex: 0 1 calc((100% - 1rem) / 2);
  }
}

@media (max-width: 400px) {
  .card-grid >li {
    flex: 0 1 100%;
  }
}

.tags-index {
  column-gap: 0.5rem; 
  display: flex;
  flex-wrap: wrap;       
}

.tags-index > a{
  white-space: nowrap;
}


.recipe-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;               
  align-items: flex-start;  
}

.recipe-row .col-left  { flex: 0 1 calc((100% - 1rem) / 3); }
.recipe-row .col-right { flex: 0 1 calc((100% - 1rem) * 2 / 3); }

.recipe-row img { max-width: 100%; height: auto; display: block; }


@media (max-width: 500px) {
  .recipe-row {
    display: block;     
             
  }

  .recipe-row .col-left,
  .recipe-row .col-right {
    width: 100%;             
    margin-bottom: 2rem; 
  }

}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: row;
  align-items: baseline;   
  gap: 0.5rem;
}


.field > input {
  width: 80%;           
  padding: 0.25rem;       
 
}

.login-form button {
  display: block;              
  width: 50%;                  
  min-width: 200px; 
  margin: 0 auto;              
  padding: 0.5rem;                  

}

@media (max-width: 700px) {
  .field {
    margin-top: 1rem;
    flex-direction: column;   
    gap: 0;                   
  }

}


dt{
    font-weight: 600;
}

ul > li{
  list-style-type: none;
}

.profile-dishes{
  border: 0.5px solid #ccc;
  border-radius: 10px;
}

#profile-heading {
  display: flex;
  justify-content: space-between;  
  align-items: center;             
  gap: 1rem;                       
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem; 
}

.profile-logo {
  width: 5rem;
  height: 5rem;
}


#tag-box {
  font-weight: bold;
  font-size: 18px; 
  width: 100%;  
  padding: 0.25rem;      
}


main section p,
main section ul,
main section ol {
  line-height: 1.25;
}

.visually-hidden {
  display: none;
}

@media (max-width: 500px) {
  html, body {
    padding-inline: 0;       
  }

  main {
    border: none;                          
    border-top: 1px solid var(--ash);      
    border-bottom: 1px solid var(--ash);                       
    padding-inline: 0;      
  }

  header {
    padding-inline: 0.5rem;  
  }

  header form {
    display: none;
  }

  .site-title { display: none; }
  .profile { margin-left: 0; }

}

.ingredients li {
  padding-left: 1rem;
  text-indent: -1rem; 
}


.title-wrap {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: start;
  justify-content: space-between;
}

textarea {
  width: 100%;
  resize: vertical;
}

.step-item textarea {
  vertical-align: top;
  display: inline-block;
}


.title-input {
  font-family: "Playwrite US Trad", cursive;
  font-weight: 400;
  font-size: 2.5rem;      
  color: var(--cacao);
  width: 100%;
  line-height: 1.1;
  padding: 1rem;
}

input[type=number] {
  width: auto;
}


.step-ingredients {
  display: block;
  padding-left: 1rem;  
  padding-bottom: 1rem;
}
.step-ingredients > li { list-style-type: disc; }

.ingredient-row { padding-bottom: 0.25;}