:root{
  --cream:#F7F1E8;      
  --cast-iron:#2E261C;  
  --cacao:#A8570C;      
  --paper:#FFF9F1;      
  --ash:#888;           
  --oak:#8B5E34;        
  --white:#FFF;     
  --card: color-mix(in srgb, var(--paper) 80%, white 20%);    
}

*{ margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--cast-iron);
  background: var(--cream);
  padding: 0 .5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > header{
    margin-bottom: 3rem;
  }

body.login form input[type="text"],
body.login form input[type="password"],
body.login form input[type="email"] {
  margin-bottom: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Playwrite US Trad", cursive;
  font-size: 1.25rem;
  color: var(--oak);
}

article > header{
  display:flex;
  flex-wrap:wrap;
  column-gap:1.5rem;   
  row-gap:0;           
  align-items:baseline;
  margin-bottom:2rem;
}
article > header .tags{
  display:flex;
  flex-wrap:wrap;
  column-gap:.5rem;    
  row-gap:0;     
}

.tags { 
  list-style:none;
  margin: 0.25rem;
  display: flex; 
  flex-wrap: wrap; 
  gap: .5rem;
}

output {
  color: #b00020;
  font-weight: 600;
  display: block;
  margin-bottom: 1rem;
}

#steps ol {
  padding-left: 1em;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--oak);
}

.header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .25rem;
}

header form {
  display: flex;
  align-items: center;
}

header form input {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--oak);
  border-radius: 4px;
  font-family: "Nunito", sans-serif;
}

header form button{ 
  padding:.25rem .5rem; 
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-link {
  color: var(--oak);
  text-decoration: none;
  font-weight: 600;
}

.profile-link:hover {
  color: var(--cacao);
  text-decoration: underline;
}

.profile-s1{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;          
  flex-wrap: wrap;
}

.profile-s1 
.profile-text{ 
  flex: 1 1 auto; 
  min-width: 0; 
}

.profile-s1 > img{
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  flex: 0 0 5rem;    
  float: none;        
}

.profile-s1 > h2{
  flex-basis: 100%;
  margin-top: 1rem;
}

.nav-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--oak);
  text-decoration: none;
  font-weight: 600;
}

.nav-list a:hover {
  color: var(--cacao);
  text-decoration: underline;
}

.brand {
  font-family: "Playwrite US Trad", cursive;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--oak);
}

.brand:hover {
  color: var(--cacao);
  text-decoration: underline;
}

.ingredients{
  list-style:none;
  margin: 0.25rem;
}

main{
  background: var(--paper);
  border: 2px solid var(--oak);
  border-radius: 26px;
  padding: 1rem;
  max-width: 700px;
  margin: 1rem auto;
  flex: 1;
}

main form input[type="search"]{ 
  width:100%; padding:.25rem; 
}

main section {
  margin-bottom: 2rem; 
}

.main-title {
  font-size: 1.8rem;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:1rem;
}

.sr-only {
    position:absolute !important;
    width:1px; height:1px;
    padding:0; margin:-1px; overflow:hidden;
    clip:rect(0,0,0,0); white-space:nowrap; border:0;
  }

.title-input {
  flex:1;
  font-family: "Playwrite US Trad", serif;
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 600;
  border: none;
  background: transparent;
  outline: none;
}

.title-btn {
  padding: 0.4em 0.9em;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f7f7f7;
  cursor: pointer;
}

.block-textarea,
.step-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font: inherit;
  line-height: 1.4;
}

.steps-list {
  list-style: decimal;
  list-style-type: none;
  padding-left: 1.5rem; 
}
.steps-list > .step-item {
  margin-top: 1rem;    
}

#ingredients ul {
  list-style-position: inside;
  padding-left: 0;
  text-indent: 0;
}

.ingredients-list {
  padding-left: 1.5rem; 
  margin-top: 0.5rem;
}

.ingredients-list li {
  padding-left: 0.25rem;
}

.ingredient-row + .ingredient-row {
  padding-top: 0.25rem;
}

.error-list {
  color: #b00020;
  margin: 0.5rem 0 1rem;
}

.error-list ul { margin:0; padding-left:1.25rem; }

input[type=number][size] {
  width: calc(attr(size number) * 1ch + 2rem);
}

strong, b { font-weight: 700; }

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-actions a{
  display:inline-block;
  padding:.5em 1em;
  border-radius:999px;  
  background:var(--cream);
  color:var(--oak);
  border:1.5px solid var(--oak);   
  text-decoration:none;
  margin-right:.5rem;
}

.hero-actions a:hover{
  background: var(--cacao);
  color: var(--paper);
  border-color: var(--cacao);
  text-decoration: underline;
}

.recipe-image{
  transform: rotate(2deg);
  border: 5px solid var(--white);
  border-radius: 3px;
  max-width: 100%;
  margin-bottom: .5rem;
}

.recipe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 1rem;
  align-items: start;
  list-style:none;
  margin: 0.25rem;
  justify-content: flex-start;
}

.recipe-list > * {
  flex: 1 1 calc(33.333% - 1rem);
  min-width: 200px;
}

article dl.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
}

article .fact-row {
  display: flex;
  width: 100%; 
  gap: 0.5rem;
}

article .fact-row > dt {
  flex: 0 0 25%; 
  white-space: nowrap;
  font-weight: 600;
}

article .fact-row > dd {
  flex: 1;
  margin: 0;
}

.visually-hidden{ display:none; }

.dish-info{
  background: var(--card);
  border: 1px solid var(--oak);
  border-radius: 8px;
  padding: .5rem .75rem;
  margin-top: .25rem;
  margin: 0;    
  border: 1px solid rgba(182, 142, 104, 0.35); 
  border-radius: 10px;
  padding: .5rem .75rem;
  
  box-shadow:
    1px 0   0 rgba(46, 38, 28, .12),  
    0   1px 0 rgba(46, 38, 28, .12),  
    8px 12px 20px rgba(46, 38, 28, .10);
}

.dish-info h3{
  margin: 0 0 .35rem;
}

.dish-info img{
  display: block;
  width: 100%;     
  height: auto;
  max-width: 100%;
}

.dish-info .tags{
  list-style: none; 
  display: flex;
  flex-wrap: wrap;
  column-gap: .5rem;
  row-gap: 0;
  padding-left: 0; 
  margin: 0;   
}

.dish-info .tags a{ 
  white-space: nowrap; 
}

.tags a::before{
  content: "#";
  color: currentColor;
  margin-right: .12em;
}

.tags a:link,
.tags a:visited {
  text-decoration: none;
  color: var(--oak);
}

.tags a:hover {
  color: var(--cacao);
  text-decoration: underline; 
}

.recipe-top{
  display: flex;
  gap: 1rem;             
  align-items: flex-start;
  flex-wrap: wrap;
}

.recipe-body{
  display: flex;
  gap: 1rem;             
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top:2rem;
}

.recipe-top  > .recipe-aside,
.recipe-body > .recipe-aside{ 
  flex: 1 1 33%; 
  min-width: 0; 
}

.recipe-top  > .recipe-main,
.recipe-body > .recipe-steps{ 
  flex: 2 1 67%; 
  min-width: 0; 
}

.recipe-image{
  float: none;           
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: .5rem;  
}

@media (max-width: 400px) {
  .recipe-list > * {
    flex: 1 1 100%;
  }
}

@media (max-width: 500px){
  body {
    padding: 0;
  }
  
  main {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  .recipe-top{
    display: flex;           
    flex-direction: column;
    gap: 2rem;          
  }

  .header-top{
    display: flex;
    padding: 0 .5rem .25rem;
    flex-direction: column;
    align-items: flex-start;
  } 
  
  .header-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 .5rem;
    gap: 0.5rem;
  }
  
  header form {
    width: 100%;
  }
  
  header form input {
    width: 100%;
  }

  .recipe-body{ 
    margin-top: 2rem;          
    display: flex;
    flex-direction: column;
    gap: 2rem; 
  } 
}

@media (min-width: 501px){
  .recipe-top,
  .recipe-body{
    display: flex;
    gap: 1rem;
    align-items: start; 
    flex-wrap: nowrap;
  }

  .recipe-top   > .recipe-aside,
  .recipe-body  > .recipe-aside{ 
    flex: 1 1 33%; 
    min-width: 0; 
  }

  .recipe-top   > .recipe-main,
  .recipe-body  > .recipe-steps{ 
    flex: 2 1 67%; 
    min-width: 0; 
  }
}

@media (max-width: 600px) {
  .recipe-list > * {
    flex: 1 1 calc(50% - 1rem);
  }
}

@media (max-width: 700px){
  body.login form{
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    column-gap:0;
    row-gap:0;
  }

  body.login form label,
  body.login form input[type="text"],
  body.login form input[type="password"],
  body.login form input[type="email"]{
    flex:0 0 100%;
    width:100%;
    margin: 0;
  }

  body.login form input[type="text"],
  body.login form input[type="password"],
  body.login form input[type="email"]{
    padding:.25rem;
  }

  body.login form input[name="username"]{
    margin-bottom: 1rem;
  }

  body.login form button{
    width: 50%;
    min-width: 200px;   
    display: block;
    margin: 0.5rem auto 0; 
  }
}




@media (min-width: 701px){
  body.login main form{
    display: flex;
    flex-direction: row;   
    flex-wrap: wrap;       
    align-items: baseline; 
    row-gap: 1rem;         
    column-gap: 0;         
    margin-top: .25rem;
  }

  body.login main form label {
    flex: 0 0 20%;
    gap: 0.5rem;
    font-size: 1.25rem;
  }

  body.login form input[type="text"],
  body.login form input[type="password"],
  body.login form input[type="email"]{
    flex: 1 0 80%;         
    width: 80%;
    padding: .25rem;
    margin-left: auto;
    font-size: 1.25rem;
  }

  body.login main form button {
    flex: 0 0 50%;
    min-width: 200px;
    padding: .25rem;
    margin: 0 auto;
    font-size: 1.25rem;
  }

}

