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

html {
  max-width: 700px;
  background-color: #F7F1E8;
  padding-left: .5rem;
  padding-right: .5rem;
}

@media (max-width: 400px) {

  html {
    padding-left: 0rem;
    padding-right: 0rem;
  }
}

body {
  font-family: "Nunito", Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

main section {
  font-size: 18px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

section a {
  display: flex;
  flex-direction: column;
  align-self: center;
}

section h1,
h2,
p {
  align-self: start;
}

section p {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}


h1 {
  font-size: calc(18px * 1.8);
  font-family: "Playwrite US Trad", cursive;
  font-weight: 400;
  color: #a8570c;
}

h2,
h3,
h4,
h5,
h6 {
  font-size: calc(18px * 1.25);
  font-family: "Playwrite US Trad", cursive;
  font-weight: 400;
  color: #a8570c;
}

header {
  display: flex;
  flex-direction: column;
  width: 100%;

  padding: .25rem .25rem 3rem .25rem;
  justify-content: space-between;
  align-items: flex-end;

  background-color: #F7F1E8;
}

@media (max-width: 400px) {

  header {
    padding: 0.5rem;
  }
}

header ul {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

header form {
  padding-top: .25rem;
}

header input,
button {
  padding: .25rem;
}

header p,
a {
  display: flex;
  align-self: flex-end;
  gap: .5rem;
}

header ul {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

header h2 {
  display: flex;
  padding: 0.25rem .25rem;

  margin-top: 0rem;
}

header div,
nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 0.25rem;
}

header form {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
}

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

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

ul,
body,
p {
  font-family: "Nunito", sans-serif;
  font-size: 18px;
  color: #191d24;
  line-height: 1.25;
}

ul {
  list-style: none;
}

.login-page {
  font-size: 125%;
  border: 1px solid black;
  padding: 15px;
  border-radius: 8px;
  background-color: #FFF9F1;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-page div {
  display: flex;
  flex-direction: column;

  padding-bottom: 2rem;
}

.login-page form div {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 1rem;
}

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

.login-page form button {
  display: flex;
  justify-content: center;
  width: 50%;
  min-width: 200px;
}

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

  .login-page {
    padding-top: 1rem;
  }
}

.line-divider {
  border-bottom: 2px solid #8B5E34;
  padding: 0;
  margin: 0.25rem 0;
}

.button-primary {
  padding: 1em;
  border-radius: 8px;
  color: #f7f1e8;
  background-color: #8b5e34;
  text-decoration: none;
  display: inline-block;
}

.button-primary:hover {
  color: #f7f1e8;
  background-color: #a8570c;
}

.card-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;

  max-width: 100%;
  padding: 0 1rem;
  justify-content: flex-start;
  align-items: start;
}


.recipe-card {
  background-color: white;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  display: flex;
  flex-direction: column;
  flex: 0 1 calc((100% - 2rem)/3);
  min-width: 0;
  height: fit-content;
}

.recipe-page {
  border: 1px solid black;
  padding: 1rem;
  border-radius: 12px;
  background-color: #FFF9F1;
  list-style: none;
}

@media (max-width: 400px) {
  .recipe-card {
    flex: 0 1 calc((100% - 2rem)/1);
  }
}

@media (max-width: 600px) {
  .recipe-card {
    flex: 0 1 calc((100% - 2rem)/2);
  }
}

.recipe-card img {
  max-width: 100%;
  max-height: 100%;
}

.recipe-image {
  transform: rotate(2deg);
  border: 5px solid white;
  border-radius: 3px;

}

.recipe-button {
  display: flex;
  align-self: center;
}

.search-card {
  padding: 1em;
  border-radius: 8px;
  border: 1px solid black;
  text-decoration: none;
  display: inline-block;
  box-shadow: #191d24;
  background-color: white;
}

.main-container {
  padding: 1em;
  border-radius: 8px;
  border: 1px solid black;
  background-color: #fff4e1;

  display: inline-block;
}

strong,
b {
  font-weight: bold;
}

.prep-time,
.cook-time,
.total-time {
  font-weight: 600;
}

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

.profile {
  display: flex;
  flex-direction: column;
  justify-content: start;

  gap: 2rem;
  padding-bottom: 3rem;
}

.profile div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

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

.profile-body {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

.profile img {
  width: 5rem;
  height: 5rem;
}


.search-page-header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: 3rem;
  width: 100%;
}

.search-page-header form {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.search-page-header input {
  flex: 1;
  padding: .25rem;
}


.recipe-page-header {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
}

.recipe-page-header div span {
  padding-left: 1.5rem;
}

.recipe-page-header div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.recipe-page-header ul {
  display: flex;
  flex-direction: row;
  gap: .5rem;
}

.recipe-page-body {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  padding-bottom: 1rem;
}

.recipe-page-body div {
  display: flex;
  flex-direction: row;
  justify-content: start;
  gap: 1.5rem;
}

.recipe-page-body img {
  width: 150%;
  height: 150%;
  padding-bottom: .5rem;
}

.recipe-page-body span {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: .5rem;
  padding-bottom: .25rem;
}

.recipe-page-bottom {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: start;
  gap: 2.5rem;
}

.recipe-page-bottom h3 {
  font-size: 23px;
}

.recipe-page-bottom ul {
  padding-left: 1rem;
  text-indent: -1rem;
}

.recipe-page-bottom ol {
  padding-left: 1rem;
}

.recipe-page-body .recipe-page-first .recipe-page-bottom {
  flex: 1 1 33%;
}

.recipe-page-body .recipe-page-second .recipe-page-bottom d {
  flex: 2 1 67%;
}

.visually-hidden {
  display: none;
}

.numbered-list {
  list-style-type: decimal;
}

.ingredients-list {
  flex-direction: column !important;
}


.edit-main {
  display: flex;
  flex-direction: row;
}

.title-section header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.title-section .title-container {
  flex-grow: 1;
  margin-right: 1rem;
}

#recipe-title {
  font-size: calc(18px * 1.8);
  font-family: "Playwrite US Trad", cursive;
  font-weight: 400;
  color: #a8570c;
}

.save-button {
  padding: 0.5rem 1rem;
  font-size: 1.1em;
  font-weight: bold;
}


textarea {
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 1em;
}

.recipe-steps-edit {
  list-style-position: outside;
}

.recipe-step-edit {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.recipe-step-edit .step-description-container {
  display: flex;
}

.recipe-step-edit textarea {
  vertical-align: top;
  margin-top: -0.25em;
}



.step-ingredients {
  flex-direction: column !important;

  padding-left: 2rem;
  margin-top: 0.5rem;
}

.ingredient-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
  padding: 0.25rem 0;
  flex-wrap: wrap; 
}

.ingredient-item input[type="number"] {
  width: 80px;
  max-width: 20%;
}

.ingredient-item input[name*="unit"] {
  width: 100px;
  max-width: 25%;
}

.ingredient-item input[name*="name"] {
  flex: 1;
  min-width: 150px;
}

.extra-step {
    background-color: #f8f9fa;
}

.extra-ingredient input::placeholder {
    color: #666;
    font-style: italic;
}

.step-ingredients {
    margin-left: 2rem;
    margin-top: 1rem;
}

.errors h1, 
.errors h2, 
.errors h3, 
.errors li {
  color: rgb(243, 1, 1);
  padding: 2px;
}