/*
 * Estudio Tappa · motion (original brief §7, values from index.html of the design):
 * - featured testimonial rotates every 8s with fade, indicators and pause on hover. The quotes and
 *   dots come from the "Testimonio" posts (inc/content-types.php): 1 = static, 2–5 = one cycle of
 *   8s × count, selected with :has() (browsers without :has() show the first quote, static);
 * - hero entrance: fade + 16px, staggered;
 * - blocks: subtle entrance on scroll (scroll-driven, once per pass, no bounce or zoom);
 * - everything is off with prefers-reduced-motion: reduce (static fallback = first testimonial).
 */

@keyframes tappa-tst {
	0% { opacity: 0; visibility: hidden; transform: translateY(10px); }
	2.5%, 31% { opacity: 1; visibility: visible; transform: none; }
	33.3%, 100% { opacity: 0; visibility: hidden; transform: translateY(-6px); }
}

@keyframes tappa-tstd {
	0% { width: 8px; background: var(--bordo-claro); }
	1.5%, 33.3% { width: 28px; background: var(--dorado); }
	35%, 100% { width: 8px; background: var(--bordo-claro); }
}

/* Same timing for 2, 4 and 5 featured quotes (tappa-tst / tappa-tstd above = 3). */
@keyframes tappa-tst-2 {
	0% { opacity: 0; visibility: hidden; transform: translateY(10px); }
	3.75%, 46.5% { opacity: 1; visibility: visible; transform: none; }
	50%, 100% { opacity: 0; visibility: hidden; transform: translateY(-6px); }
}

@keyframes tappa-tstd-2 {
	0% { width: 8px; background: var(--bordo-claro); }
	2.25%, 50% { width: 28px; background: var(--dorado); }
	52.5%, 100% { width: 8px; background: var(--bordo-claro); }
}

@keyframes tappa-tst-4 {
	0% { opacity: 0; visibility: hidden; transform: translateY(10px); }
	1.875%, 23.25% { opacity: 1; visibility: visible; transform: none; }
	25%, 100% { opacity: 0; visibility: hidden; transform: translateY(-6px); }
}

@keyframes tappa-tstd-4 {
	0% { width: 8px; background: var(--bordo-claro); }
	1.125%, 25% { width: 28px; background: var(--dorado); }
	26.25%, 100% { width: 8px; background: var(--bordo-claro); }
}

@keyframes tappa-tst-5 {
	0% { opacity: 0; visibility: hidden; transform: translateY(10px); }
	1.5%, 18.6% { opacity: 1; visibility: visible; transform: none; }
	20%, 100% { opacity: 0; visibility: hidden; transform: translateY(-6px); }
}

@keyframes tappa-tstd-5 {
	0% { width: 8px; background: var(--bordo-claro); }
	0.9%, 20% { width: 28px; background: var(--dorado); }
	21%, 100% { width: 8px; background: var(--bordo-claro); }
}

@keyframes tappa-hero {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

@keyframes tappa-rv {
	from { transform: translateY(32px); }
	to { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {

	/* Testimonials (Home): stacked quotes 35deda5b, indicators 4141d6ce, block 6cba1e35 */
	[data-id="35deda5b"]:where(:has(> :nth-child(3):last-child)) > * {
		animation: tappa-tst 24s infinite both;
	}

	[data-id="4141d6ce"]:where(:has(> :nth-child(3):last-child)) > * {
		animation: tappa-tstd 24s infinite both;
	}

	[data-id="35deda5b"]:where(:has(> :nth-child(2):last-child)) > * {
		animation: tappa-tst-2 16s infinite both;
	}

	[data-id="4141d6ce"]:where(:has(> :nth-child(2):last-child)) > * {
		animation: tappa-tstd-2 16s infinite both;
	}

	[data-id="35deda5b"]:where(:has(> :nth-child(4):last-child)) > * {
		animation: tappa-tst-4 32s infinite both;
	}

	[data-id="4141d6ce"]:where(:has(> :nth-child(4):last-child)) > * {
		animation: tappa-tstd-4 32s infinite both;
	}

	[data-id="35deda5b"]:where(:has(> :nth-child(5):last-child)) > * {
		animation: tappa-tst-5 40s infinite both;
	}

	[data-id="4141d6ce"]:where(:has(> :nth-child(5):last-child)) > * {
		animation: tappa-tstd-5 40s infinite both;
	}

	[data-id="35deda5b"] > :nth-child(2),
	[data-id="4141d6ce"] > :nth-child(2) {
		animation-delay: 8s;
	}

	[data-id="35deda5b"] > :nth-child(3),
	[data-id="4141d6ce"] > :nth-child(3) {
		animation-delay: 16s;
	}

	[data-id="35deda5b"] > :nth-child(4),
	[data-id="4141d6ce"] > :nth-child(4) {
		animation-delay: 24s;
	}

	[data-id="35deda5b"] > :nth-child(5),
	[data-id="4141d6ce"] > :nth-child(5) {
		animation-delay: 32s;
	}

	[data-id="6cba1e35"]:hover [data-id="35deda5b"] > *,
	[data-id="6cba1e35"]:hover [data-id="4141d6ce"] > * {
		animation-play-state: paused;
	}

	/* Hero entrance: Home, Nosotros, Contacto, blog listing and single post */
	[data-id="4a4864ec"] > *,
	[data-id="b1d5e7a0"] > *,
	[data-id="205c1a9d"] > *,
	[data-id="1d699eaf"],
	[data-id="b10ff001"] > *,
	.page-id-219 [data-elementor-type="wp-page"] > .e-con:first-child > .e-con > * {
		animation: tappa-hero .7s ease both;
	}

	[data-id="4a4864ec"] > :nth-child(2),
	[data-id="b1d5e7a0"] > :nth-child(2),
	[data-id="205c1a9d"] > :nth-child(2),
	[data-id="b10ff001"] > :nth-child(2),
	.page-id-219 [data-elementor-type="wp-page"] > .e-con:first-child > .e-con > :nth-child(2) {
		animation-delay: .18s;
	}

	[data-id="205c1a9d"] > :nth-child(3),
	[data-id="1d699eaf"],
	.page-id-219 [data-elementor-type="wp-page"] > .e-con:first-child > .e-con > :nth-child(3) {
		animation-delay: .36s;
	}

	[data-id="205c1a9d"] > :nth-child(4) {
		animation-delay: .5s;
	}

	/* Blocks on scroll (browsers with scroll-driven animations; others simply show them) */
	@supports (animation-timeline: view()) {
		[data-elementor-type="wp-page"] > .e-con:not(:first-child) > .e-con > *,
		[data-elementor-type="single-post"] > .e-con > .e-con:not(:first-child) > * {
			animation: tappa-rv linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 45%;
		}
	}
}
