/*
 * The suggestion menu of every jQuery UI autocomplete in the application.
 *
 * jQuery UI ships `.ui-autocomplete { position: absolute; top: 0; left: 0; cursor: default; }` and
 * nothing else: no height, no scrolling. The menu therefore grows to whatever the match count needs —
 * measured 43.161 px for 1542 boat builders and 13.246 px for the 473 that matched a single "m",
 * against a 950 px viewport, positioned with collision handling off.
 *
 * js/jui-autocomplete-cap.js is the primary bound (15 suggestions); this file is the belt to that
 * pair of braces, so anything that reaches the menu by another route is still contained. Layout only —
 * no colours, so it stays independent of the jQuery UI theme underneath it.
 *
 * Registered app-wide by JuiAutocomplete::register(). Spec: docs/jui-autocomplete-cap/README.md.
 */

.ui-autocomplete {
    /*
     * The 15 rows the script caps at, and no more. A row measures 28px with this app's styling, so the
     * content is 420px — plus the 1px border top and bottom that Bootstrap's `* { box-sizing:
     * border-box }` folds into the height, hence 422. Measured, not computed: at 420 the menu reported
     * clientHeight 418 against scrollHeight 420 and scrolled by 2px on every full list.
     *
     * Clamped to the viewport so a short window scrolls instead of getting a menu it cannot show. In
     * PIXELS on purpose: css/netwing.css sets `html { font-size: 62.5% }`, so 1rem is 10px here and a
     * rem value silently means less than half of what it reads as.
     */
    max-height: min(422px, 60vh);
    overflow-y: auto;
    overflow-x: hidden;
}

.ui-autocomplete > li {
    /* A long free-text suggestion wraps instead of stretching the menu past the field. */
    word-break: break-word;
}
