/*
 * Molten Gold Transition 63 – Frontend & Editor Styles
 */

.mgt63-wrapper {
	position: relative;
	width: 100%;
	--mgt63-scale: 1;
	--mgt63-duration: 1.2s;
	--mgt63-tint-color: #ffb800;
	--mgt63-tint-opacity: 0.28;
	--mgt63-blend-mode: overlay;
	outline: none;
}

.mgt63-wrapper.mgt63-bg-dark {
	--mgt63-bg: #0b0805;
}

.mgt63-wrapper.mgt63-bg-light {
	--mgt63-bg: #fdf6e6;
}

.mgt63-stage {
	position: relative;
	width: 100%;
	height: 70vh;
	background: var( --mgt63-bg, #0b0805 );
	overflow: hidden;
	isolation: isolate;
}

.mgt63-svg-filters {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.mgt63-media-track {
	position: relative;
	width: 100%;
	height: 100%;
	filter: contrast( var( --mgt63-contrast, 1 ) );
	transition: filter 0.3s ease;
}

.mgt63-media-item {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity var( --mgt63-duration, 1.2s ) ease, filter var( --mgt63-duration, 1.2s ) ease;
	will-change: opacity, filter;
}

.mgt63-media-item--active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

.mgt63-media-item--crossfade-out {
	opacity: 0;
	visibility: visible;
	z-index: 1;
}

.mgt63-media-visual {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mgt63-webgl-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: none;
	pointer-events: none;
}

.mgt63-wrapper.mgt63-webgl-mode .mgt63-media-item[data-webgl-active="true"] .mgt63-webgl-canvas {
	display: block;
}

.mgt63-wrapper.mgt63-webgl-mode .mgt63-media-item[data-webgl-active="true"] .mgt63-media-visual {
	opacity: 0;
}

.mgt63-media-caption {
	position: absolute;
	left: 24px;
	bottom: 24px;
	color: #fff3d0;
	font-size: 15px;
	letter-spacing: 0.04em;
	text-shadow: 0 2px 10px rgba( 0, 0, 0, 0.6 );
	pointer-events: none;
	z-index: 3;
}

.mgt63-media-trigger {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: transparent;
	border: 0;
	cursor: pointer;
	min-width: 48px;
	min-height: 48px;
	z-index: 4;
}

.mgt63-media-trigger:focus-visible {
	outline: 3px solid #ffb800;
	outline-offset: -3px;
}

.mgt63-tint-overlay {
	position: absolute;
	inset: 0;
	background: var( --mgt63-tint-color, #ffb800 );
	opacity: var( --mgt63-tint-opacity, 0.28 );
	mix-blend-mode: var( --mgt63-blend-mode, overlay );
	pointer-events: none;
	z-index: 5;
	transition: opacity 0.3s ease;
}

.mgt63-wrapper.mgt63-hover-boost .mgt63-tint-overlay {
	opacity: calc( var( --mgt63-tint-opacity, 0.28 ) * 1.15 );
}

/* Volcanic Glass: eingestreute Funken-Partikel-Ebene */
.mgt63-spark-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 6;
	opacity: var( --mgt63-spark-opacity, 0.14 );
	mix-blend-mode: screen;
	background-image:
		radial-gradient( circle, var( --mgt63-spark-color, #ff6a00 ) 0, var( --mgt63-spark-color, #ff6a00 ) 1px, transparent 2px ),
		radial-gradient( circle, var( --mgt63-spark-color, #ff6a00 ) 0, var( --mgt63-spark-color, #ff6a00 ) 1px, transparent 2px );
	background-size: 42px 42px, 71px 71px;
	background-position: 0 0, 24px 38px;
	animation: mgt63-spark-drift 9s linear infinite;
}

@keyframes mgt63-spark-drift {
	0% {
		background-position: 0 0, 24px 38px;
	}
	100% {
		background-position: 210px 420px, -140px 320px;
	}
}

/* Frozen Gold: erstarrte, facettierte Eis-/Kristallstruktur */
.mgt63-frost-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 6;
	opacity: 0.55;
	mix-blend-mode: overlay;
	background-image:
		repeating-linear-gradient( 115deg, rgba( 255, 255, 255, 0.09 ) 0 2px, transparent 2px 16px ),
		repeating-linear-gradient( 25deg, rgba( 255, 255, 255, 0.06 ) 0 2px, transparent 2px 20px );
}

@media ( prefers-reduced-motion: reduce ) {
	.mgt63-spark-overlay {
		animation: none;
	}
}

.mgt63-nav-controls {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	pointer-events: none;
	z-index: 6;
}

.mgt63-nav-prev,
.mgt63-nav-next {
	pointer-events: auto;
	min-width: 48px;
	min-height: 48px;
	border-radius: 50%;
	border: 1px solid rgba( 255, 184, 0, 0.5 );
	background: rgba( 10, 8, 4, 0.55 );
	color: #ffdf94;
	font-size: 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

.mgt63-nav-prev:hover,
.mgt63-nav-next:hover {
	background: rgba( 255, 184, 0, 0.25 );
	transform: scale( 1.05 );
}

.mgt63-nav-prev:focus-visible,
.mgt63-nav-next:focus-visible {
	outline: 3px solid #ffb800;
	outline-offset: 2px;
}

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

.mgt63-lightbox.mgt63-lightbox--open {
	display: flex;
}

.mgt63-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 5, 4, 2, 0.92 );
}

.mgt63-lightbox-content {
	position: relative;
	max-width: 92vw;
	max-height: 92vh;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.mgt63-lightbox-media-holder {
	max-width: 92vw;
	max-height: 78vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mgt63-lightbox-media-holder img,
.mgt63-lightbox-media-holder video {
	max-width: 92vw;
	max-height: 78vh;
	border-radius: 8px;
	box-shadow: 0 0 60px rgba( 255, 184, 0, 0.25 );
}

.mgt63-lightbox-close {
	position: absolute;
	top: -44px;
	right: 0;
	min-width: 48px;
	min-height: 48px;
	background: transparent;
	border: none;
	color: #fff3d0;
	font-size: 32px;
	cursor: pointer;
	line-height: 1;
}

.mgt63-lightbox-actions {
	display: flex;
	gap: 12px;
}

.mgt63-lightbox-download,
.mgt63-lightbox-share {
	min-width: 48px;
	min-height: 48px;
	padding: 0 20px;
	border-radius: 999px;
	border: 1px solid rgba( 255, 184, 0, 0.5 );
	background: rgba( 255, 184, 0, 0.12 );
	color: #ffdf94;
	cursor: pointer;
	font-size: 14px;
	letter-spacing: 0.03em;
	transition: background 0.2s ease;
}

.mgt63-lightbox-download:hover,
.mgt63-lightbox-share:hover {
	background: rgba( 255, 184, 0, 0.28 );
}

.mgt63-editor-warning {
	padding: 16px;
	background: #3a1f00;
	color: #ffdf94;
	border: 1px dashed #ffb800;
	font-size: 13px;
}

/* Reduced motion */
@media ( prefers-reduced-motion: reduce ) {
	.mgt63-media-item,
	.mgt63-tint-overlay {
		transition: none !important;
	}
}

/* Responsive scaling per spec: desktop full, tablet .75, mobile .5 + faster duration */
@media ( max-width: 1024px ) {
	.mgt63-wrapper {
		--mgt63-scale: 0.75;
	}
}

@media ( max-width: 767px ) {
	.mgt63-wrapper {
		--mgt63-scale: 0.5;
	}

	.mgt63-nav-prev,
	.mgt63-nav-next,
	.mgt63-media-trigger,
	.mgt63-lightbox-download,
	.mgt63-lightbox-share,
	.mgt63-lightbox-close {
		min-width: 48px;
		min-height: 48px;
	}
}

/* Custom control styling (editor) */
.mgt63-timeline-control .mgt63-timeline-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	background: #2a2a2a;
	border-radius: 4px;
	margin-bottom: 4px;
	cursor: grab;
}

.mgt63-timeline-remove,
.mgt63-gradient-remove-stop {
	margin-left: auto;
	background: transparent;
	border: none;
	color: #e0a800;
	cursor: pointer;
	font-size: 16px;
}

.mgt63-gradient-preview {
	height: 32px;
	border-radius: 4px;
	margin-bottom: 8px;
	background: linear-gradient( 135deg, #7a4b00, #ffb800, #fff3d0 );
}

.mgt63-gradient-stop {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}
