/**
 * villas-more/map — the Villas More coast map (Task 009-1).
 *
 * Scoped to `.vm-map` and loaded only on pages that use the block, via
 * `block.json`'s `style` handle. Every colour is a theme.json token:
 * this must read as part of the Villas More design system, not as a map
 * widget that happens to be embedded in it.
 *
 * Two modes, one stylesheet. `.vm-map--collection` and
 * `.vm-map--property` differ only in composition — the sea, the land,
 * the shelf shading, the pin language, the area typography and the
 * contextual points are shared, so the Property page's map is
 * recognisably the same map as the homepage's.
 */

.vm-map {
	/*
	 * THE MAP'S MATERIAL — the original production treatment.
	 *
	 * An art-direction pass replaced these with a lighter, chart-paper
	 * palette: warm limestone land, pale Adriatic water derived from a
	 * greener hue, a graticule, a wider depth shelf. Visual review found
	 * it less convincing than what it replaced, so this is the earlier
	 * state restored exactly — land as bright paper, water as a diluted
	 * brand teal, one hue family across the whole map.
	 *
	 * The rollback is material only. Everything the later passes added
	 * that is not a colour or a stroke stays: the water label, the
	 * corrected contextual-dot centring, the label placement that no
	 * longer clips at a frame edge, pan and zoom, secondary markers, the
	 * context index, matching, the composition.
	 *
	 * Whether the map ends up here, at chart paper, or somewhere between
	 * is a question for the Visual Identity task. This is the version
	 * that was working before that question was opened.
	 */
	--vm-map-sea: color-mix( in srgb, var( --wp--preset--color--primary ) 13%, var( --wp--preset--color--base ) );
	--vm-map-sea-deep: color-mix( in srgb, var( --wp--preset--color--primary ) 22%, var( --wp--preset--color--base ) );
	--vm-map-land: color-mix( in srgb, var( --wp--preset--color--base ) 55%, var( --wp--preset--color--white ) );
	--vm-map-coast: color-mix( in srgb, var( --wp--preset--color--primary ) 34%, transparent );
	--vm-map-shelf: color-mix( in srgb, var( --wp--preset--color--primary ) 10%, transparent );
	--vm-map-ink: var( --wp--preset--color--contrast );

	/*
	 * ONE RULE COLOUR FOR THE WHOLE MODULE.
	 *
	 * The structural hairlines were drawn in the `border` preset at 62
	 * to 75 per cent — a warm limestone that is the right colour for a
	 * control's outline and almost nothing against the section's own
	 * warm ground. Measured against the surface it carried a luminance
	 * difference of about 0.08: present in the DOM, absent to the eye,
	 * so the line meant to separate the editorial story from the
	 * interaction was not separating anything.
	 *
	 * Mixed from ink instead it is a neutral grey at roughly four times
	 * that difference, still one pixel and still quiet. Every structural
	 * rule in the module now reads this token, so they cannot drift
	 * apart again. Control outlines are deliberately NOT on it: a rule
	 * divides, a border encloses, and they are allowed to differ.
	 */
	--vm-rule: color-mix( in srgb, var( --wp--preset--color--contrast ) 22%, transparent );
	--vm-map-muted: var( --wp--preset--color--muted );
	--vm-map-accent: var( --vm-color-primary );
	--vm-map-brand: var( --wp--custom--ink );

	container-type: inline-size;
	position: relative;
}

/*
 * `hidden` must win, everywhere in this block.
 *
 * The attribute's own UA rule is `[hidden] { display: none }` at the
 * lowest possible specificity, so any class rule that sets `display`
 * silently defeats it — and this component sets `display` on almost
 * everything it hides: the stay cards are `grid`, the aside items are
 * `flex`, the control group is `flex`. The panel's opening state looked
 * correct in the DOM and rendered five cards anyway. One rule, scoped to
 * the block, rather than five careful `display: none` overrides that the
 * sixth component would forget.
 */
.vm-map [hidden] {
	display: none !important;
}

/* Screen-reader-only text, local to this block so it needs nothing global. */
.vm-map__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ *
 * Discovery — the primary control. Full width, above both columns.
 * ------------------------------------------------------------------ */

.vm-map__panel {
	min-width: 0;
	display: grid;
	gap: 1.5rem;
}

.vm-map__discovery {
	margin: 0;
	padding: 0;
}

.vm-map__choices {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.vm-map__legend {
	font-family: var( --wp--preset--font-family--heading );
	font-size: clamp( 1.42rem, 1.9cqi, 1.62rem );
	line-height: 1.15;
	letter-spacing: -0.005em;
	color: var( --vm-map-ink );
	padding: 0;
	margin: 0 0 1.05rem;
}

.vm-map__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.42rem;
}

.vm-map__chip {
	position: relative;
	display: inline-flex;
}

.vm-map__chip-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

/*
 * THE TRAIT SELECTOR.
 *
 * Three treatments were tried before this one and each failed in its
 * own direction. A fully rounded outlined pill on a transparent ground
 * is the universal shape of a search filter — correct, generic, and
 * the exact thing this section must not be. Editorial links inside a
 * sentence looked right and stopped saying "press me", which is the
 * one thing a control cannot afford to stop saying. Large rectangular
 * tiles gave six form fields the weight of six decisions.
 *
 * So: a tag, not a pill and not a tile. A soft 7px radius rather than a
 * capsule, because the capsule is the whole tell. A warm limestone
 * ground so the set reads as one considered cluster against the white
 * page rather than as six empty outlines. A hairline border kept
 * deliberately weaker than the fill, so the shape is felt rather than
 * drawn. Type at proper reading size and medium weight, because these
 * are the words a guest is actually choosing between and the old
 * `small` preset made them look like metadata.
 *
 * Selected is solid terracotta. It is the loudest single move in the
 * section and it is spent here on purpose: the same colour then appears
 * on the matched pin and on the call to action, so choosing a trait
 * visibly reaches across into the map. That echo is what stops the two
 * columns reading as two components.
 */
.vm-map__chip-face {
	display: inline-block;
	padding: 0.5rem 0.82rem;
	border: 1px solid color-mix( in srgb, var( --wp--preset--color--border ) 62%, transparent );
	border-radius: 7px;
	background: color-mix( in srgb, var( --wp--preset--color--border ) 22%, var( --wp--preset--color--base ) );
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.004em;
	color: var( --vm-map-ink );
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.vm-map__chip:hover .vm-map__chip-face {
	background: color-mix( in srgb, var( --vm-map-accent ) 11%, var( --wp--preset--color--base ) );
	border-color: color-mix( in srgb, var( --vm-map-accent ) 40%, transparent );
}

.vm-map__chip-input:checked + .vm-map__chip-face {
	background: var( --vm-map-accent );
	border-color: var( --vm-map-accent );
	color: var( --wp--preset--color--white );
	box-shadow: 0 1px 2px color-mix( in srgb, var( --vm-map-accent ) 28%, transparent );
}

.vm-map__chip:hover .vm-map__chip-input:checked + .vm-map__chip-face {
	background: color-mix( in srgb, var( --vm-map-accent ) 88%, var( --vm-map-ink ) );
	border-color: color-mix( in srgb, var( --vm-map-accent ) 88%, var( --vm-map-ink ) );
}

.vm-map__chip-input:focus-visible + .vm-map__chip-face {
	outline: 2px solid var( --vm-map-ink );
	outline-offset: 2px;
}

.vm-map__result {
	border-top: 1px solid var( --vm-rule );
	padding-top: 1.35rem;
}

/*
 * The opening state's whole argument, in one sentence. It was set at the
 * same size and colour as the draft notice underneath it, which made the
 * most important line in the panel the third most important thing on
 * screen. Promoted to reading size and to ink.
 */
.vm-map__invite {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.55;
	max-width: 26em;
	color: color-mix( in srgb, var( --vm-map-ink ) 82%, transparent );
}

.vm-map__panel-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 1.25rem;
	margin: 1.1rem 0 0;
}

.vm-map__reset,
.vm-map__back {
	background: none;
	border: 0;
	padding: 0;
	font-family: inherit;
	font-size: var( --wp--preset--font-size--small );
	color: var( --vm-map-muted );
	text-decoration: underline;
	text-underline-offset: 0.25em;
	cursor: pointer;
}

.vm-map__reset:hover,
.vm-map__back:hover {
	color: var( --vm-map-accent );
}

.vm-map__reset:focus-visible,
.vm-map__back:focus-visible {
	outline: 2px solid var( --vm-map-accent );
	outline-offset: 3px;
}

.vm-map__all {
	font-size: 0.86rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var( --vm-map-brand );
	text-decoration: none;
	margin-left: auto;
}

.vm-map__all:hover {
	color: var( --vm-map-accent );
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

/* ------------------------------------------------------------------ *
 * Body: figure + rail
 * ------------------------------------------------------------------ */

/*
 * Map-led, and asymmetric on purpose. The first build gave the map and
 * a five-item rail near-equal weight, and the section read as filters +
 * map + directory. The map is the collection here — it is the thing
 * that always shows every stay — so it takes roughly five-eighths of
 * the width and the panel beside it is where the map answers back.
 */
.vm-map__body {
	display: grid;
	grid-template-columns: minmax( 0, 1.72fr ) minmax( 0, 1fr );
	gap: 2.5rem;
	align-items: start;
}

/* Stacked is the collection map's base state; two columns are opted into
   by the container query below, at the width where they start working. */
.vm-map--collection .vm-map__body {
	grid-template-columns: minmax( 0, 1fr );
	gap: 1.9rem;
}

/*
 * PREFERENCES ON THE LEFT, GEOGRAPHY ON THE RIGHT.
 *
 * The section reads as one sentence — *what matters to me* → *where that
 * puts me* — so discovery takes the narrow left column and the map the
 * wide right one. With the map on the left it read as the content column
 * and discovery as a settings rail beside it: the wrong emphasis,
 * because the map is the payoff rather than the page, and the wrong
 * genre, because an editorial panel to the right of the main content is
 * a booking-engine filter sidebar whatever its typography says.
 *
 * The split is 35 / 65. The map is the geographic payoff and takes the
 * larger share; the discovery column takes the smallest share that still
 * works, which is a measured quantity rather than a taste: at 33 % the
 * panel is 370 px and the six trait labels break to four rows.
 *
 * The whole two-column composition lives inside one container query,
 * because it only works where the discovery column can hold the trait
 * set in three rows and not one pixel before. Measured at 35 %: a
 * 1162 px block gives a 390 px panel and three rows; 1132 px is the
 * floor for three; at 1092 px it is four rows, and at 900 px the cluster
 * has become a stack of controls — the box-filled sidebar this module
 * exists not to be. Below the threshold the section keeps the narrative
 * order, where the same six labels wrap to two rows across the full
 * width and the map takes the whole column. The breakpoint is set by the
 * type, which is the only thing that actually knows where the layout
 * stops working.
 *
 * The 3 rem column gap and this template are also read by the section's
 * introduction band in the theme's `style.css`, which sits above this
 * block and has to land its heading on the discovery column and its lede
 * on the map column. Two grids, one axis: if this template changes, that
 * one changes with it, and the comment there says so too.
 *
 * The document order never changes and is the stacked order — discovery,
 * map, result — because keyboard order follows the document and `order`
 * cannot move focus. Above the threshold it also runs left to right, so
 * the two agree rather than merely not conflicting.
 */
@container ( min-width: 1132px ) {
	.vm-map--collection .vm-map__body {
		grid-template-columns: minmax( 0, 0.538fr ) minmax( 0, 1fr );
		grid-template-rows: auto 1fr;
		column-gap: 3rem;
		row-gap: 1.5rem;
	}

	.vm-map--collection .vm-map__discovery {
		grid-column: 1;
		grid-row: 1;
	}

	.vm-map--collection .vm-map__figure {
		grid-column: 2;
		grid-row: 1 / span 2;
	}

	/*
	 * TWO COLUMNS, ONE BOTTOM EDGE.
	 *
	 * The opening state left about 220 px of empty column beside a map
	 * that ran on without it, and the section read as a short stack
	 * placed next to a tall picture. The temptation is to fill it. The
	 * better answer is to give the emptiness two edges: the question and
	 * its answer stay at the top where they belong, and the route onward
	 * drops to the foot of the column, level with the map's own
	 * attribution line. The space between them is then plainly
	 * intentional — a margin, not a gap — and the two columns start
	 * together and finish together.
	 *
	 * In the revealed state the photograph grows into that space and the
	 * `auto` margin simply goes to zero, so nothing has to be undone.
	 */
	.vm-map--collection .vm-map__panel {
		grid-column: 1;
		grid-row: 2;
		align-self: stretch;
		display: flex;
		flex-direction: column;
	}

	.vm-map--collection .vm-map__panel > .vm-map__result {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		min-height: 0;
	}

	.vm-map--collection .vm-map__panel-actions {
		margin-top: auto;
		padding-top: 1.1rem;
		border-top: 1px solid var( --vm-rule );
	}
}

.vm-map--property .vm-map__body {
	grid-template-columns: minmax( 0, 1.6fr ) minmax( 0, 1fr );
	gap: 2rem;
}

.vm-map__figure {
	min-width: 0;
	position: relative;
}

/* ------------------------------------------------------------------ *
 * Map context — the secondary control. Quieter, and above the map it
 * governs, so a keyboard user meets it before the pins it reveals.
 * ------------------------------------------------------------------ */

.vm-map__layers {
	border: 0;
	margin: 0 0 0.85rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 0.8rem;
}

/*
 * Deliberately a size and a weight below the trait set. These change
 * what the map shows; they can never change what matches. If a guest
 * cannot tell those two apart at a glance the section has two equal
 * questions on it and no clear one.
 */
.vm-map__layers-legend {
	padding: 0;
	margin: 0 0.4rem 0 0;
	font-size: 0.67rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: color-mix( in srgb, var( --vm-map-muted ) 82%, transparent );
	float: left; /* keeps the legend on the same line as its controls */
}

.vm-map__layer {
	position: relative;
	display: inline-flex;
}

.vm-map__layer-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.vm-map__layer-mark {
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 0.4rem;
	vertical-align: baseline;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	opacity: 0.75;
}

.vm-map__layer-mark--diamond {
	border-radius: 1px;
	width: 8px;
	height: 8px;
	transform: rotate( 45deg );
}

.vm-map__layer-mark--bar {
	border-radius: 999px;
	width: 14px;
	height: 6px;
}

/*
 * FOUR STATES, ALL DISTINGUISHABLE, ALL STILL SECONDARY.
 *
 * The layer chips used to differ from off to on by a 12 % tint and a
 * slightly warmer outline — a difference you could find if you were
 * looking for it and not one you noticed at a glance, which is the
 * whole job of an active state. Resting, hover, focus and on are now
 * four visibly different things.
 *
 * They stay teal, and the trait tags stay terracotta. That is the
 * hierarchy in one decision: terracotta is the colour of choosing a
 * stay, and a layer can never choose one. A layer chip switched on must
 * never look like a trait chip switched on, however clear it becomes.
 */
.vm-map__layer-face {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.7rem;
	border: 1px solid var( --vm-rule );
	border-radius: 999px;
	font-size: 0.76rem;
	line-height: 1.2;
	color: var( --vm-map-muted );
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.vm-map__layer:hover .vm-map__layer-face {
	border-color: color-mix( in srgb, var( --vm-map-brand ) 42%, transparent );
	color: var( --vm-map-ink );
}

.vm-map__layer-input:checked + .vm-map__layer-face {
	background: color-mix( in srgb, var( --vm-map-brand ) 15%, transparent );
	border-color: color-mix( in srgb, var( --vm-map-brand ) 62%, transparent );
	color: var( --vm-map-brand );
	font-weight: 500;
}

.vm-map__layer-input:checked + .vm-map__layer-face .vm-map__layer-mark {
	opacity: 1;
}

.vm-map__layer:hover .vm-map__layer-input:checked + .vm-map__layer-face {
	background: color-mix( in srgb, var( --vm-map-brand ) 22%, transparent );
	border-color: color-mix( in srgb, var( --vm-map-brand ) 78%, transparent );
}

.vm-map__layer-input:focus-visible + .vm-map__layer-face {
	outline: 2px solid var( --vm-map-ink );
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * The map itself
 * ------------------------------------------------------------------ */

.vm-map__canvas {
	/*
	 * Two ratios, deliberately kept separate even though they are
	 * currently equal at every width.
	 *
	 * `--vm-map-ratio` is the map frame's own shape, set inline by the
	 * renderer from the viewBox it chose. `--vm-canvas-ratio` is the
	 * shape this box wants to be. When they differ the plane covers and
	 * the frame crops, and QA at 390 px found what that costs: a canvas
	 * one-fifth taller than the frame cropped about 14% of the
	 * longitude, and Villa Diamond — the easternmost stay — was
	 * silently off the map. Five stays "always visible" is the first
	 * rule of this feature, so the canvas now takes the frame's shape
	 * at every width and the map is a shorter strip on a phone rather
	 * than a taller one missing its ends.
	 *
	 * The pair stays because the cover machinery below is what makes
	 * that safe to revisit: if a future frame is ever cropped on
	 * purpose, the pins will still land on the coastline.
	 */
	--vm-canvas-ratio: var( --vm-map-ratio, 1.428 );

	position: relative;
	aspect-ratio: var( --vm-canvas-ratio );
	border-radius: 3px;
	overflow: hidden;
	background: linear-gradient( 170deg, var( --vm-map-sea ) 0%, var( --vm-map-sea-deep ) 100% );
	border: 1px solid var( --wp--preset--color--border );
}

/*
 * The frame, sized to cover the canvas — the CSS equivalent of
 * `object-fit: cover`, done arithmetically so the SVG and the HTML pin
 * layer inside it are always the same rectangle.
 *
 * plane width / canvas width = map ratio / canvas ratio. When the
 * canvas is relatively taller that value exceeds 1 and the plane
 * overflows sideways; when the canvas is relatively wider the `max()`
 * holds the plane at full width and its own aspect ratio makes it
 * overflow downwards. Either way it covers, and it is centred, which is
 * exactly what `preserveAspectRatio="xMidYMid"` does to the SVG.
 */
.vm-map__plane {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	width: max( 100%, calc( 100% * var( --vm-map-ratio, 1.428 ) / var( --vm-canvas-ratio ) ) );
	aspect-ratio: var( --vm-map-ratio, 1.428 );
}

.vm-map__svg {
	display: block;
	width: 100%;
	height: 100%;
}

/*
 * `pan-y` is the whole mobile-safety story in one declaration: a
 * vertical swipe is always the page scrolling and the map never sees
 * it, while a sideways drag pans. Nothing here captures the wheel, so
 * browser zoom and page scroll are untouched.
 */
.vm-map--property .vm-map__canvas {
	touch-action: pan-y;
	cursor: grab;
}

.vm-map--property .vm-map__canvas:focus-visible {
	outline: 2px solid var( --vm-map-accent );
	outline-offset: 2px;
}

.vm-map--property .vm-map__canvas.is-dragging {
	cursor: grabbing;
}

/*
 * Narrow-width fix. The group used to be three free-standing pills in a
 * flex row, and at 342 px the row ran out of space, so "Recentre" wrapped
 * — one letter per line, inside a circle. Now the group is a single
 * pill that cannot wrap, its items never shrink, and it is anchored to
 * the map's own inset rather than to a fixed offset. Whatever the width,
 * either all three read normally or the label steps aside for its icon.
 */
.vm-map__controls {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	max-width: calc( 100% - 1.5rem );
	display: flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem;
	border-radius: 999px;
	background: color-mix( in srgb, var( --wp--preset--color--base ) 82%, transparent );
	backdrop-filter: blur( 4px );
	border: 1px solid color-mix( in srgb, var( --wp--preset--color--border ) 70%, transparent );
	white-space: nowrap;
	z-index: 4;
}

.vm-map__control {
	appearance: none;
	border: 0;
	background: transparent;
	color: var( --vm-map-ink );
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1;
	flex: none;
	white-space: nowrap;
	min-width: 1.9rem;
	height: 1.9rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.vm-map__control--reset {
	padding: 0 0.8rem;
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-left: 1px solid color-mix( in srgb, var( --wp--preset--color--border ) 80%, transparent );
	border-radius: 0 999px 999px 0;
	/*
	 * Only offered once the guest has actually moved. An always-visible
	 * "Recentre" on an un-moved map is a control advertising a problem
	 * that does not exist.
	 */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.vm-map.is-moved .vm-map__control--reset {
	opacity: 1;
	pointer-events: auto;
}

.vm-map__control:hover {
	background: color-mix( in srgb, var( --vm-map-brand ) 10%, transparent );
	color: var( --vm-map-brand );
}

.vm-map__control:focus-visible {
	outline: 2px solid var( --vm-map-accent );
	outline-offset: 2px;
}

.vm-map__land {
	fill: var( --vm-map-land );
	stroke: var( --vm-map-coast );
	stroke-width: calc( 1.6 * var( --vm-map-scale, 1 ) );
	stroke-linejoin: round;
	fill-rule: evenodd;
}

/* Depth shading, in the manner of a printed chart. */
.vm-map__shelf {
	fill: none;
	stroke: var( --vm-map-shelf );
	stroke-linejoin: round;
}

.vm-map__shelf--3 { stroke-width: calc( 26 * var( --vm-map-scale, 1 ) ); opacity: 0.35; }
.vm-map__shelf--2 { stroke-width: calc( 15 * var( --vm-map-scale, 1 ) ); opacity: 0.45; }
.vm-map__shelf--1 { stroke-width: calc( 6 * var( --vm-map-scale, 1 ) );  opacity: 0.6; }

.vm-map__area {
	fill: color-mix( in srgb, var( --vm-map-ink ) 62%, transparent );
	font-family: var( --wp--preset--font-family--heading );
	letter-spacing: 0.14em;
	text-transform: uppercase;
	/*
	 * `text-anchor` is deliberately NOT set here. It is a presentation
	 * attribute the renderer computes per label — centred normally,
	 * anchored inboard near a frame edge — and a CSS declaration would
	 * silently win over it and crop every edge label.
	 */
	paint-order: stroke;
	stroke: color-mix( in srgb, var( --vm-map-land ) 80%, transparent );
	stroke-width: calc( 3 * var( --vm-map-scale, 1 ) );
	stroke-linejoin: round;
}

.vm-map__area--minor {
	fill: color-mix( in srgb, var( --vm-map-ink ) 40%, transparent );
	letter-spacing: 0.1em;
}

/*
 * The waterbody name. Set apart from the area names on purpose — italic,
 * widely tracked, a shade of the sea rather than of the ink — so it
 * reads as a caption for the water rather than as another place on the
 * land. Its position is computed per viewport; see view.js.
 */
.vm-map__water {
	fill: color-mix( in srgb, var( --vm-map-brand ) 42%, transparent );
	font-family: var( --wp--preset--font-family--heading );
	font-style: italic;
	letter-spacing: 0.3em;
	text-anchor: middle;
	pointer-events: none;
}

/* ------------------------------------------------------------------ *
 * Pins — real HTML over the decorative SVG.
 * ------------------------------------------------------------------ */

.vm-map__pins,
.vm-map__points {
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	inset: 0;
}

/*
 * A mark is a zero-size anchor sitting exactly on its coordinate, with
 * the dot and the label positioned around it. The obvious alternative —
 * a box containing dot-then-label, centred on the point — silently puts
 * every dot about eleven pixels north of where it belongs, because half
 * the label's height counts towards the centring. On a 16 km frame that
 * is roughly 250 m of invented geography, and it is invisible until you
 * go looking for it.
 */
.vm-map__pin,
.vm-map__point {
	position: absolute;
	width: 0;
	height: 0;
}

.vm-map__pin {
	z-index: 3; /* a stay is always drawn above a contextual point */
}

/*
 * Outside the window a guest is currently looking at. Deliberately not
 * `hidden`: that attribute means "this layer is switched off", and once
 * the window can move the two have to be able to disagree.
 */
.vm-map__pin[ data-vm-outside='true' ],
.vm-map__point[ data-vm-outside='true' ],
.vm-map__nearby li[ data-vm-outside='true' ] {
	display: none;
}

.vm-map__point {
	z-index: 2;
}

.vm-map__pin-hit,
.vm-map__point > * {
	color: inherit;
	text-decoration: none;
}

.vm-map__pin-dot,
.vm-map__point-dot {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate( -50%, -50% );
	border-radius: 50%;
}

.vm-map__pin-dot {
	width: 13px;
	height: 13px;
	background: var( --vm-map-brand );
	box-shadow: 0 0 0 3px color-mix( in srgb, var( --wp--preset--color--base ) 85%, transparent );
	transition: transform 0.3s cubic-bezier( 0.2, 0.9, 0.3, 1 ), background-color 0.3s ease, box-shadow 0.3s ease;
}

.vm-map__point-hit {
	position: absolute;
	left: 0;
	top: 0;
	width: 30px;
	height: 30px;
	transform: translate( -50%, -50% );
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	/* A generous, invisible target around a nine-pixel mark. */
}

/*
 * The contextual dot lives INSIDE its 30px hit target, so its
 * containing block is the button, not the anchor. `left: 0` therefore
 * means the button's top-left corner — fifteen pixels north-west of the
 * coordinate, about 340 m on this frame. Visual UAT found every
 * contextual mark sitting off its own label by exactly that much. This
 * is the same defect the anchor comment above describes, one level
 * down: centre the dot in the button and the button on the coordinate.
 */
.vm-map__point-dot {
	left: 50%;
	top: 50%;
	width: 9px;
	height: 9px;
	border: 1.5px solid color-mix( in srgb, var( --vm-map-ink ) 45%, transparent );
	background: color-mix( in srgb, var( --wp--preset--color--base ) 78%, transparent );
	transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

/*
 * Category by shape. Circle, diamond, bar — the same three marks appear
 * inside each layer's own control, so switching a layer on shows you
 * what to look for.
 */
.vm-map__point--diamond .vm-map__point-dot {
	border-radius: 1px;
	transform: translate( -50%, -50% ) rotate( 45deg );
	width: 8px;
	height: 8px;
}

.vm-map__point--bar .vm-map__point-dot {
	border-radius: 999px;
	width: 14px;
	height: 6px;
}

.vm-map__point-hit:hover + .vm-map__point-label,
.vm-map__point.is-active .vm-map__point-dot,
.vm-map__point.is-open .vm-map__point-dot {
	border-color: var( --vm-map-brand );
}

.vm-map__point.is-active .vm-map__point-dot,
.vm-map__point.is-open .vm-map__point-dot {
	background: var( --wp--preset--color--base );
	transform: translate( -50%, -50% ) scale( 1.35 );
}

.vm-map__point--diamond.is-active .vm-map__point-dot,
.vm-map__point--diamond.is-open .vm-map__point-dot {
	transform: translate( -50%, -50% ) rotate( 45deg ) scale( 1.35 );
}

.vm-map__point-hit:focus-visible .vm-map__point-dot {
	outline: 2px solid var( --vm-map-accent );
	outline-offset: 3px;
}

/*
 * The callout. The name is normally quiet type beside the mark; when a
 * guest points at it — pointer, tap or keyboard — it comes forward onto
 * a small ground of its own so it is legible over land, sea or another
 * label. On a phone, where the resting labels are dropped for room,
 * this is the only way a mark says what it is, which is exactly the
 * defect it exists to fix.
 */
.vm-map__point.is-active,
.vm-map__point.is-open {
	z-index: 5;
}

.vm-map__point.is-active .vm-map__point-label,
.vm-map__point.is-open .vm-map__point-label {
	display: block;
	padding: 0.24rem 0.5rem;
	border-radius: 3px;
	background: color-mix( in srgb, var( --wp--preset--color--base ) 94%, transparent );
	box-shadow: 0 1px 6px color-mix( in srgb, var( --vm-map-ink ) 14%, transparent );
	color: var( --vm-map-ink );
	text-shadow: none;
}

.vm-map__pin-label,
.vm-map__point-label {
	position: absolute;
	width: max-content;
	line-height: 1.15;
	pointer-events: auto;
}

.vm-map__pin-label {
	font-family: var( --wp--preset--font-family--heading );
	font-size: clamp( 0.78rem, 1.15cqi, 0.95rem );
	color: var( --vm-map-ink );
	text-shadow:
		0 0 4px var( --vm-map-land ),
		0 0 8px var( --vm-map-land ),
		0 0 12px var( --vm-map-land );
	transition: opacity 0.3s ease, color 0.3s ease;
}

.vm-map__point-label {
	font-size: clamp( 0.7rem, 1.05cqi, 0.82rem );
	color: var( --vm-map-muted );
	text-shadow: 0 0 4px var( --vm-map-land ), 0 0 8px var( --vm-map-land );
}

/*
 * The four placements the renderer chooses between. The label moves;
 * the dot above never does.
 */
.vm-map__pin--below .vm-map__pin-label,
.vm-map__point--below .vm-map__point-label {
	left: 0;
	transform: translateX( -50% );
	text-align: center;
}

.vm-map__pin--below .vm-map__pin-label { top: 11px; }
.vm-map__point--below .vm-map__point-label { top: 8px; }

.vm-map__pin--above .vm-map__pin-label,
.vm-map__point--above .vm-map__point-label {
	left: 0;
	transform: translateX( -50% );
	text-align: center;
}

.vm-map__pin--above .vm-map__pin-label { bottom: 11px; }
.vm-map__point--above .vm-map__point-label { bottom: 8px; }

.vm-map__pin--below-right .vm-map__pin-label,
.vm-map__point--below-right .vm-map__point-label,
.vm-map__pin--above-right .vm-map__pin-label,
.vm-map__point--above-right .vm-map__point-label {
	text-align: left;
}

.vm-map__pin--below-left .vm-map__pin-label,
.vm-map__point--below-left .vm-map__point-label,
.vm-map__pin--above-left .vm-map__pin-label,
.vm-map__point--above-left .vm-map__point-label {
	text-align: right;
}

.vm-map__pin--below-right .vm-map__pin-label { left: 8px; top: 8px; }
.vm-map__point--below-right .vm-map__point-label { left: 6px; top: 6px; }
.vm-map__pin--below-left .vm-map__pin-label { right: 8px; top: 8px; }
.vm-map__point--below-left .vm-map__point-label { right: 6px; top: 6px; }
.vm-map__pin--above-right .vm-map__pin-label { left: 8px; bottom: 8px; }
.vm-map__point--above-right .vm-map__point-label { left: 6px; bottom: 6px; }
.vm-map__pin--above-left .vm-map__pin-label { right: 8px; bottom: 8px; }
.vm-map__point--above-left .vm-map__point-label { right: 6px; bottom: 6px; }

.vm-map__pin--right .vm-map__pin-label,
.vm-map__point--right .vm-map__point-label {
	top: 0;
	transform: translateY( -50% );
	text-align: left;
}

.vm-map__pin--right .vm-map__pin-label { left: 12px; }
.vm-map__point--right .vm-map__point-label { left: 9px; }

.vm-map__pin--left .vm-map__pin-label,
.vm-map__point--left .vm-map__point-label {
	top: 0;
	transform: translateY( -50% );
	text-align: right;
}

.vm-map__pin--left .vm-map__pin-label { right: 12px; }
.vm-map__point--left .vm-map__point-label { right: 9px; }

/*
 * The far ring: the label steps back and a hairline says which mark it
 * belongs to. Drawn from the mark outwards, so it is correct whatever
 * the label's own width turns out to be.
 */
.vm-map__pin--below-far .vm-map__pin-label,
.vm-map__point--below-far .vm-map__point-label,
.vm-map__pin--above-far .vm-map__pin-label,
.vm-map__point--above-far .vm-map__point-label {
	left: 0;
	transform: translateX( -50% );
	text-align: center;
}

.vm-map__pin--below-far .vm-map__pin-label { top: 34px; }
.vm-map__point--below-far .vm-map__point-label { top: 31px; }
.vm-map__pin--above-far .vm-map__pin-label { bottom: 34px; }
.vm-map__point--above-far .vm-map__point-label { bottom: 31px; }

.vm-map__pin--right-far .vm-map__pin-label,
.vm-map__point--right-far .vm-map__point-label,
.vm-map__pin--left-far .vm-map__pin-label,
.vm-map__point--left-far .vm-map__point-label {
	top: 0;
	transform: translateY( -50% );
}

.vm-map__pin--right-far .vm-map__pin-label,
.vm-map__point--right-far .vm-map__point-label { text-align: left; }

.vm-map__pin--left-far .vm-map__pin-label,
.vm-map__point--left-far .vm-map__point-label { text-align: right; }

.vm-map__pin--right-far .vm-map__pin-label { left: 35px; }
.vm-map__point--right-far .vm-map__point-label { left: 32px; }
.vm-map__pin--left-far .vm-map__pin-label { right: 35px; }
.vm-map__point--left-far .vm-map__point-label { right: 32px; }

.vm-map__pin[ class*='-far' ]::before,
.vm-map__point[ class*='-far' ]::before {
	content: '';
	position: absolute;
	background: color-mix( in srgb, var( --vm-map-ink ) 30%, transparent );
}

.vm-map__pin--below-far::before,
.vm-map__pin--above-far::before,
.vm-map__point--below-far::before,
.vm-map__point--above-far::before {
	left: 0;
	width: 1px;
	height: 22px;
	transform: translateX( -50% );
}

.vm-map__pin--below-far::before { top: 11px; }
.vm-map__point--below-far::before { top: 8px; }
.vm-map__pin--above-far::before { bottom: 11px; }
.vm-map__point--above-far::before { bottom: 8px; }

.vm-map__pin--right-far::before,
.vm-map__pin--left-far::before,
.vm-map__point--right-far::before,
.vm-map__point--left-far::before {
	top: 0;
	height: 1px;
	width: 22px;
	transform: translateY( -50% );
}

.vm-map__pin--right-far::before { left: 12px; }
.vm-map__point--right-far::before { left: 9px; }
.vm-map__pin--left-far::before { right: 12px; }
.vm-map__point--left-far::before { right: 9px; }

.vm-map__pin-hit:hover .vm-map__pin-dot,
.vm-map__pin-hit:focus-visible .vm-map__pin-dot {
	transform: translate( -50%, -50% ) scale( 1.25 );
}

.vm-map__pin-hit:focus-visible .vm-map__pin-dot {
	outline: 2px solid var( --vm-map-accent );
	outline-offset: 3px;
}

.vm-map__pin-hit:focus-visible .vm-map__pin-label {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Emphasis states, driven by the view script. Never used alone: the
   card always carries the same information as text. */
.vm-map__pin[ data-vm-rank='top' ] .vm-map__pin-dot {
	background: var( --vm-map-accent );
	transform: translate( -50%, -50% ) scale( 1.5 );
	box-shadow:
		0 0 0 3.5px color-mix( in srgb, var( --wp--preset--color--base ) 88%, transparent ),
		0 0 0 11px color-mix( in srgb, var( --vm-map-accent ) 20%, transparent );
}

.vm-map__pin[ data-vm-rank='top' ] .vm-map__pin-label,
.vm-map__pin.is-chosen .vm-map__pin-label {
	font-weight: 500;
}

/*
 * A stay chosen straight off the map gets the same terracotta as one
 * that won on traits: two routes, one act, one colour.
 */
.vm-map__pin.is-chosen .vm-map__pin-dot {
	background: var( --vm-map-accent );
	transform: translate( -50%, -50% ) scale( 1.5 );
	box-shadow:
		0 0 0 3.5px color-mix( in srgb, var( --wp--preset--color--base ) 88%, transparent ),
		0 0 0 11px color-mix( in srgb, var( --vm-map-accent ) 20%, transparent );
}

.vm-map__pin.is-chosen .vm-map__pin-label {
	opacity: 1;
}

/*
 * The unchosen stays. Raised to 68 % during the chart-paper experiment,
 * because against pale water a 40 % dot went to a smudge; with the
 * original water restored the original values read correctly again, so
 * they come back with it. This is a contrast pair, not two independent
 * numbers — if the water ever changes, check these.
 */
.vm-map__pin[ data-vm-rank='none' ] .vm-map__pin-dot {
	background: color-mix( in srgb, var( --vm-map-brand ) 40%, transparent );
}

.vm-map__pin[ data-vm-rank='none' ] .vm-map__pin-label {
	opacity: 0.5;
}

.vm-map__pin.is-linked .vm-map__pin-dot {
	transform: translate( -50%, -50% ) scale( 1.5 );
}

.vm-map__pin--current .vm-map__pin-dot {
	width: 17px;
	height: 17px;
	background: var( --vm-map-accent );
	box-shadow:
		0 0 0 4px color-mix( in srgb, var( --wp--preset--color--base ) 85%, transparent ),
		0 0 0 11px color-mix( in srgb, var( --vm-map-accent ) 20%, transparent );
}

.vm-map__pin--current .vm-map__pin-label {
	font-size: clamp( 0.8rem, 1.5cqi, 1.05rem );
}

/*
 * The rest of the collection, on a Property's own map. Smaller, neutral
 * and quiet — geographic context, not a competing recommendation. They
 * earn their place when a guest zooms out and sees where this stay sits
 * among the others; they must never look like an alternative being
 * offered instead of the one whose page this is.
 */
.vm-map__pin--secondary .vm-map__pin-dot {
	width: 9px;
	height: 9px;
	background: color-mix( in srgb, var( --vm-map-brand ) 55%, transparent );
	box-shadow: 0 0 0 2.5px color-mix( in srgb, var( --wp--preset--color--base ) 80%, transparent );
}

.vm-map__pin--secondary .vm-map__pin-label {
	font-size: clamp( 0.66rem, 1cqi, 0.8rem );
	color: var( --vm-map-muted );
	font-style: italic;
}

.vm-map__pin--secondary .vm-map__pin-hit:hover .vm-map__pin-dot,
.vm-map__pin--secondary .vm-map__pin-hit:focus-visible .vm-map__pin-dot {
	background: var( --vm-map-brand );
}

.vm-map__pin--secondary .vm-map__pin-hit:hover .vm-map__pin-label {
	color: var( --vm-map-ink );
}

.vm-map__point-group {
	display: block;
	font-size: 0.85em;
	font-style: italic;
	opacity: 0.85;
}

/*
 * A contextual layer is itself a lot of type. When one is on, the minor
 * area names step back — the map is already saying "Lapad" with three
 * beaches and a bar, and the Property card beside it carries the
 * neighbourhood in words. Major areas stay: they are the frame of
 * reference the layer sits inside.
 */
.vm-map.has-layer .vm-map__area--minor {
	opacity: 0;
	transition: opacity 0.25s ease;
}

.vm-map__credit {
	margin: 0.55rem 0 0;
	font-size: 0.66rem;
	letter-spacing: 0.02em;
	color: color-mix( in srgb, var( --vm-map-muted ) 58%, transparent );
}

/* ------------------------------------------------------------------ *
 * The rail
 * ------------------------------------------------------------------ */

.vm-map__headline {
	margin: 0 0 1.05rem;
	font-family: var( --wp--preset--font-family--heading );
	font-size: 1.24rem;
	line-height: 1.3;
	letter-spacing: -0.006em;
	color: var( --vm-map-ink );
	min-height: 2.4em; /* reserved, so nothing below it jumps */
	transition: none;
}

/*
 * The opening state has no headline, so the reserved height would leave
 * a hole above the invitation. Reserved height exists to stop the panel
 * jumping between states that *have* a headline; it should not hold
 * space for one that does not.
 */
.vm-map__headline.is-empty {
	min-height: 0;
	margin: 0;
}

.vm-map__stays {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.55rem;
}

@keyframes vm-map-reveal {
	from { opacity: 0; transform: translateY( 6px ); }
	to { opacity: 1; transform: none; }
}

.vm-map-stay {
	animation: vm-map-reveal 0.32s cubic-bezier( 0.2, 0.8, 0.25, 1 ) both;
	position: relative;
	display: grid;
	grid-template-columns: 68px minmax( 0, 1fr );
	gap: 0.85rem;
	align-items: center;
	padding: 0.55rem;
	border: 1px solid transparent;
	border-radius: 3px;
	background: transparent;
	transition: background-color 0.25s ease, border-color 0.25s ease, opacity 0.3s ease;
}

.vm-map-stay__media {
	aspect-ratio: 1;
	border-radius: 2px;
	overflow: hidden;
	background: linear-gradient( 160deg, var( --vm-color-deep ) 0%, var( --vm-color-primary ) 100% );
}


.vm-map-stay__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vm-map-stay__body {
	min-width: 0;
}

.vm-map-stay__meta {
	margin: 0;
	min-height: 1.15em; /* reserved: the tier line appears and disappears */
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var( --vm-map-accent );
}

.vm-map-stay__meta-reason {
	text-transform: none;
	letter-spacing: 0.02em;
	color: var( --vm-map-muted );
}

.vm-map-stay__name {
	margin: 0.1rem 0 0.15rem;
	font-size: 1.06rem;
	line-height: 1.2;
}

.vm-map-stay__link {
	color: var( --vm-map-ink );
	text-decoration: none;
}

/* The standard accessible card pattern: one real link, and a
   pseudo-element that makes the whole row clickable. No nested
   interactive elements, no span pretending to be a link. */
.vm-map-stay__link::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 3px;
}

.vm-map-stay__link:hover {
	color: var( --vm-map-accent );
}

.vm-map-stay__link:focus-visible {
	outline: none;
}

.vm-map-stay__link:focus-visible::after {
	outline: 2px solid var( --vm-map-accent );
	outline-offset: 2px;
}

.vm-map-stay__location,
.vm-map-stay__descriptor {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.4;
	color: var( --vm-map-muted );
}

.vm-map-stay__descriptor {
	margin-top: 0.15rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.vm-map-stay:hover,
.vm-map-stay.is-linked {
	background: color-mix( in srgb, var( --wp--preset--color--surface ) 60%, transparent );
	border-color: var( --wp--preset--color--border );
}

.vm-map-stay[ data-vm-rank='none' ] {
	opacity: 0.62;
}

/*
 * The preview state: one stay a guest pointed at on the map. Larger
 * photography and a little more air than a match result, because it is
 * the only thing in the panel and it is answering "tell me about that
 * one" rather than "which of these".
 */
.vm-map-stay.is-preview {
	opacity: 1;
}

/* ------------------------------------------------------------------ *
 * THE REVEAL — one stay, answered properly.
 *
 * A shortlist and an answer are different pieces of design. Two or
 * three tied matches stay as compact rows, because the guest is still
 * choosing and a row is the shape of a comparison. One stay — whether
 * it won on traits or was pointed at on the map — stops being a row: the
 * photograph goes full width, the name goes to heading size, and the
 * card loses its border and its ground entirely.
 *
 * Losing the border is the point. A bordered box with a thumbnail and
 * three lines of grey is a hotel search result, and that is the genre
 * this whole section exists to avoid. Without it the content sits in the
 * column as editorial matter — picture, name, place, one line, one route
 * onward — and the visual mass comes from the photograph and the type
 * rather than from a frame drawn around them.
 * ------------------------------------------------------------------ */

.vm-map__stays.is-single .vm-map-stay {
	grid-template-columns: minmax( 0, 1fr );
	gap: 0;
	padding: 0;
	border-color: transparent;
	background: none;
}

.vm-map__stays.is-single .vm-map-stay:hover {
	background: none;
	border-color: transparent;
}

.vm-map__stays.is-single .vm-map-stay__media {
	aspect-ratio: 16 / 9;
	border-radius: 2px;
	margin-bottom: 1rem;
}

.vm-map__stays.is-single .vm-map-stay__meta {
	font-size: 0.72rem;
	letter-spacing: 0.13em;
	min-height: 0;
	margin-bottom: 0.4rem;
}

.vm-map__stays.is-single .vm-map-stay__name {
	margin: 0 0 0.3rem;
	font-size: clamp( 1.5rem, 2.5cqi, 1.9rem );
	line-height: 1.08;
	letter-spacing: -0.012em;
}

.vm-map__stays.is-single .vm-map-stay__location {
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: color-mix( in srgb, var( --vm-map-muted ) 88%, transparent );
}

.vm-map__stays.is-single .vm-map-stay__descriptor {
	margin-top: 0.55rem;
	-webkit-line-clamp: 2;
	font-size: 0.97rem;
	line-height: 1.5;
	color: color-mix( in srgb, var( --vm-map-ink ) 78%, transparent );
	max-width: 34em;
}

/*
 * The route onward. Terracotta, closing the loop the selected trait and
 * the matched pin opened — three appearances of one colour across two
 * columns, which is the whole of this section's accent budget.
 */
.vm-map-stay__cta {
	display: none;
	margin: 1rem 0 0;
	font-size: 0.86rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var( --vm-map-accent );
}

.vm-map__stays.is-single .vm-map-stay__cta {
	display: block;
}

.vm-map__stays.is-single .vm-map-stay:hover .vm-map-stay__cta {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.vm-map__editor-note {
	margin: 1.1rem 0 0;
	font-size: 0.7rem;
	line-height: 1.4;
	color: var( --vm-map-muted );
	border-top: 1px dashed var( --vm-rule );
	padding-top: 0.7rem;
}

/* ------------------------------------------------------------------ *
 * THE CONTEXT INDEX — Collection mode only.
 *
 * Editorial, not a directory: a small category label with its names set
 * inline after it, wrapping like a line of type rather than stacking
 * like a list. Two or three lines at desktop with every layer on. It
 * belongs to the map and sits under it, quieter than the stay names in
 * the panel opposite and louder than the attribution above it — which
 * is the whole of its place in the hierarchy.
 * ------------------------------------------------------------------ */

.vm-map__index {
	margin-top: 1.5rem;
}

.vm-map__index-groups {
	margin: 0;
	display: grid;
	gap: 0.55rem;
}

/*
 * Label and names on one baseline. `dt` and `dd` are block-level and a
 * definition list is the honest markup for "category: these things", so
 * the group is a flex row and the names wrap inside it — the semantics
 * stay a description list and the rendering stays a line of prose.
 */
.vm-map__index-group {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.15rem 0.6rem;
}

.vm-map__index-label {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	font-size: 0.67rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var( --vm-map-muted );
}

.vm-map__index-label .vm-map__layer-mark {
	margin-right: 0.42rem;
	opacity: 1;
	color: var( --vm-map-brand );
}

.vm-map__index-names {
	margin: 0;
	min-width: 0;
}

/*
 * A name is a button because it has no destination — it lights its mark
 * on the map. Styled as running type rather than as a control: a row of
 * pills here would be a second set of chips competing with the layer
 * controls directly above the map, and the brief for this index is that
 * it must not become another sidebar or another control language.
 */
.vm-map__index-name {
	appearance: none;
	background: none;
	border: 0;
	padding: 0.1rem 0;
	margin: 0;
	font: inherit;
	font-size: 0.86rem;
	line-height: 1.45;
	color: color-mix( in srgb, var( --vm-map-ink ) 80%, transparent );
	cursor: pointer;
	transition: color 0.18s ease;
}

/* The separator is generated, so a name is never a button with a stray
   middot inside its accessible name. */
.vm-map__index-name:not( :last-child )::after {
	content: '·';
	margin: 0 0.1rem 0 0.45rem;
	color: color-mix( in srgb, var( --vm-map-muted ) 55%, transparent );
}

.vm-map__index-name:hover,
.vm-map__index-name.is-active {
	color: var( --vm-map-brand );
	text-decoration: underline;
	text-underline-offset: 0.28em;
	text-decoration-thickness: 1px;
}

.vm-map__index-name:hover::after,
.vm-map__index-name.is-active::after {
	text-decoration: none;
	display: inline-block; /* keeps the underline off the separator */
}

.vm-map__index-name:focus-visible {
	outline: 2px solid var( --vm-map-ink );
	outline-offset: 3px;
	border-radius: 2px;
}

/* Outside the window a guest is looking at. The collection map does not
   pan, so this is defensive rather than routine — but if it ever does,
   a name for a mark that is not drawn should recede, not vanish and
   leave a gap in the middle of a sentence. */
.vm-map__index-name[ data-vm-outside='true' ] {
	opacity: 0.45;
}

@container ( max-width: 560px ) {
	.vm-map__index {
		margin-top: 1.25rem;
	}

	.vm-map__index-group {
		gap: 0.1rem 0.5rem;
	}

	/* A little more to aim at with a thumb, without turning the names
	   into buttons that look like buttons. Measured at 32 px tall and
	   40 to 90 px wide — comfortably past the 24 px floor, and the cost
	   is six pixels a line. */
	.vm-map__index-name {
		padding: 0.38rem 0;
	}
}

/* ------------------------------------------------------------------ *
 * Property Explore aside
 * ------------------------------------------------------------------ */

.vm-map__nearby-label {
	margin: 0 0 0.5rem;
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var( --vm-map-muted );
}

.vm-map__nearby {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.35rem;
	font-size: 0.88rem;
	color: var( --vm-map-ink );
}

.vm-map__nearby li {
	display: flex;
	align-items: center;
	gap: 0.1rem;
	transition: color 0.2s ease;
}

.vm-map__nearby li .vm-map__layer-mark {
	color: var( --vm-map-muted );
	flex: none;
}

.vm-map__nearby li.is-active {
	color: var( --vm-map-brand );
}

.vm-map__nearby li.is-active .vm-map__layer-mark {
	color: var( --vm-map-brand );
	opacity: 1;
}

.vm-map__nearby .vm-map__point-group {
	display: inline;
	margin-left: 0.35rem;
	font-size: 0.8em;
	color: var( --vm-map-muted );
}

.vm-map__provisional,
.vm-map__unlocated {
	margin: 1.1rem 0 0;
	font-size: 0.78rem;
	font-style: italic;
	color: var( --vm-map-muted );
}

.vm-map__directions {
	margin: 1.3rem 0 0;
	font-size: 0.88rem;
}

/* ------------------------------------------------------------------ *
 * Tablet and mobile — designed, not shrunk. Container queries, so the
 * same block behaves correctly in a narrow column as on a wide page.
 * ------------------------------------------------------------------ */

@container ( max-width: 900px ) {
	/*
	 * All three selectors, because the desktop composition sets its
	 * template on `.vm-map--collection .vm-map__body` and a bare
	 * `.vm-map__body` inside this query does not outweigh it — the
	 * stacked column would keep the width of the narrow desktop one and
	 * leave the map's share of the grid standing empty beside it.
	 */
	.vm-map__body,
	.vm-map--property .vm-map__body {
		grid-template-columns: minmax( 0, 1fr );
		gap: 1.75rem;
	}

}

/*
 * TABLET STACKS. Measured, then reversed.
 *
 * The previous pass gave a portrait tablet the desktop's two columns, on
 * the reasoning that the reading order — preferences, then geography —
 * is worth keeping sideways wherever it fits. Measurement says it does
 * not fit here. At a 734 px block the discovery column is 258 px, and
 * the six trait labels wrap to FIVE rows and 208 px of stacked controls:
 * precisely the box-filled sidebar this module exists not to be.
 * Widening the panel enough to hold three rows needs about 49% of the
 * block, which costs the map its majority and trades the payoff for the
 * control.
 *
 * Stacked at the same width the cluster wraps to TWO rows and the map
 * takes the full column. The composition gives up a reading direction
 * and gets a working one, so a tablet now keeps the phone's narrative:
 * introduction, choices, map, result. The desktop direction is
 * unchanged and still begins at a 900 px block.
 *
 * No canvas-ratio override at these widths either. It was 1.35 once, to
 * give the map more height when the columns stack — but any value below
 * the frame's own 1.43 crops the longitude, and this frame spans the
 * whole collection. Height is not worth losing a stay for.
 */

@container ( max-width: 560px ) {
	/*
	 * The map declutters by dropping the least useful type, not by
	 * going anonymous. Task 009 V0.2 proposed hiding every stay label
	 * on a small screen on the grounds that the list below carries all
	 * five names — and measured on a real 390 px phone that turned out
	 * to be the wrong trade: five unlabelled dots beside five names is
	 * a matching puzzle, and the runtime placement pass resolves all
	 * five labels at that width with no collisions and no clipping. So
	 * the stay names stay, one size smaller. What goes instead is the
	 * minor area typography, which is the type a guest needs least when
	 * the Property cards are directly beneath.
	 */
	.vm-map__pin-label {
		font-size: 0.7rem;
	}

	/*
	 * Contextual points keep their marks and lose their names. Twelve
	 * labels do not fit a 342 px map, and the honest trade is that a
	 * guest who switched a layer on already knows what they asked for:
	 * the chip says "Beaches", and four hollow marks show where the
	 * beaches are. The stays keep their names, because those are the
	 * only things on this map anyone can book.
	 */
	.vm-map__point-label {
		display: none;
	}

	.vm-map__area--minor {
		display: none;
	}

	/* ---------------------------------------------------------- *
	 * THE TRAIT CLUSTER ON A PHONE.
	 *
	 * The requirement is a hard one and it is a layout requirement,
	 * not a styling preference: six choices in two or three rows at
	 * 390 px. Six full-width rows would put roughly 300 px of
	 * controls between the introduction and the map, and the map is
	 * the thing this section is for.
	 *
	 * Truncation, a carousel and a horizontal scroller are all
	 * refused: a guest cannot choose between things they cannot
	 * read, and a control that has to be scrolled to be discovered
	 * is a control half of them will never find. So the labels stay
	 * whole and the type does the work — one step down in size,
	 * tighter horizontal padding, a smaller gap. Measured at 390 px
	 * the six wrap two-two-two.
	 *
	 * The vertical padding does NOT come down with the horizontal:
	 * the face stays at least 40 px tall so the target survives a
	 * thumb, which is the thing that usually gets sacrificed when a
	 * set like this is squeezed.
	 * ---------------------------------------------------------- */
	.vm-map__chips {
		gap: 0.38rem;
	}

	.vm-map__chip-face {
		padding: 0.75rem 0.66rem;
		font-size: 0.86rem;
		line-height: 1.2;
	}

	/* A little more to aim at with a thumb. */
	.vm-map__layer-face {
		padding: 0.5rem 0.8rem;
	}

	/*
	 * "Show on map" takes its own line on a phone. Floated beside the
	 * chips it pushed the third one onto a second row on its own, and an
	 * orphaned utility control reads as a mistake; on its own line the
	 * three fit together and the set stays legible as one thing.
	 */
	.vm-map__layers-legend {
		float: none;
		width: 100%;
		margin: 0 0 0.5rem;
	}

	.vm-map__control {
		min-width: 2.15rem;
		height: 2.15rem;
	}

	.vm-map__control--reset {
		padding: 0 0.65rem;
		font-size: 0.66rem;
		letter-spacing: 0.06em;
	}

	/*
	 * On a phone the other stays keep their marks and lose their names,
	 * for the same reason the contextual points do: the current
	 * Property's name is the one that has to stay readable.
	 */
	.vm-map__pin--secondary .vm-map__pin-label {
		display: none;
	}

	.vm-map-stay {
		grid-template-columns: 60px minmax( 0, 1fr );
		gap: 0.75rem;
	}

	/*
	 * The chip's own phone sizing is set with the cluster above, where
	 * the wrapping is reasoned about. A second padding rule down here —
	 * left over from the outlined-pill treatment — silently won on
	 * specificity and held the target at 36 px however the rule above
	 * was tuned.
	 */

	.vm-map__headline {
		font-size: 1.08rem;
	}
}

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

@media ( prefers-reduced-motion: reduce ) {
	.vm-map *,
	.vm-map *::before,
	.vm-map *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}


/* ==========================================================================
   TASK-012 corrective — pins resolve to their own Property's MARK
   --------------------------------------------------------------------------
   Two separate defects, both of which made every pin the wrong colour.

   1. THE CUSTOM-PROPERTY SCOPING BUG. `--vm-map-accent: var( --vm-color-primary )`
      is declared on `.vm-map` itself. A custom property is resolved WHERE IT
      IS DECLARED and descendants inherit the already-computed value — so the
      token was fixed to whatever `--vm-color-primary` meant on the map
      container, which on the homepage is the collection olive. The
      `.vm-accent--*` class that render.php correctly puts on each pin
      (blocks/map/render.php ~line 505, and ~line 803 for the panel entries)
      changed `--vm-color-primary` inside that pin, but `--vm-map-accent` had
      already been computed above it and never looked again. The markup was
      right the whole time; the cascade was not.

      The fix is to RE-DECLARE the token inside any accent scope, so it
      re-resolves there. One attribute-substring selector, so no Property is
      named and a sixth Property needs no change here.

   2. THE RESTING PIN WAS INK. Only the emphasis states (`data-vm-rank='top'`,
      `.is-chosen`, `--current`) ever reached for the accent; a pin at rest
      used `--vm-map-brand`, which is `--wp--custom--ink` — near-black. So on
      first paint every pin on the collection map was the same dark dot.

      Identity now comes from colour at rest, and EMPHASIS comes from size and
      halo rather than from colour appearing. That ordering matters: a guest
      should be able to tell the five houses apart before interacting, and
      choosing one should read as "this one grew", not "this one gained a
      colour". The unchosen and secondary states keep the Property's own Mark
      at reduced alpha, so a stay that loses a filter recedes without losing
      its identity.

   Mark, not Core: a pin is a small non-text mark, which is exactly what
   TASK-011 reserves `--vm-color-primary` for. Labels beside the pins stay on
   the ink ramp — Mark never carries text.
   ========================================================================== */

.vm-map [ class*="vm-accent--" ] {
	--vm-map-accent: var( --vm-color-primary );
}

.vm-map__pin .vm-map__pin-dot {
	background: var( --vm-map-accent );
}

/* Filtered out by the current answers: same identity, stepped back. */
.vm-map__pin[ data-vm-rank='none' ] .vm-map__pin-dot {
	background: color-mix( in srgb, var( --vm-map-accent ) 45%, transparent );
}

/* The other stays on a Property's own map: geographic context, still theirs. */
.vm-map__pin--secondary .vm-map__pin-dot {
	background: color-mix( in srgb, var( --vm-map-accent ) 60%, transparent );
}

.vm-map__pin--secondary .vm-map__pin-hit:hover .vm-map__pin-dot,
.vm-map__pin--secondary .vm-map__pin-hit:focus-visible .vm-map__pin-dot {
	background: var( --vm-map-accent );
}

/* ------------------------------------------------------------------ *
 * Beyond the frame — Task 009-2.
 *
 * Dubrovnik Airport is outside the map. On the Collection map its name
 * sits at the edge where the line from the Old Town leaves the frame,
 * with an arrow pointing the way and the road distance beneath. It is
 * set like a contextual point's label — same muted ink, same halo — so
 * it reads as orientation, never as a stay. It is not a button and has
 * no dot: there is nothing at that spot on the map.
 *
 * On a phone the corner is where Villa Diamond's name lives, so the
 * marker gives way to a plain line under the map. Property Explore
 * always uses the line, set in the aside under "On this map", because
 * its window pans (an edge marker would have to chase it) and its zoom
 * controls are anchored to the bottom of the figure.
 * ------------------------------------------------------------------ */

.vm-map__beyond {
	position: absolute;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	width: max-content;
	line-height: 1.2;
	color: var( --vm-map-muted );
	text-shadow: 0 0 4px var( --vm-map-land ), 0 0 8px var( --vm-map-land );
	pointer-events: none;
}

.vm-map__beyond--bottom {
	align-items: flex-end;
	text-align: end;
	transform: translate( -100%, calc( -100% - 0.5rem ) );
}

.vm-map__beyond--top {
	align-items: flex-end;
	text-align: end;
	transform: translate( -100%, 0.5rem );
}

.vm-map__beyond--right {
	align-items: flex-end;
	text-align: end;
	transform: translate( calc( -100% - 0.5rem ), -50% );
}

.vm-map__beyond--left {
	transform: translate( 0.5rem, -50% );
}

.vm-map__beyond-name {
	font-size: clamp( 0.72rem, 1.1cqi, 0.86rem );
	letter-spacing: 0.01em;
}

.vm-map__beyond-note {
	font-size: clamp( 0.64rem, 0.95cqi, 0.74rem );
}

.vm-map__beyond-arrow {
	display: inline-block;
	margin-inline-start: 0.15em;
}

.vm-map__beyond-line {
	margin: 0.55rem 0 0;
	font-size: 0.78rem;
	color: var( --vm-map-muted );
}

/* In a house page's aside, under "On this map": a little air above it. */
.vm-map__beyond-line--aside {
	margin-top: 0.9rem;
}

/* On a wide Collection map the marker says it; the line would repeat it. */
.vm-map__beyond-line--echo {
	display: none;
}

@container ( max-width: 560px ) {
	.vm-map__beyond {
		display: none;
	}

	.vm-map__beyond-line--echo {
		display: block;
	}
}
