/* ── Style JSON CSS variables (defaults — overridden by JS) ──── */
:root {
	--gm-accent:     #1a1a1a;
	--gm-link:       #1a1a1a;
	--gm-cluster-bg: #1a1a1a;
	--gm-cluster-fg: #ffffff;
}

/* ── Custom cluster icon ─────────────────────────────────────── */
.gm-cluster {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	font-family: inherit;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25);
	border: 2px solid rgba(255,255,255,0.5);
	/* color and background set inline from JSON */
}

/* ── Grantee Map Wrapper ─────────────────────────────────────── */
.grantee-map-wrap {
	position: relative;
	font-family: inherit;
}

/* ── Filter Bar ──────────────────────────────────────────────── */
.grantee-map-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	padding: 16px 0 20px;
}

.grantee-filter-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.grantee-filter-group label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #666;
	margin: 0;
}

.grantee-filter-group select {
	appearance: none;
	-webkit-appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 12px center;
	border: 1.5px solid #ddd;
	border-radius: 6px;
	padding: 8px 36px 8px 12px;
	font-size: 14px;
	color: #222;
	cursor: pointer;
	min-width: 160px;
	transition: border-color 0.15s;
}

.grantee-filter-group select:focus {
	outline: none;
	border-color: #3b82f6;
}

.grantee-filter-count {
	margin-left: auto;
	flex-direction: row;
	align-items: center;
}

.grantee-count-label {
	font-size: 13px;
	color: #888;
}

.grantee-count-label strong {
	color: #222;
}

.grantee-filter-reset {
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #555;
	background: none;
	border: 1.5px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
}

.grantee-filter-reset:hover {
	border-color: #888;
	color: #111;
}

/* ── Map Canvas ──────────────────────────────────────────────── */
.grantee-map-canvas {
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
	border: 1.5px solid #e5e7eb;
	box-shadow: 0 2px 12px rgba(0,0,0,0.07);
	z-index: 0;
}

/* ── Loading Overlay ─────────────────────────────────────────── */
.grantee-map-loading {
	display: none;
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255,255,255,0.95);
	border: 1.5px solid #e5e7eb;
	border-radius: 24px;
	padding: 8px 20px;
	font-size: 13px;
	color: #555;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	z-index: 1000;
	align-items: center;
	gap: 8px;
}

.grantee-map-loading::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #ddd;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: grantee-spin 0.6s linear infinite;
}

@keyframes grantee-spin {
	to { transform: rotate(360deg); }
}

/* ── Popup ───────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper.grantee-popup,
.grantee-popup .leaflet-popup-content-wrapper {
	border-radius: 10px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0,0,0,0.14);
}

.grantee-popup .leaflet-popup-content {
	margin: 0;
	width: 320px !important;
}

.grantee-popup-inner {
	display: flex;
	flex-direction: column;
}

.grantee-popup-img {
	width: 100%;
	height: 120px;
	overflow: hidden;
	background: #f3f4f6;
}

.grantee-popup-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.grantee-popup-body {
	padding: 14px 16px 16px;
}

.grantee-popup-title {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #111;
	line-height: 1.3;
}

.grantee-popup-address,
.grantee-popup-years,
.grantee-popup-terms,
.grantee-popup-excerpt {
	font-size: 12px;
	color: #555;
	margin: 0 0 5px;
	line-height: 1.4;
}

.grantee-popup-years {
	color: #2563eb;
	font-weight: 500;
}

.grantee-popup-link {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 600;
	color: #2563eb;
	text-decoration: none;
	border-bottom: 1px solid rgba(37,99,235,0.25);
	transition: border-color 0.15s;
}

.grantee-popup-link:hover {
	border-bottom-color: #2563eb;
}

/* ── Awards list ─────────────────────────────────────────────── */
.grantee-popup-awards {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #f0f0f1;
}

.grantee-popup-awards-heading {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: #999;
	margin: 0 0 8px;
}

.grantee-popup-awards-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr auto auto;
	column-gap: 12px;
	row-gap: 6px;
	align-items: baseline;
}

.grantee-award-item {
	display: contents;
}

.grantee-award-title {
	font-size: 12px;
	font-weight: 500;
	color: #111;
	text-decoration: none;
	line-height: 1.3;
}

.grantee-award-title:hover {
	text-decoration: underline;
}

.grantee-award-year {
	font-size: 11px;
	color: #888;
	white-space: nowrap;
	text-align: right;
}

.grantee-award-amount {
	font-size: 11px;
	font-weight: 600;
	color: #111;
	white-space: nowrap;
	text-align: right;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media ( max-width: 600px ) {
	.grantee-map-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.grantee-filter-count {
		margin-left: 0;
	}

	.grantee-filter-group select {
		width: 100%;
	}
}
