/*
 * Site search (Pagefind Component UI) in jbang.dev's colours.
 * Shared by the jbang.dev pages and the documentation (jbang-antora-ui), which
 * both put data-theme="light|dark" on <html>.
 */
:root {
  --pf-text: #0f172a;
  --pf-text-secondary: #475569;
  --pf-text-muted: #64748b;
  --pf-background: #ffffff;
  --pf-border: #e2e8f0;
  --pf-border-focus: #cbd5e1;
  --pf-skeleton: #f1f5f9;
  --pf-skeleton-shine: #f8fafc;
  --pf-hover: #f8fafc;
  --pf-mark: #d63d56;
  --pf-outline-focus: #eb586f;
  --pf-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pf-border-radius: 8px;
  --pf-modal-max-width: 640px;
  --jb-search-accent: #eb586f;
  --jb-search-accent-soft: rgba(235, 88, 111, 0.1);
  --jb-search-accent-ring: rgba(235, 88, 111, 0.25);
}

[data-theme="dark"] {
  --pf-text: #f1f5f9;
  --pf-text-secondary: #94a3b8;
  --pf-text-muted: #94a3b8;
  --pf-background: #111827;
  --pf-border: #1e293b;
  --pf-border-focus: #334155;
  --pf-skeleton: #161f30;
  --pf-skeleton-shine: #1e293b;
  --pf-hover: #161f30;
  --pf-mark: #ff7c91;
  --pf-outline-focus: #f06a7f;
  --pf-modal-backdrop: rgba(2, 6, 23, 0.7);
  --jb-search-accent: #f06a7f;
  --jb-search-accent-soft: rgba(240, 106, 127, 0.14);
  --jb-search-accent-ring: rgba(240, 106, 127, 0.3);
}

/*
 * The button in the header that opens search: a pill, like the search box it
 * replaces. Pagefind's own rules are deliberately high-specificity, so restyle
 * through its variables where possible.
 */
.jb-search-trigger {
  --pf-border: var(--jb-search-accent);
  --pf-border-focus: var(--jb-search-accent);
  --pf-border-radius: 999px;
  display: block;
  min-width: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--jb-search-accent-soft);
}

.jb-search-trigger:hover,
.jb-search-trigger:focus-within {
  box-shadow: 0 0 0 3px var(--jb-search-accent-ring);
}

/* Very narrow screens: icon only */
@media (max-width: 379.98px) {
  :is(*, #\#):is(*, #\#):is(*, #\#) .jb-search-trigger .pf-trigger-text,
  :is(*, #\#):is(*, #\#):is(*, #\#) .jb-search-trigger .pf-trigger-shortcut {
    display: none;
  }
}
