/* ==========================================================================
   Intelio - shared "Search Demographics" search bar component.

   Single source of truth for the demographics/county search bar styling. Loaded
   by BOTH /search-demographics/ and the homepage hero "Explore Demographics"
   state.

   Scoped under `.demographics-searchbar` (the component root rendered by
   /search-demographics/_searchbar.php) so it never leaks into the surrounding
   page and cannot collide with the homepage hero's own classes.

   The suggestion dropdown is styled by the shared script
   (/js/demographics-search-autocomplete.js) using the page's design tokens, so
   it renders identically in both placements by construction; only the input box
   lives here.
   ========================================================================== */

.demographics-searchbar,
.demographics-searchbar * {
  box-sizing: border-box;
}

.demographics-searchbar .demographics-searchbox {
  /* Matches the original /search-demographics/ bar: bordered, card-coloured,
     sharp-cornered row with the magnifier icon on the left. */
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--card, #fff);
  border: 1px solid var(--border, #e2e2e2);
  padding: 1rem 1.25rem;
  position: relative; /* anchors the absolutely-positioned suggestions dropdown */
  width: 100%;
  transition: border-color 0.15s ease;
}

.demographics-searchbar .demographics-searchbox:focus-within {
  border-color: var(--border, #e2e2e2);
}

.demographics-searchbar .demographics-searchicon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  color: var(--muted-foreground, #5f5e5e);
}

.demographics-searchbar .demographics-search-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-sans, "Inter", ui-sans-serif, system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--foreground, #1b1b1b);
  padding: 0;
  margin: 0;
}

.demographics-searchbar .demographics-search-input::placeholder {
  color: var(--muted-foreground, #5f5e5e);
}

/* The native search widget's clear affordance is not part of the design. */
.demographics-searchbar .demographics-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* The dropdown container is positioned and shown by the shared script. */
.demographics-searchbar .demographics-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  display: none;
}
