/**
 * PP Malaga - Reels front end behaviour.
 *
 * The loop carousel renders Elementor's stock hosted-video widget, which ships
 * an image overlay and a play button meant for click-to-play. Playback here is
 * driven by hover (desktop) and visibility (touch), so the overlay becomes
 * decorative: pointer-events none stops Elementor's own click handler from ever
 * firing and removing it, and it simply fades instead. The 0.5s transition it
 * animates with already comes from the loop item template.
 */

.pp-reels-carousel .e-hosted-video {
	position: relative;
}

.pp-reels-carousel .elementor-custom-embed-image-overlay {
	pointer-events: none;
}

.pp-reels-carousel .e-loop-item.is-playing .elementor-custom-embed-image-overlay {
	opacity: 0;
}

/* Playback is automatic, so the play button is only noise. */
.pp-reels-carousel .elementor-custom-embed-play {
	display: none;
}

/* The caption sits over the video and steps aside while it plays. */
.pp-reels-carousel .pp-reel-caption {
	transition: opacity .3s ease, visibility .3s ease;
	pointer-events: none;
}

.pp-reels-carousel .e-loop-item.is-playing .pp-reel-caption {
	opacity: 0;
	visibility: hidden;
}

/*
 * On touch devices playback starts on its own, so hiding the caption would mean
 * nobody ever reads it. Remove this block to hide it there too.
 */
@media (hover: none) {
	.pp-reels-carousel .e-loop-item.is-playing .pp-reel-caption {
		opacity: 1;
		visibility: visible;
	}
}

/* Sound toggle, built by the script. */
.pp-reels-carousel .pp-reel-sound {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: #fff;
	background-color: rgba(0, 0, 0, .55);
	border: 0;
	border-radius: 50%;
	opacity: 0;
	cursor: pointer;
	pointer-events: none;
	transition: opacity .2s ease, background-color .2s ease;
}

.pp-reels-carousel .e-loop-item:hover .pp-reel-sound,
.pp-reels-carousel .e-loop-item:focus-within .pp-reel-sound,
.pp-reels-carousel .e-loop-item.is-playing .pp-reel-sound {
	opacity: 1;
	pointer-events: auto;
}

.pp-reels-carousel .pp-reel-sound:hover {
	background-color: rgba(0, 0, 0, .78);
}

.pp-reels-carousel .pp-reel-sound:focus-visible {
	opacity: 1;
	outline: 2px solid #fff;
	outline-offset: 2px;
	pointer-events: auto;
}

.pp-reels-carousel .pp-reel-sound svg {
	display: block;
	width: 20px;
	height: 20px;
}

.pp-reels-carousel .pp-reel-sound .pp-reel-icon-on {
	display: none;
}

.pp-reels-carousel .pp-reel-sound.is-on .pp-reel-icon-on {
	display: block;
}

.pp-reels-carousel .pp-reel-sound.is-on .pp-reel-icon-off {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.pp-reels-carousel .pp-reel-caption,
	.pp-reels-carousel .pp-reel-sound {
		transition: none;
	}
}
