/* Representatives Map — frontend */

.reps-map {
	--reps-navy: #1a3f7b;
	--reps-red: #c8102e;
	--reps-border: #2f2f2f;
	--reps-text: #222;
	--reps-muted: #666;
	--reps-map-height: 640px;

	font-family: Georgia, "Times New Roman", Times, serif;
	color: var(--reps-text);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

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

.reps-map__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.reps-map__toolbar {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1rem;
}

.reps-map__industries {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	align-items: center;
}

.reps-map__industry {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--reps-red);
	font: inherit;
	font-size: 1.05rem;
	line-height: 1.2;
	padding: 0.55rem 1.15rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.reps-map__industry:hover {
	transform: translateY(-1px);
}

.reps-map__industry.is-active {
	background: var(--reps-navy);
	color: #fff;
}

.reps-map__industry:focus-visible {
	outline: 2px solid var(--reps-navy);
	outline-offset: 2px;
}

.reps-map__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem 2.5rem;
	align-items: flex-end;
}

.reps-map__filter-group {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.reps-map__filter-label {
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.reps-map__filter-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.reps-map__select {
	min-width: 180px;
	max-width: 100%;
	padding: 0.55rem 2rem 0.55rem 0.85rem;
	border: 1px solid var(--reps-border);
	border-radius: 6px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23222' d='M1.4.3 6 4.9 10.6.3 12 1.7 6 7.7 0 1.7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 10px 7px;
	font: inherit;
	font-size: 0.95rem;
	color: var(--reps-text);
	appearance: none;
	cursor: pointer;
}

.reps-map__select:focus {
	outline: 2px solid var(--reps-navy);
	outline-offset: 1px;
}

.reps-map__canvas-wrap {
	position: relative;
	width: 100%;
	height: var(--reps-map-height);
	min-height: 360px;
	border-radius: 2px;
	overflow: hidden;
	background: #e8e8e8;
}

.reps-map__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.reps-map__popup {
	font-family: Georgia, "Times New Roman", Times, serif;
	color: #222;
	min-width: 180px;
	max-width: 280px;
}

.reps-map__popup-agency {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: break-word;
}

.reps-map__popup-name {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 700;
	overflow-wrap: break-word;
}

.reps-map__popup-title {
	margin: 0.15rem 0 0.45rem;
	font-size: 0.85rem;
	color: #555;
	font-style: italic;
	overflow-wrap: break-word;
}

.reps-map__popup-meta {
	margin: 0.25rem 0 0;
	font-size: 0.85rem;
	line-height: 1.4;
}

.reps-map__popup-label {
	display: inline-block;
	font-weight: 700;
	color: #222;
}

.reps-map__popup-meta a {
	color: var(--reps-navy);
	text-decoration: underline;
}

.reps-map__popup-meta a:focus {
	outline: none;
}

.reps-map__popup-meta a:focus-visible {
	outline: 2px solid var(--reps-navy);
	outline-offset: 2px;
}

.mapboxgl-popup-content {
	/* Right padding reserves the fixed 28px close button + a small gap. */
	padding: 12px 36px 12px 14px;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

/* Mapbox close button — keep padding exact; do not loosen. */
.mapboxgl-popup-close-button {
	top: 0;
	right: 0;
	width: 28px;
	height: 28px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0 4px 0 0;
	background: transparent;
	color: #555;
	font-size: 18px;
	line-height: 28px;
	text-align: center;
	cursor: pointer;
}

.mapboxgl-popup-close-button:hover {
	background-color: rgba(0, 0, 0, 0.06);
	color: #222;
}

.mapboxgl-popup-close-button:focus {
	outline: none;
}

.mapboxgl-popup-close-button:focus-visible {
	outline: 2px solid var(--reps-navy, #1a3f7b);
	outline-offset: -2px;
}

.mapboxgl-ctrl-group {
	border-radius: 4px;
	overflow: hidden;
}

@media (max-width: 720px) {
	.reps-map__select {
		min-width: 140px;
		flex: 1 1 140px;
	}

	.reps-map__canvas-wrap {
		min-height: 300px;
	}
}
