/* ==========================================================================
   Luna Video Section – Frontend Styles
   Plugin:  Luna Video Section
   Version: 1.1.0
   Author:  Sven Ebens
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Wrapper – full-bleed container
   -------------------------------------------------------------------------- */

.luna-vs-wrapper {
	position: relative;
	overflow: hidden;
	width: 100%;
	min-height: 300px;
	isolation: isolate; /* Create new stacking context */
}

/* 
   Stacking Order (with isolation: isolate on wrapper):
   10: .luna-vs-cover
   20: .luna-vs-cover-overlay
   30: .luna-vs-video-container
   40: .luna-vs-overlay (content)
*/

/* --------------------------------------------------------------------------
   2. Cover image (background-image on a div)
   -------------------------------------------------------------------------- */

.luna-vs-cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	z-index: 10;

	/* Smooth fade – staggered: cover starts immediately (0s delay) */
	transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
	opacity: 1;
}

/* --------------------------------------------------------------------------
   2.1. Background Overlay
   -------------------------------------------------------------------------- */

.luna-vs-cover-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 20;
	transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
	opacity: 1;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   3. Video element / iframe
   -------------------------------------------------------------------------- */

.luna-vs-video-container {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 30;
	background: #000;

	/* Hidden by default, fades in together with cover fade-out */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.luna-vs-video-container iframe,
.luna-vs-video-container video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	object-fit: cover;
}

/* --------------------------------------------------------------------------
   4. Overlay – content column (title, paragraph, button)
   -------------------------------------------------------------------------- */

.luna-vs-overlay {
	position: absolute;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 40px;
	box-sizing: border-box;

	/* Overlay fades faster and FIRST on play, LAST on return */
	transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	opacity: 1;
	visibility: visible;
}

.luna-vs-content {
	width: 50%;
	max-width: 100%;
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   5. Title
   -------------------------------------------------------------------------- */

.luna-vs-title {
	margin: 0 0 0.5em;
	padding: 0;
	color: #ffffff;
}

/* --------------------------------------------------------------------------
   6. Paragraph
   -------------------------------------------------------------------------- */

.luna-vs-paragraph {
	margin: 0 0 1.25em;
	padding: 0;
	color: #eeeeee;
}

/* --------------------------------------------------------------------------
   7. Play button
   -------------------------------------------------------------------------- */

.luna-vs-play-btn {
	display: inline-flex !important;
	align-items: center !important;
	gap: var(--luna-vs-btn-gap, 8px) !important;
	cursor: pointer;
	border: none;
	text-decoration: none;
	transition: background-color 0.3s ease, color 0.3s ease;
	background-color: #ffffff;
	color: #111111;
	padding: 0.75em 1.5em;
	border-radius: 4px;
	font-family: inherit;
	font-size: inherit;
	font-weight: 600;
	line-height: 1.2;
}

.luna-vs-play-btn:hover,
.luna-vs-play-btn:focus-visible {
	outline: none;
}

/* Icon inside button – inherit color by default */
.luna-vs-play-btn .luna-vs-btn-icon {
	display: inline-flex;
	align-items: center;
	line-height: 1;
	color: inherit;
	transition: color 0.3s ease;
}

.luna-vs-play-btn .luna-vs-btn-icon i {
	font-size: 1em;
	width: 1em;
	height: 1em;
	color: inherit;
}

.luna-vs-play-btn .luna-vs-btn-icon svg {
	font-size: 1em;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* --------------------------------------------------------------------------
   8. "Playing" state – overlay fades first, then cover/video cross-fade
   -------------------------------------------------------------------------- */

/* ENTERING: overlay fades immediately, cover/video delayed by 0.3s */
.luna-vs-wrapper.luna-vs-playing .luna-vs-overlay {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition-delay: 0s;
}

.luna-vs-wrapper.luna-vs-playing .luna-vs-cover {
	opacity: 0;
	pointer-events: none;
	transition-delay: 0.3s;
}

.luna-vs-wrapper.luna-vs-playing .luna-vs-cover-overlay {
	opacity: 0;
	transition-delay: 0.3s;
}

.luna-vs-wrapper.luna-vs-playing .luna-vs-video-container {
	opacity: 1;
	pointer-events: auto;
	transition-delay: 0.3s;
}

/* RETURNING: cover/video return immediately, overlay delayed by 0.5s */
.luna-vs-wrapper.luna-vs-returning .luna-vs-cover {
	opacity: 1;
	pointer-events: auto;
	transition-delay: 0s;
}

.luna-vs-wrapper.luna-vs-returning .luna-vs-cover-overlay {
	opacity: 1;
	transition-delay: 0s;
}

.luna-vs-wrapper.luna-vs-returning .luna-vs-video-container {
	opacity: 0;
	pointer-events: none;
	transition-delay: 0s;
}

.luna-vs-wrapper.luna-vs-returning .luna-vs-overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0.5s;
}

/* --------------------------------------------------------------------------
   9. Elementor editor placeholder
   -------------------------------------------------------------------------- */

.elementor-editor-active .luna-vs-wrapper {
	min-height: 400px;
}
