/*
 * Fullscreen v2 (javascript/fullscreen_v2.js). Statisch, unabhaengig vom Farbschema (der Viewer ist immer schwarz).
 * Plan: dev/plans/2026-10-06_fullscreen-v2.md
 */

/* seite darunter sperren. auf touch-geraeten noetig, damit das layout nicht so breit wie der seiteninhalt wird */
html.fsv2-open,
html.fsv2-open body {
	overflow: hidden;
}

.fsv2-root {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	overflow: hidden;
	touch-action: none;
	overscroll-behavior: contain;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	cursor: none;
	font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
.fsv2-root.fsv2-mouse-active {
	cursor: default;
}
.fsv2-bg,
.fsv2-stage {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}
.fsv2-bg {
	background: #000;
}
.fsv2-stage {
	overflow: hidden;
}
/* drei slides (prev, aktuell, next), die mittlere ist sichtbar */
.fsv2-track {
	position: absolute;
	top: 0;
	bottom: 0;
	left: -100%;
	width: 300%;
	display: flex;
	will-change: transform;
}
.fsv2-slide {
	position: relative;
	flex: 0 0 calc(100% / 3);
	height: 100%;
	overflow: hidden;
}
/* kleine varianten werden hochskaliert, damit der tausch gegen die grosse ohne sprung passiert */
.fsv2-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	border: 0;
	object-fit: contain;
	pointer-events: none;
	-webkit-user-drag: none;
}

.fsv2-spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	margin: -21px 0 0 -21px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: fsv2-spin .8s linear infinite;
}
.fsv2-loading .fsv2-spinner {
	display: block;
}
@keyframes fsv2-spin {
	to { transform: rotate(360deg); }
}

/* unsichtbare klickzonen links/rechts, sichtbar bei hover */
.fsv2-zone {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 20%;
	margin: 0;
	padding: 0 2%;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 36px;
	text-shadow: 0 0 6px rgba(0, 0, 0, .6);
	opacity: 0;
	transition: opacity .2s;
	cursor: inherit;
	outline: none;	/* fokus zeigt sich ueber den sichtbaren pfeil (:focus-visible unten), kein rahmen um die ganze zone */
}
.fsv2-zone:hover,
.fsv2-zone:focus-visible {
	opacity: .8;
}
.fsv2-mouse-active .fsv2-zone {
	cursor: pointer;
}
.fsv2-prev {
	left: 0;
	text-align: left;
}
.fsv2-next {
	right: 0;
	text-align: right;
}
.fsv2-zone[hidden] {
	display: none;
}

.fsv2-close {
	position: absolute;
	top: calc(env(safe-area-inset-top, 0px) + 8px);
	right: calc(env(safe-area-inset-right, 0px) + 8px);
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .4);
	color: #fff;
	font-size: 22px;
	line-height: 44px;
	text-align: center;
	opacity: 0;
	transition: opacity .2s;
	cursor: pointer;
}
.fsv2-mouse-active .fsv2-close,
.fsv2-close:hover,
.fsv2-close:focus-visible {
	opacity: .8;
}

.fsv2-info {
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
	padding: 0 12px;
	color: rgba(255, 255, 255, .8);
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
	text-shadow: 0 1px 3px #000;
	pointer-events: none;
	transition: opacity .2s;
}
.fsv2-info1,
.fsv2-info2 {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.fsv2-info-hidden .fsv2-info {
	opacity: 0;
}
.fsv2-stars {
	margin-left: .6em;
}
.fsv2-stars .fa {
	margin: 0 1px;
}

.fsv2-popup {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-size: 40px;
	white-space: nowrap;
	text-shadow: 0 0 10px rgba(0, 0, 0, .8);
	opacity: 0;
	pointer-events: none;
}
.fsv2-popup .fa {
	margin: 0 3px;
}
.fsv2-popup-show {
	animation: fsv2-pop 1s ease-out forwards;
}
@keyframes fsv2-pop {
	0%, 60% { opacity: 1; }
	100% { opacity: 0; }
}

/* touch-geraete: keine hover-zonen (blaettern per wischen), X immer sichtbar */
@media (hover: none) {
	.fsv2-zone {
		display: none;
	}
	.fsv2-close {
		opacity: .8;
	}
	.fsv2-root {
		cursor: default;
	}
}
