/* Tuens Floating Kontaktmenü */

.tfc {
	--tfc-bg: #2a363d;
	--tfc-fg: #ffffff;
	--tfc-accent: #4154ff;
	--tfc-offset: 0px;
	--tfc-size: 48px;
	--tfc-icon: 19px;
	--tfc-gap: 4px;
	--tfc-radius: 6px;

	position: fixed;
	top: calc(50% + var(--tfc-offset));
	transform: translateY(-50%);
	z-index: 99990;
	font-size: 14px;
	line-height: 1.45;
}

.tfc--right { right: 0; }
.tfc--left  { left: 0; }

.tfc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--tfc-gap);
}

.tfc__list > li::before { content: none; }

.tfc__item {
	position: relative;
	margin: 0;
	padding: 0;
}

/* --- Icon-Fläche --- */

.tfc__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--tfc-size);
	height: var(--tfc-size);
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--tfc-bg);
	color: var(--tfc-fg);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	transition: background-color .2s ease, color .2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tfc--right .tfc__btn { border-radius: var(--tfc-radius) 0 0 var(--tfc-radius); }
.tfc--left  .tfc__btn { border-radius: 0 var(--tfc-radius) var(--tfc-radius) 0; }

.tfc__btn:hover,
.tfc__btn:focus-visible,
.tfc__item.is-open > .tfc__btn {
	background: var(--tfc-accent);
	color: var(--tfc-fg);
}

.tfc__btn:focus { outline: 0; }

.tfc__btn:focus-visible {
	outline: 2px solid var(--tfc-fg);
	outline-offset: -4px;
}

.tfc__icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.tfc__svg {
	width: var(--tfc-icon);
	height: var(--tfc-icon);
	display: block;
	fill: currentColor;
}

/* Nur für Screenreader */
.tfc__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --- Ausfahrender Teil --- */

.tfc__flyout {
	position: absolute;
	top: 50%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	box-sizing: border-box;
	min-height: var(--tfc-size);
	padding: 10px 16px;
	background: var(--tfc-bg);
	color: var(--tfc-fg);
	white-space: nowrap;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.tfc--right .tfc__flyout {
	right: 100%;
	border-radius: var(--tfc-radius) 0 0 var(--tfc-radius);
	transform: translate(14px, -50%);
}

.tfc--left .tfc__flyout {
	left: 100%;
	border-radius: 0 var(--tfc-radius) var(--tfc-radius) 0;
	transform: translate(-14px, -50%);
}

.tfc__flyout--block {
	white-space: normal;
	width: max-content;
	max-width: min(68vw, 280px);
}

.tfc__flyout-title {
	display: block;
	font-weight: 700;
	margin-bottom: 4px;
}

.tfc__flyout-line {
	display: block;
}

/* Offen – per Hover (nur Zeigegeräte), per Tastatur oder per Klick/Tap */
@media (hover: hover) and (pointer: fine) {
	.tfc__item:hover > .tfc__flyout {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translate(0, -50%);
	}
}

.tfc__item:focus-within > .tfc__flyout,
.tfc__item.is-open > .tfc__flyout {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(0, -50%);
}

/* --- Mobil / Touch --- */

@media (max-width: 782px) {
	.tfc {
		--tfc-size: 44px;
		--tfc-icon: 17px;
		--tfc-gap: 3px;
		font-size: 13px;
	}

	.tfc__flyout {
		padding: 9px 13px;
	}

	.tfc__flyout--block {
		max-width: calc(100vw - var(--tfc-size) - 24px);
	}
}

/* Auf Touchgeräten klappt der Ausklapper nur per Tap auf; die reinen Links
   bekommen keinen Hänger vor den Mauszeiger gesetzt. */
.tfc--touch .tfc__item:focus-within > .tfc__flyout {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.tfc--touch .tfc__item.is-open > .tfc__flyout {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(0, -50%);
}

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

	.tfc--right .tfc__flyout,
	.tfc--left .tfc__flyout {
		transform: translateY(-50%);
	}
}

@media print {
	.tfc { display: none; }
}
