.recipe-app {
  max-width: 32rem;
  margin: 0 auto;
  padding-top: 4rem;
  padding-bottom: 2.5rem;
  color: #1c1c1c;
}

@media (min-width: 768px) {
  .recipe-app {
    padding-top: 0;
  }
}

.recipe-app__bar {
  position: sticky;
  top: 4rem;
  z-index: 20;
  background: #fff;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid #ece7e1;
}

.recipe-app__bar h1 {
  font-size: 1.6rem;
  margin: 0 0 0.65rem;
}

.recipe-search {
  width: 100%;
  font-size: 16px;
  line-height: 1.3;
  border: 1px solid #d5d0ca;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: #f7f5f2;
}

.recipe-search:focus {
  outline: 2px solid #0d6efd;
  background: #fff;
}

.recipe-add-open,
.recipe-save,
.recipe-add-ingredient {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  border: 0;
  border-radius: 999px;
  background: #0d6efd;
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1rem;
}

.recipe-add-ingredient {
  background: #fff;
  color: #0d6efd;
  border: 1px solid #0d6efd;
  margin-bottom: 0.5rem;
}

.recipe-modal[hidden] {
  display: none;
}

.recipe-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(28, 28, 28, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.recipe-modal__panel {
  width: 100%;
  max-width: 32rem;
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 1rem 1rem 0 0;
  padding: 1rem 1rem 1.5rem;
}

.recipe-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: -1rem;
  background: #fff;
  padding: 0.25rem 0 0.5rem;
  z-index: 1;
}

.recipe-modal__header h2 {
  font-size: 1.35rem;
  margin: 0;
}

.recipe-modal__close {
  border: 0;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0 0.25rem;
}

.recipe-field {
  display: block;
  margin: 0.75rem 0;
  font-weight: 600;
}

.recipe-field input,
.recipe-field textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  font-size: 16px;
  font-weight: 400;
  border: 1px solid #d5d0ca;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
}

.recipe-form-heading {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

.recipe-ingredient-headers,
.recipe-ingredient-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.5rem;
}

.recipe-ingredient-headers {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.recipe-ingredient-row {
  margin-bottom: 0.45rem;
}

.recipe-ingredient-row input {
  width: 100%;
  font-size: 16px;
  border: 1px solid #d5d0ca;
  border-radius: 0.5rem;
  padding: 0.6rem 0.7rem;
}

.recipe-add-error {
  color: #b42318;
  margin: 0.75rem 0 0;
}

@media (min-width: 768px) {
  .recipe-modal {
    align-items: center;
    padding: 1rem;
  }

  .recipe-modal__panel {
    border-radius: 1rem;
    max-height: 85vh;
  }
}

.recipe-status {
  margin: 1.25rem 1rem;
  color: #5c564f;
}

.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 0.75rem;
}

.recipe-card {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.recipe-card img,
.recipe-detail__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #efeae4;
}

.recipe-card h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0.7rem 1rem 0.25rem;
}

.recipe-card p {
  margin: 0 1rem;
  color: #5c564f;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-detail[hidden],
.recipe-browse[hidden] {
  display: none;
}

.recipe-back {
  position: sticky;
  top: 4rem;
  z-index: 20;
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #ece7e1;
  background: #fff;
  font-size: 1rem;
  padding: 0.9rem 1rem;
}

.recipe-detail h2 {
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 0.9rem 1rem 0.4rem;
}

.recipe-notes {
  margin: 0 1rem 0.4rem;
  color: #5c564f;
}

.recipe-detail h3 {
  font-size: 1.05rem;
  margin: 1.25rem 1rem 0.45rem;
}

.recipe-ingredients,
.recipe-steps {
  list-style: none;
  margin: 0;
  padding: 0 1rem;
}

.recipe-ingredients li {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #efeae4;
  font-size: 1rem;
}

.recipe-qty {
  flex: 0 0 5.5rem;
  color: #5c564f;
}

.recipe-steps > li {
  padding: 0.85rem 0 0.2rem;
  border-bottom: 1px solid #efeae4;
}

.recipe-steps h3 {
  margin: 0 0 0.4rem;
}

.recipe-steps ul {
  margin: 0 0 0.8rem;
  padding-left: 1.1rem;
}

.recipe-steps li li {
  margin: 0.25rem 0;
}
