/* Everest Custom Elements — service-map.css (EHF 1.4.5, handle ehf-smap)
   Desk map: one muted Canada silhouette, numbered desk markers, Southern Ontario inset, and a desk list
   that is both the control and the accessible equivalent. Tokens only (decisions.md Fix round F1).
   Elementor's ".elementor img{height:auto;max-width:100%;border-radius:0}" outranks one class: every img rule
   here is ".ehf-smap .parent img.class". */

.ehf-smap {
	box-sizing: border-box;
	width: 100%;
	padding-block: var(--ehf-pad-section);
	background: var(--ehf-c-surface, #ffffff);
	font-family: var(--ehf-ff-body);
	color: var(--ehf-c-body, #5c6570);
}

/* Elementor flex containers centre their children: without this the widget wrapper shrinks to its content and the
   section changes width when the lazy map images load (the CLS at 768-1024). */
.elementor-element.elementor-widget-everest_service_map,
.elementor-element.elementor-widget-everest_canada_map {
	width: 100%;
	max-width: 100%;
}

.ehf-smap--bg-tint {
	background: var(--ehf-c-tint-50, #f4f8fa);
}

.ehf-smap__inner {
	box-sizing: border-box;
	max-width: var(--ehf-container, 1200px);
	margin-inline: auto;
	padding-inline: var(--ehf-gutter, 24px);
}

.ehf-smap__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--ehf-s-1, 8px);
	max-width: var(--ehf-container-narrow, 800px);
	margin: 0 auto var(--ehf-s-5, 48px);
	text-align: center;
}

.ehf-smap .ehf-smap__eyebrow {
	margin: 0;
	font-size: var(--ehf-fs-eyebrow);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ehf-c-primary, #0b6993);
}

.ehf-smap .ehf-smap__heading {
	margin: 0;
	font-family: var(--ehf-ff-head);
	font-size: var(--ehf-fs-h2);
	font-weight: 800;
	line-height: 1.15;
	color: var(--ehf-c-ink, #111827);
	text-wrap: balance;
}

.ehf-smap .ehf-smap__sub {
	margin: 0;
	font-size: var(--ehf-fs-lead);
	line-height: 1.55;
	color: var(--ehf-c-body, #5c6570);
	max-width: 60ch;
}

/* ---- layout ---- */
.ehf-smap__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--ehf-s-4, 32px);
	align-items: start;
}

@media (min-width: 1025px) {
	.ehf-smap__body {
		grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
	}

	/* the open desk panel can be taller than the map: keep the map in view beside it instead of leaving a blank column */
	.ehf-smap__figure {
		position: sticky;
		top: 112px;
	}
}

.ehf-smap__figure {
	display: grid;
	grid-template-columns: minmax(0, 1fr) min(340px, 100%);
	grid-template-areas: "nat nat" "cap inset";
	gap: 12px 24px;
	align-items: start;
	margin: 0;
	min-width: 0;
}

.ehf-smap__nat {
	grid-area: nat;
}

.ehf-smap__inset {
	grid-area: inset;
}

/* ---- national frame ---- */
.ehf-smap__nat,
.ehf-smap__inset-frame {
	position: relative;
	width: 100%;
}

.ehf-smap .ehf-smap__nat img.ehf-smap__img,
.ehf-smap .ehf-smap__inset-frame img.ehf-smap__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 0;
	object-fit: fill;
	user-select: none;
	pointer-events: none;
}

.ehf-smap__lens {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

.ehf-smap .ehf-smap__lens rect {
	fill: rgba(11, 105, 147, 0.06);
	stroke: var(--ehf-c-primary, #0b6993);
	stroke-width: 1.5px;
	stroke-dasharray: 5 4;
}

/* ---- inset ---- */
.ehf-smap__inset {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 10px 10px 12px;
	background: var(--ehf-c-surface, #ffffff);
	border: var(--ehf-border);
	border-radius: var(--ehf-r-lg, 16px);
	box-shadow: var(--ehf-shadow-1);
}

.ehf-smap .ehf-smap__inset-title {
	margin: 0 0 8px;
	font-size: var(--ehf-fs-eyebrow);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ehf-c-primary, #0b6993);
}

.ehf-smap__inset-frame {
	border-radius: var(--ehf-r-sm, 8px);
	background: var(--ehf-c-surface, #ffffff);
}

.ehf-smap--bg-tint .ehf-smap__inset-frame {
	background: var(--ehf-c-surface, #ffffff);
}

.ehf-smap .ehf-smap__caption {
	grid-area: cap;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
	padding-top: 4px;
	font-size: var(--ehf-fs-small);
	font-style: normal;
	line-height: 1.5;
	color: var(--ehf-c-body, #5c6570);
}

.ehf-smap__caption-text {
	display: block;
	max-width: 36ch;
}

.ehf-smap__legend {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-top: 14px;
	border-top: var(--ehf-border);
	color: var(--ehf-c-ink, #111827);
	font-size: var(--ehf-fs-small);
	font-weight: 600;
}

.ehf-smap__legend-item {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ehf-smap__key {
	flex: 0 0 auto;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ehf-smap__key--marker {
	width: 24px;
	height: 24px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	background: var(--ehf-c-primary, #0b6993);
	box-shadow: var(--ehf-shadow-1);
	color: #ffffff;
	font-family: var(--ehf-ff-head);
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

.ehf-smap__key--box {
	width: 24px;
	height: 18px;
	border: 1.5px dashed var(--ehf-c-primary, #0b6993);
	border-radius: 3px;
	background: rgba(11, 105, 147, 0.06);
}

/* ---- points: wrapper sits at the true position, children are offset from it ---- */
.ehf-smap__pt {
	position: absolute;
	width: 0;
	height: 0;
}

.ehf-smap .ehf-smap__marker {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	transform: translate(-50%, -50%);
	border: 2px solid #ffffff;
	border-radius: 50%;
	background: var(--ehf-c-primary, #0b6993);
	box-shadow: var(--ehf-shadow-1);
	color: #ffffff;
	font-family: var(--ehf-ff-head);
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: width var(--ehf-dur, 180ms) var(--ehf-ease), height var(--ehf-dur, 180ms) var(--ehf-ease), background-color var(--ehf-dur, 180ms) var(--ehf-ease);
}

.ehf-smap .ehf-smap__marker:hover,
.ehf-smap .ehf-smap__marker.is-hover {
	background: var(--ehf-c-primary-700, #084f70);
}

.ehf-smap .ehf-smap__marker.is-active {
	z-index: 3;
	width: 36px;
	height: 36px;
	background: var(--ehf-c-primary-900, #063a52);
	box-shadow: 0 0 0 6px rgba(11, 105, 147, 0.18);
}

.ehf-smap__marker--cluster {
	display: none !important;
}

.ehf-smap__lens-tag {
	position: absolute;
	z-index: 1;
	transform: translate(-50%, 8px);
	white-space: nowrap;
	font-family: var(--ehf-ff-head);
	font-size: var(--ehf-fs-eyebrow);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ehf-c-primary, #0b6993);
	-webkit-text-stroke: 3px #ffffff;
	paint-order: stroke fill;
	pointer-events: none;
}

.ehf-smap__pt--cluster {
	display: none;
}

/* ---- labels: fixed anchors, 24px from the point = 10px from the 28px marker edge ---- */
.ehf-smap__label {
	position: absolute;
	z-index: 1;
	white-space: nowrap;
	font-family: var(--ehf-ff-head);
	font-size: 13px;
	font-weight: 700;
	line-height: 18px;
	color: var(--ehf-c-ink, #111827);
	-webkit-text-stroke: 3px #ffffff;
	paint-order: stroke fill;
	pointer-events: none;
}

.ehf-smap__label--top-start {
	left: -14px;
	bottom: 24px;
}

.ehf-smap__label--bottom {
	left: 0;
	top: 24px;
	transform: translateX(-50%);
}

.ehf-smap__label--bottom-start {
	left: -14px;
	top: 24px;
}

.ehf-smap__label--right {
	left: 24px;
	top: -9px;
}

.ehf-smap__label--left {
	right: 24px;
	top: -9px;
}

/* ---- desk list ---- */
.ehf-smap__desks {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	min-width: 0;
	border-top: var(--ehf-border);
}

.ehf-smap .ehf-smap__desk {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr) 20px;
	grid-template-areas: "num name chev" "num count chev";
	align-items: center;
	column-gap: 12px;
	row-gap: 0;
	box-sizing: border-box;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 8px 4px;
	border: 0;
	border-bottom: var(--ehf-border);
	border-radius: 0;
	background: transparent;
	color: var(--ehf-c-ink, #111827);
	font-family: var(--ehf-ff-head);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color var(--ehf-dur, 180ms) var(--ehf-ease);
}

.ehf-smap .ehf-smap__desk:hover,
.ehf-smap .ehf-smap__desk.is-hover {
	background: var(--ehf-c-tint-100, #eaf4f9);
	color: var(--ehf-c-ink, #111827);
}

.ehf-smap .ehf-smap__desk[aria-expanded="true"] {
	color: var(--ehf-c-primary-900, #063a52);
}

.ehf-smap__num {
	grid-area: num;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--ehf-c-primary, #0b6993);
	color: #ffffff;
	font-size: 13px;
	font-weight: 800;
}

.ehf-smap .ehf-smap__desk[aria-expanded="true"] .ehf-smap__num {
	background: var(--ehf-c-primary-900, #063a52);
}

.ehf-smap__name {
	grid-area: name;
	min-width: 0;
	overflow-wrap: anywhere;
}

.ehf-smap__here {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	border-radius: var(--ehf-r-pill, 999px);
	background: var(--ehf-c-tint-100, #eaf4f9);
	color: var(--ehf-c-primary, #0b6993);
	font-size: 12px;
	font-weight: 800;
	white-space: nowrap;
	vertical-align: 1px;
}

.ehf-smap__count {
	font-family: var(--ehf-ff-body);
	font-size: var(--ehf-fs-small);
	font-weight: 400;
	line-height: 1.3;
	color: var(--ehf-c-body, #5c6570);
	grid-area: count;
}

.ehf-smap__chev {
	grid-area: chev;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--ehf-c-primary, #0b6993);
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform var(--ehf-dur, 180ms) var(--ehf-ease);
}

.ehf-smap .ehf-smap__desk[aria-expanded="true"] .ehf-smap__chev {
	transform: rotate(180deg);
}

/* no JS: the list is a plain set of headed sections, everything open.
   html.ehf-js is set by a one-line inline script before the section paints, so the first paint already shows
   the state init() reaches (no collapse shift, CLS 0). */
html:not(.ehf-js) .ehf-smap .ehf-smap__chev {
	display: none;
}

html:not(.ehf-js) .ehf-smap .ehf-smap__desk {
	cursor: default;
}

html.ehf-js .ehf-smap:not(.is-js) .ehf-smap__chev {
	transform: none;
	transition: none;
}

html.ehf-js .ehf-smap:not(.is-js) .ehf-smap__panel {
	display: none;
}

.ehf-smap__panel {
	box-sizing: border-box;
	margin: 0;
	padding: var(--ehf-s-3, 24px);
	background: var(--ehf-c-surface, #ffffff);
	border: var(--ehf-border);
	border-radius: var(--ehf-r-lg, 16px);
	box-shadow: var(--ehf-shadow-1);
}

.ehf-smap__panel[hidden] {
	display: none;
}

html:not(.ehf-js) .ehf-smap .ehf-smap__panel {
	margin: 12px 0;
}

.ehf-smap .ehf-smap__addr {
	margin: 0 0 12px;
	font-size: var(--ehf-fs-small);
	font-style: normal;
	line-height: 1.5;
	color: var(--ehf-c-body, #5c6570);
}

.ehf-smap .ehf-smap__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0 0 16px;
}

.ehf-smap .ehf-smap__act,
.ehf-smap .ehf-smap__act:link,
.ehf-smap .ehf-smap__act:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: var(--ehf-c-primary, #0b6993);
	font-size: var(--ehf-fs-small);
	font-weight: 700;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.ehf-smap .ehf-smap__act:hover {
	color: var(--ehf-c-primary-700, #084f70);
	text-decoration: underline;
}

.ehf-smap .ehf-smap__act svg,
.ehf-smap .ehf-smap__link svg {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ehf-smap .ehf-smap__communities {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px 20px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
	font-size: var(--ehf-fs-small);
	line-height: 1.5;
	color: var(--ehf-c-body, #5c6570);
}

.ehf-smap .ehf-smap__communities li {
	margin: 0;
	padding: 0;
	overflow-wrap: anywhere;
}

.ehf-smap .ehf-smap__communities li:first-child {
	font-weight: 800;
	color: var(--ehf-c-ink, #111827);
}

.ehf-smap .ehf-smap__link,
.ehf-smap .ehf-smap__link:link,
.ehf-smap .ehf-smap__link:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: var(--ehf-c-primary, #0b6993);
	font-family: var(--ehf-ff-head);
	font-weight: 800;
	text-decoration: none;
}

.ehf-smap .ehf-smap__link:hover {
	color: var(--ehf-c-primary-700, #084f70);
	text-decoration: underline;
}

/* ---- desktop: buttons are rows 1-6, every panel shares row 7 (only the open one shows) ---- */
@media (min-width: 1025px) {
	html.ehf-js .ehf-smap .ehf-smap__panel {
		grid-row: 7;
		margin-top: 20px;
	}

	html.ehf-js .ehf-smap:not(.is-js) .ehf-smap__panel[data-first] {
		display: block;
	}
}

/* ---- tablet ---- */
@media (min-width: 768px) and (max-width: 1024px) {
	html.ehf-js .ehf-smap .ehf-smap__panel {
		margin: 8px 0 16px;
	}

	/* caption + legend sit centred beside the inset instead of hugging the top of an empty column */
	.ehf-smap .ehf-smap__caption {
		align-self: center;
		padding-top: 0;
		gap: 20px;
	}

	.ehf-smap__caption-text {
		max-width: 44ch;
		font-size: var(--ehf-fs-body, 16px);
	}
}

/* ---- phones: static small map, no labels, no inset, accordion rows >= 56px ---- */
@media (max-width: 767px) {
	.ehf-smap__body {
		gap: var(--ehf-s-3, 24px);
	}
	.ehf-smap .ehf-smap__marker {
		width: 24px;
		height: 24px;
		font-size: 12px;
	}
	.ehf-smap .ehf-smap__marker.is-active {
		width: 30px;
		height: 30px;
	}
	.ehf-smap .ehf-smap__marker--cluster {
		display: flex !important;
		width: 30px;
		font-size: 11px;
		border-radius: 12px;
	}
	.ehf-smap__pt--cluster {
		display: block;
	}
	.ehf-smap__label,
	.ehf-smap__lens,
	.ehf-smap__lens-tag,
	.ehf-smap__inset,
	.ehf-smap .ehf-smap__caption {
		display: none;
	}
	.ehf-smap .ehf-smap__desk {
		min-height: 56px;
		padding-block: 10px;
	}
	.ehf-smap__panel {
		margin: 8px 0 16px;
		padding: var(--ehf-s-2, 16px);
	}
	.ehf-smap .ehf-smap__actions {
		flex-direction: column;
		gap: 0;
	}
	.ehf-smap .ehf-smap__act,
	.ehf-smap .ehf-smap__act:link,
	.ehf-smap .ehf-smap__act:visited,
	.ehf-smap .ehf-smap__link,
	.ehf-smap .ehf-smap__link:link,
	.ehf-smap .ehf-smap__link:visited {
		min-height: 48px;
	}
	.ehf-smap__figure {
		display: block;
	}
}

@media (max-width: 480px) {
	.ehf-smap .ehf-smap__communities {
		grid-template-columns: minmax(0, 1fr);
	}
	}

@media (prefers-reduced-motion: reduce) {
	.ehf-smap .ehf-smap__marker,
	.ehf-smap .ehf-smap__desk,
	.ehf-smap__chev {
		transition: none;
	}
}
