@import url("https://fonts.googleapis.com/css2?family=Merienda&display=swap");

/* ---Basic Style--- */
* {
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font-size: 62.5%;
}

@media only screen and (max-width: 61.25em) {
  html {
    font-size: 50%;
  }
}

body {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: #615551;
  background-image: linear-gradient(to right, #f2709c, #ff9472);
  background-size: cover;
  background-repeat: no-repeat;
  min-height: calc(100vh - 2 * 4vw);
}

.container {
  max-width: 120rem;
  min-height: 117rem;
  margin: 4vw auto;
  background-color: #fff;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 2rem 6rem 0.5rem rgba(#615551, 0.2);

  display: grid;
  grid-template-rows: 10rem minmax(100rem, auto);
  grid-template-columns: 1fr 2fr;
  grid-template-areas:
    "head head"
    "list recipe";
}

@media only screen and (max-width: 8.15em) {
  .container {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }
}

/* ----Heading ----*/
.heading--2 {
  font-size: 2rem;
  font-weight: 700;
  color: #f38e82;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  text-align: center;
}

.link:link,
.link:visited {
  color: #918581;
}

/* Message Error */

.message,
.error {
  max-width: 40rem;
  margin: 0 auto;
  padding: 5rem 4rem;
  display: flex;
}
.message svg,
.error svg {
  height: 3rem;
  width: 3rem;
  fill: #f38e82;
  transform: translateY(-0.3rem);
}

.message p,
.error p {
  margin-left: 1.5rem;
  font-size: 1.8rem;
  line-height: 1.5;
  font-weight: 600;
}

/* spinner */
.spinner {
  margin: 5rem auto;
  text-align: center;
}

.spinner svg {
  height: 6rem;
  width: 6rem;
  fill: #ec8e4f;
  animation: rotate 2s infinite linear;
}

@keyframes rotate {
  0% {
    transform: rotate(0);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Buttons */

.btn {
  padding: 1.5rem 4rem;
  font-size: 1.5rem;
  font-weight: 600;
  background-image: linear-gradient(to right, #f2709c, #ff9472);
  border-radius: 10rem;
  border: none;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.btn:hover,
.btn--small:hover {
  transform: scale(1.05);
}
.btn:focus {
  outline: none;
}
.btn > *:first-child,
.btn--small > *:first-child {
  margin-right: 1rem;
}

.btn svg {
  height: 2.25rem;
  width: 2.25rem;
  fill: currentColor;
}

.btn--small svg {
  height: 1.75rem;
  width: 1.75rem;
  fill: currentColor;
}
.btn--small,
.btn--small :link,
.btn--small :visited {
  font-size: 1.4rem;
  font-weight: 600;
  padding: 1.25rem 2.25rem;
  text-decoration: none;
}

.btn--round {
  background-image: linear-gradient(to right, #f2709c, #ff9472);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  height: 4.5rem;
  width: 4.5rem;
  transition: all 0.2s;

  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.btn--round:hover {
  transform: scale(1.07);
}
.btn--round:focus {
  outline: none;
}

.btn--round svg {
  height: 2.5rem;
  width: 2.5rem;
  fill: #fff;
}

/* ----Header ----- */

.header {
  grid-area: head;
  background-color: #f9f5f3;
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
}
.header__logo {
  margin-left: 4rem;
  height: 4.6rem;
  display: block;
}

.logo-text {
  color: #615551;
  font-size: 1.5rem;
  font-family: "Merienda", cursive;
}
.search {
  background-color: #fff;
  border-radius: 10rem;
  display: flex;
  align-items: center;
  padding-left: 3rem;
  transition: all 0.3s;
  margin-left: auto;
}
.search:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 0.7rem 3rem rgba(#615551, 0.08);
}
.search__field {
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
  font-size: 1.7rem;
  width: 30rem;
}
.search__field:focus {
  outline: none;
}
.search__field::placeholder {
  color: #d3c7c3;
}

@media only screen and (max-width: 61.25em) {
  .search__field {
    width: auto;
  }

  .search__field::placeholder {
    color: white;
  }
}
.search__btn {
  font-weight: 600;
  font-family: inherit;
}

/* Navigation */
.nav {
  align-self: stretch;
  margin-right: 2.5rem;
}

.nav__list {
  list-style: none;
  display: flex;
  height: 100%;
}
.nav__item {
  position: relative;
}
.nav__btn {
  height: 100%;
  font-family: inherit;
  color: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 1.5rem;
  transition: all 0.3s;
  outline: none;

  display: flex;
  align-items: center;
}
.nav__btn svg {
  height: 2.4rem;
  width: 2.4rem;
  fill: #f38e82;
  margin-right: 0.7rem;
  transform: translateY(-1px);
}

.nav__btn svg:focus {
  outline: none;
}

.nav__btn svg:hover {
  background-color: #f2efee;
}

.bookmarks {
  padding: 1rem 0;
  position: absolute;
  right: -2.5rem;
  z-index: 10;
  width: 40rem;
  background-color: #fff;
  box-shadow: 0 0.8rem 5rem 2rem rgba(#615551, 0.1);
  visibility: hidden;
  opacity: 0;
  transition: all 0.5s 0.2s;
}
.bookmarks__list {
  list-style: none;
}

.bookmarks__field {
  cursor: pointer;
  padding: 0 4rem;

  display: flex;
  align-items: center;
  height: 100%;
  transition: all 0.3s;
}
.bookmarks__field.bookmarks:hover {
  background-color: #f2efee;
}

.bookmarks:hover,
.nav__btn--bookmarks:hover + .bookmarks {
  visibility: visible;
  opacity: 1;
}

/* preview */

.preview__link:link,
.preview__link:visited {
  display: flex;
  align-items: center;
  padding: 1.5rem 3.25rem;
  transition: all 0.3s;
  border-right: 1px solid #fff;
  text-decoration: none;
}

.preview:hover {
  background-color: #f9f5f3;
  transform: translateY(-2px);
}

.preview--active {
  background-color: #f9f5f3;
}

.preview__fig {
  flex: 0 0 5.8rem;
  border-radius: 50%;
  overflow: hidden;
  height: 5.8rem;
  margin-right: 2rem;
  position: relative;
  backface-visibility: hidden;
}

.preview__fig::before {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-image: linear-gradient(to right, #f2709c, #ff9472);
  opacity: 0.4;
}

.preview__fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s;
}

.preview__data {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 2rem;
  row-gap: 0.1rem;
  align-items: center;
}

.preview__title {
  grid-column: 1/-1;
  font-size: 1.45rem;
  color: #f38e82;
  text-transform: uppercase;
  font-weight: 600;

  /* This is how text is truncated! */
  text-overflow: ellipsis;
  max-width: 25rem;
  white-space: nowrap;
  overflow: hidden;
}

.preview__publisher {
  font-size: 1.15rem;
  color: #918581;
  text-transform: uppercase;
  font-weight: 600;
}

.preview__user-generated {
  background-color: darken(#f2efee, 2%);

  display: flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  width: 2rem;
  border-radius: 10rem;

  margin-left: auto;
  margin-right: 1.75rem;
}

.preview__user-generated svg {
  height: 1.2rem;
  width: 1.2rem;
  fill: #f38e82;
}

/* ----recipe style---- */

.recipe {
  background-color: #f9f5f3;
}

.recipe__fig {
  height: 32rem;
  position: relative;
  transform-origin: top;
}
.recipe__fig::before {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-image: linear-gradient(to right, #f2709c, #ff9472);
  opacity: 0.4;
}
.recipe__img {
  width: 250px;
  height: 250px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 1rem;

  /* width: 100%; */
  display: block;
  /* height: 100%; */
  object-fit: cover;
}

.recipe__title {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translate(-50%, 20%) skewY(-6deg);
  color: #fff;
  font-weight: 700;
  font-size: 2.5rem;
  text-transform: uppercase;
  width: 50%;
  line-height: 1.95;
  text-align: center;
}
.recipe__title span {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 1rem 2rem;
  background-image: linear-gradient(to right, #f2709c, #ff9472);
}

@media only screen and (max-width: 61.25em) {
  .recipe__title {
    width: 70%;
  }
}

.recipe__details {
  display: flex;
  align-items: center;
  padding: 3.5rem 8rem;
  justify-content: center;
}

.recipe__info {
  font-size: 1.65rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

.recipe__info:not(:last-child) {
  margin-right: 4.5rem;
}

.recipe__info-icon {
  height: 2.35rem;
  width: 2.35rem;
  fill: #f38e82;
  margin-right: 1.15rem;
}

.recipe__info-data {
  margin-right: 0.5rem;
  font-weight: 700;
}

.recipe__ingredients {
  padding: 5rem 8rem;
  font-size: 1.6rem;
  line-height: 1.4;
  background-color: #f2efee;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recipe__ingredient-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3rem;
  list-style: none;
}

.recipe__ingredient {
  display: flex;
}

.recipe__icon {
  height: 2rem;
  width: 2rem;
  fill: #f38e82;
  margin-right: 1.1rem;
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.recipe__quantity {
  margin-right: 0.5rem;
  flex: 0 0 auto;
}

.recipe__directions {
  padding: 5rem 10rem;
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recipe__directions-text {
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 3.5rem;
  color: #918581;
}

.recipe__publisher {
  font-weight: 700;
}

/* search results */

.search-results {
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
}

.results {
  list-style: none;
  margin-bottom: 2rem;
}

.add-recipe-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100rem;
  background-color: white;
  border-radius: 9px;

  padding: 5rem 6rem;
  box-shadow: 0 4rem 6rem rgba(0, 0, 0, 0.25);
  z-index: 1000;
  transition: all 0.5s;
}

.add-recipe-window .btn--close-modal {
  font-family: inherit;
  color: inherit;
  position: absolute;
  top: 0.5rem;
  right: 1.6rem;
  font-size: 3.5rem;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  transition: all 0.5s;
}

.hidden {
  visibility: hidden;
  opacity: 0;
}

.upload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem 6rem;
}

.upload__column {
  display: grid;
  grid-template-columns: 1fr 2.8fr;
  align-items: center;
  gap: 1.5rem;
}

.upload__column label {
  font-size: 1.5rem;
  font-weight: 600;
  color: inherit;
}

.upload__column input {
  font-size: 1.5rem;
  padding: 0.8rem 1rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  transition: all 0.2s;
}
.upload__column input::placeholder {
  color: #d3c7c3;
}

.upload__column input:focus {
  outline: none;
  border: 1px solid#f38e82;
  background-color: #f9f5f3;
}

.upload__column button {
  grid-column: 1 / span 2;
  justify-self: center;
  margin-top: 1rem;
}

.upload__heading {
  font-size: 2.25rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
  grid-column: 1/-1;
}

.upload__btn {
  grid-column: 1 / -1;
  justify-self: center;
}
