/**
 * Recipe picker — the drink dialog's "Paired with?" combobox
 * (persona-cycle 3.9, public/js/consumption/recipePicker.js).
 *
 * Its own file rather than an addition to modals.css, which is already
 * 1147 lines and ratcheted by fileSizeBudgetRatchet.test.js — the repo's
 * convention for a self-contained widget is a small sibling stylesheet
 * (drink-memory.css, recent-drinks.css, partial-amount.css).
 */

/* ─── "Paired with?" recipe combobox ──────────────────────────────
 *
 * Persona-cycle 3.9. The listbox is absolutely positioned over the rest
 * of the dialog so opening it does not reflow the fields below it — the
 * confirm button must not move under the user's cursor mid-search. That
 * needs the wrapper to be a positioning context, hence `position:
 * relative` on `.recipe-picker` and a z-index above the sibling fields.
 *
 * All show/hide is driven by the `hidden` property from JS (see the
 * global `[hidden] { display: none !important }` in layout.css); nothing
 * here sets `display` on these elements, or `hidden` would stop hiding.
 * ────────────────────────────────────────────────────────────────── */

.recipe-picker {
  position: relative;
}

.recipe-picker-control {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.recipe-picker-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary, #2c2c2c);
  background: var(--bg-card, #fff);
  border: 1px solid var(--text-muted, #6B5D4F);
  border-radius: var(--radius-md);
}

.recipe-picker-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.recipe-picker-clear {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-primary, #2c2c2c);
  background: transparent;
  border: 1px solid var(--text-muted, #6B5D4F);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.recipe-picker-clear:hover {
  background: var(--bg-slot, #F0EBE4);
}

.recipe-picker-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.recipe-picker-listbox {
  position: absolute;
  z-index: 2;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0.25rem 0 0;
  padding: 0;
  max-height: 12rem;
  overflow-y: auto;
  list-style: none;
  background: var(--bg-card, #fff);
  border: 1px solid var(--text-muted, #6B5D4F);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.recipe-picker-option {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  /* 44px min touch target (click-test undersized-target contract). */
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  color: var(--text-primary, #2c2c2c);
  cursor: pointer;
}

.recipe-picker-option:hover,
.recipe-picker-option.is-active {
  background: var(--bg-slot, #F0EBE4);
}

.recipe-picker-rating {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--text-muted, #6B5D4F);
}

.recipe-picker-message {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted, #6B5D4F);
}
