/**
 * Overmountain Customizations frontend styles.
 * Version: 1.0.4
 */

/* Existing Stratum hotspot accessibility enhancements. */
.stratum-image-hotspot__dot[role="button"] {
	cursor: pointer;
}

.stratum-image-hotspot__dot[role="button"]:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
	border-radius: 999px;
}

/* Leaflet image map shortcode. */
.ovm-image-map-wrap {
	position: relative;
	width: 100%;
}

.ovm-image-map-instructions {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.ovm-image-map {
	width: 100%;
	height: 85vh;
	min-height: 560px;
	background: #f5f5f5;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 0.3rem;
	overflow: hidden;
}

.ovm-image-map:focus-visible,
.ovm-image-map .leaflet-container:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

.ovm-image-map-marker {
	display: flex !important;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	cursor: pointer;
}

.ovm-image-map-marker__dot {
	display: block;
	width: 20px;
	height: 20px;
	border-radius: 999px;
	background: #00d85a;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.ovm-image-map-marker:focus-visible,
.leaflet-marker-icon:focus-visible .ovm-image-map-marker__dot {
	outline: 2px solid #000;
	outline-offset: 4px;
}

.ovm-image-map-popup-title {
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.ovm-image-map-popup-content {
	line-height: 1.4;
}

.ovm-image-map-popup-link {
	display: inline-block;
	margin-top: 0.5rem;
}

/* Quick Find drawer. */
.ovm-image-map-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	width: min(420px, calc(100vw - 48px));
	transform: translateX(100%);
	transition: transform 220ms ease;
}

.ovm-image-map-drawer.is-open {
	transform: translateX(0);
}

.ovm-image-map-drawer__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border-left: 1px solid rgba(0, 0, 0, 0.15);
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.2);
}

.ovm-image-map-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.ovm-image-map-drawer__title {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.25;
}

.ovm-image-map-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.ovm-image-map-quick-find-tab {
	position: absolute;
	top: 50%;
	left: 0;
	width: 44px;
	height: 132px;
	padding: 0;
	transform: translate(-100%, -50%);
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-right: 0;
	border-radius: 0.3rem 0 0 0.3rem;
	background: #fff;
	color: inherit;
	font: inherit;
	font-weight: 700;
	box-shadow: -3px 2px 12px rgba(0, 0, 0, 0.18);
	cursor: pointer;
}

.ovm-image-map-quick-find-tab__text {
	position: absolute;
	top: 50%;
	left: 50%;
	display: block;
	white-space: nowrap;
	transform: translate(-50%, -50%) rotate(90deg);
	transform-origin: center center;
}

.ovm-image-map-quick-find-tab:hover,
.ovm-image-map-quick-find-tab:focus-visible,
.ovm-image-map-drawer__close:hover,
.ovm-image-map-drawer__close:focus-visible {
	border-color: rgba(0, 0, 0, 0.65);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.ovm-image-map-directory {
	margin: 0;
}

.ovm-image-map-directory:empty {
	display: none;
}

.ovm-image-map-directory__title {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
}

.ovm-image-map-directory__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ovm-image-map-drawer .ovm-image-map-directory {
	min-height: 0;
	overflow: auto;
	padding: 1rem;
}

.ovm-image-map-drawer .ovm-image-map-directory__list {
	grid-template-columns: 1fr;
}

.ovm-image-map-directory__button {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0.6rem 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 0.3rem;
	background: #fff;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.ovm-image-map-directory__button:hover,
.ovm-image-map-directory__button:focus-visible {
	border-color: rgba(0, 0, 0, 0.65);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}


.ovm-image-map-mobile-controls {
	display: none;
}

.ovm-image-map-mobile-control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.65rem 0.85rem;
	border: 1px solid rgba(0, 0, 0, 0.28);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-weight: 700;
	line-height: 1.1;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
	cursor: pointer;
}

.ovm-image-map-mobile-control:hover,
.ovm-image-map-mobile-control:focus-visible {
	border-color: rgba(0, 0, 0, 0.65);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15), 0 3px 12px rgba(0, 0, 0, 0.22);
}

.ovm-image-map-error,
.ovm-image-map-notice {
	padding: 0.75rem 1rem;
	border-left: 4px solid #b00020;
	background: #fff4f4;
}

@media (max-width: 767px) {
	.ovm-image-map {
		height: calc(100dvh - var(--ovm-map-instructions-height, 0px));
		min-height: 320px;
	}

	.ovm-image-map.is-interaction-locked {
		touch-action: pan-y !important;
	}

	.ovm-image-map.is-interaction-unlocked {
		touch-action: none;
	}

	.ovm-image-map-mobile-controls {
		position: absolute;
		right: 1rem;
		bottom: 1rem;
		z-index: 1000;
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 0.5rem;
		pointer-events: none;
	}

	.ovm-image-map-mobile-control {
		pointer-events: auto;
	}

	.ovm-image-map-drawer {
		width: calc(100vw - 48px);
	}
}
