/**
 * Brand colours for the Sites map (see includes/sites-map.php): the marker
 * clusters rendered by the Leaflet Map plugin's clustering extension
 * (Leaflet.markercluster under the hood), and the individual markers and
 * popups on .bsc-map maps.
 */

/*
 * Clusters: override the library's default green/yellow/orange size tiers
 * with a single brand-coloured style, matching the individual marker icons.
 */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
	background-color: color-mix(in srgb, var(--wp--preset--color--primary-alt, #2f0a28) 60%, transparent) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
	background-color: var(--wp--preset--color--primary-alt, #2f0a28) !important;
	color: var(--wp--preset--color--primary-accent, #e6b22f) !important;
}

.marker-cluster span {
	font-weight: bold;
}

/*
 * Markers: the plugin rejects hex values in markerColor/iconColor (its
 * validator doesn't allow "#"), so brand the SVG extra-markers here.
 */

.bsc-map .extra-marker-svg svg > path:first-child {
	fill: var(--wp--preset--color--primary-alt, #2f0a28);
}

/* !important beats the inline colour ExtraMarkers sets on the icon. */
.bsc-map .extra-marker-svg i {
	color: var(--wp--preset--color--primary-accent, #e6b22f) !important;
}

/*
 * Popups: drop Leaflet's white wrapper so the popup content's own card
 * styling shows through.
 */

.bsc-map .leaflet-popup-content-wrapper {
	background: transparent;
	padding: 0;
	box-shadow: none;
}

/*
 * Leaflet sizes each popup to its content's unwrapped width, so popups vary
 * with title length and wrap unpredictably. A fixed width keeps them uniform;
 * !important beats the inline width Leaflet sets.
 */
.bsc-map .leaflet-popup-content {
	margin: 0;
	line-height: 1.5;
	width: min(260px, 75vw) !important;
}

/* Match the card so the little arrow blends in. */
.bsc-map .leaflet-popup-tip {
	background: var(--wp--preset--color--primary-alt, #2f0a28);
	box-shadow: none;
}

/*
 * The Site title is the popup's link. Brand yellow on the plum card;
 * !important beats Leaflet's `.leaflet-container a` link colour.
 */
/* Long titles wrap onto evenly sized lines rather than leaving one word alone. */
.bsc-map .bsc-site-popup-title {
	text-wrap: balance;
}

.bsc-map .bsc-site-popup-title a {
	color: var(--wp--preset--color--primary, #ffca04) !important;
	text-decoration: none;
}

.bsc-map .bsc-site-popup-title a:hover,
.bsc-map .bsc-site-popup-title a:focus {
	text-decoration: underline;
}

/* The default grey × is invisible on the plum card. */
.bsc-map .leaflet-popup-close-button {
	color: var(--wp--preset--color--tertiary, #f4f5f7) !important;
}
