/**
 * NPF Core — the hero search box's suggestion dropdown.
 *
 * Kept out of npf-home.css deliberately: that file is a generated port of the
 * reference stylesheet and carries a warning against hand-editing, so anything
 * added to it is lost the next time it is regenerated. This is the component's
 * own file and is loaded only on pages carrying the hero element.
 *
 * WHY EVERY SELECTOR STARTS AT `.npf-suggest-host`
 * ------------------------------------------------
 * The design stylesheet opens with a reset:
 *
 *     body.npf-home .npf-main * { margin: 0; padding: 0 }
 *
 * — two classes and an element, which outranks a plain two-class selector. A
 * dropdown written as `.npf-suggest .npf-suggest__row` therefore rendered with
 * every row's padding stripped and the whole list collapsed to text height.
 * Prefixing with the host class puts these rules at three classes, which wins
 * on merit rather than on !important. The panel element itself is the one rule
 * that cannot reach three that way, and it says so where it sits.
 *
 * The design tokens are declared on `body.npf-home .npf-main`, which is where
 * the hero normally sits, so they cascade in. Every var() below still names a
 * fallback, because the hero is an ordinary WPBakery element and can be placed
 * on a page that does not carry that scope.
 *
 * @package NPF_Core
 */

.npf-suggest-host {
  position: relative;
}

/* Two selectors for one rule: the first is all a page outside the design scope
   needs, and the second is what it takes to out-rank the reset described above
   on `padding` when the hero is where it usually is. */
.npf-suggest-host .npf-suggest,
body.npf-home .npf-main .npf-suggest,
.npf-dash .npf-suggest {
  position: absolute;
  z-index: 60;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0;
  background: #fff;
  border: 1px solid var(--line, var(--npf-line, #e3e3e3));
  border-radius: var(--radius, 16px);
  box-shadow: 0 18px 44px rgba(19, 24, 36, 0.14);
  /* The dropdown belongs to the field, not to the sentence around it — the
     hero centres its text, and these rows are a list, not prose. */
  text-align: left;
}

.npf-suggest-host .npf-suggest[hidden] {
  display: none;
}

/* ---------- Rows ---------- */

.npf-suggest-host .npf-suggest .npf-suggest__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  color: var(--ink, #020b18);
  font-family: var(--font-body, "Inter", sans-serif);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  /* No transition: the row has to look selected the instant an arrow key moves
     the selection, and a fade reads as lag when it is driven by a key rather
     than by a pointer. */
}

.npf-suggest-host .npf-suggest .npf-suggest__row:hover,
.npf-suggest-host .npf-suggest .npf-suggest__row.is-active {
  background: var(--primary-soft, #e1eeff);
  color: var(--ink, #020b18);
  text-decoration: none;
}

.npf-suggest-host .npf-suggest .npf-suggest__row:focus {
  outline: none;
}

/* The plain "search for what I typed" row, always last. The rule separates it
   from the answers above without drawing a line on a list that has none. */
.npf-suggest-host .npf-suggest .npf-suggest__row.is-search:not(:first-child) {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft, #eef1f6);
}

/* ---------- Row parts ---------- */

.npf-suggest-host .npf-suggest .npf-suggest__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--muted, #8a94a3);
}

.npf-suggest-host .npf-suggest .npf-suggest__icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.npf-suggest-host .npf-suggest .npf-suggest__row.is-category .npf-suggest__icon,
.npf-suggest-host .npf-suggest .npf-suggest__row.is-expert .npf-suggest__icon {
  color: var(--primary, #4f84c3);
}

.npf-suggest-host .npf-suggest .npf-suggest__body {
  display: flex;
  flex: 1 1 auto;
  /* Centred, not baseline-aligned: the label below is an `overflow: hidden`
     flex item, and such an item reports its bottom edge as its baseline, which
     drops the caption beside it by most of a line. */
  align-items: center;
  gap: 12px;
  /* Without this a flex child refuses to shrink below its content, and the
     ellipsis on a long listing title never appears. */
  min-width: 0;
}

.npf-suggest-host .npf-suggest .npf-suggest__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* What the visitor has *not* typed is the part worth reading. */
.npf-suggest-host .npf-suggest .npf-suggest__label b {
  font-weight: 700;
}

/* The last row runs the query as typed; there is no completion to weight. */
.npf-suggest-host .npf-suggest .npf-suggest__row.is-search .npf-suggest__label {
  color: var(--text, #4c5563);
}

.npf-suggest-host .npf-suggest .npf-suggest__meta {
  flex: none;
  font-size: 12px;
  color: var(--muted, #8a94a3);
  white-space: nowrap;
}

.npf-suggest-host .npf-suggest .npf-suggest__kind {
  flex: none;
  padding: 3px 10px;
  border-radius: var(--radius-pill, 999px);
  background: var(--bg-alt, #fafafa);
  border: 1px solid var(--line-soft, #eef1f6);
  font-family: var(--font-head, "Plus Jakarta Sans", sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--text-soft, #616e84);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 640px) {
  .npf-suggest-host .npf-suggest,
  body.npf-home .npf-main .npf-suggest {
    max-height: 60vh;
    border-radius: var(--radius-sm, 10px);
  }

  .npf-suggest-host .npf-suggest .npf-suggest__row {
    gap: 12px;
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Two captions plus a pill on a 320px row leaves nothing for the answer
     itself, so the classification goes and the supply count stays — it is the
     one that tells a visitor whether the row is worth tapping. */
  .npf-suggest-host .npf-suggest .npf-suggest__kind {
    display: none;
  }
}
