/* =========================================================================
   Raimundo Motion – capa de movimiento sobre el tema "Raimundo Filmmaker"
   Todo lo de aquí solo se carga cuando el plugin está activo.
   ========================================================================= */

:root {
	--rfm-ease: cubic-bezier(0.2, 0.65, 0.2, 1);
}

/* ---------- 1. Aparición al hacer scroll ----------
   html.rfm-js lo pone el plugin en <head>. Si el script no carga, se quita solo
   a los 3,5 s y todo se ve normal. La lista de selectores es la misma que
   REVEAL_SELECTOR en rfm.js. */
html.rfm-js section:not(#hero_section) section-title,
html.rfm-js section:not(#hero_section) button-container,
html.rfm-js #about_me_section image-container,
html.rfm-js .projects-list > .project-item,
html.rfm-js #testimonials_section b-container,
html.rfm-js #clients_section li,
html.rfm-js #services_section images-grid-container image-container,
html.rfm-js #contact_map_section image-container,
html.rfm-js #contact_map_section b-map,
html.rfm-js #contact_section .contact-links li,
html.rfm-js page-title,
html.rfm-js #content_section b-content > * {
	opacity: 0;
	transform: translate3d(0, 28px, 0);
	transition:
		opacity 0.9s var(--rfm-ease),
		transform 0.9s var(--rfm-ease);
}

/* Las tarjetas de proyecto de la portada ya tenían una transición de anchura en el tema */
html.rfm-js .home #featured_projects_section .projects-list > .project-item {
	transition:
		opacity 0.9s var(--rfm-ease),
		transform 0.9s var(--rfm-ease),
		max-width 0.3s var(--transition-curve, ease);
}

html.rfm-js .rfm-in {
	opacity: 1 !important;
	transform: none !important;
}

/* ---------- 2. Previsualización de vídeo en las tarjetas ---------- */
.project-item image-container.rfm-has-preview {
	position: relative;
	overflow: hidden;
}

.rfm-preview {
	position: absolute;
	inset: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	background-color: #000;
	border-radius: inherit;
	transition: opacity 0.45s ease;
}

.rfm-preview.rfm-on {
	opacity: 1;
}

.rfm-preview iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 101%;
	height: 101%;
	border: 0;
	pointer-events: none;
	transform: translate(-50%, -50%);
}

/* Barra fina de progreso, arriba para que no la tape el degradado del título */
.rfm-preview-bar {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	width: 100%;
	height: 3px;
	background-color: rgba(255, 255, 255, 0.85);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.25s linear;
}

/* ---------- 3. Cabecera: proyectos destacados después del logo ---------- */
/* Corte seco entre proyectos: sin fundido */
.home #hero_section video-container iframe.rfm-hero-clip {
	z-index: 1;
	opacity: 0;
	transition: none;
}

.home #hero_section video-container iframe.rfm-hero-clip.rfm-on {
	opacity: 1;
}

/* ---------- 4. Fotos de Servicios que rotan ---------- */
#services_section image-container.rfm-rot {
	position: relative;
	overflow: hidden;
}

.rfm-rot-layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	opacity: 0;
	transition: opacity 0.6s ease;
}

.rfm-rot-layer.rfm-on {
	opacity: 1;
}

/* ---------- 5. Logos de clientes: foco al pasar el ratón ---------- */
@media (hover: hover) and (pointer: fine) {
	.home #clients_section ul image-container {
		transition:
			width 0.3s var(--transition-curve, ease),
			opacity 0.35s ease,
			transform 0.35s var(--rfm-ease);
	}

	.home #clients_section ul:hover image-container {
		opacity: 0.45;
	}

	.home #clients_section ul li:hover image-container {
		opacity: 1;
		transform: scale(1.08);
	}
}

/* ---------- 6. "¿Dónde estamos?": vídeo en lugar de la foto ---------- */
#contact_map_section image-container.rfm-has-bgvideo {
	position: relative;
	overflow: hidden;
}

.rfm-bgvideo {
	position: absolute;
	inset: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	border-radius: inherit;
	transition: opacity 0.5s ease;
}

.rfm-bgvideo.rfm-on {
	opacity: 1;
}

.rfm-bgvideo iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 101%;
	height: 101%;
	border: 0;
	pointer-events: none;
	transform: translate(-50%, -50%);
}

/* Vídeo vertical: el recuadro se adapta (solo mientras el vídeo esté puesto) */
@media (max-width: 767px) {
	#contact_map_section.rfm-map-portrait b-content:has(image-container) image-container {
		aspect-ratio: 4 / 5;
	}
}

@media (min-width: 768px) and (max-width: 1023px) {
	#contact_map_section.rfm-map-portrait b-content:has(image-container) image-container {
		aspect-ratio: 4 / 3;
	}
}

@media (min-width: 1024px) {
	#contact_map_section.rfm-map-portrait b-content:has(image-container) {
		--content-columns: 0.75fr 1.25fr;
		align-items: stretch;
	}

	#contact_map_section.rfm-map-portrait b-content:has(image-container) image-container {
		height: auto;
		aspect-ratio: 3 / 4;
	}

	#contact_map_section.rfm-map-portrait b-content:has(image-container) b-map {
		height: auto;
	}
}
