/* GVH Lot Maps: front end */
.gvh-lot-map {
	--gvh-occupied: #c8b9ab;
	--gvh-occupied-hover: #b8a797;
	--gvh-available: #edd999;
	--gvh-available-hover: #e3c763;
	--gvh-for-sale: #a4b1c8;
	--gvh-for-sale-hover: #7f93b6;
	--gvh-ink: #2b2b2b;
	--gvh-focus: #1f3f73;
	position: relative;
	max-width: 100%;
	color: var(--gvh-ink);
}

.gvh-lot-map__stage {
	position: relative;
}

.gvh-lot-map svg.gvh-map-svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

/* Only lots are interactive; borders, roads and labels let clicks pass through. */
.gvh-map-svg * { pointer-events: none; }
.gvh-map-svg .gvh-lot,
.gvh-map-svg .gvh-lot-link { pointer-events: auto; }

.gvh-lot { transition: fill .15s ease; }
.gvh-lot.is-occupied  { fill: var(--gvh-occupied); }
.gvh-lot.is-available { fill: var(--gvh-available); }
.gvh-lot.is-for-sale  { fill: var(--gvh-for-sale); }

.gvh-lot-link { cursor: pointer; }
.gvh-lot-link:focus { outline: none; }

.gvh-lot.is-occupied:hover,  .gvh-lot.is-occupied.is-active  { fill: var(--gvh-occupied-hover); }
.gvh-lot.is-available:hover, .gvh-lot.is-available.is-active { fill: var(--gvh-available-hover); }
.gvh-lot.is-for-sale:hover,  .gvh-lot.is-for-sale.is-active  { fill: var(--gvh-for-sale-hover); }

.gvh-lot-link:focus-visible .gvh-lot {
	stroke: var(--gvh-focus);
	stroke-width: 3;
	paint-order: stroke;
}

/* Tooltip */
.gvh-lot-map__tip {
	position: absolute;
	z-index: 5;
	min-width: 9.5em;
	max-width: 15em;
	padding: .55em .8em .6em;
	background: #fff;
	border: 1px solid #cfc6bc;
	border-radius: 4px;
	box-shadow: 0 6px 18px rgba(40, 32, 20, .18);
	font-size: 14px;
	line-height: 1.35;
	transform: translate(-50%, calc(-100% - 10px));
}
.gvh-lot-map__tip[hidden] { display: none; }
.gvh-lot-map__tip.is-below { transform: translate(-50%, 10px); }
.gvh-lot-map__tip::after {
	content: "";
	position: absolute;
	left: var(--gvh-arrow, 50%);
	bottom: -6px;
	width: 10px;
	height: 10px;
	margin-left: -5px;
	background: #fff;
	border-right: 1px solid #cfc6bc;
	border-bottom: 1px solid #cfc6bc;
	transform: rotate(45deg);
}
.gvh-lot-map__tip.is-below::after {
	top: -6px;
	bottom: auto;
	transform: rotate(225deg);
}
.gvh-lot-map__tip-lot {
	display: block;
	font-weight: 700;
	font-size: 15px;
}
.gvh-lot-map__tip-status {
	display: flex;
	align-items: center;
	gap: .4em;
}
.gvh-lot-map__tip-status::before {
	content: "";
	width: .75em;
	height: .75em;
	border: 1px solid #555;
	background: var(--gvh-swatch, var(--gvh-occupied));
}
.gvh-lot-map__tip[data-status="available"] { --gvh-swatch: var(--gvh-available); }
.gvh-lot-map__tip[data-status="for-sale"]  { --gvh-swatch: var(--gvh-for-sale); }
.gvh-lot-map__tip-link {
	display: inline-block;
	margin-top: .35em;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.gvh-lot-map__tip-link[hidden] { display: none; }

/* Legend + expand */
.gvh-lot-map__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5em 1.25em;
	margin-top: .75em;
	font-size: 14px;
}
.gvh-lot-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: .35em 1.1em;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}
.gvh-lot-map__legend li {
	display: flex;
	align-items: center;
	gap: .45em;
	margin: 0;
	padding: 0 !important;
}
.gvh-lot-map__legend li::before { display: none; }
.gvh-swatch {
	width: 1em;
	height: 1em;
	border: 1.5px solid #222;
	background: var(--gvh-occupied);
}
.gvh-lot-map__legend .is-available .gvh-swatch { background: var(--gvh-available); }
.gvh-lot-map__legend .is-for-sale .gvh-swatch  { background: var(--gvh-for-sale); }
.gvh-count { opacity: .7; }

.gvh-lot-map__expand {
	padding: .45em .9em;
	border: 1px solid #b9ada1;
	border-radius: 3px;
	background: #fff;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
.gvh-lot-map__expand:hover { background: #f4f0ec; }
.gvh-lot-map__expand:focus-visible,
.gvh-lot-map__tip-link:focus-visible {
	outline: 2px solid var(--gvh-focus);
	outline-offset: 2px;
}

/* Larger map: full-screen, scrollable in both directions */
.gvh-lot-map.is-expanded {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	padding: 12px;
	background: #fff;
}
.gvh-lot-map.is-expanded .gvh-lot-map__stage {
	flex: 1;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}
.gvh-lot-map.is-expanded svg.gvh-map-svg {
	width: max(100%, 1100px);
	max-width: none;
}
.gvh-lot-map.is-expanded .gvh-lot-map__bar { order: -1; margin: 0 0 10px; }
html.gvh-lot-map-lock, html.gvh-lot-map-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.gvh-lot { transition: none; }
}
