/* Modern Locator – front end. Override any --mloc-* variable in your theme. */
.mloc {
	--mloc-accent: #1f5f8b;
	--mloc-accent-contrast: #fff;
	--mloc-text: inherit;
	--mloc-muted: color-mix(in srgb, currentColor 62%, transparent);
	--mloc-border: color-mix(in srgb, currentColor 18%, transparent);
	--mloc-surface: color-mix(in srgb, currentColor 4%, transparent);
	--mloc-panel: #fff;
	--mloc-panel-text: #1d1d1f;
	--mloc-radius: 8px;
	--mloc-gap: 1rem;
	--mloc-highlight: color-mix(in srgb, var(--mloc-accent) 12%, transparent);
	color: var(--mloc-text);
	position: relative;
	margin-block: 1.5rem;
}
.mloc *, .mloc *::before, .mloc *::after { box-sizing: border-box; }
.mloc-sr, .mloc .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Form ------------------------------------------------------------- */
.mloc-form { margin: 0 0 var(--mloc-gap); }
.mloc-form__fields {
	display: flex; flex-wrap: wrap; gap: .75rem var(--mloc-gap); align-items: flex-end;
}
.mloc-field { flex: 1 1 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.mloc-field--w-half { flex-basis: calc(50% - var(--mloc-gap)); }
.mloc-field--w-third { flex-basis: calc(33.333% - var(--mloc-gap)); }
.mloc-field--w-quarter { flex-basis: calc(25% - var(--mloc-gap)); min-width: 9rem; }
.mloc-field--w-auto, .mloc-field--submit { flex: 0 0 auto; }
@media (max-width: 640px) {
	.mloc-field--w-half, .mloc-field--w-third, .mloc-field--w-quarter { flex-basis: 100%; }
	.mloc-field--submit { flex-basis: 100%; }
	.mloc-field--submit .mloc-button { width: 100%; }
}
.mloc-field > label, .mloc-field > legend {
	display: block; font-size: .875em; font-weight: 600; margin: 0 0 .35rem; padding: 0;
}
.mloc-field input[type="text"], .mloc-field input[type="search"], .mloc-field input[type="number"], .mloc-field select {
	width: 100%; min-height: 2.75rem; padding: .5rem .75rem; font: inherit; color: inherit;
	background: var(--mloc-panel); color: var(--mloc-panel-text);
	border: 1px solid var(--mloc-border); border-radius: var(--mloc-radius);
}
.mloc-field select[multiple] { min-height: auto; padding: .25rem; }
.mloc-field input:focus-visible, .mloc-field select:focus-visible, .mloc-button:focus-visible, .mloc-geolocate:focus-visible {
	outline: 2px solid var(--mloc-accent); outline-offset: 2px;
}
.mloc-field--range { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.mloc-field--range legend { flex-basis: 100%; }
.mloc-field--range label { flex: 1; }

.mloc-choices__list { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.mloc-check { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; cursor: pointer; }
.mloc-choices--buttons .mloc-choices__list { gap: .4rem; }
.mloc-choices--buttons .mloc-check { position: relative; }
.mloc-choices--buttons .mloc-check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mloc-choices--buttons .mloc-check span {
	display: inline-block; padding: .35rem .8rem; border: 1px solid var(--mloc-border);
	border-radius: 999px; font-size: .9em; transition: background .15s, color .15s;
}
.mloc-choices--buttons .mloc-check input:checked + span { background: var(--mloc-accent); border-color: var(--mloc-accent); color: var(--mloc-accent-contrast); }
.mloc-choices--buttons .mloc-check input:focus-visible + span { outline: 2px solid var(--mloc-accent); outline-offset: 2px; }

.mloc-button {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	min-height: 2.75rem; padding: .5rem 1.4rem; font: inherit; font-weight: 600; cursor: pointer;
	border: 1px solid transparent; border-radius: var(--mloc-radius);
}
.mloc-button--primary { background: var(--mloc-accent); color: var(--mloc-accent-contrast); }
.mloc-button--primary:hover { filter: brightness(1.08); }
.mloc-button[disabled] { opacity: .65; cursor: progress; }

.mloc-form__error {
	margin: 0 0 .75rem; padding: .6rem .8rem; border-radius: var(--mloc-radius);
	background: #fdecea; color: #8a1c13; border: 1px solid #f5c2bd;
}

/* Location input, geolocate button, suggestions */
.mloc-location { position: relative; }
.mloc-location input { padding-right: 2.75rem !important; }
.mloc-geolocate {
	position: absolute; top: 50%; right: .3rem; transform: translateY(-50%);
	width: 2.2rem; height: 2.2rem; display: grid; place-items: center; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--mloc-accent); cursor: pointer;
}
.mloc-geolocate:hover { background: var(--mloc-highlight); }
.mloc-geolocate.is-busy svg { animation: mloc-spin 1s linear infinite; }
.mloc-suggest {
	position: absolute; z-index: 1001; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem 0; list-style: none;
	background: var(--mloc-panel); color: var(--mloc-panel-text); border: 1px solid var(--mloc-border);
	border-radius: var(--mloc-radius); box-shadow: 0 8px 24px rgba(0,0,0,.14); max-height: 18rem; overflow: auto;
}
.mloc-suggest li { padding: .55rem .85rem; cursor: pointer; line-height: 1.3; }
.mloc-suggest li:hover, .mloc-suggest li.is-active { background: var(--mloc-highlight); }

/* ---- Layout ------------------------------------------------------------ */
.mloc-body { display: grid; gap: var(--mloc-gap); }
.mloc-body--split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.mloc--map-right .mloc-body--split { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.mloc--map-right .mloc-body--split .mloc-map { order: 2; }
.mloc-body--split .mloc-map { position: sticky; top: 1rem; }
.mloc-body--split .mloc-results { max-height: var(--mloc-list-height, 70vh); overflow: auto; padding-right: .25rem; }
@media (max-width: 860px) {
	.mloc .mloc-body--split, .mloc--map-right .mloc-body--split, .mloc--map-left .mloc-body--split { grid-template-columns: minmax(0, 1fr); }
	.mloc-body--split .mloc-map { position: relative; top: 0; order: 0 !important; }
	.mloc-body--split .mloc-results { max-height: none; }
}
.mloc--map-above > .mloc-map { margin-bottom: var(--mloc-gap); }
.mloc--no-list .mloc-results { display: none; }

/* ---- Map ---------------------------------------------------------------- */
.mloc-map {
	position: relative; width: 100%; min-height: 150px; border-radius: var(--mloc-radius);
	overflow: hidden; background: #e8ecef; border: 1px solid var(--mloc-border); isolation: isolate;
}
.mloc-map.mloc-is-fullscreen, .mloc-map:fullscreen {
	position: fixed !important; inset: 0; z-index: 100000; height: 100% !important; border-radius: 0; border: 0;
}
.mloc-map__error { padding: 1rem; margin: 0; }
.mloc-popup__title { display: block; font-size: 1.02em; margin-bottom: .2rem; }
.mloc-popup__distance { color: #555; font-size: .9em; }
.mloc-popup__link { display: inline-block; margin-top: .35rem; font-weight: 600; }

.mloc-marker { background: none !important; border: 0 !important; }
.mloc-marker svg { display: block; overflow: visible; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
.mloc-marker--dot svg { filter: drop-shadow(0 0 3px rgba(0,0,0,.35)); }
/* "You are here" on area maps */
.mloc-marker--current { outline: 3px solid var(--mloc-current, #f5b400); outline-offset: 2px; border-radius: 4px; animation: mloc-current 1.8s ease-out infinite; }
@keyframes mloc-current { 0% { box-shadow: 0 0 0 0 rgba(245,180,0,.7); } 100% { box-shadow: 0 0 0 14px rgba(245,180,0,0); } }
@media (prefers-reduced-motion: reduce) { .mloc-marker--current { animation: none; } }
.mloc-area-map { margin-top: 1.5em; }
.mloc-area-map__title { margin-bottom: .5em; }
.mloc-bounce { animation: mloc-bounce .8s ease; }
.mloc-gmarker svg, .mloc-gmarker img { display: block; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
.mloc-handle { background: #fff; border: 2px solid var(--mloc-accent, #1f5f8b); border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: nwse-resize; }

/* Layer control + full screen (both engines) */
.mloc-layers { position: relative; font: 14px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1d1d1f; }
.mloc-layers__toggle, .mloc-fullscreen {
	display: grid; place-items: center; width: 36px; height: 36px; padding: 0; cursor: pointer;
	background: #fff; color: #333; border: 0; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.mloc-fullscreen.mloc-mv-control { border: 2px solid rgba(0,0,0,.2); box-shadow: none; width: 34px; height: 34px; border-radius: 4px; }
.mloc-layers__toggle:hover, .mloc-fullscreen:hover { background: #f4f4f4; }
.gm-style .mloc-layers { margin: 10px; }
.mloc-layers__panel {
	position: absolute; right: 0; top: 42px; z-index: 1000; width: min(300px, 80vw);
	max-height: 60vh; overflow: auto; padding: .6rem .8rem; background: #fff; border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.mloc-layers fieldset { border: 0; margin: 0 0 .5rem; padding: 0; }
.mloc-layers legend { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #555; padding: 0; margin-bottom: .25rem; }
.mloc-layers__row { display: flex; gap: .5rem; align-items: flex-start; padding: .2rem 0; cursor: pointer; }
.mloc-layers__row input { margin-top: .2rem; }
.mloc-layers__opacity { display: block; padding: 0 0 .35rem 1.6rem; }
.mloc-layers__opacity input { width: 100%; accent-color: var(--mloc-accent, #1f5f8b); }
.mloc-gattr { background: rgba(255,255,255,.75); font: 10px/1.4 system-ui, sans-serif; padding: 0 4px; margin: 0 0 14px; max-width: 60vw; }
.mloc-gattr a { color: #333; }

/* ---- Results ---------------------------------------------------------- */
.mloc-results { min-height: 1px; transition: opacity .2s; }
.mloc.is-loading .mloc-results { opacity: .45; }
.mloc.is-loading .mloc-map::after {
	content: ""; position: absolute; z-index: 1000; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px;
	border: 3px solid rgba(0,0,0,.15); border-top-color: var(--mloc-accent); border-radius: 50%;
	animation: mloc-spin .8s linear infinite;
}
.mloc-results__summary { font-weight: 600; margin: 0 0 .75rem; }
.mloc-results__empty, .mloc-results__error { padding: 1rem; border: 1px dashed var(--mloc-border); border-radius: var(--mloc-radius); }
.mloc-results__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.mloc--layout-grid .mloc-results__list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.mloc-result {
	padding: .9rem 1rem; border: 1px solid var(--mloc-border); border-radius: var(--mloc-radius);
	background: var(--mloc-surface); transition: border-color .2s, box-shadow .2s;
}
.mloc-result.is-active { border-color: var(--mloc-accent); box-shadow: 0 0 0 2px var(--mloc-highlight); }
.mloc-result > *:first-child { margin-top: 0; }
.mloc-result > *:last-child { margin-bottom: 0; }
.mloc-result p { margin: .25rem 0; }
.mloc-result__title { font-size: 1.1em; margin: 0 0 .25rem; }
.mloc-result__distance { color: var(--mloc-muted); font-size: .9em; font-weight: 600; }
.mloc-result__thumb { float: right; margin: 0 0 .5rem .75rem; }
.mloc-result__thumb img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.mloc-result__actions { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem !important; font-size: .92em; }
.mloc-link-button { padding: 0; border: 0; background: none; font: inherit; color: var(--mloc-accent); text-decoration: underline; cursor: pointer; }
.mloc-pagination { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.mloc-page {
	min-width: 2.4rem; height: 2.4rem; display: inline-grid; place-items: center; padding: 0 .5rem;
	border: 1px solid var(--mloc-border); border-radius: var(--mloc-radius); text-decoration: none; color: inherit;
}
.mloc-page.is-current { background: var(--mloc-accent); border-color: var(--mloc-accent); color: var(--mloc-accent-contrast); }

@keyframes mloc-spin { to { transform: rotate(360deg); } }
@keyframes mloc-bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-14px); } 60% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
	.mloc *, .mloc *::after { animation: none !important; transition: none !important; }
}

/* ---- Legend (marker key) --------------------------------------------- */
.mloc-legend {
	font: 13px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1d1d1f;
	background: rgba(255,255,255,.95); border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.25);
	max-width: min(260px, 70vw); max-height: 45vh; overflow: auto;
}
.gm-style .mloc-legend { margin: 0 10px 24px; }
.mloc-legend summary { cursor: pointer; padding: .45rem .7rem; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #444; }
.mloc-legend ul { list-style: none; margin: 0; padding: 0 .5rem .45rem; }
.mloc-legend label { display: flex; align-items: center; gap: .45rem; padding: .2rem .2rem; cursor: pointer; border-radius: 4px; }
.mloc-legend label:hover { background: rgba(0,0,0,.05); }
.mloc-legend input { margin: 0; }
.mloc-legend input:not(:checked) ~ span { opacity: .45; }
.mloc-legend__icon { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.mloc-legend__icon svg, .mloc-legend__icon img { display: block; }
.mloc-legend__count { margin-left: auto; color: #666; font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---- Measure tool ------------------------------------------------------- */
.mloc-measure { position: relative; }
.mloc-measure__toggle {
	display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
	background: #fff; color: #333; border: 2px solid rgba(0,0,0,.2); border-radius: 4px; background-clip: padding-box;
}
.mloc-measure__toggle:hover { background: #f4f4f4; }
.mloc-measure.is-active .mloc-measure__toggle { background: var(--mloc-accent, #1f5f8b); color: #fff; }
.mloc-measure__panel {
	position: absolute; left: 42px; top: 0; z-index: 1000; width: max-content; max-width: min(260px, 60vw);
	padding: .5rem .7rem; background: #fff; color: #1d1d1f; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.25);
	font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.mloc-measure__panel { pointer-events: none; } /* never block clicks on the map */
.mloc-measure__clear { pointer-events: auto; }
.mloc-measure__help { margin: 0; color: #555; }
.mloc-measure__clear { margin-top: .35rem; padding: .15rem .5rem; font: inherit; text-transform: none; letter-spacing: normal; color: #1d1d1f; cursor: pointer; background: #f1f1f1; border: 1px solid #ccc; border-radius: 4px; }

/* ---- Info cards ---------------------------------------------------------
 * Popup on wide maps; bottom sheet on narrow ones. The excerpt is clamped
 * by viewport: 5 lines on desktop, 4 on small laptops, 3 on tablets, 2 on
 * phones and on short (landscape) screens. */
.mloc-card { width: 300px; max-width: 100%; color: #1d1d1f; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.mloc-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #e9edf0; }
.mloc-card__img { display: block; width: 100%; height: 100% !important; max-width: none; object-fit: cover; }
.mloc-card__body { padding: .7rem .9rem .85rem; }
.mloc-card__title { margin: 0 0 .2rem; font-size: 1.05em; line-height: 1.25; font-weight: 700; }
.mloc-card__title a { color: inherit; text-decoration: none; }
.mloc-card__title a:hover { text-decoration: underline; }
.mloc-card__meta { margin: 0 0 .35rem; color: #5b6168; font-size: .86em; display: flex; flex-wrap: wrap; gap: 0 .5rem; }
.mloc-card__meta:empty, .mloc-card__distance:empty { display: none; }
.mloc-card__distance { font-weight: 600; color: #2b3035; }
.mloc-card__excerpt {
	margin: 0 0 .55rem; color: #33383d;
	display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
	-webkit-line-clamp: 5; line-clamp: 5;
}
.mloc-card__link {
	display: inline-flex; align-items: center; gap: .35rem; min-height: 2.25rem; padding: .35rem .85rem;
	border-radius: 999px; background: var(--mloc-accent, #1f5f8b); color: #fff !important; font-weight: 600; text-decoration: none;
}
.mloc-card__link:hover { filter: brightness(1.1); }
.mloc-card__link:focus-visible, .mloc-card__title a:focus-visible { outline: 2px solid var(--mloc-accent, #1f5f8b); outline-offset: 2px; }

@media (max-width: 1024px) { .mloc-card__excerpt { -webkit-line-clamp: 4; line-clamp: 4; } }
@media (max-width: 768px)  { .mloc-card__excerpt { -webkit-line-clamp: 3; line-clamp: 3; } .mloc-card { width: 270px; } }
@media (max-width: 480px)  { .mloc-card__excerpt { -webkit-line-clamp: 2; line-clamp: 2; } }
@media (max-height: 560px) { .mloc-card__excerpt { -webkit-line-clamp: 2; line-clamp: 2; } .mloc-card__media { aspect-ratio: 21 / 9; } }

/* Google InfoWindow */
.gm-style .gm-style-iw-c:has(.mloc-card) { padding: 0 !important; }
.gm-style .gm-style-iw-d:has(.mloc-card) { overflow: hidden !important; padding: 0 !important; }

/* Loading skeleton */
.mloc-skel { background: linear-gradient(90deg, #e9edf0 25%, #f5f7f8 50%, #e9edf0 75%); background-size: 200% 100%; animation: mloc-shimmer 1.2s infinite; border-radius: 4px; }
.mloc-skel--line { height: .8em; margin: .45rem 0; }
.mloc-skel--short { width: 55%; }
@keyframes mloc-shimmer { to { background-position: -200% 0; } }

/* Bottom sheet (narrow maps / phones) */
.mloc-sheet {
	user-select: text; -webkit-user-select: text;
	position: absolute; z-index: 1100; left: 8px; right: 8px; bottom: 8px; max-height: min(75%, 420px); overflow: auto;
	background: #fff; border-radius: 14px; box-shadow: 0 6px 28px rgba(0,0,0,.3);
	transform: translateY(calc(100% + 16px)); transition: transform .25s ease; visibility: hidden; outline: none;
	overscroll-behavior: contain;
}
.mloc-sheet.is-open { transform: none; visibility: visible; }
.mloc-sheet__close {
	position: absolute; z-index: 2; top: 8px; right: 8px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(0,0,0,.5); color: #fff; font-size: 22px; line-height: 32px; cursor: pointer;
}
.mloc-sheet .mloc-card { width: auto; }
/* Side-by-side layout saves height in the sheet */
.mloc-sheet .mloc-card.has-image { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; }
.mloc-sheet .mloc-card.has-image .mloc-card__media { aspect-ratio: auto; height: 100%; min-height: 120px; }
.mloc-sheet .mloc-card__body { padding-right: 2.6rem; }
@media (max-width: 360px) {
	.mloc-sheet .mloc-card.has-image { display: block; }
	.mloc-sheet .mloc-card.has-image .mloc-card__media { aspect-ratio: 21 / 9; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .mloc-sheet { transition: none; } .mloc-skel { animation: none; } }

/* ---- Clusters ------------------------------------------------------------ */
.mloc-cluster-icon { background: none !important; border: 0 !important; }
.mloc-cluster {
	position: relative; display: grid; place-items: center; border-radius: 50%;
	filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); cursor: pointer; transition: transform .15s ease;
}
.mloc-cluster:hover { transform: scale(1.08); }
.mloc-cluster svg { position: absolute; inset: 0; z-index: 0; }
.mloc-cluster__count {
	position: relative; z-index: 1; font: 700 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1d1d1f;
	font-variant-numeric: tabular-nums;
}
.mloc-cluster--count { background: var(--mloc-accent, #1f5f8b); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mloc-accent, #1f5f8b) 30%, transparent); }
.mloc-cluster--count .mloc-cluster__count { color: #fff; }
/* Full-width maps (block "Full width" alignment or align="full") */
.mloc.alignfull .mloc-map { border-radius: 0; border-left: 0; border-right: 0; }
@media (prefers-reduced-motion: reduce) { .mloc-cluster { transition: none; } }
