/* Office map — Contact page "Our Global Presence" dotted world map.
   Markup: templates/contact-page.php, script: assets/js/office-map.js. */

/* main.css floats the heading over a fixed 861px Leaflet map; the dot map
   keeps its own aspect ratio, so the heading goes back into the flow. */
.contact-map-section[data-office-map] {
	min-height: 0;
	padding-bottom: 60px;
}

.contact-map-section[data-office-map] .container .contact-map-description {
	position: static;
}

.contact-map-section .location-list button {
	margin: 5px;
	padding: 8px 12px;
	border: none;
	cursor: pointer;
	transition: color 0.3s;
	background: transparent;
}

.contact-map-section .location-list button:hover {
	color: rgba(0, 80, 239, 1);
}

.contact-map-section .location-list button.selected {
	border-bottom: 3px solid rgba(0, 80, 239, 1);
}

.office-map__outer {
	position: relative;
	margin-top: 24px;
}

.office-map__wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1000 / 383;
	overflow: hidden;
	cursor: grab;
	/* Vertical page scroll stays native on touch; horizontal drag pans. */
	touch-action: pan-y;
}

.office-map__wrap:active {
	cursor: grabbing;
}

.office-map__svg {
	display: block;
	width: 100%;
	height: 100%;
	user-select: none;
}

.office-map__dots circle {
	fill: #c2d8f5;
}

.office-map__marker {
	fill: rgba(0, 80, 239, 1);
	stroke: #fff;
	stroke-width: 1.5;
	pointer-events: none; /* the transparent hit circle on top takes clicks */
	transition: fill 0.15s ease;
}

.office-map__marker.is-active {
	fill: #dc2626;
}

/* Glide markers out of (and back into) a pile on hover. */
.office-map__shift {
	transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.office-map__fan-line {
	stroke: rgba(0, 80, 239, 0.5);
	stroke-width: 1.2;
	pointer-events: none;
}

.office-map__hit {
	fill: transparent;
	pointer-events: all;
	cursor: pointer;
}

.office-map__pulse {
	fill: rgba(0, 80, 239, 0.3);
	pointer-events: none;
	transform-box: fill-box;
	transform-origin: center;
	animation: officeMapPulse 2.2s ease-out infinite;
}

.office-map__pulse.is-active {
	fill: rgba(220, 38, 38, 0.45);
	animation-duration: 1.4s;
}

@keyframes officeMapPulse {
	0% { transform: scale(0.6); opacity: 0.65; }
	100% { transform: scale(2.4); opacity: 0; }
}

/* Popup — an HTML overlay above the SVG so it can overflow the map box. */
.office-map__popup {
	position: absolute;
	z-index: 30;
	transform: translate(-50%, calc(-100% - 14px));
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 200px;
	max-width: 260px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
	text-align: left;
}

.office-map__popup[hidden] {
	display: none;
}

.office-map__popup::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: -7px;
	width: 12px;
	height: 12px;
	background: #fff;
	border-right: 1px solid #e2e8f0;
	border-bottom: 1px solid #e2e8f0;
	transform: translateX(-50%) rotate(45deg);
}

.office-map__popup-close {
	position: absolute;
	top: 6px;
	right: 8px;
	padding: 0 4px;
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	color: #94a3b8;
	cursor: pointer;
}

.office-map__popup-close:hover {
	color: #0f172a;
}

.office-map__popup-title {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	padding-right: 16px;
}

.office-map__popup-address {
	font-size: 13px;
	color: #475569;
	line-height: 1.45;
}

.office-map__popup-phone {
	font-size: 13px;
	color: #475569;
	line-height: 1.45;
	white-space: pre-line;
}

.office-map__popup-link {
	font-size: 13px;
	font-weight: 600;
	color: rgba(0, 80, 239, 1);
	word-break: break-all;
}

.office-map__popup-link:hover {
	text-decoration: underline;
}

.office-map__zoom {
	position: absolute;
	right: 16px;
	bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.office-map__zoom button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	background: #fff;
	color: #0f172a;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
	transition: background 0.15s ease, color 0.15s ease;
}

.office-map__zoom button:hover {
	background: rgba(0, 80, 239, 1);
	border-color: rgba(0, 80, 239, 1);
	color: #fff;
}

@media (max-width: 767px) {
	.office-map__zoom {
		right: 8px;
		bottom: 8px;
		gap: 6px;
	}

	.office-map__zoom button {
		width: 30px;
		height: 30px;
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.office-map__shift {
		transition: none;
	}

	.office-map__pulse {
		animation: none;
	}
}
