/* ==========================================================================
   FHG Lageplan v1.7.4
   Titel (H2 SangBleu Kingdom italic) unten links, Pin-SVG Popup
   Mobile: Inner-Viewport scrollt horizontal innerhalb des Frame-Containers
   ========================================================================== */

/* --- Map Container --- */

.fhg-lageplan {
	position: relative;
	width: 100%;
	overflow: visible;
	border-radius: 12px;
}

.fhg-lageplan__viewport {
	position: relative;
	width: 100%;
	height: 100%;
}

.fhg-lageplan__canvas {
	position: relative;
	width: 100%;
	height: 100%;
}

.fhg-lageplan__image {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	object-fit: cover !important;
}

/* --- Titel (unten links) --- */

.fhg-lageplan__title {
	position: absolute;
	bottom: 200px;
	left: 32px;
	z-index: 5;
	margin: 0;
	font-family: 'SangBleu Kingdom', serif;
	font-weight: 500;
	font-style: italic;
	font-size: 100px;
	line-height: 100px;
	letter-spacing: -2px;
	color: #0D2102;
	pointer-events: none;
}

@media (max-width: 1024px) {
	.fhg-lageplan__title {
		font-size: 60px;
		line-height: 60px;
		bottom: 20px;
		left: 24px;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.fhg-lageplan {
		aspect-ratio: 1 / 1 !important;
	}
}

@media (max-width: 767px) {
	.fhg-lageplan {
		aspect-ratio: auto !important;
		height: 660px !important;
		overflow: hidden;
		width: 100%;
		max-width: 100%;
	}

	.fhg-lageplan__title {
		font-size: 42px;
		line-height: 42px;
		bottom: 60px;
		left: 16px;
	}

	.fhg-lageplan__spot {
		left: var(--fhg-x-m, var(--fhg-x));
		top: var(--fhg-y-m, var(--fhg-y));
	}
}

/* --- Spot (Marker + Popup Wrapper) --- */

.fhg-lageplan__spot {
	position: absolute;
	left: var(--fhg-x);
	top: var(--fhg-y);
	transform: translate(-50%, -100%);
	z-index: 10;
}

.fhg-lageplan__spot.is-active {
	z-index: 100;
}

/* --- Marker Button --- */

.fhg-lageplan__marker,
button.fhg-lageplan__marker,
.fhg-lageplan__marker[type="button"] {
	display: block;
	padding: 0;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.35s cubic-bezier(0.33, 0, 0.2, 1);
	transform-origin: center bottom;
}

.fhg-lageplan__marker:hover {
	transform: scale(1.15);
}

.fhg-lageplan__spot.is-active .fhg-lageplan__marker {
	opacity: 0;
	pointer-events: none;
}

.fhg-lageplan__pin {
	display: block;
	width: 100%;
	height: auto;
}

/* --- Popup (Pin-Form mit SVG-Background) --- */

.fhg-lageplan__popup {
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%) scale(0.5);
	transform-origin: center bottom;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	background: transparent !important;
	transition: opacity 0.4s cubic-bezier(0.33, 0, 0.2, 1),
	            transform 0.4s cubic-bezier(0.33, 0, 0.2, 1),
	            visibility 0s linear 0.4s;
}

.fhg-lageplan__spot.is-active .fhg-lageplan__popup {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) scale(1);
	transition: opacity 0.4s cubic-bezier(0.33, 0, 0.2, 1),
	            transform 0.4s cubic-bezier(0.33, 0, 0.2, 1),
	            visibility 0s linear 0s;
}

/* SVG Pin-Shape als Hintergrund (fuellt den gesamten Popup-Container) */
.fhg-lageplan__popup-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

/* Feste Groesse aus Figma (offen.svg: 197 x 325) */
.fhg-lageplan__popup {
	width: 197px;
	aspect-ratio: 197 / 325;
}

/* SVG haelt exakte Proportionen */
.fhg-lageplan__popup-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

/* Content sitzt im oberen gerundeten Bereich */
.fhg-lageplan__popup-inner {
	position: relative;
	z-index: 1;
	padding: 60px 25px 0;
	width: 100%;
	box-sizing: border-box;
}

/* --- Popup Title (Poppins Medium, unterstrichen, zentriert) --- */

.fhg-lageplan__popup-title {
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	font-size: 16px;
	line-height: 28px;
	letter-spacing: -0.16px;
	margin-bottom: 5px;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --- Popup Description (Poppins Light, zentriert) --- */

.fhg-lageplan__popup-desc {
	font-family: 'Poppins', sans-serif;
	font-weight: 300;
	font-size: 16px;
	line-height: 22px;
	letter-spacing: -0.16px;
	text-align: center;
}

.fhg-lageplan__popup-desc p {
	margin: 0 0 8px;
}

.fhg-lageplan__popup-desc p:last-child {
	margin-bottom: 0;
}

/* --- Popup Link --- */

.fhg-lageplan__popup-link {
	display: inline-block;
	margin-top: 12px;
	font-family: 'Poppins', sans-serif;
	font-weight: 500;
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
	color: inherit;
	transition: opacity 0.2s ease;
}

.fhg-lageplan__popup-link:hover {
	opacity: 0.75;
}

/* --- Focus visible --- */

.fhg-lageplan__marker:focus-visible {
	outline: 2px solid #F4EE8F;
	outline-offset: 4px;
	border-radius: 50%;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
	.fhg-lageplan__popup-title {
		font-size: 15px;
	}

	.fhg-lageplan__popup-desc {
		font-size: 14px;
		line-height: 20px;
	}
}

@media (max-width: 767px) {
	/* Mobile: Karte ist breiter als Frame, viewport pannt horizontal */
	.elementor-widget-fhg_lageplan {
		width: 100%;
		max-width: 100%;
		overflow: hidden;
	}

	.fhg-lageplan__viewport {
		width: 100%;
		height: 100%;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
	}

	.fhg-lageplan__canvas {
		width: max-content;
		height: 100%;
	}

	.fhg-lageplan__image {
		width: auto !important;
		height: 100% !important;
		max-width: none !important;
		object-fit: contain !important;
	}

	.fhg-lageplan__marker {
		width: 36px !important;
	}

	.fhg-lageplan__spot.is-active .fhg-lageplan__popup {
		transform: translateX(-50%) scale(0.7);
	}

	/* Scrollbar anpassen */
	/* Webkit (Chrome, Safari, Edge) */
	.fhg-lageplan__viewport::-webkit-scrollbar {
	height: 10px!important; 
	}

	.fhg-lageplan__viewport::-webkit-scrollbar-track {
	background: #C4C9AD;
	border-radius: 6px;
	}

	.fhg-lageplan__viewport::-webkit-scrollbar-thumb {
	background-color: #7F8951; 
	border-radius: 6px;
	border: 2px solid #C4C9AD; 
	}

	.fhg-lageplan__viewport::-webkit-scrollbar-thumb:hover {
	background-color: #C4C9AD; 
	}

	/* Firefox */
	.fhg-lageplan__viewport {
	scrollbar-width: 10px; 
	scrollbar-color: #7F8951 #C4C9AD; 
	}

	.fhg-lageplan__canvas {
	position: relative;
	}

	.fhg-lageplan__canvas::after {
	content: 'Scroll →';
	display: block;
	text-align: center;
	font-size: 11px;
	color: #7F8951;
	letter-spacing: 0.1em;
	margin-top: 6px;
	position: absolute;
	left: 20px;
	bottom: 10px;
	}


}

/* --- Reduce motion --- */

@media (prefers-reduced-motion: reduce) {
	.fhg-lageplan__marker,
	.fhg-lageplan__popup {
		transition: none;
	}
}
