.gobii-pagefind-search {
  min-width: 260px;
}

.gobii-pagefind-search .pagefind-ui {
  --pagefind-ui-primary: var(--ifm-color-primary);
  --pagefind-ui-text: var(--ifm-font-color-base);
  --pagefind-ui-background: var(--ifm-navbar-background-color);
  --pagefind-ui-border: var(--ifm-color-emphasis-300);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 8px;
  --pagefind-ui-font: var(--ifm-font-family-base);
  width: 100%;
}

.gobii-pagefind-search .pagefind-ui__form::before,
.gobii-pagefind-search .pagefind-ui__suppressed {
  display: none;
}

.gobii-pagefind-search .pagefind-ui__search-input {
  border-color: var(--ifm-color-emphasis-300);
  height: 38px !important;
  padding-left: 2.45rem !important;
  padding-right: 0.9rem !important;
  font-size: 0.875rem !important;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.gobii-pagefind-search .pagefind-ui__search-input:hover {
  border-color: var(--ifm-color-emphasis-400);
}

.gobii-pagefind-search .pagefind-ui__search-input:focus {
  border-color: var(--ifm-color-primary);
  box-shadow: 0 0 0 3px var(--gobii-doc-focus-ring);
}

.gobii-pagefind-search .pagefind-ui__search-clear {
  align-items: center;
  border: 0 !important;
  border-radius: 6px !important;
  color: var(--ifm-color-emphasis-700) !important;
  display: flex;
  font-size: 0 !important;
  height: 1.7rem !important;
  justify-content: center;
  padding: 0 !important;
  right: 0.45rem !important;
  transition: background-color 140ms ease, color 140ms ease;
  width: 1.7rem !important;
}

.gobii-pagefind-search .pagefind-ui__search-clear::before {
  content: '×';
  font-size: 1.1rem;
  line-height: 1;
}

.gobii-pagefind-search .pagefind-ui__search-clear:hover {
  background: var(--gobii-doc-subtle-active) !important;
  color: var(--ifm-font-color-base) !important;
}

.gobii-pagefind-search .pagefind-ui__drawer {
  position: absolute;
  top: 3rem;
  right: 0;
  z-index: 50;
  width: min(680px, calc(100vw - 2rem));
  max-height: calc(100vh - 5rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--ifm-color-emphasis-200);
  border-radius: 8px;
  background: var(--ifm-background-surface-color);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.gobii-pagefind-search .pagefind-ui__result {
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.gobii-pagefind-search .pagefind-ui__result:hover {
  background: var(--gobii-doc-subtle-active);
}

.gobii-pagefind-search mark {
  background: color-mix(in srgb, var(--ifm-color-primary) 22%, transparent);
  border-radius: 4px;
  color: inherit;
  padding: 0 0.1rem;
}

@media (max-width: 600px) {
  .gobii-pagefind-search {
    min-width: 0;
    width: min(46vw, 180px);
  }

  .gobii-pagefind-search .pagefind-ui__search-input {
    height: 36px !important;
    font-size: 0.84rem !important;
    padding-left: 2.15rem !important;
    padding-right: 0.75rem !important;
  }
}
