/* –––––– SEARCH SECTION –––––– */

section.search h1 {
  color: var(--color-primary);
  font-size: var(--text-2\.5lg);
  margin-bottom: 2rem;
}

section.search form input {
  padding: 12px 14px;
  border-radius: 10px;
  min-width: 235px;
  flex-grow: 1;
  max-width: min(400px, 40%);
  color: var(--color-black);
  background-color: var(--color-white);
  border: 1px solid #e9e9e9;
  outline: none;
  transition: border 0.3s ease;
}
section.search form input:focus-within {
  border-color: var(--color-primary);
}

section.search .btn {
  padding-block: 4px;
  border-radius: 8px;
}

section.search div[aria-live="polite"] p {
  color: var(--color-black);
  font-size: var(--text-md);
  font-weight: 500;
}

section.search ul li {
  padding-block: 1.5rem;
  border-bottom: 1px solid #eee;
}
section.search ul li a {
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}
section.search ul li a img {
  flex: 0 0 280px;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}
section.search ul li .search-results__content h3 {
  color: var(--color-primary);
  font-weight: 900;
  font-size: var(--text-lg);
  margin-bottom: 1.3rem;
}
section.search ul li .search-results__content > p {
  color: var(--color-black);
  font-weight: 400;
  font-size: var(--text-md);

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media screen and (max-width: 640px) {
  section.search ul li a {
    flex-direction: column;
  }
  section.search ul li a img {
    flex: unset;
    width: 100%;
    height: 260px;
  }
}

/* –––––– END SEARCH SECTION END –––––– */

#search-screen {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0rem;
  z-index: 100;
}
#search-screen > div {
  height: 100%;
  background-color: hsla(0, 0%, 0%, 0.7);
}
#search-screen .search-screen__container {
  background-color: #ffffff;
  backdrop-filter: brightness(0.5);
  height: 80%;
  max-height: 550px;
}

#search-screen .search-screen__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid #e9e9e9;
}
#search-screen .search-screen__header input {
  padding: 12px 14px;
  border-radius: 10px;
  min-width: 235px;
  flex-grow: 1;
  max-width: min(400px, 40%);
  color: var(--color-black);
  background-color: var(--color-white);
  border: 1px solid var(--border-primary);
  box-shadow: 0px 1px 2px 0px #121a2b0d;
}
#search-screen .search-screen__header #search-screen__close {
  background: transparent;
  border: none;
  height: fit-content;
  width: fit-content;
  cursor: pointer;

  color: var(--color-black);

  transition: color 0.3s ease;
}
#search-screen .search-screen__header > p {
  font-family: var(--font-fixel);
  font-weight: 400;
  font-size: var(--text-l3);
  line-height: 1;
}

@media (hover) {
  #search-screen .search-screen__header #search-screen__close:hover {
    color: black;
  }
}

#search-screen .search-screen__header #search-screen__close:active {
  color: black;
}

#search-screen .search-screen__body {
  padding-block: 2rem;
  max-height: 430px;
  overflow: hidden;
}
#search-screen .search-screen__body > p {
  font-family: var(--font-fixel);
  font-weight: 500;
  font-size: var(--text-2xl);
  line-height: 1;
  text-align: center;
}

#search-screen .search-screen__body ul {
  overflow-y: scroll;
  overscroll-behavior: contain;
  height: 430px;
}
#search-screen .search-screen__body ul li:last-child {
  margin-bottom: 2rem;
}
#search-screen .search-screen__body ul li a {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 3fr;
  align-items: center;
  margin-block: 1.5rem;
}
#search-screen .search-screen__body ul li a img {
  grid-row: span 2;
  align-self: start;
  height: 160px;
  object-fit: cover;
  object-position: center;
}
#search-screen .search-screen__body ul li a > p {
  grid-column: 2;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-fixel);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.5;
  padding-right: 3rem;
  color: var(--color-black);

  transition: color 0.3s ease;
}
@media (hover) {
  #search-screen .search-screen__body ul li:hover a > p {
    color: var(--color-secondary);
  }
}
#search-screen .search-screen__body ul li a span {
  grid-column: 2;

  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-fixel);
  font-weight: 400;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-black);
}

#search-screen .search-screen__loading {
  display: flex;
  align-items: end;
  gap: 1rem;
}
#search-screen .search-screen__loading > * {
  width: 40px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background-color: var(--color-primary);

  animation: loading infinite 0.5s;
}
#search-screen .search-screen__loading > *:nth-child(2) {
  animation-delay: 0.1s;
}
#search-screen .search-screen__loading > *:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes loading {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.2);
  }
}

@media (max-width: 540px) {
  #search-screen .search-screen__container {
    height: 100%;
  }
  #search-screen .search-screen__body ul li {
    border-bottom: 1px solid var(--border-primary);
  }
  #search-screen .search-screen__body ul li:last-child {
    border-bottom: none;
  }
  #search-screen .search-screen__body ul li a {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  #search-screen .search-screen__body ul li a > p {
    padding-right: 0;
    text-align: center;
  }
  #search-screen .search-screen__body > p {
    text-align: center;
  }
}
