/* ==========================================================================
   search-suggest.css — type-ahead dropdown for the search boxes
   Used by Home/en (hero box) and Search/en (hero box); the AR page styles its
   dropdown with the AR tree's Bootstrap classes instead (standing AR decision).

   ADDITION, not from Design-A: Design-A never drew an autosuggest (search did
   not exist when it was drawn), so like the search empty state this is styled
   from the frozen tokens only — it adds a component the approved design never
   covered and restyles nothing.
   ========================================================================== */

/* Positioning context wrapping a search <form> + its [data-suggest-list].
   A wrapper rather than the form itself because .search-hero-form clips
   overflow for its rounded corners — an absolute child inside it would be
   cut off. Width mirrors both search boxes' own max-width so the dropdown
   aligns exactly with the box edges. */
.search-suggest-wrap { position: relative; max-inline-size: 640px; }

/* The home hero clips overflow (decorative bg containment), which cut the
   dropdown dead at the hero's bottom edge — the next section's background
   appeared to cover the rest of the list. Lift the clip only when a suggest
   box lives inside: the hero's bg image and overlay are inset:0 absolutes,
   so nothing else can escape and the approved look is unchanged. */
.ha-hero:has([data-suggest-wrap]) { overflow: visible; }
/* The home hero centres its box; mirror that on the wrapper (the form's own
   max-width/margin still apply unchanged inside). */
.search-suggest-wrap--center { margin-inline: auto; }

.search-suggest {
  position: absolute;
  inset-block-start: calc(100% + var(--sp-2));
  inset-inline: 0;
  z-index: var(--z-dropdown);
  background: var(--bg-white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;            /* clip row hover to the rounded corners */
  text-align: start;           /* .ha-hero__inner centres text; rows must not inherit it */
}

.search-suggest-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 44px;            /* touch target */
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--gray-900);
  text-decoration: none;
  cursor: pointer;
}
.search-suggest-option:hover,
.search-suggest-option.active {
  background: var(--gray-100);
}

.search-suggest-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-type {
  flex-shrink: 0;
  padding: 2px var(--sp-2);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-700);
}
