/* RENA interactive map (shortcode [rena_map]) – front-end styles. */
.rena-map {
	--rena-model-a: #1d4ed8;
	--rena-model-b: #b45309;
	--rena-model-c: #047857;
	--rena-mixed: #374151;
	--rena-map-height: 600px;
	margin: 0 0 1.5rem;
	font-size: 0.95rem;
	line-height: 1.4;
}

.rena-map *,
.rena-map *::before,
.rena-map *::after {
	box-sizing: border-box;
}

.rena-map__title {
	margin: 0 0 0.75rem;
}

/* Toolbar: filters + search */
.rena-map__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	align-items: flex-start;
	margin-bottom: 0.5rem;
}

.rena-map__filters {
	flex: 1 1 420px;
	background: #fff;
	border: 1px solid #cfd3d8;
	border-radius: 6px;
	padding: 0.5rem 0.9rem;
}

.rena-map__summary {
	cursor: pointer;
	font-weight: 600;
}

.rena-map__badge {
	display: inline-block;
	min-width: 1.4em;
	padding: 0 0.4em;
	margin-left: 0.35em;
	border-radius: 999px;
	background: var(--rena-model-a);
	color: #fff;
	font-size: 0.8em;
	text-align: center;
}

.rena-map__form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0.75rem 1.25rem;
	margin-top: 0.6rem;
}

.rena-map__fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.rena-map__fieldset--minority {
	grid-column: 1 / -1;
}

.rena-map__fieldset legend {
	font-weight: 600;
	padding: 0;
	margin-bottom: 0.3rem;
}

.rena-map__checks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.15rem 1rem;
}

.rena-map__check {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0.1rem 0;
	font-weight: 400;
}

.rena-map__check input {
	margin: 0;
	flex: none;
}

.rena-map__swatch,
.rena-legend__swatch,
.rena-popup__model {
	display: inline-block;
	min-width: 1.5em;
	padding: 0 0.3em;
	border-radius: 4px;
	color: #fff;
	font-size: 0.8em;
	font-weight: 700;
	text-align: center;
	line-height: 1.6;
}

.rena-map__check--model-a .rena-map__swatch { background: var(--rena-model-a); }
.rena-map__check--model-b .rena-map__swatch { background: var(--rena-model-b); }
.rena-map__check--model-c .rena-map__swatch { background: var(--rena-model-c); }

.rena-map__actions {
	grid-column: 1 / -1;
	margin: 0;
}

.rena-map__reset {
	font: inherit;
	padding: 0.3rem 0.8rem;
	border: 1px solid #555;
	border-radius: 4px;
	background: #f3f4f6;
	color: #111;
	cursor: pointer;
}

.rena-map__reset:hover,
.rena-map__reset:focus-visible {
	background: #e5e7eb;
}

.rena-map__search {
	flex: 1 1 220px;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.rena-map__search label {
	font-weight: 600;
}

.rena-map__search input {
	font: inherit;
	padding: 0.45rem 0.6rem;
	border: 1px solid #555;
	border-radius: 4px;
	width: 100%;
}

.rena-map__status {
	margin: 0.25rem 0 0.5rem;
	font-weight: 600;
}

/* Map canvas */
.rena-map__canvas {
	position: relative;
	height: var(--rena-map-height);
	min-height: 240px;
	width: 100%;
	border: 1px solid #cfd3d8;
	border-radius: 6px;
	background: #e9eef2;
	z-index: 0;
}

.rena-map__canvas:focus-within {
	outline: 3px solid var(--rena-model-a);
	outline-offset: 2px;
}

.rena-map__noscript {
	padding: 1rem;
}

/* Markers */
.rena-marker {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
	color: #fff;
	font: 700 12px/1 Arial, Helvetica, sans-serif;
	background: var(--rena-mixed);
}

.rena-marker--a { background: var(--rena-model-a); }
.rena-marker--b { background: var(--rena-model-b); }
.rena-marker--c { background: var(--rena-model-c); }
.rena-marker--mixed { background: var(--rena-mixed); }

.rena-marker--mixed span {
	font-size: 10px;
	letter-spacing: 0.5px;
}

.leaflet-marker-icon:focus-visible,
.leaflet-container a:focus-visible,
.leaflet-control a:focus-visible {
	outline: 3px solid #111;
	outline-offset: 2px;
}

.rena-cluster {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(55, 65, 81, 0.92);
	border: 3px solid rgba(255, 255, 255, 0.85);
	color: #fff;
	font: 700 13px/1 Arial, Helvetica, sans-serif;
}

/* Legend (static strip above the map) */
.rena-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1.25rem;
	list-style: none;
	margin: 0 0 0.5rem;
	padding: 0;
	font-size: 0.85rem;
}

.rena-map__legend li {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.rena-legend__swatch.rena-marker--a { background: var(--rena-model-a); }
.rena-legend__swatch.rena-marker--b { background: var(--rena-model-b); }
.rena-legend__swatch.rena-marker--c { background: var(--rena-model-c); }
.rena-legend__swatch.rena-marker--mixed { background: var(--rena-mixed); }

/* Popup */
.rena-popup__title {
	margin: 0 0 0.4rem;
	font-size: 1.05rem;
}

.rena-popup__table {
	border-collapse: collapse;
	font-size: 0.85rem;
	margin: 0;
}

.rena-popup__table th,
.rena-popup__table td {
	padding: 0.15rem 0.5rem 0.15rem 0;
	text-align: left;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: top;
}

.rena-popup__num {
	text-align: right;
}

.rena-popup__model.rena-marker--a { background: var(--rena-model-a); }
.rena-popup__model.rena-marker--b { background: var(--rena-model-b); }
.rena-popup__model.rena-marker--c { background: var(--rena-model-c); }

/* Footer: exports + list */
.rena-map__footer {
	margin-top: 0.6rem;
}

.rena-map__exports {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1rem;
	margin: 0 0 0.5rem;
}

.rena-map__list {
	border: 1px solid #cfd3d8;
	border-radius: 6px;
	padding: 0.5rem 0.9rem;
	background: #fff;
}

.rena-map__items {
	margin: 0.5rem 0 0 1.2rem;
	padding: 0;
	max-height: 320px;
	overflow: auto;
}

.rena-map__item {
	font: inherit;
	font-weight: 700;
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.rena-map__item:focus-visible {
	outline: 2px solid var(--rena-model-a);
	outline-offset: 2px;
}

/* Hero layout (homepage) */
.rena-map--hero {
	margin-bottom: 0;
}

.rena-map--hero .rena-map__canvas {
	height: clamp(320px, 55vh, var(--rena-map-height));
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.rena-map--hero .rena-map__filters {
	flex-basis: 260px;
	background: rgba(255, 255, 255, 0.92);
}

.rena-map--hero .rena-map__form {
	grid-template-columns: 1fr;
	max-height: 50vh;
	overflow: auto;
}

.rena-map--hero .rena-map__status {
	font-size: 0.9rem;
}

.rena-map--hero .rena-map__legend {
	font-size: 0.78rem;
	gap: 0.2rem 0.9rem;
}

.rena-map--hero .rena-map__list {
	background: rgba(255, 255, 255, 0.92);
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
	.leaflet-zoom-anim .leaflet-zoom-animated,
	.leaflet-fade-anim .leaflet-tile,
	.leaflet-fade-anim .leaflet-popup,
	.marker-cluster,
	.leaflet-cluster-anim .leaflet-marker-icon,
	.leaflet-cluster-anim .leaflet-marker-shadow {
		transition: none !important;
	}
}

@media (max-width: 600px) {
	.rena-map__form {
		grid-template-columns: 1fr;
	}
	.rena-map__canvas {
		height: clamp(300px, 60vh, var(--rena-map-height));
	}
}
