/* ============================================================
   EL PESO RINDE — CAPA DE MOVIMIENTO (reversible)
   Se activa con 2 líneas al final de cada página (ver abajo):
     <link rel="stylesheet" href="css/movimiento.css">
     <script src="js/movimiento.js" defer></script>
   Quitando esas 2 líneas, el sitio vuelve exactamente a su
   diseño base. NO modifica css/styles.css ni el contenido:
   todo va ENCIMA, con clases prefijadas mv-.
   Reglas: solo transform/opacity en animaciones de elementos
   (GPU, sin trabar el móvil), sin desbordamiento horizontal,
   sin tapar textos ni botones, y respeto total a
   prefers-reduced-motion (sin animaciones ni mascota).
   ============================================================ */

/* ---------- 1. Entrada al hacer scroll ----------
   El JS añade .mv-reveal a tarjetas, bloques, fotos, datos y
   títulos, y .mv-visible cuando entran en pantalla. Sin JS no
   se oculta nada: .mv-reveal solo existe si el JS corrió
   (el JS marca <html class="mv-js"> antes de observar). */
html.mv-js .mv-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
  will-change: opacity, transform;
}
html.mv-js .mv-reveal.mv-visible {
  opacity: 1;
  transform: none;
}
/* Variantes de entrada (opt-in, con la clase mv-reveal puesta) */
html.mv-js .mv-reveal.mv-desde-izq { transform: translateX(-22px); }
html.mv-js .mv-reveal.mv-desde-der { transform: translateX(22px); }
html.mv-js .mv-reveal.mv-zoom { transform: scale(.96); }
html.mv-js .mv-reveal.mv-visible.mv-desde-izq,
html.mv-js .mv-reveal.mv-visible.mv-desde-der,
html.mv-js .mv-reveal.mv-visible.mv-zoom { transform: none; }

/* ---------- 2. Hover con elevación ----------
   Solo bajo body.mv-on (el JS lo pone al arrancar), así que
   sin JS no cambia ningún hover del diseño base. Solo
   transform + sombra: nada de cambios de layout. */
body.mv-on .tarjeta,
body.mv-on .articulo-card,
body.mv-on .mv-lift {
  transition: transform .25s ease, box-shadow .25s ease;
}
body.mv-on .tarjeta:hover,
body.mv-on .articulo-card:hover,
body.mv-on .mv-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 74, 36, .16);
}
body.mv-on .btn,
body.mv-on .mv-boton {
  transition: transform .2s ease, filter .2s ease;
}
body.mv-on .btn:hover,
body.mv-on .mv-boton:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
body.mv-on .btn:active,
body.mv-on .mv-boton:active { transform: translateY(0) scale(.98); }

/* ---------- 3. Acentos de color animados ---------- */
/* Degradado verde/dorado con movimiento (solo fondo, opt-in) */
.mv-degradado {
  background: linear-gradient(100deg, #0f4a24, #1b7a3d 30%, #c9a227 52%, #1b7a3d 74%, #0f4a24);
  background-size: 220% 220%;
  animation: mvDegradado 9s ease-in-out infinite alternate;
}
@keyframes mvDegradado {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
/* Texto con degradado animado (títulos opt-in) */
.mv-titulo {
  background: linear-gradient(100deg, #0f4a24, #1b7a3d 35%, #c9a227 55%, #1b7a3d 75%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mvDegradado 8s ease-in-out infinite alternate;
}
/* Halo dorado/verde pulsante detrás de un elemento (opt-in) */
.mv-halo { position: relative; isolation: isolate; }
.mv-halo::after {
  content: ""; position: absolute; inset: -10px; z-index: -1;
  border-radius: inherit; pointer-events: none;
  background: radial-gradient(closest-side, rgba(201, 162, 39, .35), rgba(27, 122, 61, .18) 55%, transparent 75%);
  opacity: .7;
  animation: mvHalo 4.5s ease-in-out infinite;
}
@keyframes mvHalo {
  0%, 100% { opacity: .45; transform: scale(.97); }
  50% { opacity: .85; transform: scale(1.03); }
}
/* Partículas sutiles solo con CSS (opt-in, sobre un contenedor).
   Dos capas de puntitos dorados/verdes que suben y se desvanecen.
   El contenedor recorta: nunca genera scroll horizontal. */
.mv-particulas { position: relative; overflow: hidden; isolation: isolate; }
.mv-particulas::before,
.mv-particulas::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(circle, rgba(231, 217, 168, .9) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255, 255, 255, .55) 0 1.5px, transparent 2.5px);
  background-size: 120px 120px, 170px 170px;
  background-position: 0 0, 40px 60px;
  animation: mvParticulas 14s linear infinite;
}
.mv-particulas::after {
  animation-duration: 21s; animation-direction: reverse; opacity: .35;
}
@keyframes mvParticulas {
  from { transform: translateY(12px); }
  to { transform: translateY(-120px); }
}
/* El contenido real queda por encima de las partículas */
.mv-particulas > * { position: relative; z-index: 1; }

/* ---------- 4. Videos cortos en loop (opt-in) ----------
   El coordinador pone el <video> con preload="none" y data-src
   (nunca src directo, nunca autoplay con sonido, nunca en el
   hero). El JS carga y reproduce solo cuando está visible. */
.mv-video {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; border-radius: 14px;
  background: #0c3b1d;
  box-shadow: 0 6px 24px rgba(15, 74, 36, .12);
}
.mv-video-wrap { max-width: 860px; margin: 22px auto; }
.mv-video-wrap figcaption { padding: 10px 16px; font-size: .86rem; color: #5c5c5c; }

/* ---------- 5. Centavito flotante ----------
   Widget fijo abajo-izquierda. No tapa contenido central: mide
   ~110px, y en móvil ~84px. El botón de cierre es grande y
   siempre visible. pointer-events solo sobre el widget. */
.mv-centavito {
  position: fixed; left: 14px; bottom: 14px; z-index: 8900;
  width: 118px; text-align: center;
  animation: mvFlotar 4s ease-in-out infinite;
}
@keyframes mvFlotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.mv-centavito img {
  width: 100%; height: auto; display: block; margin: 0 auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
  cursor: pointer;
}
.mv-centavito-burbuja {
  background: #fff; color: #0f4a24; border: 2px solid #c9a227;
  border-radius: 14px; padding: 8px 10px; margin-bottom: 6px;
  font-size: .85rem; line-height: 1.35; font-weight: 600;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  opacity: 0; transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
.mv-centavito-burbuja.mv-mostrar { opacity: 1; transform: none; }
.mv-centavito-cerrar {
  position: absolute; top: -8px; left: -4px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff; background: #0f4a24; color: #fff;
  font-size: 17px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.mv-centavito.mv-entrada { animation: mvEntrar .6s ease both, mvFlotar 4s ease-in-out .6s infinite; }
@keyframes mvEntrar {
  from { opacity: 0; transform: translateY(26px) scale(.85); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .mv-centavito { width: 86px; left: 10px; bottom: 10px; }
  .mv-centavito-burbuja { font-size: .78rem; }
}

/* ---------- 5b. Botón flotante El Periódico del Peso ----------
   Esquina opuesta a Centavito: abajo-derecha. En pg-world.html
   no se crea (sería un enlace a sí misma). */
.mv-periodico {
  position: fixed; right: 16px; bottom: 14px; z-index: 8900;
  width: 56px; height: 56px; border-radius: 50%;
  background: #0f4a24; border: 2px solid #c9a227;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}
.mv-periodico:hover { filter: brightness(1.1); }
@media (max-width: 640px) {
  .mv-periodico { width: 48px; height: 48px; right: 12px; bottom: 10px; font-size: 22px; }
}

/* ---------- 6. Seguridad: nunca scroll horizontal ---------- */
.mv-centavito, .mv-particulas, .mv-video-wrap { max-width: 100vw; }

/* ---------- 7. prefers-reduced-motion: todo quieto ----------
   Sin animaciones, sin transiciones de entrada (contenido
   visible de inmediato) y mascota estática. */
@media (prefers-reduced-motion: reduce) {
  html.mv-js .mv-reveal,
  html.mv-js .mv-reveal.mv-visible {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .mv-degradado, .mv-titulo, .mv-halo::after,
  .mv-particulas::before, .mv-particulas::after,
  .mv-centavito { animation: none !important; }
  body.mv-on .tarjeta:hover, body.mv-on .articulo-card:hover,
  body.mv-on .mv-lift:hover, body.mv-on .btn:hover {
    transform: none; box-shadow: none; filter: none;
  }
}
