/* Estate map section — interactive SVG overlay over aerial render. */

:root {
	--map-free:            rgba(72, 145, 90, 0.60);
	--map-free-strong:     rgba(72, 145, 90, 0.9);
	--map-reserved:        rgba(200, 130, 50, 0.60);
	--map-reserved-strong: rgba(200, 130, 50, 0.9);
	--map-sold:            rgba(180, 60, 55, 0.60);
	--map-sold-strong:     rgba(180, 60, 55, 0.9);
}

.estate-map-section {
	padding: 4rem 1.5rem;
	background-color: var(--color-bg);
}

.estate-map-section__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.estate-map-section__title {
	color: var(--color-heading);
	margin-bottom: 0.5rem;
	text-align: center;
}

.estate-map-section__hint {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin: 0 auto 1.5rem;
	color: var(--color-text-muted);
	font-size: 0.95rem;
	text-align: center;
}

.estate-map-section__hint-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: var(--color-secondary);
}

/* Wrapper keeps the exact aspect ratio of the source render/overlay (1656×1081). */
.estate-map {
	position: relative;
	width: 100%;
	aspect-ratio: 1656 / 1081;
	border-radius: 8px;
	overflow: hidden;
}

.estate-map__bg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: fill;
}

/* SVG fills the exact same box; preserveAspectRatio="none" (set in file) → no drift. */
.estate-map svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Resting state: status color shown immediately (class added by JS), subtle outline. */
.estate-map svg path {
	fill: transparent;
	stroke: rgba(255, 255, 255, 0.6);
	stroke-width: 1;
	cursor: pointer;
	transition: fill 0.15s ease, stroke 0.15s ease;
}

/* Stronger outline on interaction for clear feedback. */
.estate-map svg path:hover,
.estate-map svg path.is-active {
	stroke: rgba(255, 255, 255, 0.9);
}

/* Status colors — applied by JS on hover (desktop) or active tap (mobile). */
.estate-map svg path.is-free     { fill: var(--map-free); }
.estate-map svg path.is-reserved { fill: var(--map-reserved); }
.estate-map svg path.is-sold     { fill: var(--map-sold); }

.estate-map svg path.is-free.is-active,
.estate-map svg path.is-free:hover     { fill: var(--map-free-strong); }
.estate-map svg path.is-reserved.is-active,
.estate-map svg path.is-reserved:hover { fill: var(--map-reserved-strong); }
.estate-map svg path.is-sold.is-active,
.estate-map svg path.is-sold:hover     { fill: var(--map-sold-strong); }

/* Tooltip — single reused element, positioned by JS relative to .estate-map. */
.estate-map__tooltip {
	position: absolute;
	z-index: 5;
	pointer-events: none;
	background: var(--color-surface);
	color: var(--color-text);
	border: 1px solid var(--color-accent);
	border-radius: 6px;
	padding: 0.6rem 0.8rem;
	font-size: 0.85rem;
	line-height: 1.4;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
	max-width: 220px;
	transform: translate(-50%, calc(-100% - 12px));
}

.estate-map__tooltip[hidden] { display: none; }
.estate-map__tooltip strong { display: block; color: var(--color-heading); }

/* Legend */
.estate-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	justify-content: center;
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
	color: var(--color-text-muted);
	font-size: 0.9rem;
}

.estate-map__legend li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.estate-map__dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: inline-block;
}

.estate-map__dot--free     { background: var(--map-free-strong); }
.estate-map__dot--reserved { background: var(--map-reserved-strong); }
.estate-map__dot--sold     { background: var(--map-sold-strong); }

@media (max-width: 767px) {
	.estate-map-section { padding: 2.5rem 1rem; }
	.estate-map__tooltip { font-size: 0.8rem; max-width: 180px; }
}
