/* LMB Ride Calendar – search bar additions (Nov 19, 2026). Goes with ride-search.php and ride-search.js. */

/* ---- The row of tools under the search bar ---- */
.lmb-search-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 10px 0 4px; font-family: var(--lmb-font, "Montserrat", sans-serif); font-size: 13px; color: var(--lmb-text, #23272d); }
.lmb-search-tools .lmb-st__group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.lmb-search-tools .lmb-st__end { flex-basis: 100%; justify-content: flex-end; margin-left: 0; gap: 6px 14px; min-height: 18px; } /* always its own line, so nothing jumps when the Within slider appears */
.lmb-search-tools .lmb-st__label { font-weight: 600; margin: 0; }

.lmb-search-tools .lmb-st__pick { font: inherit; font-size: 13px; line-height: 1.2; padding: 5px 11px; border: 1px solid #c3ccd5; border-radius: 999px; background: #fff; color: var(--lmb-text, #23272d); cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: 0; min-height: 0; }
.lmb-search-tools .lmb-st__pick:hover { border-color: var(--lmb-blue, #0b5a8a); color: var(--lmb-blue, #0b5a8a); background: #fff; }
.lmb-search-tools .lmb-st__pick.is-on { background: var(--lmb-blue, #0b5a8a); border-color: var(--lmb-blue, #0b5a8a); color: #fff; }
.lmb-search-tools .lmb-st__pick:focus-visible, .lmb-search-tools .lmb-st__reset:focus-visible { outline: 2px solid var(--lmb-blue, #0b5a8a); outline-offset: 2px; }

.lmb-search-tools .lmb-st__near { flex: 1 1 240px; flex-wrap: nowrap; }
.lmb-search-tools .lmb-st__near input[type="range"] { flex: 1 1 auto; width: auto; min-width: 120px; max-width: 420px; margin: 0; padding: 0; accent-color: var(--lmb-blue, #0b5a8a); }
.lmb-search-tools .lmb-st__near output { white-space: nowrap; }
.lmb-search-tools .lmb-st__near output { min-width: 70px; font-weight: 600; font-variant-numeric: tabular-nums; }

.lmb-search-tools .lmb-result-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.lmb-search-tools .lmb-st__reset { color: var(--lmb-blue, #0b5a8a); text-decoration: underline; }

@media (max-width: 640px) {
	.lmb-search-tools .lmb-st__end { justify-content: space-between; }
	/* Phones: the Within slider gets its own full-width line and a bigger handle for thumbs (Nov 19, 2026). */
	.lmb-search-tools .lmb-st__near { flex-basis: 100%; }
	.lmb-search-tools .lmb-st__near input[type="range"] { max-width: none; height: 32px; -webkit-appearance: none; appearance: none; background: transparent; }
	.lmb-search-tools .lmb-st__near input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: #c3ccd5; }
	.lmb-search-tools .lmb-st__near input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #c3ccd5; }
	.lmb-search-tools .lmb-st__near input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--lmb-blue, #0b5a8a); border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
	.lmb-search-tools .lmb-st__near input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--lmb-blue, #0b5a8a); border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
}

/* ---- Ride Length: two handles on one track (Advanced Search) ---- */
.lmb-length { font-family: var(--lmb-font, "Montserrat", sans-serif); font-size: 14px; color: var(--lmb-text, #23272d); padding: 4px 2px 0; }
.lmb-length .lmb-length__track { position: relative; height: 28px; --lo: 0%; --hi: 100%; }
.lmb-length .lmb-length__track::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px;
	background: linear-gradient(to right, #d5dbe1 0, #d5dbe1 var(--lo), var(--lmb-blue, #0b5a8a) var(--lo), var(--lmb-blue, #0b5a8a) var(--hi), #d5dbe1 var(--hi), #d5dbe1 100%); }
.lmb-length .lmb-length__track input[type="range"] { position: absolute; left: 0; top: 0; width: 100%; height: 28px; margin: 0; padding: 0; border: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; box-shadow: none; }
.lmb-length .lmb-length__track input[type="range"]::-webkit-slider-runnable-track { background: none; height: 28px; border: 0; }
.lmb-length .lmb-length__track input[type="range"]::-moz-range-track { background: none; height: 28px; border: 0; }
.lmb-length .lmb-length__track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; background: #fff; border: 2px solid var(--lmb-blue, #0b5a8a); cursor: pointer; }
.lmb-length .lmb-length__track input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--lmb-blue, #0b5a8a); cursor: pointer; }
.lmb-length .lmb-length__track input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--lmb-blue, #0b5a8a); outline-offset: 2px; }
.lmb-length .lmb-length__track input[type="range"]:focus-visible::-moz-range-thumb { outline: 2px solid var(--lmb-blue, #0b5a8a); outline-offset: 2px; }
.lmb-length .lmb-length__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-top: 4px; }
.lmb-length .lmb-length__out { font-weight: 600; font-variant-numeric: tabular-nums; }
.lmb-length .lmb-length__units { display: flex; gap: 12px; }
.lmb-length .lmb-length__units label { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 400; cursor: pointer; }
.lmb-length .lmb-length__units input { margin: 0; width: auto; }

/* ---- Advanced Search: "Within N miles" in place of the Region and State lists (Nov 19, 2026) ---- */
.em-search-advanced .em-search-section-location .em-search-geo-units { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 10px; height: auto !important; overflow: visible !important; opacity: 1 !important; }
.em-search-advanced .em-search-section-location .em-search-geo-units > label:not(.screen-reader-text) { margin: 0; font-weight: 600; }
.em-search-advanced .em-search-section-location .em-search-geo-units select { width: auto; min-width: 84px; flex: 0 1 auto; margin: 0; }
.em-search-advanced .em-search-section-location .em-search-geo-units::after { content: "of the place in the Near box above."; flex-basis: 100%; font-size: 13px; color: #5a6470; }

/* ---- Map view with nothing to show: a note on top of the map (Nov 19, 2026) ---- */
.lmb-map-empty { margin: 12px 60px 0; padding: 9px 14px; max-width: 80%; background: #fff; color: var(--lmb-text, #23272d); border-left: 4px solid var(--lmb-blue, #0b5a8a); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-family: var(--lmb-font, "Montserrat", sans-serif); font-size: 14px; font-weight: 600; line-height: 1.35; text-align: center; }

/* ---- Near box: a small "x" to clear the place (Nov 19, 2026). The !important lines beat Events Manager's own button styling. ---- */
.em.em-search button.lmb-near-clear, .em-search button.lmb-near-clear { position: absolute !important; right: 6px !important; top: 50% !important; transform: translateY(-50%) !important; width: 20px !important; min-width: 0 !important; height: 20px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important; background: #dfe5ea !important; color: #23272d !important; font: 700 14px/20px Arial, sans-serif !important; text-align: center !important; cursor: pointer; box-shadow: none !important; z-index: 2; display: block; }
.em.em-search button.lmb-near-clear[hidden], .em-search button.lmb-near-clear[hidden] { display: none !important; }
.em.em-search button.lmb-near-clear:hover, .em-search button.lmb-near-clear:hover { background: var(--lmb-blue, #0b5a8a) !important; color: #fff !important; }
.em-search button.lmb-near-clear:focus-visible { outline: 2px solid var(--lmb-blue, #0b5a8a); outline-offset: 2px; }
.em-search .em-search-main-bar input[name="geo"] { padding-right: 30px !important; }

/* ---- Phones: a search bar you can actually type in (Nov 20, 2026) ----
 * Events Manager squeezes the text box to a sliver on a phone and hides the Near box altogether.
 * Under 640px wide: the text box gets its own full-width line, the Near box comes back on a second line,
 * and the filter icon, view picker, and Search button share a third. Dates stay in the quick picks and Advanced Search. */
@media (max-width: 640px) {
	.em.em-search .em-search-main-bar { flex-wrap: wrap !important; height: auto !important; padding: 0 !important; }
	.em.em-search .em-search-main-bar > .em-search-text,
	.em.em-search .em-search-main-bar > .em-search-geo { display: block !important; flex: 1 1 100% !important; width: 100% !important; max-width: none !important; border-right: 0 !important; border-bottom: 1px solid #d5dbe1 !important; position: relative; }
	.em.em-search .em-search-main-bar > .em-search-text input,
	.em.em-search .em-search-main-bar > .em-search-geo input[name="geo"] { width: 100% !important; min-height: 46px; font-size: 16px !important; } /* 16px stops iPhones zooming in on focus */
	.em.em-search .em-search-main-bar > .em-search-geo, .em.em-search .em-search-main-bar > .em-search-geo input[name="geo"] { visibility: visible !important; opacity: 1 !important; }
	.em.em-search .em-search-main-bar > .em-search-submit { flex: 1 1 auto !important; }
	.em.em-search .em-search-main-bar > .em-search-submit button { width: 100% !important; }
	.em.em-search .em-search-main-bar > .em-search-advanced-trigger,
	.em.em-search .em-search-main-bar > .em-search-views,
	.em.em-search .em-search-main-bar > .em-search-submit { margin-top: 6px !important; margin-bottom: 6px !important; }
}
