body {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
}

/* start of header and header link styling */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 5px;
}

nav {
  display: flex;
  flex-direction: row;
  text-align: center;
  gap: 0rem 1rem;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* home page styling */

.home-page {
  text-align: center;
}

/* recipe list styling */

.recipe-cards > li {
  border: 2px solid black;
  list-style-type: none;
  background-color: lightblue;
  padding: 1rem;
  margin: 1rem;
}

@media (min-width: 675px) {
  .recipe-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .recipe-cards > li {
    width: calc(50% - 4.5rem);
  }
}

.recipe-cards > li > h2 {
  display: block;
  text-align: center;
  margin: 0 auto;
}

.recipe-cards > li > p {
  text-wrap-mode: wrap;
  text-align: center;
}

.recipe-cards h2 > a {
  text-decoration: underline;
}

/* recipe page styling */

.author-name > a {
  font-weight: bold;
}

.recipe-tags {
  display: flex;
  flex-direction: row;
  gap: 0rem 2rem;
}

.recipe-description {
  max-width: 40%;
  text-align: center;
}

.recipe-columns {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ingredients > ul {
  border: 2px solid black;
  background-color: lightblue;
  padding: 2rem;
}

.steps {
  margin: 0rem 0rem 2rem 0rem;
}

.steps > ol {
  border: 2px solid black;
  background-color: lightblue;
  padding: 1rem;
  max-width: 45%;
  margin: 0 auto;
  text-wrap-style: pretty;
}

.steps > ol > li {
  margin: 1rem;
}

.ingredients > h3,
.steps > h3 {
  display: block;
  text-align: center;
  margin: 0 0 0 0 auto;
}

/* profile page user info */
.profile-intro > ul > li {
  text-align: center;
  list-style-type: none;
  margin: 1rem;
}

.form-errors {
  border: 2px solid #9b1c1c;
  background: #fde8e8;
  padding: 1rem;
  width: min(90%, 700px);
}

.recipe-form-layout {
  display: grid;
  gap: 2rem;
  width: min(95%, 1100px);
  align-items: start;
}

.recipe-form,
.recipe-preview,
.draft-cards > li {
  border: 2px solid black;
  background-color: #f4fbff;
  padding: 1rem;
}

.recipe-form {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.time-grid {
  display: grid;
  gap: 0.5rem;
}

.time-field {
  display: grid;
  gap: 0.35rem;
}

.checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.dynamic-section {
  display: grid;
  gap: 0.75rem;
}

.repeatable-row {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag-row {
  align-items: center;
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.helper-text {
  margin: 0;
  font-size: 0.95rem;
}

.recipe-preview {
  width: 100%;
}

.recipe-preview .recipe-description {
  max-width: 100%;
}

.draft-cards {
  list-style: none;
  padding: 0;
  width: min(95%, 700px);
}

.draft-cards > li {
  margin-bottom: 1rem;
}

.draft-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.draft-actions form {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .recipe-form-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .time-grid {
    grid-template-columns: 1fr;
  }

  .ingredient-row {
    grid-template-columns: 1fr 1fr 2fr auto;
  }

  .tag-row {
    grid-template-columns: 1fr auto;
  }

  .step-row {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}
