* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  font-size: 18px;
  height: 100%;
  display: flex;                 
  justify-content: center;       
  padding: 0 .5rem;   
}
body{
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 18px;
  color: #2E261C;
  background-color: #F7F1E8;
  display: flex;
  flex-direction: column;   
  align-items: center;      
  width: 100%;
  margin: 0;
  padding: 0;
}
header {
  display: flex;
  flex-direction: column;
  max-width: 700px;
  width: 100%;
}
header .top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #6B4226;
  align-items: baseline;
}
header .nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}
header form input[type="search"],
header form button {
  padding: 0.25rem; 
}
header ul {
  display: flex;
  gap: 1rem;
  gap: 1rem;
  list-style: none;
}
header form {
  display: flex;
  gap: 0.5rem;
}
.top-header{
  border-bottom: 2px solid #6B4226; 
}
main{
  background-color: #FFF9F1;
  border: 2px solid #6B4226;  
  border-radius: 16px;        
  max-width: 700px;           
  width: 100%; 
  margin-top: 3rem;  
  padding: 1rem;
}
h2,h3{
  font-family: 'Playwrite US Trad', 'Times New Roman', serif;
  font-size: 1.25rem;
  color: #A8570C;

}
h1{
  font-family: 'Playwrite US Trad', 'Times New Roman', serif;
  font-size: 1.8rem;
  color: #A8570C;
}

.description {
    line-height: 125%;
}
.ingredients {
    line-height: 125%;
    padding-left: 1rem;
    text-indent: -1rem;
    width: 33%;
  
  
}
.steps {
  line-height: 125%;
  padding-left: 1em;     
}
.button-group{
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;

}
.btn{
    background-color: #8B5E34 ;
    color: #F7F1E8;
    padding: .5em 1em;
    border-radius: 999px; 
    text-align: center;
}
a {
    text-decoration: none;  
    color: #8B5E34 ;         
}
a:hover{
    color: #A8570C;
    text-decoration: underline;

}
ul{
    list-style-type: none;
}

.visually-hidden {
    display: none;
}
.chicken-adobo {
  transform: rotate(2deg);      
  border: 5px solid #FFF;       
  border-radius: 3px;           
  max-width: 33%;              
  margin-bottom: 0.5rem;        
}
.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  margin: 1rem 0;
  max-width: 80%;

}
.recipe-meta > * {
  margin-right: 1.5rem;
}

.recipe-meta > div {
  display: flex;
  align-items: center;
}
.recipe-author a {
    margin-left: 0.25rem; 
}
.recipe-tags {
  display: flex;
  gap: 0.5rem;          
}

.recipe-tags a {
  text-decoration: none;
  color: #8a5a2d;        
}
.recipe-details {
  display: flex;
  flex-wrap: wrap;
  width: 33%;  
  column-gap: 0.5rem;   
  row-gap: 0.25rem;     
  margin-top: 0.5rem;
  margin-bottom: 3rem; 

}
.recipe-details dt {
  flex: 0 0 calc(25% - 0.5rem);  
  font-weight: 600;
}

.recipe-details dd {
  flex: 0 0 calc(75% - 0.5rem);  
}
.recipe-box1 {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 1em;
  gap: 1rem;
}

.recipe-box1 .recipe-photo {
  flex: 0 0 33%;                
  max-width: 33%;
  height: auto;
  display: block;             
}
.recipe-box1 .description {
  flex: 1 1 60%;
  min-width: 250px;             
}

.recipe-box2 {
  display: flex; 
  flex-wrap: wrap;
  width: 100%;
}

.recipe-box2 .ingredients {
  flex: 0 0 calc(33% - 1rem);  
  margin-right: 1rem;
}

.recipe-box2 .steps {
  flex: 0 0 calc(67% - 1rem);  
}
.recipe-box2 h2,
.recipe-box2 h3 {
  margin-bottom: 0.5rem; 
}
@media (max-width: 500px) {

  .recipe-box1,
  .recipe-box2 {
    flex-direction: column;
    gap: 2rem;       
  }

  .recipe-box1 .chicken-adobo,
  .recipe-box1 .description,
  .recipe-box2 .ingredients,
  .recipe-box2 .steps {
    flex: 0 0 100%;   
    margin-right: 0;  
  }

  main {
    padding: 0;         
    border-left: none;  
    border-right: none; 
  }
  header {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  header .top-row,
  header .nav-row {
    width: 100%;
  }
}

.tags{
  display: flex;
  flex-wrap: wrap;
}
.tags li {
  margin-right: 0.5rem;   
  white-space: nowrap;    
}
.recipe-card img{
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.recipe-card {
    display: flex;
    border: 4px  #FFF9F1;   
    border-radius: 8px;          
    background:  #FFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); 
    padding: 0.5rem;  
    height: 100%;
    flex-direction: column;
}
.card-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}
.card-grid > li {
  flex: 0 0 calc(33.333% - 1rem); 
}
@media (max-width: 600px) {
  .card-grid > li {
    flex: 0 0 calc(50% - 1rem);
  }
}

@media (max-width: 400px) {
  .card-grid > li {
    flex: 0 0 100%;
  }
}

.search-form__row input[type="search"] {
  width: 100%;         
  padding: 0.25rem;    
  margin-bottom: 3rem;
}
.search-form__row input[type="search"]::placeholder {
  font-weight: bold;
  color:black;
}

.profile-header {
  display: flex;                
  align-items: flex-start;      
  gap: 1rem;            
  justify-content: space-between;
  margin-bottom: 2rem;

}
.profile-header img {
  width: 5rem;                  
  height: 5rem;    
               
}
.joined-authored{
  display: flex;
  gap: 1.5rem;       
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem; 
}

.form-row {
  display: flex;
  align-items: baseline; 
  gap: 1rem;             
}

.form-row input {
  width: 80%;
  padding: 0.25rem;
  text-align: right;     
}

.login-btn {
  width: 50%;
  min-width: 200px;      
  margin: 1rem auto 0;   
}


@media (max-width: 700px) {
  .form-row {
    flex-direction: column; 
    gap: 0;                 
  }
  .form-row + .form-row {
    margin-top: 1rem;      
  }
  .form-row input {
    width: 100%;           
    text-align: left;       
  }
}
.edit-recipe-form h1.recipe-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.edit-recipe-form h1 input[name="title"] {
  font-family: 'Playwrite US Trad', serif;
  font-size: 2.5rem;
  font-weight: 550;
  width: 90%;
  color: #A8570C;
}

.edit-recipe-form h1.recipe-title .save-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 3rem;
  cursor: pointer;
}

.edit-recipe-form .steps textarea {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: .8rem;
  line-height: 1.1;
  padding: 0.4rem 0.5rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}
/*edit form ingredients steps*/
.edit-recipe-form .recipe-box2 {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 2rem;
}

.edit-recipe-form .ingredients {
  flex: 0 0 33%; 
  min-width: 200px;
}
.edit-recipe-form .steps {
  flex: 1; 
  min-width: 0; 
}

.edit-recipe-form .steps ul li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.edit-recipe-form .steps ul li::before {
  content: "○";   
  color: #000;
  font-size: 1em;
}


.edit-recipe-form .steps ul li input[type="number"] {
  flex: 1 1 25%; 
  min-width: 2rem;
  padding: 0.25rem;
  text-align: left;
}

.edit-recipe-form .steps ul li input[type="text"]:nth-of-type(1) {
  flex: 1 1 30%; 
  min-width: 3rem;
  padding: 0.25rem;
}

.edit-recipe-form .steps ul li input[type="text"]:nth-of-type(2) {
  flex: 1 1 45%; 
  min-width: 6rem;
  padding: 0.25rem;
  
}
.edit-recipe-form .steps ul li input[type="text"]:nth-of-type(3) {
  flex: 1 1 45%; 
  min-width: 6rem;
  padding: 0.25rem;
  
}


.edit-recipe-form label.visually-hidden {
  position: absolute;
  left: -9999px;
}
/*edit form description box*/
.edit-recipe-form .description textarea {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  line-height: 1.3;
  padding: 0.5rem;
  resize: vertical;
}


/* Section for my dl and dd for my edit.html*/
.edit-recipe-form dl.recipe-details {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  align-items: center;
}

.edit-recipe-form dl.recipe-details dt {
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
}

.edit-recipe-form dl.recipe-details dd {
  display: flex;
  align-items: center;
  font-weight: 400;
  gap: 0.25rem;
  margin: 0;
  font-family: 'Nunito', sans-serif;
}

.edit-recipe-form dl.recipe-details input[type="number"] {
  width: 4rem;
  padding: 0.25rem;
  font-size: 1rem;
  text-align: left;
}

.error-messages {
  color: red;
  font-weight: bold;
  margin: 1em 0;
}


.form-row input[type="checkbox"] {
    width: auto;          
    margin: 0;            
}

.form-row input[type="checkbox"] + label {
    margin: 0;            
}

.form-row:has(input[type="checkbox"]) {
    align-items: center;  
    gap: 0.5rem;          
}