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

html {
  font-size: 18px;
}

body {
  font-family: Nunito, serif;
  font-size: 18px;
  background-color: #f7f1e8;
  color: #2e261c;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
}

main {
  background-color: #fff9f1;
  padding: 1rem;
  border: 1px solid #2e261c;
  border-radius: 0.5rem;
}

main h2 {
  margin-bottom: 2rem;
}

h1 {
  font-family: Playwrite US Trad, serif;
  font-size: 125%;
  color: #a8570c;
}

h2,
h3,
h4 {
  font-family: Playwrite US Trad, serif;
  color: #a8570c;
}

h2 {
  font-size: 180%;
}

h3 {
  font-size: 125%;
}

dt {
  font-weight: 600;
}

.recipe {
  line-height: 1.25;
}

.login-forms {
  font-size: 125%;
}

.index_button {
  border-radius: 17px;
  color: #f7f1e8;
  background-color: #8b5e34;
  padding: 0.5em 1em;
}

.recipe_image {
  transform: rotate(2deg);
  border-color: 5px solid white;
  border-radius: 3px;
}

ul {
  list-style-type: none;
}

.visually-hidden {
  display: none;
}

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

@media (max-width: 700px) {
  body {
    display: flex;
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

header {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
}

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

.recipe + .recipe {
  margin-top: 2rem;
}

.top_header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
}

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

.bottom_header_links {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
}

.top_header_right {
  display: flex;
  gap: 0.25rem;
}

.nav_search {
  gap: 0.25rem;
  padding-inline: 0.25rem;
}

.recipe_meta {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.recipe_tags {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.header_divider {
  border: none;
  border-top: 1px solid #8b5e34;
}

.ingredients_list {
  padding-left: 1rem;
  text-indent: -1rem;
}

.steps_list {
  padding-left: 1em;
}

.recipe_page_image {
  transform: rotate(2deg);
  border-color: 5px solid white;
  border-radius: 3px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  margin-bottom: 0.5rem;
}

.recipe_stat {
  display: flex;
  flex-direction: row;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
  flex: 0 0 calc(25% - 0.5rem);
}

.recipe_stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}

.index_buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.index_buttons a {
  text-align: center;
  background-color: #8b5e34;
  color: #f7f1e8;
  border: none;
  border-radius: 1rem;
  padding: 0.5em 1em;
}

.index_buttons a:hover {
  background-color: #a8570c;
  color: #fff9f1;
}

.card_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem;
}

@media (max-width: 600px) {
  .card_grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .card_grid {
    grid-template-columns: 1fr;
  }
}

.card_grid li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card {
  background-color: #fff9f1;
  padding: 0.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px #8b5e34;
}

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

.recipe_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.recipe_tags li {
  white-space: nowrap;
}

.search_recipes {
  width: 100%;
  padding: 0.25rem;
  box-sizing: border-box;
  font-size: 1rem;
}

.profile_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile_header img {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  align-self: flex-start;
}

.recipe_page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem;
}

.recipe_page .photo_metadata {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.recipe_page .photo_metadata img {
  flex: 1 1 calc(33.333% - 1rem);
  max-width: 100%;
  height: auto;
}

.recipe_page .recipe_stats {
  flex: 2 1 calc(66.666% - 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.recipe_page .ingredients_steps {
  display: flex;
  gap: 1rem;
}

.recipe_page .ingredients_list,
.recipe_page .steps_list {
  flex: 1;
}

@media (max-width: 500px) {
  .recipe_page {
    padding: 0;
    border: none;
  }

  .recipe_page .photo_metadata,
  .recipe_page .ingredients_steps {
    flex-direction: column;
    gap: 2rem;
  }

  header {
    padding: 0.5rem;
  }

  .header_divider {
    margin: 0;
  }

  .login-forms {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .login-forms label {
    display: flex;
    align-items: baseline;
    width: 100%;
  }

  .login-forms input {
    flex: 0 0 80%;
    padding: 0.25rem;
    margin-left: auto;
    box-sizing: border-box;
  }

  .login-forms button {
    width: 50%;
    max-width: 400px;
    min-width: 200px;
    margin: 0 auto;
    padding: 0.5rem;
    text-align: center;
  }

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

    .login-forms input {
      width: 100%;
      margin-left: 0;
    }

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

  .recipe_title_container{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .ingredient_row {
    display: flex;
    flex-direction: row;
    list-style-type: circle;
    width: auto;
  }
}
