:root {
  --red: rgb(82, 32, 32);
}

* {
  box-sizing: border-box;
}

body {
  padding: 7vh 0;
  min-height: 100vh;
  background-color: rgb(196, 170, 170);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--red);
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
}

button:focus,
input:focus {
  outline: 0;
}

/*search section---------------------------------------------*/
.form-container {
  display: flex;
  align-items: center;
  justify-content: center;
}
h1 {
  text-align: center;
  border-bottom: solid 2px white;
  padding-bottom: 8px;
}

form input {
  border: solid 1px var(--red);
  border-right: 0;
  padding: 10px;
  border-radius: 5px 0 0 5px;
  color: var(--red);
  font-size: 16px;
  font-weight: 600;
  width: 65vw;
  max-width: 300px;
}
button {
  border: solid 1px var(--red);
  padding: 9px;
  font-size: 17px;
  cursor: pointer;
  transition: 0.6s;
  background-color: var(--red);
  color: white;
  border-radius: 0 5px 5px 0;
}
button:hover {
  background-color: white;
  color: var(--red);
  transition: 0.6s;
}
button#search-btn {
  margin: 0 10px 0 -5px;
}

button#random-btn {
  border-radius: 5px;
}

/*result section---------------------------------------------*/
.result-container {
  text-align: center;
  width: 80vw;
  max-width: 800px;
}

#result-heading h3 {
  background-color: #ffffff73;
  padding: 10px 0;
  margin-top: 40px;
}

#result-meals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 20px;
}
@media (max-width: 900px) {
  #result-meals {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  #result-meals {
    grid-template-columns: repeat(1, 1fr);
  }
}

#result-meals .meal {
  cursor: pointer;
  height: 100%;
  width: 100%;
  position: relative;
  border: solid 1px white;
  border-radius: 10px;
}

#result-meals .meal-title {
  position: absolute;
  top: 0%;
  left: 0%;
  color: white;
  height: 100%;
  width: 100%;
  background-color: rgba(82, 32, 32, 0.7);
  border-radius: 10px;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  transition: opacity 0.6s ease-out;
}

#result-meals .meal:hover .meal-title {
  opacity: 1;
  transition: opacity 0.4s ease-in;
}

#result-meals img {
  border-radius: 10px;
  width: 100%;
  height: 100%;
}

#result-single-meal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.329);
  margin-top: 40px;
}

.single-meal {
  padding: 20px;
}

#result-single-meal h4 {
  margin: 30px 10px;
  text-align: center;
}

#result-single-meal img {
  width: 300px;
  border-radius: 10px;
}
@media (max-width: 400px) {
  #result-single-meal img {
    width: 70vw;
    border-radius: 6px;
  }
}

#result-single-meal .single-meal-type-origin {
  font-weight: 600;
  width: fit-content;
  margin: 30px auto;
}

#result-single-meal .single-meal-type-origin p {
  margin: 6px auto;
}

#result-single-meal .single-meal-main {
  text-align: left;
  padding: 0 30px;
  font-size: 14px;
}

#result-single-meal .single-meal-main ul {
  list-style-type: none;
  font-weight: 500;
  padding-left: 0;
  text-align: center;
}

#result-single-meal .single-meal-main ul li {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.808);
  margin: 4px;
  padding: 4px 8px;
  border-radius: 3px;
}
