/* =========================================================
   Zugfenster09 – Frontend Styles
   English comments per code convention, German UI strings live in PHP.
   ========================================================= */

.zf09 {
	--zf09-height: 520px;
	--zf09-frame-color: #5a4632;
	--zf09-bg-color: #87ceeb;
	--zf09-outside-color: #1a1a1a;
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

.zf09__scene {
	position: relative;
	width: 100%;
	height: var(--zf09-height);
	overflow: hidden;
	border-radius: 6px;
	background: var(--zf09-outside-color);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
	perspective: 800px;
}

/* -------------------------------------------------
   Background / foreground parallax layers
   ------------------------------------------------- */
.zf09__layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
	will-change: transform;
}

.zf09__layer--background {
	/* --zf09-sky-color is animated frame-by-frame from JS (color interpolation) on slide change,
	   since CSS cannot smoothly transition a gradient stop without the @property API (limited support). */
	background-image: linear-gradient( to bottom, var(--zf09-sky-color, var(--zf09-bg-color)) 0%, rgba(255, 255, 255, 0.15) 100% );
	z-index: 1;
}

.zf09__layer--foreground {
	z-index: 5;
	background-repeat: repeat-x;
	background-position: bottom left;
	background-size: auto 100%;
	opacity: 0.9;
}

.zf09__layer--posts {
	position: absolute;
	inset: 0;
	z-index: 6;
	pointer-events: none;
	overflow: hidden;
}

.zf09__post {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 6%;
	background: linear-gradient( to right, rgba(20, 15, 10, 0.95), rgba(20, 15, 10, 0.75) );
	transform: translateX(120%);
}

/* -------------------------------------------------
   Viewport / media
   ------------------------------------------------- */
.zf09__viewport {
	position: absolute;
	inset: 8%;
	overflow: hidden;
	z-index: 3;
	cursor: grab;
	background: #000;
	border-radius: 2px;
}

.zf09__viewport:active {
	cursor: grabbing;
}

.zf09__viewport:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
	box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.35);
}

.zf09__slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.zf09__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
}

.zf09__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

.zf09__slide.is-incoming {
	z-index: 3;
}

.zf09__media {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1.08) translateX(0);
	transition: transform 0.05s linear;
}

.zf09__slide.zf09--blur .zf09__media {
	filter: blur(var(--zf09-blur-amount, 0px));
}

.zf09__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px 14px;
	background: linear-gradient( to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0) );
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-family: inherit;
	pointer-events: none;
}

.zf09__caption-title {
	font-size: 1em;
	font-weight: 600;
}

.zf09__caption-sub {
	font-size: 0.8em;
	opacity: 0.85;
}

/* -------------------------------------------------
   Reflection & motion blur overlays
   ------------------------------------------------- */
.zf09__reflection {
	position: absolute;
	inset: 0;
	z-index: 8;
	pointer-events: none;
	background: linear-gradient( 115deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.05) 55%, rgba(255, 255, 255, 0) 70% );
	mix-blend-mode: screen;
	opacity: 0.6;
	transition: transform 0.15s ease-out, opacity 0.3s ease;
}

.zf09--time-night .zf09__reflection {
	opacity: 0.85;
	mix-blend-mode: soft-light;
}

/* -------------------------------------------------
   Weather particle canvas (rain / snow / fog)
   ------------------------------------------------- */
.zf09__weather {
	position: absolute;
	inset: 0;
	z-index: 8;
	pointer-events: none;
	width: 100%;
	height: 100%;
}

.zf09__weather--fog {
	opacity: 0.55;
}

/* -------------------------------------------------
   Frosted / condensation glass edges (night & dusk)
   ------------------------------------------------- */
.zf09__frost {
	position: absolute;
	inset: 0;
	z-index: 9;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.6s ease;
	background: radial-gradient( ellipse at center, rgba(255, 255, 255, 0) 55%, rgba(220, 235, 245, 0.5) 100% );
	-webkit-mask-image: radial-gradient( ellipse at center, transparent 50%, black 100% );
	mask-image: radial-gradient( ellipse at center, transparent 50%, black 100% );
	backdrop-filter: blur(3px);
}

.zf09--time-night .zf09__frost {
	opacity: 0.9;
}

.zf09--time-dusk .zf09__frost {
	opacity: 0.5;
}

.zf09__motion-blur-overlay {
	position: absolute;
	inset: 0;
	z-index: 9;
	pointer-events: none;
	background: transparent;
	opacity: 0;
	backdrop-filter: blur(0px);
	transition: opacity 0.2s ease;
}

.zf09__motion-blur-overlay.is-active {
	opacity: 1;
}

/* -------------------------------------------------
   Window frame
   ------------------------------------------------- */
.zf09__frame {
	position: absolute;
	inset: 0;
	z-index: 7;
	pointer-events: none;
	border: 3% solid var(--zf09-frame-color);
	box-sizing: border-box;
	border-radius: 4px;
	box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.5);
}

.zf09__frame--wood {
	border-width: 4%;
	border-image: none;
	background-image: repeating-linear-gradient( 90deg, rgba(0, 0, 0, 0.08) 0, rgba(0, 0, 0, 0.08) 2px, transparent 2px, transparent 10px );
	background-clip: border-box;
}

.zf09__frame--metal {
	border-width: 2.5%;
	box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), inset 0 0 2px rgba(255, 255, 255, 0.4);
}

.zf09__frame--modern {
	border-width: 1.5%;
	border-radius: 8px;
	box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.zf09__mullion {
	position: absolute;
	background: var(--zf09-frame-color);
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.zf09__mullion--h {
	left: 8%;
	right: 8%;
	top: 50%;
	height: 2%;
	transform: translateY(-50%);
}

.zf09__mullion--v {
	top: 8%;
	bottom: 8%;
	left: 50%;
	width: 1.4%;
	transform: translateX(-50%);
}

.zf09__sill {
	position: absolute;
	left: 4%;
	right: 4%;
	bottom: 2%;
	height: 4%;
	background: var(--zf09-frame-color);
	border-radius: 2px;
}

/* -------------------------------------------------
   Arrows / Dots
   ------------------------------------------------- */
.zf09__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 12;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.zf09__arrow:hover,
.zf09__arrow:focus-visible {
	background: rgba(0, 0, 0, 0.7);
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.zf09__arrow--prev {
	left: 10px;
}

.zf09__arrow--next {
	right: 10px;
}

.zf09__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}

.zf09__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid var(--zf09-frame-color);
	background: transparent;
	padding: 0;
	cursor: pointer;
	transition: background 0.2s ease;
}

.zf09__dot.is-active,
.zf09__dot:hover {
	background: var(--zf09-frame-color);
}

.zf09__dot:focus-visible {
	outline: 2px solid var(--zf09-frame-color);
	outline-offset: 2px;
}

/* -------------------------------------------------
   Gyroscope permission button (iOS)
   ------------------------------------------------- */
.zf09__gyro-permission {
	position: absolute;
	bottom: 10px;
	right: 10px;
	z-index: 13;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 20px;
	padding: 6px 14px;
	font-size: 0.8em;
	cursor: pointer;
}

/* -------------------------------------------------
   Lightbox
   ------------------------------------------------- */
.zf09__lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.zf09__lightbox[hidden] {
	display: none;
}

.zf09__lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
}

.zf09__lightbox-content {
	position: relative;
	max-width: 92vw;
	max-height: 90vh;
	z-index: 2;
}

.zf09__lightbox-media img,
.zf09__lightbox-media video {
	max-width: 92vw;
	max-height: 90vh;
	display: block;
	border-radius: 4px;
}

.zf09__lightbox-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

.zf09__lightbox-close:focus-visible,
.zf09__lightbox-close:hover {
	color: #ccc;
}

body.zf09-lock-scroll {
	overflow: hidden;
}

/* -------------------------------------------------
   Orientation
   ------------------------------------------------- */
.zf09--orientation-vertical .zf09__layer--foreground,
.zf09--orientation-vertical .zf09__layer--background {
	background-position: left bottom;
}

/* -------------------------------------------------
   Reduced motion
   ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.zf09__media,
	.zf09__layer,
	.zf09__reflection,
	.zf09__slide {
		transition: none !important;
	}
}

/* -------------------------------------------------
   Responsive
   ------------------------------------------------- */
@media (max-width: 767px) {
	.zf09__scene {
		height: min(var(--zf09-height), 70vh);
	}

	.zf09__arrow {
		width: 34px;
		height: 34px;
		font-size: 14px;
	}

	.zf09__caption-title {
		font-size: 0.9em;
	}
}
