/**
 * Dronah Map Projects – frontend styles
 */

.dmp-map-wrapper {
	--dmp-sidebar-width: 240px;
	--dmp-filter-bg: #f7f7f7;
	--dmp-filter-border: #e2e2e2;
	--dmp-filter-active: #1a1a1a;
	--dmp-pin-color: #1a1a1a;
	--dmp-pin-dot: #c0392b;
	--dmp-tooltip-bg: #ffffff;
	--dmp-tooltip-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	font-family: inherit;
	color: #333;
	max-width: 1200px;
	margin: 0 auto;
}

.dmp-map-heading {
	margin: 0 0 1.5rem;
	font-size: 1.75rem;
	font-weight: 600;
}

.dmp-map-layout {
	display: grid;
	grid-template-columns: var(--dmp-sidebar-width) 1fr;
	gap: 2rem;
	align-items: start;
}

.dmp-filter-title {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
}

.dmp-filter-group + .dmp-filter-group,
.dmp-multiselect + .dmp-multiselect {
	margin-top: 1.25rem;
}

.dmp-multiselect {
	position: relative;
}

.dmp-multiselect-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	width: 100%;
	padding: 0.6rem 0.75rem;
	margin: 0;
	border: 1px solid var(--dmp-filter-border);
	background: #fff;
	background-color: #fff;
	color: #333;
	font: inherit;
	font-size: 0.82rem;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dmp-multiselect-toggle:hover,
.dmp-multiselect-toggle:focus,
.dmp-multiselect-toggle:active,
.dmp-multiselect-toggle:focus-visible,
.dmp-multiselect.is-open .dmp-multiselect-toggle {
	background: #fff;
	background-color: #fff;
	color: #333;
	border-color: #999;
	outline: none;
	box-shadow: 0 0 0 1px #ddd;
}

.dmp-multiselect-text {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dmp-multiselect-chevron {
	flex: 0 0 10px;
	width: 10px;
	height: 10px;
	border-right: 2px solid #666;
	border-bottom: 2px solid #666;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.15s ease;
}

.dmp-multiselect.is-open .dmp-multiselect-chevron {
	transform: rotate(-135deg) translateY(-2px);
}

.dmp-multiselect-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 40;
	max-height: 240px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--dmp-filter-border);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.dmp-multiselect-menu[hidden] {
	display: none;
}

.dmp-multiselect-options {
	list-style: none;
	margin: 0;
	padding: 0.35rem 0;
}

.dmp-multiselect-option {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.45rem 0.75rem;
	font-size: 0.82rem;
	line-height: 1.35;
	color: #333;
	cursor: pointer;
}

.dmp-multiselect-option:hover {
	background: #f5f5f5;
}

.dmp-multiselect-option input {
	margin: 0.15rem 0 0;
	flex: 0 0 auto;
}

.dmp-multiselect-option span {
	flex: 1;
}

.dmp-multiselect-empty {
	margin: 0;
	padding: 0.75rem;
	font-size: 0.82rem;
	color: #777;
}

.dmp-clear-filters {
	margin-top: 1.25rem;
	padding: 0;
	border: 0;
	background: transparent;
	background-color: transparent;
	color: #666;
	font: inherit;
	font-size: 0.82rem;
	text-decoration: underline;
	cursor: pointer;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.dmp-clear-filters:hover,
.dmp-clear-filters:focus,
.dmp-clear-filters:active {
	background: transparent;
	background-color: transparent;
	color: #111;
	box-shadow: none;
	outline: none;
}

.dmp-map-wrapper .dmp-multiselect-toggle,
.dmp-map-wrapper .dmp-multiselect-toggle:hover,
.dmp-map-wrapper .dmp-multiselect-toggle:focus,
.dmp-map-wrapper .dmp-multiselect-toggle:active,
.dmp-map-wrapper .dmp-multiselect.is-open .dmp-multiselect-toggle {
	background: #fff !important;
	background-color: #fff !important;
	color: #333 !important;
}

.dmp-map-wrapper .dmp-clear-filters,
.dmp-map-wrapper .dmp-clear-filters:hover,
.dmp-map-wrapper .dmp-clear-filters:focus,
.dmp-map-wrapper .dmp-clear-filters:active {
	background: transparent !important;
	background-color: transparent !important;
}

.dmp-map-panel {
	position: relative;
	min-height: 520px;
	background: transparent;
}

.dmp-map-canvas {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 5;
	max-height: 720px;
	background: transparent;
	overflow: visible;
}

.dmp-map-canvas svg {
	display: block;
	width: 100%;
	height: 100%;
}

.dmp-map-canvas .dmp-map-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.dmp-map-canvas .dmp-state-label {
	font-size: 7px;
	fill: #555;
	font-family: Arial, Helvetica, sans-serif;
	pointer-events: none;
}

.dmp-pins-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.dmp-pin {
	position: absolute;
	transform: translate(-50%, -100%);
	pointer-events: auto;
	z-index: 2;
}

.dmp-pin.is-active {
	z-index: 30;
}

.dmp-pin-marker {
	display: block;
	position: relative;
	z-index: 2;
	width: 18px;
	height: 24px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	background-color: transparent;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
	color: var(--dmp-pin-state-color, var(--dmp-pin-color));
}

.dmp-pin-marker:hover,
.dmp-pin-marker:focus,
.dmp-pin-marker:active {
	background: transparent;
	background-color: transparent;
	box-shadow: none;
	outline: none;
}

.dmp-pin-marker:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
	border-radius: 2px;
}

.dmp-pin-icon {
	display: block;
	width: 18px;
	height: 24px;
	pointer-events: none;
}

.dmp-pin-icon path.pin-body {
	fill: var(--dmp-pin-state-color, var(--dmp-pin-color));
}

.dmp-pin-icon circle.pin-dot {
	fill: #ffffff;
	stroke: var(--dmp-pin-state-color, var(--dmp-pin-dot));
	stroke-width: 2px;
}

/* Outer wrapper: invisible padding bridges the gap down to the pin */
.dmp-pin-popover {
	position: absolute;
	left: 50%;
	bottom: calc(100% - 6px);
	transform: translateX(-50%) translateY(6px);
	width: 260px;
	max-width: min(260px, 70vw);
	padding-bottom: 30px;
	background: transparent;
	border: 0;
	box-shadow: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	pointer-events: none;
	z-index: 1;
}

.dmp-pin-popover-card {
	display: flex;
	align-items: stretch;
	background: var(--dmp-tooltip-bg);
	border: 1px solid #e8e8e8;
	box-shadow: var(--dmp-tooltip-shadow);
	border-radius: 4px;
	overflow: hidden;
}

.dmp-pin.is-active .dmp-pin-popover {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.dmp-pin-popover-image {
	flex: 0 0 88px;
	width: 88px;
	min-height: 72px;
	display: block;
	background: #eee;
	text-decoration: none;
	overflow: hidden;
}

.dmp-pin-popover-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dmp-pin-popover-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 72px;
	background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
}

.dmp-pin-popover-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.25rem;
	padding: 0.65rem 0.75rem;
	min-width: 0;
}

.dmp-pin-popover-title {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.35;
	color: #1a1a1a;
	text-decoration: none;
}

.dmp-pin-popover-title:hover,
.dmp-pin-popover-title:focus-visible {
	color: var(--dmp-pin-dot);
	text-decoration: underline;
	outline: none;
}

.dmp-pin-popover-image:hover img,
.dmp-pin-popover-image:focus-visible img {
	opacity: 0.92;
}

.dmp-pin-popover-image:focus-visible {
	outline: 2px solid var(--dmp-pin-dot);
	outline-offset: -2px;
}

.dmp-pin-popover-state {
	display: block;
	font-size: 0.72rem;
	line-height: 1.3;
	color: #777;
}

.dmp-map-empty {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: rgba(255, 255, 255, 0.88);
	font-size: 0.95rem;
	color: #666;
	text-align: center;
	z-index: 5;
	pointer-events: none;
}

.dmp-map-empty.is-visible {
	display: flex;
}

.dmp-map-canvas.is-loading .dmp-pins-layer {
	opacity: 0.45;
}

@media (max-width: 900px) {
	.dmp-map-layout {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.dmp-filters {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 1.5rem;
	}

	.dmp-map-canvas {
		max-height: 560px;
	}
}

@media (max-width: 600px) {
	.dmp-filters {
		grid-template-columns: 1fr;
	}
}
