* { margin: 0; padding: 0; box-sizing: border-box; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playwrite US Trad', cursive;
  font-weight: 400;
  color: #A8570C;
}

main {
  background-color: transparent;
  width: 100%;
  max-width: 700px;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  box-sizing: border-box;
  border: 1rem;
  padding: 2rem;
}

header {
  display: flex;
  flex-direction: column;
  background-color: transparent;
  gap: 0.25rem;
  margin-bottom: 3rem;
}

div {
  border-bottom: 1px solid #8B5E34;
}

.header-size {
  font-size: 180%;
}

textarea,
input[type=text],
input[type=number] {
font-family: 'Nunito', sans-serif;
font-size: 1rem;
line-height: 1.4;
border-radius: 4px;
padding: 0.25rem 0.5rem;;
}

textarea {
  resize: vertical;
  min-height: 2.5em;
  max-height: 12em;
  height: auto;
}

input#title {
font-family: "Playwrite US Trad";
font-size: 2rem;
font-weight: 400;
width: 100%;
color: #A8570C;
border: none;
border-bottom: 2px solid #A8570C;
background-color: transparent;
padding: 0.25rem 0;
margin-bottom: 0.5rem;
}

.content-header {
position: relative;
}

.content-header button[type=submit] {
position: absolute;
right: 0;
top: 0;
font-size: 1rem;
padding: 0.5rem 1rem;
}

.description textarea {
width: 100%;
resize: vertical;
margin-top: 0.25rem;
font-size: 0.95rem;
}

.description,
.ingredients,
.steps {
  line-height: 1.25;
}

dt {
  font-weight: 600;
}

a {
  color: #8B5E34; 
  text-decoration: none;
}

a:hover{
  color: #A8570C; 
  text-decoration: underline;
}

a.button{
  background-color: #8B5E34;
  color: white;
  padding: 0.5em 1em;
  border-radius: 9999px;
}

.recipe-photo{
  transform: rotate(2deg);
  border: 5px solid #FFF;
  border-radius: 3px;
}

.bordered {
  background-color: #F7F1E8;
  border: 1px solid #8B5E34;
  border-radius: 6px;
  padding: 1rem;
}

.remove-li {
  list-style-type: none;
}   

.recipe-background {
  background-color: #FFF9F1;
  border: 1px solid #888;
  border-radius: 10px;
}

.recipe-border {
  background-color: #FFF;
  border: 0.5px solid #2E261C;
  border-radius: 6px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem; 
}

.recipe-border img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tags inside card */
.recipe-border ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  row-gap: 0;
  padding: 0;
  margin: 0;
}

.recipe-border li {
  white-space: nowrap; /* prevent tag text from splitting */
}

.card-background {
  background-color: #FFF9F1;
  border: 1px solid #888;
  border-radius: 10px;
}

body {
  font-family: 'Nunito', sans-serif;
  color: #2E261C;
  font-size: 18px;
  line-height: 1.5;
  background-color: #F7F1E8; 
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.recipe-page {
  background-color: #FFF9F1;
  border: 0.5px solid #2E261C;
  border-radius: 6px;
  margin-bottom: 2rem;
}

html {
  font-size: 18px;
}

nav{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-top: 0.25rem;
  gap: 1rem;
}
.div-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.content-header {
  margin-bottom: 2rem;
}

.input-padding,
.button-padding {
  padding: 0.25rem;
}

nav ul {
  display: flex;
  flex-direction: row;
  gap: 1rem; 
}

/* Below is Recipie CSS */
.recipe-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.recipe-metadata ul {
  display: flex;
  gap: 0.5rem;
}

.ingredients ul {
  padding-left: 1rem;
}
.ingredients ul li {
  text-indent: -1rem;
  padding-left: 1rem;
}

.steps ol {
  padding-left: 1rem;
}

.recipe-photo {
  max-width: 100%;
  width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
  display: block;
}

.recipe-info {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.25rem;
  column-gap: 0.5rem;
  width: 100%;
}

.recipe-info dt {
  flex-basis: calc(25% - 0.5rem);
  font-weight: 600;
  margin: 0;
}

.recipe-info dd {
  flex-basis: calc(75% - 0.5rem);
  margin: 0;
}

/* Phase 4 Below */
.button-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.25rem;
  box-sizing: border-box;
}

.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 1rem;
  margin: 0;
  list-style: none;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.profile-logo {
  width: 5rem;
  height: 5rem;
  margin-left: auto;
}

.profile-div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-meta {
  display: flex;
  flex-direction: row;
  border: none;
  gap: 3rem;
  margin: 0;
}

.profile-meta p {
  border: none;
}

.side-by-side {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.side-by-side .left {
  flex: 1;
}
.side-by-side .right {
  flex: 2;
}
@media (max-width: 500px) {
  .side-by-side {
    flex-direction: column;
    gap: 2rem;
  }

  header.content-header {
    padding: 0.5rem;
    border: none;
  }
}

/* Login Page */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.login-form input {
  width: 80%;
  padding: 0.25rem;
}

/* Button */
.login-button {
  width: 50%;
  min-width: 200px;
  margin: auto;
  padding: 0.5rem;
}

@media (max-width: 700px) {
  .login-form label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .login-form label + label {
    margin-top: 1rem;
  }

  .login-form input {
    width: 100%;
    text-align: left;
  }
}

.card-grid > * {
  flex: 1 1 calc(33.333% - 1rem);
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .card-grid > * {
    flex: 1 1 calc(50% - 1rem);
  }
}

@media (max-width: 400px) {
  .card-grid > * {
    flex: 1 1 100%;
  }
}

input[type=number][size] { width: calc(attr(size number) * 1ch + 2rem); }

/* --- Time and yield inputs (Prep, Cook, etc.) --- */
.recipe-info {
display: grid;
grid-template-columns: auto 1fr;
row-gap: 0.25rem;
column-gap: 0.5rem;
align-items: center;
}

.recipe-info dt {
text-align: right;
font-weight: 600;
}

.recipe-info dd {
margin: 0;
display: flex;
align-items: center;
gap: 0.25rem;
}

.recipe-info input[type=number] {
width: 4rem;
text-align: right;
padding: 0.15rem 0.25rem;
border: 1px solid #8B5E34;
border-radius: 4px;
}

.steps textarea {
display: block;
width: 100%;
margin-top: 0.25rem;
border: 1px solid #8B5E34;
border-radius: 4px;
}

.steps ul {
list-style-type: disc;
margin-left: 1.5rem;
margin-top: 0.25rem;
padding-left: 0.5rem;
}

.steps ul li {
padding: 0.25rem 0;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.25rem;
}

.steps ul li input {
border: 1px solid #8B5E34;
border-radius: 4px;
padding: 0.15rem 0.25rem;
font-size: 0.9rem;
line-height: 1.3;
}

.steps ul li input[type=number] {
width: 3.5rem;
text-align: right;
}

.steps ul li input[name*=_unit] {
width: 6rem;
}

.steps ul li input[name*=_name] {
flex: 1;
min-width: 10rem;
}

.steps li {
padding-bottom: 1rem;
}

output.errors {
  color: red;
  font-weight: bold;
}

.login-form label.show-password-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}