/* Search dialog — see search.js */

html.docs-search-open {
  overflow: hidden;
}

.docs-search[hidden] {
  display: none;
}

.docs-search {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6rem 1rem 1rem;
}

.docs-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 45%);
  backdrop-filter: blur(4px);
}

.docs-search__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
  max-height: min(32rem, calc(100vh - 8rem));
  overflow: hidden;
  background: #fff;
  border: 1px solid rgb(148 163 184 / 30%);
  border-radius: 0.875rem;
  box-shadow: 0 24px 48px -12px rgb(15 23 42 / 35%);
}

.docs-search__ui {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.875rem;
}

.docs-search__hint {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  color: #64748b;
  border-top: 1px solid rgb(148 163 184 / 25%);
}

.docs-search__hint kbd {
  padding: 0 0.3rem;
  font: inherit;
  border: 1px solid rgb(148 163 184 / 45%);
  border-radius: 0.25rem;
}

/* Pagefind UI theming — matches the docs primary color from docs.json */
.docs-search__ui {
  --pagefind-ui-scale: 0.85;
  --pagefind-ui-primary: #16a34a;
  --pagefind-ui-text: #0f172a;
  --pagefind-ui-background: #fff;
  --pagefind-ui-border: rgb(148 163 184 / 35%);
  --pagefind-ui-tag: rgb(148 163 184 / 15%);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 0.5rem;
  --pagefind-ui-font: inherit;
}

.docs-search mark {
  background: rgb(22 163 74 / 18%);
  color: inherit;
  border-radius: 0.2rem;
}

html.dark .docs-search__panel {
  background: #0f1117;
  border-color: rgb(148 163 184 / 22%);
}

html.dark .docs-search__hint {
  color: #94a3b8;
}

html.dark .docs-search mark {
  background: rgb(7 201 131 / 22%);
}

html.dark .docs-search__ui {
  --pagefind-ui-primary: #07c983;
  --pagefind-ui-text: #e2e8f0;
  --pagefind-ui-background: #0f1117;
  --pagefind-ui-border: rgb(148 163 184 / 25%);
  --pagefind-ui-tag: rgb(148 163 184 / 12%);
}

@media (max-width: 640px) {
  .docs-search {
    padding: 3.5rem 0.75rem 0.75rem;
  }
}
