/* Minimal styles; customize to match your site */
:root {
  --thumbnailSize: 150px;
  --liveSearchGap: 12px;
}

.live-search {
  position: relative;
  margin-left: auto;
  z-index: 4100;
  min-width: 0;
}

.live-search__results {
  position: absolute;
  top: calc(100% + 1em);
  right: 0;

  width: min(calc(var(--thumbnailSize) + 300px), calc(100vw - 24px));
  max-height: min(70dvh, 700px);

  z-index: 4100;
  background: #fff;
  color: #000;

  overflow-x: hidden;
  overflow-y: auto;

  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.live-search__item {
  display: grid;
  grid-template-columns: var(--thumbnailSize) minmax(0, 1fr);
  gap: var(--liveSearchGap);
  padding: 12px;
  text-decoration: none;
  color: inherit;
}

.live-search__item:hover {
  background: rgba(0, 0, 0, .04);
}

.live-search__thumb {
  width: var(--thumbnailSize);
  aspect-ratio: 1300 / 850;
  object-fit: cover;
  background: rgba(0, 0, 0, .06);
}

.live-search__thumb--placeholder {
  display: block;
}

.live-search__content {
  min-width: 0;
}

.live-search__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.live-search__desc {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.live-search__tag {
  background-color: var(--light-blue);
  width: fit-content;
  color: #fff;
  font-size: 0.6rem;
  border-radius: 1em;
  padding: .2em .6em;
  margin-top: 1em;
}

.live-search__empty {
  padding: 12px;
  opacity: 0.8;
}

.live-search__loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.live-search__spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: liveSearchSpin 0.75s linear infinite;
}

.live-search__loading-text {
  font-weight: 700;
}

@keyframes liveSearchSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  :root {
    --thumbnailSize: 72px;
  }

  .live-search {
    position: static;
    flex: 1 1 auto;
    width: 100%;
    margin-left: 0;
  }

  .live-search__results {
    left: 12px;
    right: 12px;
    top: calc(100% + 6px);

    width: auto;
    max-height: calc(100dvh - var(--header-height) - 56px - 12px);
  }

  .live-search__item {
    grid-template-columns: var(--thumbnailSize) minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .live-search__title {
    font-size: 16px;
    line-height: 1.15;
  }

  .live-search__desc {
    font-size: 13px;
    line-height: 1.25;
  }

  .live-search__tag {
    margin-top: .5em;
  }
}