/* Cervicide Regional Directors — interactive map (matches the page design mockup). */

.crd-map-wrap {
	--accent: #e2552c;
	--ink: #1a1a1a;
	--cream: #f5f3f0;
	--card: #ffffff;
	--border: #e5e1db;
	--portrait: #e8e4de;
	--muted: #a39d95;
	--muted-2: #8a8580;
	--placeholder: #cdc6bd;

	max-width: 1320px;
	margin: 0 auto;
	font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--ink);
}

/* ---- Stats bar ---- */
.crd-stats {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 44px;
	margin-bottom: 28px;
}
.crd-stat-num {
	font-family: 'Oswald', sans-serif;
	font-size: 48px;
	font-weight: 600;
	line-height: 0.9;
	color: var(--ink);
}
.crd-stat-label {
	display: block;
	color: var(--muted-2);
	font-size: 11px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	margin-top: 6px;
}

/* ---- Map ---- */
.crd-map-outer {
	position: relative; /* float card positions against this */
}
.crd-map {
	position: relative;
	width: 100%;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 32px 40px;
	overflow: hidden;
}
.crd-map svg.crd-us-map {
	width: 100%;
	height: auto;
	max-height: 620px;
	display: block;
	margin: 0 auto;
}

.crd-state {
	fill: var(--portrait);
	stroke: var(--card);
	stroke-width: 1;
	transition: fill 0.18s ease;
	cursor: pointer;
}
.crd-state:hover,
.crd-state:focus,
.crd-state.crd-active {
	fill: var(--accent);
	outline: none;
}
.crd-state.crd-unassigned {
	fill: #ece9e3;
	opacity: 0.55;
	pointer-events: none;
	cursor: default;
}

/* ---- Region overlay pill (top of map, on hover/focus) ---- */
.crd-region-pill {
	position: absolute;
	top: 18px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 6;
	background: var(--ink);
	color: #fff;
	font-family: 'Oswald', sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 8px 18px;
	border-radius: 100px;
	box-shadow: 0 6px 20px rgba(26, 26, 26, 0.18);
	pointer-events: none;
	white-space: nowrap;
}

/* ---- Floating hover card on the map ---- */
.crd-card--float {
	position: absolute;
	z-index: 5;
	width: 200px;
	max-width: 60%;
	pointer-events: none;
	box-shadow: 0 14px 32px rgba(26, 26, 26, 0.18);
}
@media (hover: none) {
	/* On touch devices the float card is tappable (tap → scroll to grid). */
	.crd-card--float {
		pointer-events: auto;
		cursor: pointer;
	}
}

/* ---- Director card (mockup design) — shared by float card + grid ---- */
.crd-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
	transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.crd-card-portrait {
	position: relative;
	aspect-ratio: 4 / 5;
	background: var(--portrait);
	overflow: hidden;
}
.crd-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.crd-card-badge {
	position: absolute;
	top: 0;
	left: 0;
	background: var(--accent);
	color: #fff;
	font-family: 'Oswald', sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	padding: 5px 13px;
}
.crd-card-body {
	padding: 16px 18px 18px;
}
.crd-card-region {
	font-family: 'Oswald', sans-serif;
	color: var(--accent);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	margin-bottom: 7px;
}
.crd-card-name {
	color: var(--ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	margin-bottom: 9px;
}
.crd-card-states {
	color: var(--muted);
	font-size: 12px;
	line-height: 1.55;
	text-wrap: pretty;
}

/* ---- Grid ---- */
.crd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
	gap: 22px;
	margin-top: 40px;
}
.crd-grid .crd-card {
	cursor: pointer;
}
.crd-grid .crd-card:hover,
.crd-grid .crd-card.crd-active {
	border-color: var(--accent);
	transform: translateY(-4px);
	box-shadow: 0 14px 32px rgba(26, 26, 26, 0.12);
}

/* ---- Login gate ---- */
.crd-login-gate {
	max-width: 480px;
	margin: 2rem auto;
	font-family: 'Rubik', sans-serif;
}
.crd-login-card {
	background: var(--cream, #f5f3f0);
	border: 1px solid var(--border, #e5e1db);
	border-radius: 8px;
	padding: 2.5rem 2rem;
	text-align: center;
}
.crd-login-card h2 {
	font-family: 'Oswald', sans-serif;
	color: var(--ink, #1a1a1a);
}
.crd-login-button {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 12px 28px;
	background: var(--accent, #e2552c);
	color: #fff;
	border-radius: 6px;
	font-weight: 700;
	text-decoration: none;
}

/* ---- Responsive ---- */
@media (max-width: 781px) {
	/* Hide the region pill on mobile (too cramped); float card stays — JS shows it on first tap. */
	.crd-region-pill {
		display: none !important;
	}
	.crd-map {
		padding: 16px;
	}
	.crd-stat-num {
		font-size: 38px;
	}

	/* Compact float card on mobile: a short horizontal row (thumb + text) so it
	   always fits inside the small map window instead of a tall portrait card. */
	.crd-card--float {
		display: flex;
		align-items: stretch;
		width: auto;
		max-width: 88%;
		max-height: 90%;
	}
	.crd-card--float .crd-card-portrait {
		flex: 0 0 84px;
		width: 84px;
		aspect-ratio: auto;       /* drop the 4:5 ratio — match the row height */
		align-self: stretch;
	}
	.crd-card--float .crd-card-badge {
		font-size: 10px;
		letter-spacing: 0.5px;
		padding: 3px 8px;
	}
	.crd-card--float .crd-card-body {
		padding: 10px 12px;
		min-width: 0;             /* allow text to wrap/ellipsis inside flex */
		flex: 1 1 auto;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}
	.crd-card--float .crd-card-region {
		font-size: 10px;
		letter-spacing: 1px;
		margin-bottom: 3px;
	}
	.crd-card--float .crd-card-name {
		font-size: 14px;
		margin-bottom: 4px;
	}
	.crd-card--float .crd-card-states {
		font-size: 11px;
		line-height: 1.4;
		/* keep the card short: clamp states to 2 lines */
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
}
