/*
 * Neighborhood Map — front end.
 * Everything is scoped to .hgnm so theme styles (Flatsome buttons, list margins, h3 sizes)
 * don't leak in. Colors and sizes come from CSS variables set inline by the shortcode.
 */

.hgnm {
	--hgnm-primary: #5b3a31;
	--hgnm-accent: #c0573a;
	--hgnm-text: #2a2421;
	--hgnm-muted: #8d8783;
	--hgnm-rule: #2a2421;
	--hgnm-soft: #ebe8e4;
	--hgnm-h: 640px;
	--hgnm-h-m: 380px;
	--hgnm-list-h: 380px;
	--hgnm-indent: 40px;

	position: relative;
	display: grid;
	grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
	gap: clamp(24px, 4vw, 64px);
	align-items: stretch;
	color: var(--hgnm-text);
	line-height: 1.4;
	text-align: left;
}

.hgnm *,
.hgnm *::before,
.hgnm *::after {
	box-sizing: border-box;
}

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

.hgnm__panel {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 40px 0 8px;
}

.hgnm__mapwrap {
	position: relative;
	min-height: var(--hgnm-h);
	overflow: hidden;
	background: #eceae6;
}

.hgnm__map {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

/* ---------- theme resets (Flatsome styles every <button>, <h3> and <li>) ---------- */

.hgnm .hgnm__heading {
	margin: 0;
	padding: 0;
	border: 0;
	font: inherit;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
}

.hgnm .hgnm__toggle,
.hgnm .hgnm__item,
.hgnm .hgnm__hide,
.hgnm .hgnm__load,
.hgnm .hgnm-pin {
	-webkit-appearance: none;
	appearance: none;
	width: auto;
	height: auto;
	min-width: 0;
	max-width: none;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	text-shadow: none;
	font: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	vertical-align: baseline;
	color: inherit;
	opacity: 1;
	cursor: pointer;
}

.hgnm .hgnm__toggle:hover,
.hgnm .hgnm__toggle:focus,
.hgnm .hgnm__item:hover,
.hgnm .hgnm__item:focus,
.hgnm .hgnm__load:focus {
	background: none;
	box-shadow: none;
}

.hgnm .hgnm__toggle:focus-visible,
.hgnm .hgnm__item:focus-visible,
.hgnm .hgnm__hide:focus-visible,
.hgnm .hgnm__load:focus-visible {
	outline: 2px solid var(--hgnm-accent);
	outline-offset: 2px;
}

.hgnm .hgnm__list,
.hgnm .hgnm__list > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------- accordion ---------- */

.hgnm .hgnm__toggle {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 20px 2px 20px 0;
	border-bottom: 1.5px solid transparent;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.hgnm .hgnm__toggle:hover {
	color: var(--hgnm-accent);
}

.hgnm .hgnm__group.is-open .hgnm__toggle {
	border-bottom-color: var(--hgnm-rule);
}

.hgnm__gicon {
	display: inline-flex;
	flex: 0 0 24px;
}

.hgnm .hgnm-ico {
	display: block;
	width: 24px;
	height: 24px;
}

.hgnm__glabel {
	flex: 1 1 auto;
	min-width: 0;
}

/* plus / minus */
.hgnm__pm {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
}

.hgnm__pm::before,
.hgnm__pm::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1.5px;
	margin-top: -0.75px;
	background: currentColor;
	transition: transform 0.25s ease;
}

.hgnm__pm::after {
	transform: rotate(90deg);
}

.hgnm .hgnm__group.is-open .hgnm__pm::after {
	transform: rotate(0deg);
}

.hgnm__body {
	padding: 14px 0 6px;
	animation: hgnm-fade 0.25s ease;
}

.hgnm__body[hidden],
.hgnm__groups[hidden] {
	display: none;
}

.hgnm__scroll {
	position: relative; /* offsetParent for scroll-into-view math */
	max-height: var(--hgnm-list-h);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 22px;
	scrollbar-width: thin;
	scrollbar-color: #cfcac5 transparent;
}

.hgnm__scroll::-webkit-scrollbar {
	width: 4px;
}

.hgnm__scroll::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: #cfcac5;
}

/* fade the edge rows while there is more to scroll, a soft "keep going" cue */
.hgnm__scroll.has-more {
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
	mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
}

.hgnm__scroll.has-less {
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 44px);
	mask-image: linear-gradient(to bottom, transparent, #000 44px);
}

.hgnm__scroll.has-less.has-more {
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 72px), transparent);
	mask-image: linear-gradient(to bottom, transparent, #000 44px, #000 calc(100% - 72px), transparent);
}

.hgnm__li {
	display: flex;
	align-items: center;
	gap: 10px;
}

.hgnm .hgnm__item {
	display: flex;
	flex: 1 1 auto;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 12px 0 12px var(--hgnm-indent);
	font-size: 17px;
	letter-spacing: 0.02em;
	color: var(--hgnm-text);
	transition: color 0.15s ease;
}

.hgnm__name {
	min-width: 0;
}

.hgnm__dist {
	flex: 0 0 auto;
	white-space: nowrap;
	color: var(--hgnm-muted);
	font-variant-numeric: tabular-nums;
}

.hgnm .hgnm__item:hover,
.hgnm .hgnm__item.is-hl,
.hgnm .hgnm__item.is-active {
	color: var(--hgnm-accent);
}

.hgnm .hgnm__item.is-active .hgnm__name {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.hgnm .hgnm__empty {
	padding: 12px 0 12px var(--hgnm-indent);
	font-size: 15px;
	color: var(--hgnm-muted);
}

/* loading bars */
.hgnm .hgnm__sk,
.hgnm__skeleton span {
	display: block;
	height: 14px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--hgnm-soft) 25%, #f6f4f2 50%, var(--hgnm-soft) 75%);
	background-size: 200% 100%;
	animation: hgnm-shimmer 1.3s linear infinite;
}

.hgnm .hgnm__sk {
	margin: 18px 38% 18px var(--hgnm-indent);
}

.hgnm .hgnm__sk:nth-child(2n) {
	margin-right: 22%;
}

.hgnm .hgnm__sk:nth-child(3n) {
	margin-right: 50%;
}

.hgnm__skeleton {
	display: flex;
	flex-direction: column;
	gap: 34px;
	padding-top: 22px;
}

.hgnm__skeleton span:nth-child(odd) {
	width: 42%;
}

.hgnm__skeleton span:nth-child(even) {
	width: 58%;
}

/* "See what's nearby" (load-on-click mode) */
.hgnm__cta {
	padding: 8px 0;
}

.hgnm .hgnm__load {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 16px 26px;
	border: 1.5px solid var(--hgnm-rule);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hgnm .hgnm__load:hover {
	background: var(--hgnm-text);
	color: #fff;
}

.hgnm .hgnm__load .hgnm-ico {
	width: 20px;
	height: 20px;
}

.hgnm__status {
	margin: 16px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--hgnm-muted);
}

.hgnm__status.is-error {
	color: #b42318;
}

.hgnm__credit {
	margin: auto 0 0;
	padding-top: 18px;
	font-size: 11px;
	letter-spacing: 0.03em;
	color: var(--hgnm-muted);
}

.hgnm.is-error .hgnm__groups,
.hgnm.is-error .hgnm__cta {
	display: none;
}

/* admin preview: hide / unhide */
.hgnm .hgnm__hide {
	flex: 0 0 auto;
	padding: 3px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: #fff;
	font-size: 12px;
	color: #50575e;
}

.hgnm .hgnm__hide:hover {
	border-color: var(--hgnm-accent);
	color: var(--hgnm-accent);
}

.hgnm .hgnm__li.is-hidden .hgnm__item {
	opacity: 0.45;
	text-decoration: line-through;
	cursor: default;
}

/* ---------- map pins ---------- */

.hgnm-layer {
	position: absolute;
	top: 0;
	left: 0;
}

.hgnm .hgnm-pin {
	position: absolute;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--hgnm-primary);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 3px 10px rgba(0, 0, 0, 0.22);
	color: #fff;
	text-align: center;
	transform: translate(-50%, -50%);
	transition: transform 0.18s ease, background-color 0.18s ease;
}

.hgnm .hgnm-pin:hover,
.hgnm .hgnm-pin.is-hl {
	z-index: 3;
	transform: translate(-50%, -50%) scale(1.14);
}

.hgnm .hgnm-pin.is-active {
	z-index: 4;
	background: var(--hgnm-accent);
}

.hgnm .hgnm-pin:focus-visible {
	outline: 2px solid var(--hgnm-accent);
	outline-offset: 3px;
}

.hgnm .hgnm-pin__ico {
	display: block;
	width: 20px;
	height: 20px;
}

.hgnm .hgnm-pin--cluster {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0;
	font-variant-numeric: tabular-nums;
}

.hgnm .hgnm-pin--cluster.is-md {
	width: 46px;
	height: 46px;
}

.hgnm .hgnm-pin--cluster.is-lg {
	width: 54px;
	height: 54px;
	font-size: 16px;
}

/* the property: logo disc with a pointer; its tip sits on the exact spot */
.hgnm .hgnm-pin--property {
	z-index: 6;
	width: 64px;
	height: 74px;
	border-radius: 0;
	background: none;
	box-shadow: none;
	transform: translate(-50%, -100%);
	transform-origin: 50% 100%;
}

.hgnm .hgnm-pin--property:hover {
	transform: translate(-50%, -100%) scale(1.05);
}

.hgnm-prop {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--hgnm-accent);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 6px 16px rgba(0, 0, 0, 0.25);
}

.hgnm-prop::after {
	content: "";
	position: absolute;
	bottom: -10px;
	left: 50%;
	margin-left: -9px;
	border-style: solid;
	border-width: 11px 9px 0;
	border-color: var(--hgnm-accent) transparent transparent;
}

.hgnm-prop::before {
	content: "";
	position: absolute;
	top: -7px;
	right: -7px;
	bottom: -7px;
	left: -7px;
	border: 2px solid var(--hgnm-accent);
	border-radius: 50%;
	opacity: 0;
	animation: hgnm-pulse 2.6s ease-out infinite;
}

.hgnm .hgnm-prop img {
	display: block;
	width: 68%;
	height: 68%;
	max-width: none;
	object-fit: contain;
}

.hgnm .hgnm-prop__ico {
	width: 30px;
	height: 30px;
	color: #fff;
}

/* ---------- pop-up (Google InfoWindow content) ---------- */

.hgnm .hgnm-iw__title {
	padding-top: 4px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: #1f1a17;
}

.hgnm .hgnm-iw {
	min-width: 200px;
	font-size: 13.5px;
	line-height: 1.45;
	color: #4a4340;
}

.hgnm .hgnm-iw__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--hgnm-muted);
}

.hgnm .hgnm-iw__ico {
	width: 15px;
	height: 15px;
	color: var(--hgnm-primary);
}

.hgnm .hgnm-iw__addr,
.hgnm .hgnm-iw__rating {
	margin: 0 0 6px;
}

.hgnm .hgnm-iw__rating {
	color: #1f1a17;
}

.hgnm .hgnm-iw__rating > span:first-child {
	color: #e0a128;
}

.hgnm .hgnm-iw__count {
	color: var(--hgnm-muted);
}

.hgnm .hgnm-iw__links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin-top: 8px;
}

.hgnm .hgnm-iw__links a {
	font-weight: 600;
	text-decoration: none;
	color: var(--hgnm-accent);
}

.hgnm .hgnm-iw__links a:hover {
	text-decoration: underline;
}

/* keep theme rules off Google's own controls */
.hgnm .gm-style img {
	max-width: none;
}

.hgnm .gm-style button {
	min-height: 0;
	margin: 0;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
}

/* ---------- admin-only notice on the front end ---------- */

.hgnm-notice {
	padding: 14px 18px;
	border-left: 4px solid #c0573a;
	background: #fbf7f5;
	font-size: 14px;
}

/* ---------- phones & small tablets ---------- */

@media (max-width: 849px) {
	.hgnm {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.hgnm__mapwrap {
		order: -1;
		min-height: var(--hgnm-h-m);
	}

	.hgnm__panel {
		padding-top: 8px;
	}

	.hgnm .hgnm__toggle {
		padding: 16px 0;
		font-size: 15px;
	}

	.hgnm__scroll {
		padding-right: 6px;
	}

	.hgnm .hgnm__item {
		padding-top: 11px;
		padding-bottom: 11px;
		font-size: 15.5px;
		letter-spacing: 0.01em;
	}
}

/* ---------- motion ---------- */

@keyframes hgnm-shimmer {
	to {
		background-position: -200% 0;
	}
}

@keyframes hgnm-fade {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

@keyframes hgnm-pulse {
	0% {
		opacity: 0.55;
		transform: scale(0.92);
	}

	100% {
		opacity: 0;
		transform: scale(1.4);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hgnm-prop::before,
	.hgnm .hgnm__sk,
	.hgnm__skeleton span,
	.hgnm__body {
		animation: none;
	}

	.hgnm .hgnm-pin,
	.hgnm .hgnm__toggle,
	.hgnm .hgnm__item,
	.hgnm__pm::before,
	.hgnm__pm::after {
		transition: none;
	}
}
