/* =============================================================================
   Association Map Widget — blaek-am
   ============================================================================= */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.blaek-am {
	font-size: 1rem;
	line-height: 1.5;
	position: relative;
	z-index: 1;
}

/* Allow the map wrapper to visually break out of the Elementor column */
.elementor-widget-blaek_association_map,
.elementor-widget-blaek_association_map > .elementor-widget-container {
	overflow: visible !important;
}

/* Clip at the Elementor section/container level so the breakout doesn't
   cause a horizontal scrollbar on the page */
.elementor-element.e-parent:has(.elementor-widget-blaek_association_map) {
	overflow: hidden !important;
}

/* ── Search area ─────────────────────────────────────────────────────────── */
/* Crosslinks inside the panel (phase 3) */
.blaek-am__panel-link {
	color: var(--e-global-color-f733163, #0F7DC8);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.blaek-am__panel-link:hover,
.blaek-am__panel-link:focus {
	text-decoration: none;
	border-bottom-color: transparent;
}

.blaek-am__panel-counties {
	margin: 0 0 16px;
}

.blaek-am__panel-list {
	list-style: none;
	margin: 0.25rem 0 0;
	padding: 0;
	columns: 2;
	column-gap: 1.5rem;
}

.blaek-am__panel-list li {
	margin: 0 0 0.25rem;
	break-inside: avoid;
}

/* Optional info text under the heading */
.blaek-am__info {
	margin: 0 0 32px;
}

.blaek-am__info > :last-child {
	margin-bottom: 0;
}

.blaek-am__search {
	margin-bottom: 2rem;
}

/* Text input row */
.blaek-am__input-row {
	display: flex;
	align-items: stretch;
	box-shadow: 0 0 25px 0 rgba(0, 0, 0, 0.1);
}

.blaek-am__text-input {
	flex: 1 1 auto;
	height: 68px;
	padding: 0.65rem 20px;
	font-size: 1rem;
	border: 1px solid rgba(110, 120, 130, 1);
	border-right: none;
	border-radius: 0;
	outline: none;
	background: #fff;
	color: inherit;
	transition: border-color 0.15s;
}

.blaek-am__text-input:focus {
	border-color: var(--e-global-color-f733163, #0F7DC8);
}

.blaek-am__search-btn {
	flex: 0 0 68px;
	width: 68px;
	height: 68px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: #fff;
	color: #6e7882; /* quiet grey magnifier — no blue CTA shout */
	border: 1px solid rgba(110, 120, 130, 1);
	border-left: none; /* continues the input field's edge */
	border-radius: 0;
	cursor: pointer;
	transition: color 0.15s, background 0.15s;
}

.blaek-am__search-btn:hover {
	background: #f2f6fa; /* very subtle */
	color: #4a5560;
}

/* Keyboard focus stays clearly visible (BITV); mouse clicks stay quiet. */
.blaek-am__search-btn:focus {
	background-color: var(--e-global-color-f733163, #0F7DC8);
	color: #fff;
}

.blaek-am__search-btn:focus-visible {
	outline: 2px solid var(--e-global-color-f733163, #0F7DC8);
	outline-offset: -2px;
}

.blaek-am__search-btn svg {
	width: 20px;
	height: 20px;
}

/* "oder" separator */
.blaek-am__or {
	display: block;
	margin: 16px 0;
	color: #666;
	font-size: 0.9rem;
}

/* Dropdowns */
.blaek-am__dropdowns {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.blaek-am__select-wrap {
	position: relative;
}

.blaek-am__select {
	width: 100%;
}

/* ── Select2 overrides ───────────────────────────────────────────────────── */
.blaek-am .select2-container {
	width: 100% !important;
}

.blaek-am .select2-container--default .select2-selection--single {
	min-height: 68px;
	display: flex;
	align-items: center;
	padding: 0.65rem 20px;
	border: 1px solid #d0d0d0;
	border-radius: 0;
	font-size: 1rem;
	line-height: 1.5;
	background: #fff;
	box-shadow: 0 0 25px 0 rgba(0, 0, 0, 0.1);
	transition: border-color 0.15s;
}

.blaek-am .select2-container--default.select2-container--open .select2-selection--single,
.blaek-am .select2-container--default.select2-container--focus .select2-selection--single {
	border-color: var(--e-global-color-f733163, #0F7DC8);
	outline: none;
}

.blaek-am .select2-container--default .select2-selection--single .select2-selection__rendered {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
	color: var(--e-global-color-f733163, #0F7DC8);
	line-height: inherit;
	font-weight: 400;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.blaek-am .select2-container--default .select2-selection--single .select2-selection__placeholder {
	color: var(--e-global-color-97e2714, #085A9C);
}

.blaek-am .select2-container--default .select2-selection--single .select2-selection__arrow {
	top: 50%;
	right: 1rem;
	transform: translateY(-50%);
	height: auto;
	width: 16px;
}

.blaek-am .select2-container--default .select2-selection--single .select2-selection__arrow b {
	display: none;
}

.blaek-am .select2-container--default .select2-selection--single .select2-selection__arrow::after {
	content: '';
	display: block;
	width: 10px;
	height: 10px;
	border-right: 2px solid var(--e-global-color-f733163, #0F7DC8);
	border-bottom: 2px solid var(--e-global-color-f733163, #0F7DC8);
	transform: rotate(45deg) translateY(-3px);
}

.blaek-am .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow::after {
	transform: rotate(-135deg) translateY(-3px);
}

.blaek-am .select2-container--default .select2-selection--single .select2-selection__clear {
	position: static;
	display: inline-flex;
	align-items: center;
	align-self: center;
	flex-shrink: 0;
	order: -1;
	margin-right: 0.5rem;
	color: var(--e-global-color-f733163, #0F7DC8);
	font-size: 1.1rem;
	line-height: 1;
	height: auto;
}

.blaek-am .select2-dropdown {
	border: 1px solid #d0d0d0;
	border-top: none;
	border-radius: 0;
	font-size: 1rem;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.blaek-am .select2-container--default .select2-search--dropdown .select2-search__field {
	padding: 0.5rem 0.75rem;
	border: 1px solid #d0d0d0;
	border-radius: 0;
	font-size: 0.95rem;
}

.blaek-am .select2-container--default .select2-results__option {
	padding: 0.6rem 1rem;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.blaek-am .select2-container--default .select2-results__option--highlighted[aria-selected] {
	background-color: var(--e-global-color-f733163, #0F7DC8);
	color: #fff;
}

/* Reset row */
.blaek-am__reset-row {
	display: flex;
	justify-content: flex-end;
	margin-top: 16px;
}

.blaek-am__reset {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.9rem;
	color: var(--e-global-color-f733163, #0F7DC8);
	text-decoration: none;
	cursor: pointer;
}

.blaek-am__reset:hover {
	text-decoration: underline;
}

.blaek-am__reset-icon {
	flex-shrink: 0;
	display: inline-block;
	vertical-align: middle;
}

/* ── Map wrapper (receives full-width breakout from JS) ──────────────────── */
.blaek-am__map-wrapper {
	position: relative;
	overflow: hidden;
	/* width + margin-left set dynamically by JS */
}

/* ── Map container ───────────────────────────────────────────────────────── */
.blaek-am__map-container {
	position: relative;
	width: 100%;
	height: 600px;
}

.blaek-am__map-container .leaflet-control-attribution {
	display: none;
}

/* ── Custom marker ───────────────────────────────────────────────────────── */
.blaek-am__marker {
	width: 18px;
	height: 18px;
	background-color: var(--e-global-color-f733163, #0F7DC8);
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.blaek-am__marker:hover {
	transform: scale(1.4);
	background-color: #085A9C;
}

.blaek-am__marker--district {
	width: 22px;
	height: 22px;
	background-color: #085A9C;
}

.blaek-am__marker--active {
	background-color: #E87722;
	transform: scale(1.3);
}

.blaek-am__marker--active:hover {
	background-color: #E87722;
	transform: scale(1.4);
}

.blaek-am__marker--hidden {
	display: none !important;
	pointer-events: none;
}

/* ── Side panel ──────────────────────────────────────────────────────────── */
.blaek-am__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: 50%;
	height: 100%;
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(10px);
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
	z-index: 1000;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	pointer-events: none;
}

.blaek-am__panel.is-open {
	transform: translateX(0);
	pointer-events: auto;
}

.blaek-am__panel-close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	color: #666;
	border-radius: 4px;
	transition: color 0.15s, background 0.15s;
	flex-shrink: 0;
	z-index: 1;
}

.blaek-am__panel-close svg{
	width: 24px;
	fill: var(--e-global-color-95595b8, #003F72);
}

.blaek-am__panel-close:hover {
	color: var(--e-global-color-f733163, #0F7DC8);
	background: #f5f5f5;
}

.blaek-am__panel-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 70px 50px 50px;
	scrollbar-width: thin;
	scrollbar-color: #b8c2cc #eef2f5;
}

.blaek-am__panel-body::-webkit-scrollbar {
	width: 8px;
}

.blaek-am__panel-body::-webkit-scrollbar-track {
	background: #eef2f5;
	border-radius: 8px;
}

.blaek-am__panel-body::-webkit-scrollbar-thumb {
	background: #b8c2cc;
	border-radius: 8px;
}

.blaek-am__panel-body::-webkit-scrollbar-thumb:hover {
	background: #aab6c2;
}

/* ── Panel content ───────────────────────────────────────────────────────── */
.blaek-am__panel-name {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--e-global-color-f733163, #0F7DC8);
	margin: 0 2rem 1rem 0;
	line-height: 1.3;
}

.blaek-am__panel-address {
	font-style: normal;
	color: #444;
	margin-bottom: 0.75rem;
	line-height: 1.6;
}

.blaek-am__panel-field {
	margin: 0 0 0.5rem;
	color: #444;
}

.blaek-am__panel-label {
	font-weight: 600;
	margin-right: 0.25rem;
}

.blaek-am__panel-field a {
	color: var(--e-global-color-f733163, #0F7DC8);
	text-decoration: none;
}

.blaek-am__panel-field a:hover {
	text-decoration: underline;
}

.blaek-am__panel-roles {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #e5e5e5;
}

.blaek-am__panel-role {
	margin-bottom: 0.6rem;
}

.blaek-am__panel-role-label {
	display: block;
	margin-bottom: 0.15rem;
	font-weight: 600;
}

.blaek-am__panel-role-person {
	display: block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media screen and (max-width: 992px) {
	.blaek-am__panel-body{
		padding: 60px 30px 30px;
	}
}

@media (max-width: 767px) {
	.blaek-am__panel {
		top: auto;
		bottom: 0;
		right: 0;
		left: 0;
		width: 100%;
		height: auto;
		max-height: 50%;
		transform: translateY(100%);
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
		overflow-y: auto;
	}

	.blaek-am__panel.is-open {
		transform: translateY(0);
	}

	.blaek-am__panel-body {
		overflow-y: auto;
		padding: 50px 24px 24px;
	}

	.blaek-am__panel::after {
		content: '';
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: 60px;
		background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
		pointer-events: none;
		z-index: 1;
	}
}

@media (max-width: 640px) {
	.blaek-am__input-row,
	.blaek-am__dropdowns {
		max-width: 100%;
	}
}

/* ── Consent gate (cookieless, per session) ───────────────────────────── */
.blaek-am__consent {
	position: absolute;
	inset: 0;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: #f4f6f8;
	border-radius: 6px;
	text-align: center;
}
.blaek-am__consent-inner { max-width: 540px; }
.blaek-am__consent-text {
	margin: 0 0 1.25rem;
	font-size: 0.95rem;
	line-height: 1.5;
	color: #3a4248;
}
.blaek-am__consent-text a { text-decoration: underline; }
.blaek-am__consent-btn {
	display: inline-block;
	padding: 0.7rem 1.6rem;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: #0a6ebd;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}
.blaek-am__consent-btn:hover { background: #085a9c; }
.blaek-am__consent-btn:focus { background-color: var(--e-global-color-f733163, #0F7DC8); }
.blaek-am__consent[aria-busy="true"] .blaek-am__consent-btn { opacity: 0.6; cursor: progress; }

/* ── Typeahead suggestions ────────────────────────────────────────────── */
.blaek-am__input-row {
	position: relative;
}
.blaek-am__suggestions {
	position: absolute;
	top: calc( 100% + 4px );
	left: 0;
	right: 0;
	z-index: 1100;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid #dfe3e8;
	border-radius: 4px;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.12 );
	max-height: 320px;
	overflow-y: auto;
}
.blaek-am__suggestions[hidden] {
	display: none;
}
.blaek-am__suggestion {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0.55rem 0.9rem;
	cursor: pointer;
}
.blaek-am__suggestion:hover,
.blaek-am__suggestion:focus,
.blaek-am__suggestion.is-active {
	background: #f2f6fa;
	outline: none;
}
.blaek-am__suggestion-name {
	font-weight: 600;
	color: #0a3a5c;
}
.blaek-am__suggestion-sub {
	font-size: 0.85rem;
	color: #5b6770;
}
.blaek-am__suggestion--empty {
	cursor: default;
	color: #5b6770;
	font-size: 0.9rem;
}
.blaek-am__suggestion--empty:hover {
	background: transparent;
}

/* ── Views: map | list, switch buttons (phase 4) ─────────────────────────── */
.blaek-am__view[hidden] {
	display: none !important;
}

.blaek-am__view-switch {
	display: flex;
	margin: 0 0 24px;
}

.blaek-am .blaek-am__view-btn {
	padding: 0.65rem 1.5rem;
	border: 1px solid var(--e-global-color-f733163, #0F7DC8);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.8);
	color: var(--e-global-color-f733163, #0F7DC8);
	font: inherit;
	line-height: 1.5;
	white-space: normal;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.blaek-am .blaek-am__view-btn + .blaek-am__view-btn {
	border-left: 0;
}

.blaek-am .blaek-am__view-btn:hover,
.blaek-am .blaek-am__view-btn:focus {
	background: rgba(15, 125, 200, 0.1) !important;
	color: var(--e-global-color-f733163, #0F7DC8) !important;
	box-shadow: none !important;
}

.blaek-am .blaek-am__view-btn[aria-pressed="true"],
.blaek-am .blaek-am__view-btn[aria-pressed="true"]:hover,
.blaek-am .blaek-am__view-btn[aria-pressed="true"]:focus {
	background: var(--e-global-color-f733163, #0F7DC8) !important;
	color: #fff !important;
}

.blaek-am__view-btn:focus-visible {
	outline: 2px solid var(--e-global-color-f733163, #0F7DC8);
	outline-offset: 2px;
}

/* ── Tree list: districts → counties → delegates ─────────────────────────── */
.blaek-am__tree-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.blaek-am__tree-list--bv > .blaek-am__tree-item {
	border-bottom: 1px solid #979797;
}

.blaek-am__tree-list--kv {
	padding: 0 0 12px 1.75rem;
}

.blaek-am__tree-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding: 14px 0;
}

.blaek-am__tree-list--kv .blaek-am__tree-row {
	padding: 8px 0;
}

.blaek-am__tree-list--bv > .blaek-am__tree-item > .blaek-am__tree-row .blaek-am__tree-name {
	font-weight: 700;
}

.blaek-am .blaek-am__tree-toggle {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.6rem;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--e-global-color-f733163, #0F7DC8);
	font: inherit;
	line-height: inherit;
	text-align: left;
	white-space: normal;
	cursor: pointer;
}

.blaek-am .blaek-am__tree-toggle:hover,
.blaek-am .blaek-am__tree-toggle:focus {
	background: none !important;
	color: var(--e-global-color-f733163, #0F7DC8) !important;
	box-shadow: none !important;
	text-decoration: underline;
}

.blaek-am__tree-toggle:focus-visible {
	outline: 2px solid var(--e-global-color-f733163, #0F7DC8);
	outline-offset: 2px;
}

.blaek-am__tree-icon {
	flex-shrink: 0;
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-top: 0.55em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.15s;
}

.blaek-am__tree-toggle[aria-expanded="true"] .blaek-am__tree-icon {
	transform: rotate(45deg);
}

.blaek-am__tree-meta {
	display: inline-flex;
	flex-shrink: 0;
	align-items: baseline;
	gap: 1.25rem;
	font-size: 0.9rem;
	color: #666;
	white-space: nowrap;
}

.blaek-am__tree-count:empty {
	display: none;
}

.blaek-am__tree-map {
	color: var(--e-global-color-f733163, #0F7DC8);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.blaek-am__tree-map:hover,
.blaek-am__tree-map:focus {
	border-bottom-color: transparent;
}

.blaek-am__tree-people {
	padding: 0 0 12px 1.75rem;
}

.blaek-am__tree-people[hidden],
.blaek-am__tree-list[hidden] {
	display: none;
}

.blaek-am__tree-people-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.blaek-am__tree-people-list li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 1rem;
	padding: 6px 0;
	border-top: 1px solid #e3e3e3;
}

.blaek-am__tree-people-list li:first-child {
	border-top: 0;
}

.blaek-am__tree-person {
	font-weight: 600;
}

.blaek-am__tree-specialty {
	color: #555;
}

.blaek-am__tree-badge {
	display: inline-block;
	padding: 0.1em 0.5em;
	border: 1px solid var(--e-global-color-f733163, #0F7DC8);
	border-radius: 2px;
	font-size: 0.78rem;
	line-height: 1.4;
	color: var(--e-global-color-f733163, #0F7DC8);
}

.blaek-am__tree-loading,
.blaek-am__tree-empty,
.blaek-am__tree-error {
	margin: 0;
	padding: 6px 0;
	color: #666;
	font-style: italic;
}

/* Embedded delegate list under the map/list */
.blaek-am__delegates {
	margin-top: 48px;
}

@media (max-width: 767px) {
	.blaek-am__tree-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.35rem;
	}

	.blaek-am__tree-list--kv,
	.blaek-am__tree-people {
		padding-left: 1rem;
	}
}

/* "Karte anzeigen" repeated inside a panel that opened before consent */
.blaek-am .blaek-am__panel-consent {
	display: inline-block;
	margin: 0 0 16px;
	padding: 0.55rem 1.2rem;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	color: #fff !important;
	background: #0a6ebd !important;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.blaek-am .blaek-am__panel-consent:hover,
.blaek-am .blaek-am__panel-consent:focus {
	background: #085a9c !important;
	color: #fff !important;
}

.blaek-am .blaek-am__panel-consent:disabled {
	opacity: 0.6;
	cursor: progress;
}

/* Flat tree (delegates directly under the district): county after the specialty */
.blaek-am__tree-county {
	color: #555;
}

.blaek-am__tree-county::before {
	content: '·';
	margin-right: 1rem;
	color: #999;
}

.blaek-am__tree-badge--manual {
	color: #fff;
	background: #085A9C;
	border-color: #085A9C;
}
