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

html,
body {
  margin: 0;
  padding: 0 0.5rem;
  display: flex;
  justify-content: center;
}

body {
  font-family: "Nunito", Arial, sans-serif;
  font-size: 18px;
  line-height: normal;
  background-color: #f7f1e8;
  flex-direction: column;
}

html {
  font-size: 18px;
}

header,
main {
  max-width: 700px;
  width: 100%;
}

header {
  margin-bottom: 3rem;
}

header h1,
.logged-in-user {
  display: inline-block;
  vertical-align: bottom;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Playwrite US Trad", "Times New Roman", serif;
  color: #a8570c;
}

h1 {
  font-size: calc(18px * 1.8);
  font-weight: bold;
}
h2,
h3,
h4,
h5,
h6 {
  font-size: calc(18px * 1.25);
  font-weight: bold;
}

.login-form,
.login-form input,
.login-form label,
.login-form button {
  font-size: calc(18px * 1.25);
}

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

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

ul,
dl {
  list-style-type: none;
}

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

a:hover {
  color: #a8570c;
}

.logged-in-user p,
.logged-in-user a {
  display: inline;
}
.recipe-card
hr {
  border: none;
  height: 2px;
  background: #8b5e34;
  margin: 1rem 0;
  width: 750px;
}

.hr-login {
  width: 100%;
}

nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

nav ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav form {
  display: flex;
  gap: 0.25rem;
}

nav input,
nav button {
  padding: 0.25rem;
}

.top-button {
  background-color: #8b5e34;
  color: #f7f1e8;
  border: none;
  border-radius: 20px;
  font-size: large;
  padding: 0.5em 1em;
  cursor: pointer;
}

.top-button:hover {
  background-color: #a8570c;
  color: #fff9f1;
}

.background-card {
  background-color: #fff9f1;
  border-radius: 30px 30px 0 0;
  border: 1px solid #888;
  width: 750px;
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  border-bottom: none;
  padding: 1rem;
}

.background-card > section:first-of-type h1 {
  margin-bottom: 2rem;
}

.background-card > section:nth-of-type(2) > p {
  margin-bottom: 2rem;
}

.background-card-login {
  background-color: #fff9f1;
  border-radius: 30px 30px 0 0;
  border: 1px solid #888;
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  border-bottom: none;
  flex-direction: column;
  padding: 1rem;
}

.background-card-login > section:first-of-type h1 {
  margin-bottom: 2rem;
}

.background-card-login > section:nth-of-type(2) > p {
  margin-bottom: 2rem;
}

.recipe-card {
  background-color: white;
  border-radius: 0 0 10px 10px;
  width: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin: 0;
  float: right;
  overflow-x: visible;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.recipe-card-search {
  background-color: white;
  border-radius: 0 0 10px 10px;
  width: 95%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
  margin: 0;
  float: right;
}

.signin-text {
  font-size: 24px;
}

.top-signin-text {
  color: #8b5e34;
}

.signin-input {
  height: 50px;
  width: 710px;
  font-size: 200px;
}

.signin-button {
  height: 30px;
  width: 85px;
  font-size: 22px;
}

.search-input {
  height: 26px;
  width: 235px;
  font-size: 23px;
  margin-bottom: 20px;
}

.jane-doe {
  margin-left: 350px;
}

.user-desc {
  margin: 40px 0;
}

.user-profile {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recipe-img {
  transform: rotate(2deg);
  border: 5px solid white;
  margin-top: 10px;
  border-radius: 3px;
  width: 300px; 
  height: auto;
}

.recipe-page article > header p,
.recipe-page article > header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
}

.recipe-page article > header ul {
  list-style: none;
  padding: 0;
  gap: 0 0.5rem;
}

.recipe-page aside ul {
  list-style: none;
  padding-left: 1rem;
  text-indent: -1rem;
  margin: 0;
}

.recipe-page .recipe-steps ol {
  padding-left: 1em;
}

.recipe-page .recipe-img {
  display: block;
  max-width: 100%;
  margin-bottom: 0.5rem;
}

.recipe-times dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 1rem 0;
}

.recipe-times dt {
  font-weight: bold;
  margin: 0;
}

.recipe-times dd {
  margin: 0;
}

.recipe-page dl li {
  display: flex;
  width: calc(50% - 0.25rem);
  gap: 0.5rem;
}

.recipe-page dl li strong {
  width: 25%;
  flex-shrink: 0;
}

.recipe-page .top-sidebar-pair,
.recipe-page .bottom-sidebar-pair {
  display: flex;
  gap: 1rem;
}

.recipe-page .top-sidebar-pair > section,
.recipe-page .bottom-sidebar-pair > * {
  flex-shrink: 1;
  flex-grow: 1;
}

.recipe-page .top-sidebar-pair > section:first-child,
.recipe-page .bottom-sidebar-pair > :first-child {
  flex-basis: 33.3333%;
}

.recipe-page .top-sidebar-pair > section:last-child,
.recipe-page .bottom-sidebar-pair > :last-child {
  flex-basis: 66.6667%;
}

.bottom-sidebar-pair {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.bottom-sidebar-pair aside,
.bottom-sidebar-pair .recipe-steps {
  flex: 1;
}

@media (max-width: 500px) {
  .recipe-page .top-sidebar-pair,
  .recipe-page .bottom-sidebar-pair {
    display: block;
  }

  .recipe-page .top-sidebar-pair > section,
  .recipe-page .bottom-sidebar-pair > * {
    flex-basis: auto;
    flex-grow: 0;
    margin-bottom: 2rem;
  }

  .recipe-page main {
    padding-left: 0;
    padding-right: 0;
  }

  .recipe-page header {
    border-left: none;
    border-right: none;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .recipe-page header hr {
    margin-left: 0;
    margin-right: 0;
  }
}

.index-page .top-button {
  display: inline-block;
  margin-right: 1rem;
}

.index-page p:has(.top-button) {
  text-align: center;
  margin-top: 1rem;
}

.index-page .top-button:last-child {
  margin-right: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0 1rem;
  align-items: start;
}

.recipe-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
}

.recipe-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.recipe-card ul li {
  margin: 0;
  padding: 0;
}

.recipe-card ul li a {
  white-space: nowrap;
}

.recipe-card .card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.recipe-card .tags,
.recipe-card .tags ul,
.recipe-card .tags li {
  list-style: none;
  margin: 0;
  padding: 0;
  text-indent: 0;
}

.recipe-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.5rem;
}

.recipe-card .tags li {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.recipe-card .tags li a {
  white-space: nowrap;
  text-decoration: none;
  color: #8b5e34;
}

.recipe-card .tags,
.recipe-card .tags li,
.recipe-card .tags li a {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.search-page .cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

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

@media (max-width: 400px) {
  .search-page .cards-container {
    grid-template-columns: 1fr;
  }
}

.profile-page .profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 40px;
}

.profile-page .user-logo {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
}

.login-page form > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.login-page form input[type="text"],
.login-page form input[type="password"] {
  width: 80%;
  padding: 0.25rem;
  font-size: 2.25rem;
  text-align: right;
}

.login-page form button[type="submit"] {
  width: 50%;
  height: 45px;
  min-width: 200px;
  margin: 0 auto;
  display: block;
  font-size: larger;
}

.button-container {
  display: flex;
  justify-content: center;
}

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

  .login-page form > div.username-field {
    margin-bottom: 1rem;
  }

  .login-page form input[type="text"],
  .login-page form input[type="password"] {
    width: 100%;
    text-align: left;
  }
}

.edit-page input[type=text],
.edit-page input[type=number],
.edit-page textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  display: block;
  margin-bottom: 0.35rem;
  padding: 0.3rem 0.4rem;
  font-family: inherit;
  font-size: 0.95rem;
  background-color: #fffdf8;
  border: 1.5px solid #8b6a4b;
  border-radius: 4px;
}

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

.edit-page textarea {
  min-height: 2.8rem;
  resize: none;
  overflow: hidden;
}

.edit-page textarea,
.edit-page input {
  font-family: inherit;
  font-size: inherit;
}

.recipe-page h1 input {
  font-family: 'Playwrite US Trad', serif;
  font-size: 2rem;
  border: none;
  border-bottom: 1px solid #8b6a4b;
  width: auto;
}

#title {
  color:  #a8570c;
  font-size: 2.5rem;
}

.submit-form {
  padding: 0.2rem;
  margin-left: 0.2rem;
}

.edit-page .recipe-times input {
  display: inline-block;
  vertical-align: middle;
}

.edit-page .top-sidebar-pair,
.edit-page .bottom-sidebar-pair {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.edit-page .ingredients,
.edit-page .steps {
  flex: 1;
}

.edit-page .ingredient-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.25rem;
}

.title-row {
  display: flex;
  align-items: start;
  gap: 1.8rem;
  justify-content: space-between;
}

.edit-page .ingredient-row .bullet {
  width: 0.6rem;
  height: 0.6rem;
  border: 2px solid #7a5232;
  border-radius: 50%;
  flex-shrink: 0;
}

.edit-page .ingredient-row input[type="text"],
.edit-page .ingredient-row input[type="number"] {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.4rem;
  border: 1.5px solid #8b6a4b;
  border-radius: 4px;
  background-color: #fffdf8;
  font-size: 0.9rem;
}

.edit-page .ingredients h3,
.edit-page .steps h3 {
  margin-bottom: 0.4rem;
}

.edit-page ol {
  padding-left: 1.3rem;
}

.edit-page ol li {
  margin-bottom: 0.35rem;
}

.edit-page .recipe-steps ul {
  margin-left: 1.5rem;
  padding-top: 0.25rem;
}

.edit-page .recipe-steps ul li {
  padding: 0.2rem 0;
}

.edit-page .step-list textarea {
  width: 100%;
  border: 1.5px solid #8b6a4b;
  border-radius: 4px;
  background-color: #fffdf8;
  resize: none;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.35rem 0.4rem;
}

.edit-page input:focus,
.edit-page textarea:focus {
  outline: none;
  border-color: #7a5232;
  box-shadow: 0 0 3px rgba(122, 82, 50, 0.25);
}

.edit-page label.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.recipe-times input {
  width: 20px;
}

#prep_time,
#cook_time,
#total_time,
#serves {
  width: 75px;
}

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

#header-input{
  font-size: 14px;
  height: 30px;
  width: 175px;
}

.show-password-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}