/**
 * Woningkiezer
 * Override in your theme (defaults use :where(), so any selector wins), e.g.:
 * .woningkiezer, .woning-card { --wk-accent: #003b5c; --wk-te-koop: #2e7d32; }
 */

/* Defaults with zero specificity: theme overrides always win */
:where(.woningkiezer, .woningkiezer__tooltip, .woning-card) {
	--wk-te-koop: #1cb04b;
	--wk-optie: #f2a516;
	--wk-verkocht: #c0392b;
	--wk-accent: #5f4d40;
	--wk-border: #e5e5e5;
	--wk-tooltip-width: 340px;
}

/* Map */
.woningkiezer {
	position: relative;
}

.woningkiezer__map svg {
	display: block;
	width: 100%;
	height: auto;
}

.woningkiezer__map text {
	pointer-events: none;
}

.woningkiezer__unit {
	cursor: pointer;
	transition: opacity .2s ease;
	-webkit-tap-highlight-color: transparent;
}

.woningkiezer__unit:hover,
.woningkiezer__unit.is-active {
	opacity: .8;
}

.woningkiezer__unit--te-koop  { fill: var(--wk-te-koop); }
.woningkiezer__unit--optie    { fill: var(--wk-optie); }
.woningkiezer__unit--verkocht { fill: var(--wk-verkocht); }
.woningkiezer__unit--onbekend { fill: #d5d5d5; }

/* Tooltip — desktop: next to the hovered unit (moved to <body> by JS) */
.woningkiezer__tooltip {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 9999;
	width: var(--wk-tooltip-width);
	max-width: calc(100vw - 2rem);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity .15s ease, transform .25s ease;
}

.woningkiezer__tooltip.is-visible {
	opacity: 1;
	visibility: visible;
}

.woningkiezer__tooltip.is-visible {
	pointer-events: auto;
}

.woningkiezer__close {
	display: none;
	position: absolute;
	top: 4px;
	right: 6px;
	z-index: 1;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.woningkiezer__tooltip.is-pinned .woningkiezer__close {
	display: block;
}

/* Touch devices: centered modal */
@media (hover: none), (pointer: coarse) {
	.woningkiezer__tooltip {
		position: fixed;
		top: 50% !important;
		left: 50% !important;
		width: min(var(--wk-tooltip-width), calc(100vw - 32px));
		max-width: none;
		max-height: 85vh;
		overflow-y: auto;
		transform: translate(-50%, -45%);
		box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5);
	}

	.woningkiezer__tooltip.is-visible {
		transform: translate(-50%, -50%);
	}
}

/* Card — sizes in px so the theme's base font size doesn't scale it */
.woning-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 2px solid #000;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
	font-family: var(--wk-font, inherit);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .01em;
}

.woning-card__header {
	padding: 12px 44px;
	background: var(--wk-type-color, var(--wk-accent));
	color: #fff;
	font-size: 24px;
	line-height: 1;
	text-align: center;
}

.woning-card__list {
	margin: 0;
	padding: 10px 22px 0;
}

.woning-card__row {
	display: grid;
	grid-template-columns: 54% 1fr;
	padding: 9px 0 8px;
	border-bottom: 1px solid var(--wk-type-color, var(--wk-accent));
	font-size: 18px;
	line-height: 1;
}

.woning-card .woning-card__label,
.woning-card .woning-card__value {
	margin: 0;
	color: #000;
	font-weight: 400;
}

.woning-card__value sup {
	font-size: .55em;
}

.woning-card__image {
	padding: 16px 22px;
}

.woning-card__image img {
	display: block;
	width: 100%;
	height: auto;
}

.woning-card__button {
	display: block;
	margin-top: auto;
	padding: 12px 16px;
	background: #000;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	text-align: center;
	text-decoration: none;
}

.woning-card__button:visited,
.woning-card__button:hover,
.woning-card__button:focus {
	color: #fff;
	background: #222;
}
