/* Modern Practice Map 2.0 — front end
   Layout: scrollable location list beside a sticky map.
   Every accent traces back to --mpm-accent, set by the shortcode. */

.mpm-locator {
	--mpm-ink: #111827;
	--mpm-muted: #5b6472;
	--mpm-line: #e6e9ee;
	--mpm-surface: #ffffff;
	--mpm-hover: #f6f8fa;
	--mpm-radius: 14px;

	display: grid;
	grid-template-columns: minmax(280px, 380px) 1fr;
	gap: 24px;
	margin: 0 0 2rem;
	color: var(--mpm-ink);
}

.mpm-locator--map-left {
	grid-template-columns: 1fr minmax(280px, 380px);
}

.mpm-locator--map-left .mpm-panel {
	order: 2;
}

.mpm-locator--map-left .mpm-mapcol {
	order: 1;
}

.mpm-locator--map,
.mpm-locator--list {
	grid-template-columns: 1fr;
}

/* ---------- Left panel ---------- */

.mpm-panel {
	display: flex;
	flex-direction: column;
	max-height: var(--mpm-height, 640px);
	min-height: 0;
}

.mpm-panel__search {
	flex: 0 0 auto;
	margin-bottom: 10px;
}

.mpm-search {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--mpm-line);
	border-radius: 999px;
	background: var(--mpm-surface);
	font-size: .875rem;
	font-family: inherit;
	color: var(--mpm-ink);
}

.mpm-search:focus {
	outline: none;
	border-color: var(--mpm-accent, #0f766e);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mpm-accent, #0f766e) 18%, transparent);
}

.mpm-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0;
	padding: 0 4px 0 0;
	list-style: none;
}

.mpm-list::-webkit-scrollbar {
	width: 8px;
}

.mpm-list::-webkit-scrollbar-thumb {
	background: #d5dae1;
	border-radius: 99px;
}

.mpm-list__empty {
	margin: 12px 2px 0;
	color: var(--mpm-muted);
	font-size: .875rem;
}

/* ---------- Location card ---------- */

.mpm-item {
	position: relative;
	margin: 0 0 8px;
	padding: 16px 18px 16px 20px;
	border: 1px solid var(--mpm-line);
	border-radius: var(--mpm-radius);
	background: var(--mpm-surface);
	list-style: none;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.mpm-item::before {
	content: "";
	position: absolute;
	top: 14px;
	bottom: 14px;
	left: 0;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--mpm-accent, #0f766e);
	opacity: 0;
	transition: opacity .15s ease;
}

.mpm-item:hover {
	background: var(--mpm-hover);
	border-color: #d8dee6;
}

.mpm-item.is-active {
	background: var(--mpm-surface);
	border-color: var(--mpm-accent, #0f766e);
	box-shadow: 0 4px 16px rgba(16, 24, 40, .09);
}

.mpm-item.is-active::before {
	opacity: 1;
}

.mpm-item--nopin {
	cursor: default;
}

.mpm-item[hidden] {
	display: none;
}

.mpm-item__heading {
	margin: 0 0 8px;
	padding: 0;
	font-size: 1.0625rem;
	line-height: 1.25;
}

.mpm-item__trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.mpm-item__trigger:focus-visible {
	outline: 2px solid var(--mpm-accent, #0f766e);
	outline-offset: 3px;
	border-radius: 4px;
}

.mpm-item__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--mpm-accent, #0f766e);
	color: #fff;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1;
}

.mpm-item__name {
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--mpm-ink);
}

.mpm-item__address {
	margin: 0 0 10px;
	font-size: .875rem;
	font-style: normal;
	line-height: 1.5;
	color: var(--mpm-muted);
}

.mpm-item__contact {
	margin: 0 0 14px;
	font-size: .8125rem;
	line-height: 1.5;
}

.mpm-item__contact dt {
	margin: 8px 0 0;
	font-weight: 700;
	color: var(--mpm-ink);
}

.mpm-item__contact dt:first-child {
	margin-top: 0;
}

.mpm-item__contact dd {
	margin: 0;
	color: var(--mpm-muted);
}

.mpm-item__contact a {
	color: var(--mpm-ink);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid var(--mpm-line);
}

.mpm-item__contact a:hover {
	color: var(--mpm-accent, #0f766e);
	border-bottom-color: currentColor;
}

.mpm-item__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* ---------- Buttons ---------- */

.mpm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	border: 1px solid var(--mpm-accent, #0f766e);
	border-radius: 999px;
	background: var(--mpm-accent, #0f766e);
	color: #fff;
	font-size: .8125rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: opacity .15s ease;
}

.mpm-btn:hover,
.mpm-btn:focus {
	color: #fff;
	opacity: .88;
	text-decoration: none;
}

.mpm-btn--ghost {
	background: transparent;
	color: var(--mpm-accent, #0f766e);
	border-color: var(--mpm-line);
}

.mpm-btn--ghost:hover,
.mpm-btn--ghost:focus {
	color: var(--mpm-accent, #0f766e);
	border-color: var(--mpm-accent, #0f766e);
	opacity: 1;
}

.mpm-btn:focus-visible {
	outline: 2px solid var(--mpm-accent, #0f766e);
	outline-offset: 2px;
}

/* ---------- Map column ---------- */

.mpm-mapcol {
	min-width: 0;
}

.mpm-map {
	position: sticky;
	top: 24px;
	width: 100%;
	height: var(--mpm-height, 640px);
	border-radius: var(--mpm-radius);
	overflow: hidden;
	background: #eef1f5;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
	z-index: 1;
}

/* ---------- Pins ---------- */

.mpm-pin {
	color: var(--mpm-accent, #0f766e);
	filter: drop-shadow(0 3px 5px rgba(16, 24, 40, .35));
	transition: transform .16s ease;
	transform-origin: 50% 100%;
}

.mpm-pin svg {
	display: block;
	width: 32px;
	height: 42px;
}

.mpm-pin:hover {
	transform: scale(1.12);
}

.mpm-pin--active {
	transform: scale(1.25);
	filter: drop-shadow(0 6px 10px rgba(16, 24, 40, .4));
}

.mpm-locator .leaflet-tooltip {
	padding: 5px 10px;
	border: 0;
	border-radius: 8px;
	background: #111827;
	color: #fff;
	font-size: .75rem;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(16, 24, 40, .25);
}

.mpm-locator .leaflet-tooltip-top::before {
	border-top-color: #111827;
}

.mpm-locator .leaflet-control-attribution {
	background: rgba(255, 255, 255, .82);
	font-size: 10px;
	border-radius: 6px 0 0 0;
}

/* ---------- Stacked layout ---------- */

@media (max-width: 899px) {
	.mpm-locator,
	.mpm-locator--map-left {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.mpm-locator .mpm-mapcol {
		order: 1;
	}

	.mpm-locator .mpm-panel {
		order: 2;
		max-height: none;
	}

	.mpm-map {
		position: relative;
		top: 0;
		height: min(var(--mpm-height, 640px), 60vh);
	}

	.mpm-list {
		overflow: visible;
		max-height: none;
	}

	.mpm-item__actions .mpm-btn {
		flex: 1 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mpm-pin,
	.mpm-item,
	.mpm-item::before {
		transition: none;
	}
}
