/* Service finder: map of regions. Replaces the Google map of pins. */

.service-finder-map-inner #map.region-map {
	background: #e2f4f4;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

@media (min-width: 960px) {
	.service-finder-map-inner #map.region-map {
		padding: 5rem 1.5rem 1.5rem;
	}
}

.map-full-width .service-finder-map-inner #map.region-map {
	padding: 4.5rem 1rem 1rem;
}

/* Small screens: in full map view the map sets its own height, so the
   key never spills over what comes next on the page. */
@media (max-width: 959px) {
	.map-full-width .service-finder-map-inner {
		height: auto;
	}

	.map-full-width .service-finder-map-inner #map.region-map {
		height: auto;
	}

	.map-full-width .region-map-svg {
		flex: none;
		height: auto;
	}

	/* Clear the map toggle, which sits just above the list here. */
	.service-finder-listing-wrapper .region-map-current {
		margin-top: 1.25rem;
	}
}

.region-map-svg {
	display: block;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
}

/* Regions. Darker means more services. */
.region-map-area path {
	stroke: #fff;
	stroke-linejoin: round;
	stroke-width: 1.5;
	transition: fill 0.15s ease;
}

.region-map-area.level-0 path { fill: #d9d9d9; }
.region-map-area.level-1 path { fill: #a6dcdf; }
.region-map-area.level-2 path { fill: #73c8cd; }
.region-map-area.level-3 path { fill: #40b4bb; }
.region-map-area.level-4 path { fill: #1aa5ad; }
.region-map-area.level-5 path { fill: #008790; }

a.region-map-area {
	cursor: pointer;
}

a.region-map-area:hover path,
a.region-map-area:focus path {
	fill: #ffcb03;
}

a.region-map-area:focus {
	outline: none;
}

a.region-map-area:focus-visible path {
	stroke: #333;
	stroke-width: 3;
}

a.region-map-area.is-active path {
	fill: #5b3c8a;
}

/* Number of services, sat on each region. */
.region-map-count {
	pointer-events: none;
}

.region-map-count circle {
	fill: #fff;
	stroke: rgba(0, 0, 0, 0.15);
}

.region-map-count text {
	fill: #333;
	font-size: 13px;
	font-weight: 700;
	text-anchor: middle;
}

.region-map-count.is-active circle {
	fill: #ffcb03;
}

/* Exact dots, only for places the public can visit. */
.region-map-centre circle {
	fill: #ffcb03;
	stroke: #333;
	stroke-width: 1.5;
}

.region-map-centre:hover circle,
.region-map-centre:focus circle {
	fill: #ea5c51;
}

/* Key under the map. Also the way in for keyboard and screen reader users. */
.region-map-key {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}

.region-map-key li {
	margin: 0;
	padding: 0;
}

.region-map-key li::before {
	display: none;
}

.region-map-key a {
	background: #fff;
	border-radius: 2rem;
	color: #333;
	display: inline-block;
	font-size: 0.85rem;
	line-height: 1.2;
	padding: 0.35rem 0.75rem;
	text-decoration: none;
}

.region-map-key a span {
	color: #008790;
	font-weight: 700;
	margin-left: 0.2rem;
}

.region-map-key a:hover,
.region-map-key a:focus {
	background: #ffcb03;
}

.region-map-key a.is-active,
.region-map-key a.is-active span {
	background: #5b3c8a;
	color: #fff;
}

.region-map-key-centre {
	align-items: center;
	display: inline-flex;
	font-size: 0.85rem;
	gap: 0.4rem;
	padding: 0.35rem 0.5rem !important;
}

.region-map-key-centre i {
	background: #ffcb03;
	border: 1.5px solid #333;
	border-radius: 50%;
	display: inline-block;
	height: 0.6rem;
	width: 0.6rem;
}

/* "Services in Wales" line above the list. */
.region-map-current {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	justify-content: space-between;
	margin: 0 0 1rem;
}

/* The theme centres direct children with auto margins. Undo that here. */
.region-map-current strong,
.region-map-current a {
	margin: 0;
}

.region-map-current a {
	color: #008790;
	text-decoration: underline;
}
