h2, h3, h4, h5, h6 {
    font-family: 'Playwrite US Trad', cursive, sans-serif;
    font-size: 1.25em;
    color: #A8570C;
}
body {
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    color: #2E261C;
    background-color: #F7F1E8;
}
h1 {
    font-size: 1.8em;
    color: #8B5E34;
    font-family: 'Playwrite US Trad', cursive, sans-serif;
}
a {
    color: #8B5E34;
    text-decoration: none;
}
a:hover {
    color: #A8570C;
    text-decoration: underline;
}
.description, .ingredients, .steps {
    line-height: 1.25;
}
.button {
    color: #F7F1E8;
    background-color: #8B5E34;
    padding: .5em 1em;
    border-radius: 9999px;
}
.button:hover {
    background-color: #A8570C;
    color: #F7F1E8;
}
ul {
    list-style-type: none;
}
.visually-hidden {
    display: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 18px;
}

.page-container {
  max-width: 700px;
  margin: 0 auto;           
  padding: 0 .5rem;        
  display: flex;
  flex-direction: column;
  gap: 3rem;                
  background-color: #F7F1E8;
}

.main-content {
  padding: 2rem;                 
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background-color: #FFF9F1;    
  border: 1.5px solid #ccc;        
  border-radius: 0.75rem;        
}

.login-content {
  padding: 2rem;                 
  display: flex;
  flex-direction: column;
  gap: 1rem;        
}

.search-content {
  padding: 2rem;                 
  display: flex;
  flex-direction: column;
  gap: 1rem;        
}

.description {
  margin-bottom: 2rem;     
}

header {
  display: flex;
  flex-direction: column;
  gap: .25rem;              
  padding: .5rem 1rem;
}

.header-top {
  display: flex;
  justify-content: space-between; 
  align-items: flex-end;    
  border-bottom: 4px solid #8B5E34;
  flex-direction: row;         

}

.header-bottom {
  display: flex;
  justify-content: space-between; 
  align-items: center;
  padding-top: .25rem;  
  flex-direction: row;         
}

nav {
  display: flex;
  flex-direction: row;
  gap: 1rem; 
}

.search-form input,
.search-form button {
  padding: .25rem;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;          
  gap: 1.5rem;              
}

.recipe-meta .tag-list {
  display: flex;
  flex-direction: row;
  gap: .5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ingredients {
  padding-left: 1rem;
  text-indent: -1rem;
}

.steps {
  padding-left: 1em;
}

.recipe-photo {
  max-width: 100%;      
  margin-bottom: .5rem; 
  border: 5px solid white;
  border-radius: 3px;
  transform: rotate(2deg);
}

dl {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .25rem; 
  margin: 0;
}

dt, dd {
  margin: 0;
  flex: 1 1 calc(50% - .25rem);  
}

dt {
  flex-basis: calc(25% - .25rem); 
  font-weight: bold;
}

dd {
  flex-basis: calc(75% - .25rem); 
}

.index-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;              
  margin-top: 1rem;      
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;             
  padding: 0 1rem;        
  align-items: start;     
}

.card img {
  max-width: 100%;
  height: auto;
}

.card .tag-list {
  display: flex;
  flex-wrap: wrap;         
  gap: .5rem;              
}

.card .tag-list li {
  white-space: nowrap;     
}

.search-form input[type="text"] {
  width: 70%;            
  padding: .25rem;
  box-sizing: border-box;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.profile-header img {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
}

.card {
  background: white;
  border-radius: 0.5rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: none; 
}

.card img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  display: block;
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card ul li {
  white-space: nowrap;
}


/* Recipe side-by-side layout */
.recipe-top,
.recipe-bottom {
  display: flex;
  gap: 1rem;
}

.recipe-sidebar {
  flex: 1;
}

.recipe-description,
.steps {
  flex: 2;
}

/* Responsive collapse below 500px */
@media (max-width: 500px) {
  .page-container {
    padding: 0; /* remove side padding */
    border: none; /* remove weird borders at edges */
  }

  header {
    padding: 0.5rem; /* restore padding inside header */
  }

  .recipe-top,
  .recipe-bottom {
    flex-direction: column;
    gap: 2rem;
  }
}

.visually-hidden {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.steps li {
  padding-bottom: 1rem;
}

.ingredients li {
  padding: 0.25rem 0;
  padding-left: 1rem;
}

button[type="submit"] {
  background-color: #8B5E34;
  color: #F7F1E8;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  float: right;
}

button[type="submit"]:hover {
  background-color: #A8570C;
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  padding: 0.25rem;
  background-color: #ffffff; /* changed from #fff9f1 to pure white */
  resize: vertical;
  vertical-align: top;
}

.error-list {
  color: red;
  margin: 1em 0;
  font-weight: bold;
}
