/* ==========================================================================
   Movimiento: entrada → revelado → interacción → transición.
   Lenguaje de la app: 10–12 px, curvas suaves, escalonado 40–55 ms.
   Solo con html.lmb-motion (lo pone el <head> si no hay prefers-reduced-motion).
   ========================================================================== */

:root {
	--lmb-m-ease: cubic-bezier(.22, 1, .36, 1);
	--lmb-m-dur: 360ms;
	--lmb-m-rise: 12px;
	--lmb-skeleton-a: #e8eef7;
	--lmb-skeleton-b: #f2f6fb;
}

/* 1–2. Entrada y revelado al hacer scroll. */
html.lmb-motion .lmb-r:not(.is-in) {
	opacity: 0;
	transform: translate3d(0, var(--lmb-m-rise), 0);
}

html.lmb-motion .lmb-r.is-in {
	animation: lmb-rise var(--lmb-m-dur) var(--lmb-m-ease) var(--lmb-d, 0ms) both;
}

@keyframes lmb-rise {
	from { opacity: 0; transform: translate3d(0, var(--lmb-m-rise), 0); }
	to   { opacity: 1; transform: none; }
}

/* La noticia principal es la imagen de carga (LCP): no parte de invisible, solo se asienta. */
html.lmb-motion .lmb-home-lead.lmb-r:not(.is-in) { opacity: 1; }
html.lmb-motion .lmb-home-lead.lmb-r.is-in { animation-name: lmb-settle; }

@keyframes lmb-settle {
	from { transform: translate3d(0, 10px, 0); }
	to   { transform: none; }
}

/* 3. Cabecera de categoría en tres tiempos: azul → foto → texto. */
html.lmb-motion .lmb-cat-hero.lmb-r:not(.is-in),
html.lmb-motion .lmb-cat-hero.lmb-r.is-in {
	opacity: 1;
	transform: none;
	animation: none;
}

html.lmb-motion .lmb-cat-hero.lmb-r .lmb-cat-hero__photo {
	transform: scale(1.06);
	clip-path: inset(0 0 0 22%);
}

html.lmb-motion .lmb-cat-hero.lmb-r.is-in .lmb-cat-hero__photo {
	animation: lmb-photo-reveal 620ms var(--lmb-m-ease) 80ms both;
}

@keyframes lmb-photo-reveal {
	from { clip-path: inset(0 0 0 22%); transform: scale(1.06); }
	to   { clip-path: inset(0 0 0 0); transform: scale(1); }
}

html.lmb-motion .lmb-cat-hero.lmb-r > :is(.lmb-cat-hero__kicker, .lmb-cat-hero__title, h1, .lmb-cat-hero__desc) {
	opacity: 0;
	transform: translate3d(0, var(--lmb-m-rise), 0);
}

html.lmb-motion .lmb-cat-hero.lmb-r.is-in > :is(.lmb-cat-hero__kicker, .lmb-cat-hero__title, h1, .lmb-cat-hero__desc) {
	animation: lmb-rise var(--lmb-m-dur) var(--lmb-m-ease) both;
}

html.lmb-motion .lmb-cat-hero.lmb-r.is-in > .lmb-cat-hero__kicker { animation-delay: 260ms; }
html.lmb-motion .lmb-cat-hero.lmb-r.is-in > :is(.lmb-cat-hero__title, h1) { animation-delay: 320ms; }
html.lmb-motion .lmb-cat-hero.lmb-r.is-in > .lmb-cat-hero__desc { animation-delay: 380ms; }

/* 4. Carga de imágenes: azul de marca muy sutil, nada de bloques grises. */
:is(.wp-block-post-featured-image, .lmb-lead__media, .lmb-article__media, .lmb-mini__media) {
	background: linear-gradient(110deg, var(--lmb-skeleton-a) 8%, var(--lmb-skeleton-b) 18%, var(--lmb-skeleton-a) 33%) !important;
	background-size: 200% 100% !important;
}

html.lmb-motion :is(.wp-block-post-featured-image, .lmb-lead__media, .lmb-article__media):has(img.lmb-img-wait:not(.lmb-img-in)) {
	animation: lmb-shimmer 1.6s linear infinite;
}

@keyframes lmb-shimmer {
	to { background-position-x: -200%; }
}

html.lmb-motion img.lmb-img-wait {
	opacity: 0;
	transition: opacity 320ms var(--lmb-m-ease);
}

html.lmb-motion img.lmb-img-wait.lmb-img-in {
	opacity: 1;
}

/* 6. Interacción contenida. */
@media (hover: hover) and (pointer: fine) {
	.lmb-card .wp-block-post-featured-image img {
		transition: transform 420ms var(--lmb-m-ease);
	}

	.lmb-card:hover .wp-block-post-featured-image img {
		transform: scale(1.022);
	}
}

@media (hover: none) {
	.lmb-card,
	.lmb-tabbar__item {
		transition: transform 140ms var(--lmb-m-ease);
	}

	.lmb-card:active,
	.lmb-tabbar__item:active {
		transform: scale(.985);
	}
}

/* Transición entre páginas: corta y suave (180–240 ms). */
@media (prefers-reduced-motion: no-preference) {
	::view-transition-old(root),
	::view-transition-new(root) {
		animation-duration: 220ms;
		animation-timing-function: var(--lmb-m-ease);
	}
}

/* Movimiento reducido: todo visible y quieto. */
@media (prefers-reduced-motion: reduce) {
	html.lmb-motion .lmb-r,
	html.lmb-motion .lmb-r > *,
	html.lmb-motion .lmb-cat-hero__photo,
	html.lmb-motion img.lmb-img-wait {
		opacity: 1 !important;
		transform: none !important;
		clip-path: none !important;
		animation: none !important;
	}
}
