/**
 * mod_googlemaps
 * (C) 2026 cover72 - GNU General Public License version 2 or later
 */

.gmap {
	--gmap-height: 400px;
	--gmap-width: 600px;
	--gmap-radius: 12px;
	--gmap-accent: #1a1a1a;
	--gmap-accent-fg: #ffffff;
	--gmap-shadow: 0 10px 30px rgba(0, 0, 0, .18);
	display: block;
	max-width: 100%;
	font-size: 15px;
	line-height: 1.45;
}

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

.gmap--fixed {
	width: var(--gmap-width);
	max-width: 100%;
}

.gmap__title {
	margin: 0 0 10px;
	padding-left: 14px;
	border-left: 4px solid var(--gmap-accent);
	font-weight: 700;
}

/* ---------- Kartenrahmen ---------- */

.gmap__frame {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: var(--gmap-height);
	border-radius: var(--gmap-radius);
	background-color: #e8e8e4;
}

.gmap--shadow .gmap__frame {
	box-shadow: var(--gmap-shadow);
}

.gmap__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/*
 * Graustufen-Ansicht: die Karte wird erst beim Beruehren oder bei Tastaturfokus farbig.
 * Respektiert "Bewegung reduzieren", indem der Uebergang dort einfach entfaellt statt zu
 * blitzen.
 */
.gmap--grayscale .gmap__iframe {
	filter: grayscale(1);
	transition: filter .25s ease;
}

.gmap--grayscale .gmap__frame:hover .gmap__iframe,
.gmap--grayscale .gmap__frame:focus-within .gmap__iframe {
	filter: grayscale(0);
}

@media (prefers-reduced-motion: reduce) {
	.gmap__iframe {
		transition: none;
	}
}

/* ---------- Info-Karte ---------- */

.gmap__infocard {
	position: absolute;
	z-index: 3;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	max-width: min(320px, calc(100% - 24px));
	margin: 12px;
	padding: 14px 16px;
	border-radius: 10px;
	background-color: #ffffff;
	color: #1f2937;
	box-shadow: var(--gmap-shadow);
	font-size: .92em;
	line-height: 1.4;
}

.gmap__infocard--top-left {
	top: 0;
	left: 0;
}

.gmap__infocard--top-right {
	top: 0;
	right: 0;
}

.gmap__infocard--bottom-left {
	bottom: 0;
	left: 0;
}

.gmap__infocard--bottom-right {
	bottom: 0;
	right: 0;
}

.gmap__infocard-image {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: 8px;
	object-fit: cover;
}

.gmap__infocard-body {
	min-width: 0;
}

.gmap__infocard-title {
	margin: 0 0 .3em;
	font-weight: 700;
	color: #111827;
}

.gmap__infocard-address {
	margin: 0 0 .5em;
	color: #4b5563;
}

.gmap__infocard-address span {
	display: block;
}

.gmap__infocard-contact {
	display: flex;
	flex-direction: column;
	gap: .3em;
}

.gmap__infocard-contact a {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	overflow: hidden;
	color: #1f2937;
	text-decoration: none;
}

.gmap__infocard-contact a span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gmap__infocard-contact a:hover,
.gmap__infocard-contact a:focus-visible {
	text-decoration: underline;
}

.gmap__infocard-contact svg {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	fill: currentColor;
}

@media (max-width: 480px) {
	.gmap__infocard {
		max-width: calc(100% - 20px);
		margin: 10px;
		padding: 10px 12px;
	}

	.gmap__infocard-image {
		width: 44px;
		height: 44px;
	}
}

/* ---------- Klick-Schutz ---------- */

.gmap__consent {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.gmap__consent-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #e8e8e4;
	background-image:
		linear-gradient(rgba(0, 0, 0, .05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(0, 0, 0, .05) 1px, transparent 1px);
	background-size: 28px 28px;
}

.gmap__consent-pin {
	display: inline-flex;
	width: 40px;
	height: 40px;
	color: rgba(0, 0, 0, .22);
}

.gmap__consent-pin svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.gmap__consent-panel {
	position: relative;
	width: min(360px, 100%);
	padding: 18px 20px;
	border-radius: 12px;
	background-color: #ffffff;
	color: #1f2937;
	box-shadow: var(--gmap-shadow);
	text-align: left;
}

.gmap__consent-title {
	margin: 0 0 .4em;
	font-weight: 700;
}

.gmap__consent-text {
	margin: 0 0 .7em;
	font-size: .92em;
	color: #4b5563;
}

.gmap__consent-text p:last-child {
	margin-bottom: 0;
}

.gmap__consent-link {
	margin: 0 0 .8em;
	font-size: .85em;
}

.gmap__consent-btn {
	display: inline-flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border: 0;
	border-radius: 8px;
	background-color: var(--gmap-accent);
	color: var(--gmap-accent-fg);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.gmap__consent-fallback {
	margin: .7em 0 0;
	font-size: .82em;
	text-align: center;
}

.gmap__consent-fallback a {
	color: #6b7280;
}

/* ---------- Routen-Button ---------- */

.gmap__route {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 12px;
	padding: 10px 18px;
	border-radius: 999px;
	background-color: var(--gmap-route-bg, var(--gmap-accent));
	color: var(--gmap-route-fg, var(--gmap-accent-fg));
	font-weight: 600;
	text-decoration: none;
}

.gmap__route:hover,
.gmap__route:focus-visible {
	filter: brightness(1.08);
	color: var(--gmap-route-fg, var(--gmap-accent-fg));
}
