/* bachlertal Fotostrecke */

.bfs-gallery {
	--bfs-ratio: 3 / 2;
	--bfs-fit: cover;
	--bfs-bg: #000;
	--bfs-speed: 450ms;
	position: relative;
	width: 100%;
	margin: 1.5em auto;
	outline: none;
}

.bfs-gallery:focus-visible .bfs-viewport {
	box-shadow: 0 0 0 3px var(--vm-accent-color, #2271b1);
}

.bfs-viewport {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--bfs-ratio);
	background: var(--bfs-bg);
	border-radius: 4px;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

/* Fallback für sehr alte Browser ohne aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
	.bfs-viewport { height: 0; padding-top: 66.66%; }
	.bfs-track { position: absolute; inset: 0; }
}

.bfs-track {
	display: flex;
	height: 100%;
	transition: transform var(--bfs-speed) ease;
	will-change: transform;
}

.bfs-gallery.is-dragging .bfs-track {
	transition: none;
}

.bfs-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	padding: 0;
	position: relative;
}

.bfs-slide img,
.bfs-slide .bfs-img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: var(--bfs-fit);
	object-position: center;
	margin: 0 !important;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

/* ---------- Foto mit Link ---------- */

.bfs-slide > a.bfs-link {
	display: block;
	width: 100%;
	height: 100%;
	cursor: pointer;
	-webkit-user-drag: none;
	outline-offset: -3px;
}

.bfs-slide > a.bfs-link:focus-visible {
	outline: 3px solid var(--vm-accent-color, #2271b1);
}

/* ---------- Automatischer Durchlauf (Widget): Überblenden ---------- */

.bfs-mode-autoplay .bfs-track {
	display: block;
	position: relative;
	transform: none !important;
}

.bfs-mode-autoplay .bfs-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 900ms ease;
}

.bfs-mode-autoplay .bfs-slide.is-active {
	opacity: 1;
}

/* Unsichtbare (ausgeblendete) Fotos dürfen keine Klicks abfangen. */
.bfs-mode-autoplay .bfs-slide:not(.is-active) {
	pointer-events: none;
}

.bfs-mode-autoplay .bfs-viewport {
	cursor: default;
	touch-action: auto;
}

/* ---------- Punkte ---------- */

.bfs-dots {
	position: absolute;
	left: 50%;
	bottom: 10px;
	transform: translateX(-50%);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px;
	max-width: calc(100% - 20px);
	padding: 2px 6px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.28);
	z-index: 2;
	line-height: 0;
}

.bfs-dot {
	/* Tipp-Fläche 22 px, sichtbarer Punkt 9 px */
	position: relative;
	display: inline-block;
	width: 22px;
	height: 22px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 50%;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	min-height: 0;
	min-width: 0;
}

.bfs-dot::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 9px;
	height: 9px;
	margin: -4.5px 0 0 -4.5px;
	border-radius: 50%;
	background: #fff;
	opacity: 0.5;
	transition: opacity 200ms ease, transform 200ms ease;
}

.bfs-dot:hover::before {
	opacity: 0.8;
}

.bfs-dot.is-active::before {
	opacity: 1;
	transform: scale(1.25);
}

.bfs-dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -3px;
}

span.bfs-dot {
	cursor: default;
	width: 16px;
	height: 16px;
}

/* Viele Fotos: Punkte etwas kleiner */
.bfs-dots:has(> .bfs-dot:nth-child(16)) .bfs-dot {
	width: 16px;
	height: 16px;
}
.bfs-dots:has(> .bfs-dot:nth-child(16)) .bfs-dot::before {
	width: 7px;
	height: 7px;
	margin: -3.5px 0 0 -3.5px;
}

.bfs-single .bfs-dots {
	display: none;
}

/* ---------- Im Widget ---------- */

.vm-box .bfs-gallery,
.widget .bfs-gallery {
	margin: 0;
}

.bfs-notice {
	padding: 0.5em 0.75em;
	border-left: 3px solid #dba617;
	background: #fcf9e8;
}

@media (prefers-reduced-motion: reduce) {
	.bfs-track,
	.bfs-mode-autoplay .bfs-slide {
		transition-duration: 1ms !important;
	}
}
