/**
 * Contact page styles — map section with overlay card.
 */

/* === Map Section ===
 * Full-bleed white background section (Figma 6808:333341). Inner width is
 * handled by `.wlre-container` per design-system convention — don't add a
 * local max-width here or it'll diverge from the rest of the page. */
.wlre-contact-map {
	background: var(--wlre-color-white);
	padding-block: var(--wlre-space-80);
}

.wlre-contact-map__heading {
	color: var(--wlre-color-text-900);
	text-align: center;
	margin: 0 auto 16px;
	max-width: 720px;
}

.wlre-contact-map__subtitle {
	color: var(--wlre-color-text-900);
	text-align: center;
	max-width: 720px;
	margin: 0 auto 40px;
}

.wlre-contact-map__container {
	position: relative;
	min-height: 160px;
}

.wlre-contact-map__image {
	width: 100%;
	border-radius: var(--wlre-radius-20);
	overflow: hidden;
}

.wlre-contact-map__image .wlre-placeholder-image,
.wlre-contact-map__leaflet {
	aspect-ratio: 16 / 9;
}

/* Leaflet + Google iframe container — keeps map visually consistent with the
 * placeholder so overlay card positioning is unchanged across modes.
 *
 * `isolation: isolate` creates a new stacking context so Leaflet's internal
 * panes (which go up to z-index 700) cannot break out and paint over sticky
 * headers, filter dropdowns, or modals elsewhere on the page. Without this,
 * any site-wide overlay with z-index &lt; 700 renders *behind* the map.
 */
.wlre-contact-map__leaflet {
	width: 100%;
	height: auto;
	min-height: 420px;
	background: #d9e2ef;
	position: relative;
	z-index: 0;
	isolation: isolate;
}

.wlre-contact-map__leaflet .leaflet-tile-pane {
	filter: saturate(0.72) contrast(0.88) brightness(1.06);
}

.wlre-contact-map__leaflet .leaflet-control-container,
.wlre-contact-map__leaflet .leaflet-control-attribution {
	display: none;
}

/* Multi-office cards grid (point 060) — auto-fit between 1 and 3 columns. */
.wlre-contact-map__cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: var(--wlre-space-24);
}

.wlre-contact-map__card {
	position: absolute;
	bottom: var(--wlre-space-32);
	right: var(--wlre-space-32);
	box-sizing: border-box;
	width: 434.516px;
	min-height: 259px;
	background: var(--wlre-color-white);
	border-radius: var(--wlre-radius-20);
	padding: var(--wlre-space-32);
	max-width: 434.516px;
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-12);
}

/* Standalone variant: when the card lives inside the cards grid (no overlay
 * map behind it), drop the absolute positioning + fixed width so it flows
 * inline with the grid. */
.wlre-contact-map__card--standalone {
	position: static;
	width: auto;
	max-width: none;
	min-height: 0;
	bottom: auto;
	right: auto;
	box-shadow: 0 4px 16px rgba(10, 36, 56, 0.06);
	border: 1px solid var(--wlre-color-neutral-200);
}

.wlre-contact-map__card-heading {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wlre-space-12);
	color: var(--wlre-color-text-900);
	margin: 0;
	font-size: var(--wlre-font-size-h5);
	line-height: var(--wlre-line-height-heading);
}

.wlre-contact-map__card-heading svg {
	width: 26px;
	height: 26px;
	color: var(--wlre-color-accent-500);
	flex-shrink: 0;
	padding: 13px;
	box-sizing: content-box;
	background: var(--wlre-color-green-50);
	border-radius: 50%;
}

.wlre-contact-map__card-text {
	color: var(--wlre-color-text-900);
	margin: 0;
	white-space: pre-line;
	font-size: var(--wlre-font-size-l);
	line-height: var(--wlre-line-height-body);
}

/* Prevent mobile browsers from auto-styling detected phone numbers */
.wlre-contact-map__card-text a {
	color: inherit;
	text-decoration: none;
}

.wlre-contact-map__card-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--wlre-color-text-900);
	text-decoration: none;
	margin-top: 4px;
}

.wlre-contact-map__card-link:hover {
	color: var(--wlre-color-accent-500);
}

.wlre-contact-map__card-link svg {
	width: 20px;
	height: 20px;
}

/* === Responsive === */
@media (max-width: 767px) {
	.wlre-contact-map {
		box-sizing: border-box;
		height: auto;
		padding: 40px 16px;
	}

	.wlre-contact-map__heading {
		width: 100%;
		font-size: 32px;
		line-height: 1.2;
		margin-bottom: 20px;
	}

	.wlre-contact-map__subtitle {
		width: 100%;
		max-width: 343px;
		font-size: 14px;
		line-height: 1.48;
		margin-bottom: 29px;
	}

	.wlre-contact-map__container {
		width: 100%;
		height: 496px;
		min-height: 496px;
		overflow: hidden;
		border-radius: 12px;
	}

	.wlre-contact-map__image .wlre-placeholder-image,
	.wlre-contact-map__leaflet {
		aspect-ratio: auto;
		height: 496px;
		min-height: 496px;
	}

	.wlre-contact-map__card {
		position: absolute;
		right: 10px;
		bottom: 20px;
		left: 10px;
		width: auto;
		min-height: 218px;
		max-width: none;
		margin: 0;
		padding: 20px 16px;
		border-radius: var(--wlre-radius-20);
		gap: var(--wlre-space-12);
	}

	.wlre-contact-map__card--standalone {
		position: static;
		bottom: auto;
		right: auto;
		left: auto;
		min-height: 0;
	}

	.wlre-contact-map__cards {
		grid-template-columns: 1fr;
	}

	.wlre-contact-map__card-heading {
		gap: var(--wlre-space-12);
		font-size: 20px;
	}

	.wlre-contact-map__card-heading svg {
		width: 24px;
		height: 24px;
		padding: 12px;
	}

	.wlre-contact-map__card-text {
		font-size: 14px;
	}

	.wlre-contact-map__card-link {
		height: 32px;
		margin-top: 0;
		font-size: 16px;
	}

	/* Leaflet zoom controls — override vendored default (30×30) via
	 * !important because Leaflet's selector has matching specificity. */
	.wlre-contact-map__leaflet .leaflet-control-zoom-in,
	.wlre-contact-map__leaflet .leaflet-control-zoom-out {
		width: var(--wlre-tap-target) !important;
		height: var(--wlre-tap-target) !important;
		line-height: var(--wlre-tap-target) !important;
		font-size: 22px !important;
	}
}

@media (min-width: 768px) {
	.wlre-contact-map {
		padding: var(--wlre-space-80) var(--wlre-space-40);
	}
}

@media (min-width: 1024px) {
	.wlre-contact-map {
		box-sizing: border-box;
		width: 100%;
		max-width: none;
		padding: var(--wlre-space-80) 120px;
	}

	.wlre-contact-map__heading {
		font-size: 44px;
		line-height: 1.2;
	}

	.wlre-contact-map__subtitle {
		max-width: 667px;
	}

	.wlre-contact-map__container {
		min-height: 529px;
	}

	.wlre-contact-map__image .wlre-placeholder-image,
	.wlre-contact-map__leaflet {
		aspect-ratio: auto;
		height: 529px;
		min-height: 529px;
	}
}
