/*
 * RMD · Resistencia Migrante Disidente
 * Comportamiento global que no se puede expresar con las clases globales de Elementor V4.
 * Los estilos visuales viven en las clases globales; aquí solo: foco, cabecera fija,
 * animaciones, carrusel, acordeón y movimiento reducido.
 * Breakpoints: los de Elementor por defecto (Tablet ≤ 1024, Móvil ≤ 767).
 */

/* ---------- Accesibilidad: foco y salto al contenido ---------- */
:where(a, button, summary, [tabindex], input, select, textarea):focus-visible {
	outline: 3px solid var(--magenta, #EA24E5);
	outline-offset: 3px;
}
.fondo-blanco :focus-visible,
.fondo-magenta :focus-visible,
.fondo-verde :focus-visible {
	outline-color: var(--negro, #000);
}
.skip-link.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	width: auto;
	height: auto;
	position: fixed;
	left: 16px;
	top: 16px;
	z-index: 100000;
	background: var(--magenta, #EA24E5);
	color: #000 !important;
	padding: 12px 18px;
	font-weight: 600;
	text-decoration: none;
}
[id] { scroll-margin-top: 110px; }

/* Kuhlman Variable (Adobe Fonts) · estilo Condensed (eje wdth: 50 Condensed · 75 Narrow · 100 Regular · 125 Wide) */
.titulo-display,
.pegatina-titulo,
.cinta-palabra,
.menu-panel-enlace,
.hito-anio {
	font-stretch: 50%;
	font-variation-settings: "SEED" 0, "wdth" 50;
}

/* ---------- Cabecera ----------
 * Estructura en la plantilla Header:
 *   .cabecera-logo  > a.logo-enlace > img.logo-completo + img.logo-simbolo
 *   .cabecera-sitio > .menu-enlaces (escritorio) + .menu-boton (e-flexbox tag button, con .icono-abrir/.icono-cerrar)
 *                   > .menu-panel (panel magenta en tablet/móvil)
 */
.cabecera-logo,
.cabecera-sitio {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
}
body.admin-bar .cabecera-logo,
body.admin-bar .cabecera-sitio { top: 32px; }
@media (max-width: 782px) {
	body.admin-bar .cabecera-logo,
	body.admin-bar .cabecera-sitio { top: 46px; }
}
.cabecera-sitio {
	z-index: 50;
	mix-blend-mode: difference;
	color: #fff;
}
.cabecera-logo {
	z-index: 51;
	pointer-events: none;
}
.cabecera-logo a { pointer-events: auto; }
.logo-enlace { position: relative; display: block; }
.logo-enlace .logo-completo {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: auto;
	max-width: none;
	transition: opacity .35s ease;
}
.logo-enlace .logo-simbolo { opacity: 0; transition: opacity .35s ease; }
.rmd-scrolled .logo-enlace .logo-completo { opacity: 0; }
.rmd-scrolled .logo-enlace .logo-simbolo { opacity: 1; }

.menu-boton { cursor: pointer; color: #fff; }
@media (hover: hover) {
	.menu-boton:hover { color: var(--magenta, #EA24E5); }
}
/* Iconos dibujados con CSS (no requieren SVG subido) */
.icono-abrir, .icono-cerrar { position: relative; padding: 0 !important; flex: none; }
.icono-abrir {
	width: 38px !important;
	height: 26px;
	border-top: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
}
.icono-abrir::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 2.5px;
	margin-top: -1.25px;
	background: currentColor;
}
.icono-cerrar { width: 30px !important; height: 30px; }
.icono-cerrar::before,
.icono-cerrar::after {
	content: "";
	position: absolute;
	left: -4px;
	right: -4px;
	top: 50%;
	height: 2.5px;
	margin-top: -1.25px;
	background: currentColor;
	transform: rotate(45deg);
}
.icono-cerrar::after { transform: rotate(-45deg); }
.menu-boton .icono-cerrar { display: none !important; }
.cabecera-sitio.is-open .menu-boton .icono-abrir { display: none !important; }
.cabecera-sitio.is-open .menu-boton .icono-cerrar { display: block !important; }
.menu-enlaces a[aria-current="page"] { border-bottom-color: var(--magenta, #EA24E5); }

.menu-panel { display: none !important; }

@media (min-width: 1025px) {
	.menu-enlaces {
		opacity: 0;
		visibility: hidden;
		transform: translateX(24px);
		transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
	}
	.cabecera-sitio.is-open .menu-enlaces {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity .25s ease, transform .25s ease, visibility 0s;
	}
}
@media (max-width: 1024px) {
	.menu-enlaces { display: none !important; }
	.cabecera-sitio.is-open { mix-blend-mode: normal; background: #000; }
	.cabecera-sitio.is-open .menu-panel { display: block !important; }
	/* Menú abierto a pantalla completa (2026-11-04); la página de debajo no se desplaza */
	.cabecera-sitio.is-open {
		bottom: 0;
		display: flex;
		flex-direction: column;
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.cabecera-sitio.is-open .cabecera-barra { flex: none; }
	.cabecera-sitio.is-open .menu-panel { flex: 1 0 auto; }
	html.rmd-menu-abierto,
	html.rmd-menu-abierto body { overflow: hidden; }
}

/* ---------- Selector de idioma (VAL / CAS) ----------
 * .selector-idioma > a.idioma-circulo × 2, en .menu-enlaces (junto a Contacto) y en .menu-panel.
 * Idioma actual: aria-current="true" (relleno). Cabecera: blanco con texto negro; panel: negro con texto magenta.
 */
.menu-enlaces .idioma-circulo[aria-current] { background-color: var(--blanco, #fff); color: var(--negro, #000); }
.menu-panel .idioma-circulo[aria-current] { background-color: var(--negro, #000); color: var(--magenta, #EA24E5); }
@media (hover: hover) {
	.menu-enlaces .idioma-circulo:hover { background-color: var(--blanco, #fff); color: var(--negro, #000); }
	.menu-panel .idioma-circulo:hover { background-color: var(--negro, #000); color: var(--magenta, #EA24E5); }
}

/* ---------- Hero con fotos (corte seco cada 2 s) ----------
 * .hero > .hero-fotos > .hero-ventana.hero-ventana-a / .hero-ventana-b > imágenes
 * Botón: .hero-pausa (dentro de .hero)
 */
.hero { position: relative; overflow: hidden; }
.hero-fotos { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-ventana { position: absolute; overflow: hidden; background: #111; padding: 0; }
.hero-ventana-a { left: 0; top: 12px; width: 39%; aspect-ratio: 1.6; }
.hero-ventana-b { right: 1%; bottom: 56px; width: 37%; aspect-ratio: 1.33; }
.hero-ventana > * {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0;
}
.hero-ventana img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.86); }
.hero-ventana:not(.rmd-js) > :first-child,
.hero-ventana > .is-activa { opacity: 1; }
@media (max-width: 767px) {
	.hero-ventana-a { width: 72%; top: 8px; }
	.hero-ventana-b { width: 66%; bottom: 70px; }
}

/* ---------- Hero con vídeo de fondo (sustituye a las ventanas de fotos) ----------
 * .hero > .hero-fotos > video.hero-video.hero-video-escritorio + video.hero-video.hero-video-movil
 * Las clases globales los colocan a sangre y muestran uno u otro según el breakpoint;
 * el JS reproduce solo el visible (y responde a «Pausar fondo»).
 */
.hero-fotos:has(.hero-video) { max-width: none !important; }
.hero-video { filter: brightness(.86); pointer-events: none; }

/* ---------- Manifiesto fijo: las secciones siguientes pasan por encima ---------- */
.manifiesto-fijo { position: sticky; top: 0; z-index: 0; }
.manifiesto-fijo ~ * { position: relative; z-index: 1; }

/* ---------- Cinta de ejes ----------
 * .cinta-ejes > .cinta-pista > .cinta-grupo > .cinta-palabra
 * Botón: .cinta-pausa. El JS duplica .cinta-grupo para el bucle (copia oculta a lectores).
 */
.cinta-pista { display: flex; width: max-content; animation: rmd-cinta 38s linear infinite; }
.cinta-grupo { display: flex; flex: none; align-items: center; padding: 22px 0; }
.cinta-ejes.is-paused .cinta-pista { animation-play-state: paused; }
.cinta-pausa { position: absolute; right: 16px; bottom: 12px; z-index: 2; }
@keyframes rmd-cinta { to { transform: translateX(-50%); } }

/* ---------- Carrusel (proyectos en Home, línea de tiempo en Nosotres) ----------
 * Aplicar .carrusel al contenedor que hace scroll (en un Loop: al layout del Loop)
 * y .carrusel-item a cada ítem. Botones: .carrusel-anterior / .carrusel-siguiente.
 */
.carrusel {
	display: flex;
	flex-wrap: nowrap;
	gap: 16px;
	align-items: flex-start;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	/* Alineado con la caja (.contenedor): en pantallas más anchas que ancho-max,
	 * el margen crece para que la primera tarjeta empiece donde empieza el contenido. */
	--carrusel-margen: max(var(--margen-lateral, 40px), calc((100% - var(--ancho-max, 1600px)) / 2 + var(--margen-lateral, 40px)));
	padding: 28px var(--carrusel-margen) 44px;
	scroll-padding-inline: var(--carrusel-margen);
}
.carrusel::-webkit-scrollbar { display: none; }
.carrusel-item { flex: none; scroll-snap-align: start; }
@media (max-width: 1024px) {
	.carrusel { padding-inline: var(--margen-lateral-tablet, 40px); scroll-padding-inline: var(--margen-lateral-tablet, 40px); }
}
@media (max-width: 767px) {
	.carrusel { gap: 12px; padding-inline: var(--margen-lateral-movil, 20px); scroll-padding-inline: var(--margen-lateral-movil, 20px); }
}

/* Botones anterior/siguiente: flecha dibujada con CSS, centrada en el círculo
 * (el carácter ← → dependía de la fuente y quedaba descentrado en móvil).
 * El texto queda en el DOM; el JS pone aria-label «Anterior» / «Siguiente». */
.boton-control.carrusel-anterior,
.boton-control.carrusel-siguiente {
	position: relative;
	font-size: 0 !important;
	line-height: 0 !important;
}
.boton-control.carrusel-anterior::before,
.boton-control.carrusel-siguiente::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 2px;
	margin: -1px 0 0 -9px;
	background: currentColor;
}
.boton-control.carrusel-anterior::after,
.boton-control.carrusel-siguiente::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	box-sizing: border-box;
	width: 10px;
	height: 10px;
	margin-top: -5px;
	border-top: 2px solid currentColor;
	border-left: 2px solid currentColor;
}
.boton-control.carrusel-anterior::after { margin-left: -8px; transform: rotate(-45deg); }
.boton-control.carrusel-siguiente::after { margin-left: -2px; transform: rotate(135deg); }

/* Estado :hover de los botones (las clases globales de Elementor no lo guardan).
 * Hello Elementor pinta los <button> de #c36 al pasar el ratón; aquí se usa la paleta de la web.
 * :where() mantiene la prioridad baja: los estilos propios de cada botón (p. ej. Historia) siguen mandando. */
@media (hover: hover) {
	.elementor :where(.boton-pausa):hover { color: var(--negro, #000); background-color: var(--blanco, #fff); }
	.elementor :where(.boton-control):hover { color: var(--blanco, #fff); background-color: var(--negro, #000); }
}

/* Pantallas táctiles: el estado :hover se queda «pegado» tras tocar un botón. Se anulan los hover
 * que genera Elementor en las flechas y en los botones de pausa (el foco con teclado se mantiene). */
@media (hover: none) {
	.elementor .boton-control.carrusel-anterior:hover,
	.elementor .boton-control.carrusel-siguiente:hover { color: var(--negro, #000); background-color: transparent; }
	.elementor .hero-pausa.boton-pausa:hover { color: var(--blanco, #fff); background-color: transparent; }
	.elementor .cinta-pausa.boton-pausa:hover { color: var(--negro, #000); background-color: var(--blanco, #fff); }
	.elementor .muro-reordenar.boton-pausa:hover { color: inherit; background-color: transparent; }
	/* Pastillas de contorno: el hover no se queda pegado y el cambio es instantáneo (la transición se veía gris).
	 * Al tocarlas, el JS añade .is-pulsado: mismo relleno que el hover de escritorio hasta que carga la página siguiente. */
	.elementor .boton-pill { transition: none; }
	.elementor .boton-pill:not(.boton-pill-relleno):not(.boton-pill-invertido):not(.boton-pill-magenta):hover { color: var(--negro, #000); background-color: transparent; }
	.elementor .boton-pill-magenta.boton-pill:hover { color: var(--magenta, #EA24E5); background-color: transparent; }
	.elementor .boton-pill.is-pulsado:not(.boton-pill-relleno):not(.boton-pill-invertido):not(.boton-pill-magenta) { color: var(--blanco, #fff); background-color: var(--negro, #000); }
	.elementor .boton-pill-magenta.boton-pill.is-pulsado { color: var(--negro, #000); background-color: var(--magenta, #EA24E5); }
}

/* «Pausar fondo» del hero: blanco al pulsarlo y mientras el fondo está en pausa («Reanudar fondo») */
.elementor .hero-pausa.boton-pausa:active,
.elementor .hero-pausa.boton-pausa[aria-pressed="true"] { color: var(--negro, #000); background-color: var(--blanco, #fff); }
a, button, summary, [role="button"] { -webkit-tap-highlight-color: transparent; }

/* Línea de tiempo (Nosotres · Historia) */
.linea-tiempo { scroll-snap-type: x mandatory; scrollbar-width: none; }
.linea-tiempo::-webkit-scrollbar { display: none; }
.hito { scroll-snap-align: start; }
.hito::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 120px;
	height: 3px;
	background: currentColor;
}
.hito-anio { transition: transform .3s ease; }
.hito-punto { transition: transform .25s ease; }
.hito:hover .hito-anio { transform: translateY(-8px); }
.hito:hover .hito-punto { transform: scale(1.4); }
.hito .hito-punto + .texto-etiqueta { margin-top: 22px; }
.hito .hito-punto + .hito-texto,
.hito .hito-punto + .hito-columnas { margin-top: 24px; }

/* Tarjetas de proyecto: tamaños alternos y giro al pasar el ratón */
.carrusel-item:nth-child(4n+1) .tarjeta-proyecto { width: 340px; height: 346px; }
.carrusel-item:nth-child(4n+2) .tarjeta-proyecto { width: 410px; height: 468px; }
.carrusel-item:nth-child(4n+3) .tarjeta-proyecto { width: 300px; height: 266px; }
.carrusel-item:nth-child(4n+4) .tarjeta-proyecto { width: 300px; height: 346px; }
.carrusel-item:nth-child(even) .tarjeta-proyecto:hover,
.carrusel-item:nth-child(even) .tarjeta-proyecto:focus-visible { transform: translateY(-16px) rotate(1.5deg); }
.tarjeta-proyecto:focus-visible { transform: translateY(-16px) rotate(-1.5deg); }
@media (max-width: 767px) {
	.carrusel-item:nth-child(4n+1) .tarjeta-proyecto { width: 260px; height: 290px; }
	.carrusel-item:nth-child(4n+2) .tarjeta-proyecto { width: 280px; height: 360px; }
	.carrusel-item:nth-child(4n+3) .tarjeta-proyecto,
	.carrusel-item:nth-child(4n+4) .tarjeta-proyecto { width: 240px; height: 250px; }
}
.tarjeta-proyecto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Campos vacíos de proyectos (ACF): no dejar huecos ---------- */
.texto-cuerpo:empty,
.texto-grande:empty,
.texto-etiqueta:empty,
.ficha-valor:empty,
.acordeon-subtitulo:empty { display: none !important; }
.ficha-linea:has(> .ficha-valor:empty) { display: none !important; }
img.proyecto-logo:not([src]),
img.proyecto-logo[src=""] { display: none !important; }
.rmd-vacio { display: none !important; }

/* ---------- Acordeón de proyectos (e-accordion, <details>) ---------- */
details[open] .acordeon-subtitulo { opacity: 0; visibility: hidden; }
.acordeon-cabecera { list-style: none; }
.acordeon-cabecera::-webkit-details-marker { display: none; }
.acordeon-cabecera:hover .acordeon-titulo { color: var(--magenta, #EA24E5); }
.acordeon-cabecera:focus-visible { outline: 3px solid var(--magenta, #EA24E5); outline-offset: 4px; }
/* Icono +/− dibujado con CSS (sustituye al chevrón por defecto) */
.acordeon-icono { transform: none !important; }
.acordeon-icono > * { display: none !important; }
.acordeon-icono::before,
.acordeon-icono::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 40px;
	height: 4px;
	margin: -2px 0 0 -20px;
	background: currentColor;
}
.acordeon-icono::after { transform: rotate(90deg); }
details[open] > summary .acordeon-icono::after { display: none; }
@media (max-width: 767px) {
	.acordeon-icono::before, .acordeon-icono::after { width: 28px; margin-left: -14px; }
}
.acordeon-subtitulo { transition: opacity .2s ease; }
.proyecto-slug { display: none !important; }

/* ---------- Servicios: entrada escalonada (el JS asigna --i) ---------- */
.servicio-fila {
	position: relative;
	border-top-color: transparent !important;
	animation: rmd-sube .8s cubic-bezier(.2, .7, .2, 1) both;
	animation-delay: calc(var(--i, 0) * 140ms + 120ms);
}
.servicio-fila::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -2px;
	height: 2px;
	background: currentColor;
	transform-origin: left center;
	animation: rmd-linea .4s cubic-bezier(.5, 0, .2, 1) both;
	animation-delay: calc(var(--i, 0) * 90ms);
}
.servicio-fila .acordeon-titulo { transition: color .2s ease, transform .3s cubic-bezier(.2, .7, .2, 1); }
.servicio-fila:hover .acordeon-titulo { color: var(--magenta, #EA24E5); transform: translateX(8px); }
@keyframes rmd-sube { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes rmd-linea { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Pegatinas de principios: giro + arrastre ----------
 * El JS mueve cada pegatina con --x / --y (ratón, dedo o flechas del teclado).
 * Botón «Volver a ordenar»: .muro-reordenar. En móvil no se arrastran.
 */
.pegatina {
	position: relative;
	transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg));
	transition: transform .25s ease, box-shadow .2s ease;
}
.pegatina:nth-child(8n+1) { --r: -2.2deg; }
.pegatina:nth-child(8n+2) { --r: 1.6deg; }
.pegatina:nth-child(8n+3) { --r: -1deg; }
.pegatina:nth-child(8n+4) { --r: 2.4deg; }
.pegatina:nth-child(8n+5) { --r: -1.8deg; }
.pegatina:nth-child(8n+6) { --r: 1.2deg; }
.pegatina:nth-child(8n+7) { --r: -2.6deg; }
.pegatina:nth-child(8n+8) { --r: 2deg; }
@media (min-width: 768px) {
	.pegatina.rmd-arrastrable {
		cursor: grab;
		user-select: none;
		-webkit-user-select: none;
		touch-action: none;
	}
	.pegatina.is-drag {
		--r: 0deg;
		cursor: grabbing;
		transition: none;
		box-shadow: 0 22px 36px rgba(0, 0, 0, .5) !important;
	}
}
.pegatina:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@media (max-width: 767px) {
	.pegatina:nth-child(n) { --r: 0deg; --x: 0px !important; --y: 0px !important; }
	.muro-barra { display: none !important; }
}

/* ---------- Efecto spray (filtros SVG que inserta el JS) ---------- */
.hito::before { filter: url(#rmd-spray); }
.hito-punto { filter: url(#rmd-spray-dot); }

/* ---------- Línea de tiempo: entrada de los hitos ----------
 * El hito no se desplaza (es el punto de encaje del scroll-snap: si se movía, el navegador encajaba
 * en la posición desplazada y en móvil el texto quedaba cortado al pulsar «siguiente» la primera vez).
 * El hito hace el fundido y su contenido entra 48 px desde la derecha con «translate»,
 * que no interfiere con los «transform» del hover del año y de la bola. */
.hito { transition: opacity .7s ease; }
.hito.is-hidden { opacity: 0; }
.hito.is-in { opacity: 1; }
.hito > * { transition: translate .7s cubic-bezier(.2, .7, .2, 1); }
.hito > .hito-anio { transition: transform .3s ease, translate .7s cubic-bezier(.2, .7, .2, 1); }
.hito > .hito-punto { transition: transform .25s ease, translate .7s cubic-bezier(.2, .7, .2, 1); }
.hito.is-hidden > * { translate: 48px 0; }

/* ---------- Páginas legales (.legal): enlaces dentro del texto ---------- */
.legal a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
}
.legal a:hover { color: var(--magenta, #EA24E5); }
.legal strong { font-weight: 600; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
	.cinta-pista { width: auto; }
	.cinta-grupo { flex-wrap: wrap; padding-inline: 40px; }
	.cinta-grupo[aria-hidden="true"], .cinta-pausa, .hero-pausa { display: none !important; }
	.hito.is-hidden { opacity: 1; }
	.hito.is-hidden > * { translate: none; }
	.tarjeta-proyecto:hover, .tarjeta-proyecto:focus-visible,
	.lista-servicios-item:hover, .servicio-fila:hover .acordeon-titulo { transform: none !important; }
}

/* ---------- Flechas (← → ↓ ↗) como texto, no como emoji ----------
 * En los textos van seguidas de U+FE0E; esto es la red de seguridad para navegadores que lo admiten.
 */
body { font-variant-emoji: text; }
