/* Hospice East Bay service area map */

.heb-sa {
	--heb-sa-primary: #0f2c70;
	--heb-sa-accent: #e58e47;
	--heb-sa-third: #3f8a7e;
	--heb-sa-ink: #17213d;
	--heb-sa-muted: #5b6479;
	--heb-sa-line: rgba(15, 44, 112, 0.14);
	--heb-sa-soft: #f6f3ee;
	--heb-sa-surface: #ffffff;
	--heb-sa-radius: 18px;
	--heb-sa-c-alameda: var(--heb-sa-accent);
	--heb-sa-c-contra-costa: var(--heb-sa-primary);
	--heb-sa-c-solano-napa: var(--heb-sa-third);
	--heb-sa-label: 10.5px;
	color: var(--heb-sa-ink);
	font: inherit;
	line-height: 1.5;
	margin: 0 auto;
	max-width: 1180px;
	display: grid;
	gap: clamp(20px, 3vw, 32px);
	/* Layout follows the width of the column the map sits in, not the browser window. */
	container-type: inline-size;
	container-name: heb-sa;
}

.heb-sa *,
.heb-sa *::before,
.heb-sa *::after {
	box-sizing: border-box;
}

/* Neutralize theme button and list styles inside the component. */
.heb-sa button {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	font: inherit;
	letter-spacing: normal;
	line-height: 1.2;
	margin: 0;
	min-height: 0;
	padding: 0;
	text-align: inherit;
	text-decoration: none;
	text-transform: none;
	width: auto;
}

.heb-sa ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.heb-sa li {
	margin: 0;
	padding: 0;
}

.heb-sa li::before,
.heb-sa li::marker {
	content: none;
}

.heb-sa button:focus-visible,
.heb-sa a:focus-visible,
.heb-sa input:focus-visible {
	outline: 3px solid var(--heb-sa-accent);
	outline-offset: 2px;
}

/* Header and lookup */

.heb-sa__head {
	display: grid;
	gap: 20px;
	align-items: end;
}

@container heb-sa (min-width: 760px) {
	.heb-sa__head {
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
		gap: 48px;
	}
}

.heb-sa__eyebrow {
	color: var(--heb-sa-accent);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.heb-sa .heb-sa__title {
	color: var(--heb-sa-primary);
	font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
	line-height: 1.12;
	margin: 0 0 10px;
	text-wrap: balance;
}

.heb-sa__intro {
	color: var(--heb-sa-muted);
	font-size: 1.0625rem;
	margin: 0;
	max-width: 52ch;
}

.heb-sa__search {
	margin: 0;
	visibility: hidden;
}

.heb-sa.is-ready .heb-sa__search {
	visibility: visible;
}

.heb-sa__search-label {
	display: block;
	font-weight: 700;
	margin-bottom: 8px;
}

.heb-sa__combo {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--heb-sa-surface);
	border: 1.5px solid var(--heb-sa-line);
	border-radius: 999px;
	box-shadow: 0 1px 2px rgba(15, 44, 112, 0.06), 0 8px 24px -12px rgba(15, 44, 112, 0.25);
	padding: 5px 5px 5px 46px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.heb-sa__combo:focus-within {
	border-color: var(--heb-sa-primary);
	box-shadow: 0 0 0 4px rgba(15, 44, 112, 0.12), 0 8px 24px -12px rgba(15, 44, 112, 0.3);
}

.heb-sa__search-icon {
	position: absolute;
	left: 17px;
	top: 50%;
	width: 20px;
	height: 20px;
	transform: translateY(-50%);
	fill: none;
	stroke: var(--heb-sa-muted);
	stroke-width: 2;
	stroke-linecap: round;
}

.heb-sa .heb-sa__input {
	appearance: none;
	background: transparent;
	border: 0;
	box-shadow: none;
	color: var(--heb-sa-ink);
	flex: 1;
	font: inherit;
	font-size: 1.0625rem;
	height: 46px;
	margin: 0;
	min-width: 0;
	outline: 0;
	padding: 0 8px 0 0;
	width: 100%;
}

.heb-sa .heb-sa__input:focus-visible {
	outline: 0;
}

.heb-sa .heb-sa__input::placeholder {
	color: #8a91a3;
	opacity: 1;
}

.heb-sa .heb-sa__submit {
	background: var(--heb-sa-primary);
	border-radius: 999px;
	color: #fff;
	flex: none;
	font-weight: 700;
	height: 46px;
	padding: 0 22px;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.heb-sa .heb-sa__submit:hover {
	background: color-mix(in srgb, var(--heb-sa-primary) 82%, #000);
}

.heb-sa .heb-sa__submit:active {
	transform: scale(0.97);
}

.heb-sa__listbox {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 20;
	background: var(--heb-sa-surface);
	border: 1px solid var(--heb-sa-line);
	border-radius: 16px;
	box-shadow: 0 18px 40px -16px rgba(15, 44, 112, 0.35);
	max-height: 280px;
	overflow-y: auto;
	padding: 6px;
}

.heb-sa__listbox[hidden] {
	display: none;
}

.heb-sa .heb-sa__option {
	align-items: center;
	border-radius: 10px;
	cursor: pointer;
	display: flex;
	gap: 10px;
	justify-content: space-between;
	padding: 10px 12px;
}

.heb-sa .heb-sa__option[aria-selected="true"],
.heb-sa .heb-sa__option:hover {
	background: var(--heb-sa-soft);
}

.heb-sa__option mark {
	background: none;
	color: var(--heb-sa-primary);
	font-weight: 700;
}

.heb-sa__option-county {
	color: var(--heb-sa-muted);
	font-size: 0.8125rem;
	white-space: nowrap;
}

.heb-sa__result {
	font-size: 0.975rem;
	margin: 12px 4px 0;
	min-height: 1.5em;
}

.heb-sa__result:empty {
	margin-top: 0;
}

.heb-sa__result.is-yes,
.heb-sa__result.is-no {
	align-items: flex-start;
	display: flex;
	gap: 10px;
}

.heb-sa__result.is-yes::before,
.heb-sa__result.is-no::before {
	border-radius: 50%;
	color: #fff;
	content: "\2713";
	display: grid;
	flex: none;
	font-size: 13px;
	font-weight: 700;
	height: 22px;
	margin-top: 1px;
	place-items: center;
	width: 22px;
}

.heb-sa__result.is-yes::before {
	background: #2f855a;
}

.heb-sa__result.is-no::before {
	background: var(--heb-sa-accent);
	content: "?";
}

.heb-sa__result a {
	color: var(--heb-sa-primary);
	font-weight: 700;
	white-space: nowrap;
}

/* Map */

.heb-sa__stage {
	position: relative;
}

.heb-sa__figure {
	aspect-ratio: 792 / 612;
	background: #dce9f1;
	border-radius: var(--heb-sa-radius);
	box-shadow: 0 1px 2px rgba(15, 44, 112, 0.08), 0 30px 60px -30px rgba(15, 44, 112, 0.45);
	isolation: isolate;
	margin: 0;
	overflow: hidden;
	position: relative;
}

.heb-sa__svg {
	display: block;
	height: 100%;
	width: 100%;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.heb-sa__base {
	transition: opacity 0.45s ease;
}

.heb-sa[data-style="satellite"] .heb-sa__base--illustrated,
.heb-sa[data-style="illustrated"] .heb-sa__base--satellite {
	opacity: 0;
	pointer-events: none;
}

.heb-sa__water {
	fill: #d7e7f0;
}

.heb-sa__land {
	fill: #f4efe6;
}

.heb-sa__county-lines {
	fill: none;
	stroke: #c6bba7;
	stroke-dasharray: 3 3;
	stroke-width: 0.9;
	vector-effect: non-scaling-stroke;
}

.heb-sa__dim {
	fill: rgba(9, 16, 38, 0.42);
	pointer-events: none;
	transition: fill 0.45s ease;
}

.heb-sa[data-style="illustrated"] .heb-sa__dim {
	fill: rgba(244, 239, 230, 0.35);
}

.heb-sa__region {
	cursor: pointer;
	fill: var(--heb-sa-region, var(--heb-sa-primary));
	fill-opacity: 0.16;
	stroke: none;
	transition: fill-opacity 0.25s ease;
}

.heb-sa__region[data-region="alameda"] { --heb-sa-region: var(--heb-sa-c-alameda); }
.heb-sa__region[data-region="contra-costa"] { --heb-sa-region: var(--heb-sa-c-contra-costa); }
.heb-sa__region[data-region="solano-napa"] { --heb-sa-region: var(--heb-sa-c-solano-napa); }

.heb-sa[data-style="illustrated"] .heb-sa__region {
	fill-opacity: 0.32;
}

.heb-sa__region.is-hover {
	fill-opacity: 0.4;
}

.heb-sa[data-style="illustrated"] .heb-sa__region.is-hover {
	fill-opacity: 0.5;
}

.heb-sa.has-selection .heb-sa__region {
	fill-opacity: 0.05;
}

.heb-sa.has-selection .heb-sa__region.is-selected {
	fill-opacity: 0.34;
}

.heb-sa[data-style="illustrated"].has-selection .heb-sa__region {
	fill-opacity: 0.14;
}

.heb-sa[data-style="illustrated"].has-selection .heb-sa__region.is-selected {
	fill-opacity: 0.48;
}

.heb-sa__outline,
.heb-sa__split {
	fill: none;
	pointer-events: none;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.heb-sa__outline {
	stroke: #fff;
	stroke-width: 2.5;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.heb-sa__split {
	stroke: rgba(255, 255, 255, 0.85);
	stroke-dasharray: 5 4;
	stroke-width: 1.5;
}

.heb-sa[data-style="illustrated"] .heb-sa__outline {
	filter: none;
	stroke: var(--heb-sa-primary);
	stroke-width: 1.75;
}

.heb-sa[data-style="illustrated"] .heb-sa__split {
	stroke: var(--heb-sa-primary);
	stroke-opacity: 0.55;
}

/* City labels: Rico's yellow on satellite, navy on the illustrated map. */

.heb-sa__label {
	dominant-baseline: central;
	fill: #fed828;
	font-family: inherit;
	font-size: var(--heb-sa-label);
	font-weight: 700;
	letter-spacing: 0.01em;
	paint-order: stroke;
	pointer-events: none;
	stroke: rgba(18, 18, 22, 0.88);
	stroke-linejoin: round;
	stroke-width: 0.28em;
	text-anchor: middle;
	transition: opacity 0.25s ease, fill 0.25s ease;
}

.heb-sa[data-style="illustrated"] .heb-sa__label {
	fill: var(--heb-sa-ink);
	stroke: rgba(255, 255, 255, 0.92);
}

.heb-sa.is-compact .heb-sa__label {
	opacity: 0;
}

.heb-sa.has-selection .heb-sa__label {
	opacity: 0.25;
}

.heb-sa.has-selection .heb-sa__label.in-selection,
.heb-sa .heb-sa__label.is-active {
	opacity: 1;
}

.heb-sa .heb-sa__label.is-active {
	fill: #fff;
	stroke: var(--heb-sa-primary);
}

.heb-sa[data-style="illustrated"] .heb-sa__label.is-active {
	fill: var(--heb-sa-primary);
	stroke: #fff;
}

.heb-sa__ping {
	opacity: 0;
	pointer-events: none;
}

.heb-sa__ping.is-on {
	opacity: 1;
}

.heb-sa__ping-dot {
	fill: var(--heb-sa-accent);
	stroke: #fff;
	stroke-width: 1.5;
	vector-effect: non-scaling-stroke;
}

.heb-sa__ping-ring {
	fill: none;
	stroke: var(--heb-sa-accent);
	stroke-width: 2.5;
	transform-box: fill-box;
	transform-origin: center;
	vector-effect: non-scaling-stroke;
}

.heb-sa__ping.is-on .heb-sa__ping-ring {
	animation: heb-sa-ping 1.8s ease-out infinite;
}

@keyframes heb-sa-ping {
	from { opacity: 0.95; transform: scale(0.35); }
	to { opacity: 0; transform: scale(1.6); }
}

/* Map controls */

.heb-sa__toolbar {
	display: flex;
	gap: 8px;
	position: absolute;
	right: 12px;
	top: 12px;
	visibility: hidden;
}

.heb-sa.is-ready .heb-sa__toolbar {
	visibility: visible;
}

.heb-sa__toggle,
.heb-sa .heb-sa__reset {
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	background: rgba(255, 255, 255, 0.9);
	border-radius: 999px;
	box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45);
}

.heb-sa__toggle {
	display: flex;
	padding: 3px;
}

.heb-sa .heb-sa__toggle button {
	border-radius: 999px;
	color: var(--heb-sa-ink);
	font-size: 0.8125rem;
	font-weight: 700;
	padding: 7px 13px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.heb-sa .heb-sa__toggle button[aria-pressed="true"] {
	background: var(--heb-sa-primary);
	color: #fff;
}

.heb-sa .heb-sa__reset {
	align-items: center;
	color: var(--heb-sa-ink);
	display: inline-flex;
	font-size: 0.8125rem;
	font-weight: 700;
	gap: 6px;
	padding: 8px 13px;
}

.heb-sa .heb-sa__reset[hidden] {
	display: none;
}

.heb-sa__reset svg {
	fill: none;
	height: 15px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.2;
	width: 15px;
}

.heb-sa__legend {
	bottom: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	left: 12px;
	position: absolute;
	right: 140px;
}

.heb-sa .heb-sa__legend-item {
	align-items: center;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	background: rgba(255, 255, 255, 0.9);
	border-radius: 999px;
	box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45);
	color: var(--heb-sa-ink);
	display: inline-flex;
	font-size: 0.8125rem;
	font-weight: 700;
	gap: 8px;
	padding: 7px 13px 7px 9px;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.heb-sa .heb-sa__legend-item:hover {
	background: #fff;
}

.heb-sa .heb-sa__legend-item:active {
	transform: scale(0.97);
}

.heb-sa .heb-sa__legend-item[aria-pressed="true"] {
	background: var(--heb-sa-ink);
	color: #fff;
}

.heb-sa__swatch {
	background: var(--heb-sa-swatch, var(--heb-sa-primary));
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
	display: inline-block;
	flex: none;
	height: 14px;
	width: 14px;
}

[data-region="alameda"] > .heb-sa__swatch,
[data-region="alameda"] .heb-sa__county-title .heb-sa__swatch { --heb-sa-swatch: var(--heb-sa-c-alameda); }
[data-region="contra-costa"] > .heb-sa__swatch,
[data-region="contra-costa"] .heb-sa__county-title .heb-sa__swatch { --heb-sa-swatch: var(--heb-sa-c-contra-costa); }
[data-region="solano-napa"] > .heb-sa__swatch,
[data-region="solano-napa"] .heb-sa__county-title .heb-sa__swatch { --heb-sa-swatch: var(--heb-sa-c-solano-napa); }

.heb-sa__credit {
	bottom: 6px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 10px;
	pointer-events: none;
	position: absolute;
	right: 10px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.heb-sa[data-style="illustrated"] .heb-sa__credit {
	color: var(--heb-sa-muted);
	text-shadow: none;
}

.heb-sa[data-style="satellite"] .heb-sa__credit--illustrated,
.heb-sa[data-style="illustrated"] .heb-sa__credit--satellite {
	display: none;
}

.heb-sa__tooltip {
	background: var(--heb-sa-ink);
	border-radius: 10px;
	box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.875rem;
	left: 0;
	line-height: 1.3;
	padding: 8px 12px;
	pointer-events: none;
	position: absolute;
	top: 0;
	transform: translate(-50%, calc(-100% - 14px));
	white-space: nowrap;
	z-index: 5;
}

.heb-sa__tooltip strong {
	display: block;
}

.heb-sa__tooltip span {
	color: rgba(255, 255, 255, 0.75);
	font-size: 0.8125rem;
}

.heb-sa__tooltip[hidden] {
	display: none;
}

@container heb-sa (max-width: 640px) {
	.heb-sa__figure {
		border-radius: 14px;
	}

	.heb-sa__stage {
		margin-inline: -4px;
	}

	.heb-sa__legend {
		bottom: auto;
		left: 0;
		margin-top: 10px;
		overflow-x: auto;
		position: static;
		flex-wrap: nowrap;
		padding: 2px 2px 6px;
		right: auto;
		scrollbar-width: none;
	}

	.heb-sa .heb-sa__legend-item {
		background: var(--heb-sa-soft);
		box-shadow: none;
		flex: none;
	}

	.heb-sa__toolbar {
		right: 8px;
		top: 8px;
	}

	.heb-sa .heb-sa__toggle button,
	.heb-sa .heb-sa__reset {
		font-size: 0.75rem;
		padding: 6px 10px;
	}

}

/* County lists */

.heb-sa__counties {
	display: grid;
	gap: 16px;
}

@container heb-sa (min-width: 760px) {
	.heb-sa__counties {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Alameda and Solano & Napa share the first row; Contra Costa, the longest list, runs full width below. */
	.heb-sa__county[data-region="contra-costa"] {
		grid-column: 1 / -1;
		grid-row: 2;
	}
}

@container heb-sa (min-width: 1040px) {
	.heb-sa__counties {
		grid-template-columns: 1fr 2fr 0.8fr;
	}

	.heb-sa__county[data-region="contra-costa"] {
		grid-column: auto;
		grid-row: auto;
	}
}

.heb-sa__county {
	background: var(--heb-sa-surface);
	border: 1px solid var(--heb-sa-line);
	border-radius: 16px;
	padding: 20px;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.heb-sa__county.is-selected {
	border-color: var(--heb-sa-primary);
	box-shadow: 0 0 0 3px rgba(15, 44, 112, 0.1);
}

.heb-sa .heb-sa__county-title {
	align-items: center;
	color: var(--heb-sa-ink);
	display: flex;
	flex-wrap: wrap;
	font-size: 1.125rem;
	gap: 4px 10px;
	line-height: 1.3;
	margin: 0 0 14px;
}

.heb-sa__county-count {
	color: var(--heb-sa-muted);
	font-size: 0.875rem;
	font-weight: 400;
	margin-left: auto;
}

.heb-sa__cities {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.heb-sa .heb-sa__city {
	background: var(--heb-sa-soft);
	border-radius: 999px;
	color: var(--heb-sa-ink);
	font-size: 0.9375rem;
	padding: 7px 13px;
	transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.heb-sa .heb-sa__city:hover {
	background: color-mix(in srgb, var(--heb-sa-primary) 10%, #fff);
	color: var(--heb-sa-primary);
}

.heb-sa .heb-sa__city.is-active {
	background: var(--heb-sa-primary);
	color: #fff;
}

.heb-sa:not(.is-ready) .heb-sa__city {
	cursor: default;
}

/* Call to action */

.heb-sa__cta {
	align-items: center;
	background: var(--heb-sa-primary);
	border-radius: var(--heb-sa-radius);
	color: #fff;
	display: grid;
	gap: 16px 32px;
	padding: clamp(20px, 3vw, 28px) clamp(20px, 4vw, 36px);
}

@container heb-sa (min-width: 760px) {
	.heb-sa__cta {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

.heb-sa__cta-text {
	font-size: 1.0625rem;
	margin: 0;
	max-width: 60ch;
}

.heb-sa__cta-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.heb-sa .heb-sa__btn {
	align-items: center;
	border-radius: 999px;
	display: inline-flex;
	font-weight: 700;
	gap: 8px;
	padding: 12px 22px;
	text-decoration: none;
	transition: transform 0.1s ease, background-color 0.15s ease;
	white-space: nowrap;
}

.heb-sa .heb-sa__btn:active {
	transform: scale(0.97);
}

.heb-sa .heb-sa__btn svg {
	fill: currentColor;
	height: 18px;
	width: 18px;
}

.heb-sa .heb-sa__btn--primary {
	background: var(--heb-sa-accent);
	color: #fff;
}

.heb-sa .heb-sa__btn--primary:hover {
	background: color-mix(in srgb, var(--heb-sa-accent) 85%, #000);
	color: #fff;
}

.heb-sa .heb-sa__btn--ghost {
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6);
	color: #fff;
}

.heb-sa .heb-sa__btn--ghost:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.heb-sa .heb-sa__cta a:focus-visible {
	outline-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.heb-sa *,
	.heb-sa *::before,
	.heb-sa *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.heb-sa__ping.is-on .heb-sa__ping-ring {
		animation: none;
		opacity: 0.8;
	}
}

.heb-sa:not(.is-ready) .heb-sa__legend {
	visibility: hidden;
}

.heb-sa.is-compact .heb-sa__label:not(.is-active) {
	opacity: 0;
}

/*
 * Theme guard. The site's Elementor kit styles every button on hover and focus
 * (white background, navy text). These rules keep the map's own button colors.
 */
.heb-sa .heb-sa__submit:is(:hover, :focus) {
	color: #fff;
}

.heb-sa .heb-sa__submit:focus:not(:hover) {
	background: var(--heb-sa-primary);
}

.heb-sa .heb-sa__reset:is(:hover, :focus) {
	background: #fff;
	color: var(--heb-sa-ink);
}

.heb-sa .heb-sa__toggle button:is(:hover, :focus):not([aria-pressed="true"]) {
	background: rgba(15, 44, 112, 0.08);
	color: var(--heb-sa-ink);
}

.heb-sa .heb-sa__legend-item:is(:hover, :focus):not([aria-pressed="true"]) {
	background: #fff;
	color: var(--heb-sa-ink);
}

.heb-sa .heb-sa__city:focus:not(:hover):not(.is-active) {
	background: var(--heb-sa-soft);
	color: var(--heb-sa-ink);
}
