/*
 * WWCIFFC NPL Map — front-end styles.
 * All selectors are prefixed with .wwciffc-npl-map- to avoid collisions
 * with theme or other plugin CSS.
 */

.wwciffc-npl-map-wrap {
	max-width: 1000px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wwciffc-npl-map-national {
	position: absolute;
	top: 3%;
	right: 0;
	max-width: 36%;
	z-index: 200;
}

.wwciffc-npl-map-national-title {
	font-size: clamp(13px, 1.8vw, 20px);
	margin: 0 0 8px;
	color: #222;
	line-height: 1.2;
	text-align: left;
}
.wwciffc-npl-map-agency-title {
	font-size: clamp(13px, 1.8vw, 20px);
	margin: 0 0 8px;
	color: #222;
	line-height: 1.2;
	text-align: center;
	font-weight: bold;
}

.wwciffc-npl-map-national-inner {
	display: flex;
	align-items: center;
}

.wwciffc-npl-map-national-badge {
	/* !important overrides the more specific ".wwciffc-npl-map-container img"
	   rule below, which would otherwise force this into an absolutely
	   positioned, unconstrained-width layer like the base/overlay/province
	   images (this badge lives inside the map container but needs to behave
	   like a normal inline image instead). */
	position: static !important;
	max-width: 90px !important;
	margin-right: 12px;
	width: clamp(34px, 8%, 90px);
	height: auto;
	flex-shrink: 0;
}

.wwciffc-npl-map-national-text {
	font-size: clamp(10px, 1.3vw, 15px);
	color: #222;
	line-height: 1.3;
}

.wwciffc-npl-map-national-updated {
	color: #666;
	font-size: clamp(9px, 1vw, 13px);
	margin-top: 2px;
}

.wwciffc-npl-map-container {
	position: relative;
	width: 100%;
	aspect-ratio: 1175 / 1005;
	overflow: hidden;
}

.wwciffc-npl-map-container img {
	position: absolute;
	display: block;
	max-width: none;
	user-select: none;
}

.wwciffc-npl-map-base,
.wwciffc-npl-map-overlay {
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

.wwciffc-npl-map-overlay {
	pointer-events: none;
	z-index: 100;
}

.wwciffc-npl-map-province-layer {
	position: absolute;
	display: block;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 10;
	pointer-events: none;
}

.wwciffc-npl-map-province-link {
	pointer-events: none;
}

.wwciffc-npl-map-province-shape {
	/* SVG hit-testing is limited to the painted province path, not its box. */
	pointer-events: visiblePainted;
	cursor: pointer;
}

.wwciffc-npl-map-province-link:focus-visible .wwciffc-npl-map-province-shape {
	stroke: #111;
	stroke-width: 4px;
	vector-effect: non-scaling-stroke;
}

.wwciffc-npl-map-province-static {
	pointer-events: none;
}

.wwciffc-npl-map-legend {
	margin-top: 20px;
}

.wwciffc-npl-map-legend img {
	max-width: 100%;
	height: auto;
	display: block;
}

@media (max-width: 700px) {
	.wwciffc-npl-map-wrap {
		padding: 0 14px;
	}

	.wwciffc-npl-map-national {
		max-width: 50%;
	}

	.wwciffc-npl-map-national-badge {
		margin-right: 8px;
	}
}

/* --- Exit-confirmation dialog ------------------------------------------- */
.wwciffc-npl-map-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: 420px;
	width: calc(100% - 32px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wwciffc-npl-map-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.wwciffc-npl-map-dialog-box {
	padding: 28px 24px 20px;
}

.wwciffc-npl-map-dialog-message {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.5;
	color: #222;
	white-space: pre-line;
}

.wwciffc-npl-map-dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.wwciffc-npl-map-dialog-confirm,
.wwciffc-npl-map-dialog-cancel {
	padding: 8px 20px;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
	line-height: 1.4;
}

.wwciffc-npl-map-dialog-confirm {
	background: #2b2b2b;
	color: #fff;
	border: none;
}

.wwciffc-npl-map-dialog-confirm:hover {
	background: #111;
}

.wwciffc-npl-map-dialog-cancel {
	background: #fff;
	color: #333;
	border: 1px solid #bbb;
}

.wwciffc-npl-map-dialog-cancel:hover {
	background: #f0f0f0;
}
