/* Funkeln Reels Carousel 1.1.0 */

.fnk-reels {
	--fnk-per-view: 4;
	--fnk-slide-width: 280px;
	--fnk-min-width: 180px;
	--fnk-gap: 16px;
	--fnk-ratio: 9 / 16;
	--fnk-radius: 16px;
	--fnk-card-bg: #141414;
	--fnk-border: rgba(255, 255, 255, 0.12);
	--fnk-border-width: 1px;

	--fnk-grad-from: rgba(0, 0, 0, 0.85);
	--fnk-grad-mid: rgba(0, 0, 0, 0.35);
	--fnk-grad-to: rgba(0, 0, 0, 0);
	--fnk-grad-height: 55%;

	--fnk-title-color: #ffffff;
	--fnk-caption-color: rgba(255, 255, 255, 0.7);
	--fnk-creator-color: rgba(255, 255, 255, 0.6);
	--fnk-badge-radius: 40px;

	--fnk-sound-bg: rgba(0, 0, 0, 0.45);
	--fnk-sound-bg-hover: rgba(0, 0, 0, 0.75);
	--fnk-sound-color: #ffffff;

	--fnk-badge-bg: rgba(0, 0, 0, 0.6);
	--fnk-badge-color: #ffffff;

	--fnk-arrow-bg: #ffffff;
	--fnk-arrow-color: #111111;
	--fnk-progress: #ffffff;
	--fnk-progress-track: rgba(255, 255, 255, 0.2);

	position: relative;
}

.fnk-reels__viewport {
	overflow: hidden;
}

.fnk-reels__track {
	display: flex;
	gap: var(--fnk-gap);
	margin: 0;
	padding: 0 0 4px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}

.fnk-reels__track::-webkit-scrollbar {
	display: none;
}

.fnk-reels[data-dragging="1"] .fnk-reels__track {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
}

.fnk-reels__slide {
	/* Standard: feste Breite, unabhaengig vom Container */
	flex: 0 0 var(--fnk-slide-width);
	max-width: 100%;
	scroll-snap-align: start;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fnk-reels[data-size="per-view"] .fnk-reels__slide {
	flex: 0 0 calc((100% - (var(--fnk-per-view) - 1) * var(--fnk-gap)) / var(--fnk-per-view));
	min-width: var(--fnk-min-width);
	max-width: none;
}

/* Volle Fensterbreite, auch in einem schmalen Container */
.fnk-reels[data-bleed="1"] {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.fnk-reels[data-bleed="1"] .fnk-reels__track {
	padding-left: clamp(16px, 4vw, 64px);
	padding-right: clamp(16px, 4vw, 64px);
}

.fnk-reels[data-bleed="1"] .fnk-reels__nav {
	padding-left: clamp(16px, 4vw, 64px);
	padding-right: clamp(16px, 4vw, 64px);
}

.fnk-reels__card {
	position: relative;
	aspect-ratio: var(--fnk-ratio);
	border-radius: var(--fnk-radius);
	border: var(--fnk-border-width) solid var(--fnk-border);
	overflow: hidden;
	background: var(--fnk-card-bg);
	isolation: isolate;
}

.fnk-reels__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: var(--fnk-card-bg);
}

.fnk-reels__shade {
	position: absolute;
	inset: auto 0 0 0;
	height: var(--fnk-grad-height);
	background: linear-gradient(
		to top,
		var(--fnk-grad-from) 0%,
		var(--fnk-grad-mid) 45%,
		var(--fnk-grad-to) 100%
	);
	pointer-events: none;
}

/* Badge */
.fnk-reels__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	display: inline-block;
	padding: 6px 12px;
	background-color: var(--fnk-badge-bg);
	color: var(--fnk-badge-color);
	border-radius: var(--fnk-badge-radius);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.01em;
	backdrop-filter: blur(6px);
	pointer-events: none;
}

/* Play-Symbol, solange pausiert */
.fnk-reels__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: 54px;
	height: 54px;
	margin: -27px 0 0 -27px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	backdrop-filter: blur(4px);
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.2s ease;
}

.fnk-reels__card.is-playing .fnk-reels__play {
	opacity: 0;
}

/* Text */
.fnk-reels__meta {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 16px 16px 18px;
	pointer-events: none;
}

.fnk-reels__creator {
	color: var(--fnk-creator-color);
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.3;
}

.fnk-reels__brand {
	color: var(--fnk-title-color);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
}

.fnk-reels__caption {
	color: var(--fnk-caption-color);
	font-size: 13px;
	line-height: 1.4;
}

.fnk-reels__link {
	position: absolute;
	inset: 0;
	z-index: 4;
}

.fnk-reels__link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

/* Ton-Schalter */
.fnk-reels__sound {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background 0.15s ease;
}

.fnk-reels__sound:hover {
	background: rgba(0, 0, 0, 0.75);
}

.fnk-reels__sound:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.fnk-reels__sound .fnk-reels__sound-on {
	display: none;
}

.fnk-reels__sound[aria-pressed="true"] .fnk-reels__sound-on {
	display: inline-flex;
}

.fnk-reels__sound[aria-pressed="true"] .fnk-reels__sound-off {
	display: none;
}

/* Navigation */
.fnk-reels__nav {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-top: 18px;
}

.fnk-reels__progress {
	position: relative;
	flex: 1;
	height: 2px;
	background: var(--fnk-progress-track);
	border-radius: 2px;
	overflow: hidden;
}

.fnk-reels__progress-bar {
	position: absolute;
	inset: 0 auto 0 0;
	width: 20%;
	background: var(--fnk-progress);
	border-radius: 2px;
	transition: transform 0.2s ease, width 0.2s ease;
}

.fnk-reels__arrows {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.fnk-reels__arrow {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--fnk-arrow-bg);
	color: var(--fnk-arrow-color);
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.fnk-reels__arrow:hover {
	transform: scale(1.06);
}

.fnk-reels__arrow:focus-visible {
	outline: 2px solid var(--fnk-arrow-bg);
	outline-offset: 2px;
}

.fnk-reels__arrow[disabled] {
	opacity: 0.3;
	cursor: default;
	transform: none;
}

.fnk-reels__empty {
	margin-top: 12px;
	padding: 20px;
	border: 1px dashed currentColor;
	border-radius: 8px;
	text-align: center;
	font-size: 13px;
	opacity: 0.7;
}

.fnk-reels .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.fnk-reels__track {
		scroll-behavior: auto;
	}
	.fnk-reels__arrow:hover {
		transform: none;
	}
	.fnk-reels__progress-bar,
	.fnk-reels__play {
		transition: none;
	}
}

/* ---------------------------------------------------------------------
 * Theme-Reset
 * Viele Themes setzen globale Button-Stile (Rahmen, Eckenradius, Farben).
 * Diese Regeln stehen bewusst am Ende und erzwingen das Widget-Design,
 * damit Frontend und Editor identisch aussehen.
 * ------------------------------------------------------------------ */
.fnk-reels button.fnk-reels__arrow,
.fnk-reels button.fnk-reels__sound,
.fnk-reels button.fnk-reels__arrow:hover,
.fnk-reels button.fnk-reels__sound:hover,
.fnk-reels button.fnk-reels__arrow:focus,
.fnk-reels button.fnk-reels__sound:focus,
.fnk-reels button.fnk-reels__arrow:active,
.fnk-reels button.fnk-reels__sound:active {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	background-image: none !important;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-size: 0 !important;
	line-height: 1 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	outline-offset: 2px;
	cursor: pointer !important;
	transition: background 0.15s ease, transform 0.15s ease !important;
}

.fnk-reels button.fnk-reels__arrow,
.fnk-reels button.fnk-reels__arrow:hover,
.fnk-reels button.fnk-reels__arrow:focus,
.fnk-reels button.fnk-reels__arrow:active {
	width: 40px !important;
	height: 40px !important;
	background-color: var(--fnk-arrow-bg) !important;
	color: var(--fnk-arrow-color) !important;
}

.fnk-reels button.fnk-reels__arrow:hover {
	transform: scale(1.06) !important;
}

.fnk-reels button.fnk-reels__arrow[disabled] {
	opacity: 0.3 !important;
	transform: none !important;
	cursor: default !important;
}

.fnk-reels button.fnk-reels__sound,
.fnk-reels button.fnk-reels__sound:focus,
.fnk-reels button.fnk-reels__sound:active {
	width: 32px !important;
	height: 32px !important;
	background-color: var(--fnk-sound-bg) !important;
	color: var(--fnk-sound-color) !important;
}

.fnk-reels button.fnk-reels__sound:hover {
	background-color: var(--fnk-sound-bg-hover) !important;
}

.fnk-reels button.fnk-reels__arrow svg,
.fnk-reels button.fnk-reels__sound svg {
	display: block;
	fill: none;
	stroke: currentColor;
	pointer-events: none;
}

.fnk-reels .fnk-reels__play svg {
	fill: currentColor;
	stroke: none;
}

.fnk-reels a.fnk-reels__link,
.fnk-reels a.fnk-reels__link:hover,
.fnk-reels a.fnk-reels__link:focus {
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

.fnk-reels .fnk-reels__brand {
	color: var(--fnk-title-color) !important;
}

.fnk-reels .fnk-reels__caption {
	color: var(--fnk-caption-color) !important;
}

.fnk-reels .fnk-reels__creator {
	color: var(--fnk-creator-color) !important;
}

.fnk-reels .fnk-reels__badge {
	background-color: var(--fnk-badge-bg) !important;
	color: var(--fnk-badge-color) !important;
}

.fnk-reels .fnk-reels__progress {
	background-color: var(--fnk-progress-track) !important;
}

.fnk-reels .fnk-reels__progress-bar {
	background-color: var(--fnk-progress) !important;
}

.fnk-reels .fnk-reels__card {
	background-color: var(--fnk-card-bg) !important;
	border-color: var(--fnk-border) !important;
	border-width: var(--fnk-border-width) !important;
	border-style: solid !important;
	border-radius: var(--fnk-radius) !important;
}
