/* =========================================================
   DESTACADOS NIUVO — 4 imágenes con animación al bajar
   100% CSS (no necesita JavaScript).
   Prefijo "dniuvo-" para no afectar otros estilos.
   ========================================================= */

.dniuvo-seccion {
    --dniuvo-acento: #f29bb6;
    --dniuvo-texto: #1f1f1f;
    --dniuvo-suave: #555;
    --dniuvo-radio: 16px;
    --dniuvo-espacio: 18px;

    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 16px;
    font-family: "Lato", "Segoe UI", Arial, sans-serif;
    color: var(--dniuvo-texto);
    overflow: hidden;
    /* evita scroll lateral durante la animación */
}

.dniuvo-seccion *,
.dniuvo-seccion *::before,
.dniuvo-seccion *::after {
    box-sizing: border-box;
}

/* ---------- Encabezado ---------- */
.dniuvo-encabezado {
    text-align: center;
    margin: 0 0 32px;
}

.dniuvo-titulo {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.dniuvo-punto {
    display: inline-block;
    color: var(--dniuvo-acento);
}

.dniuvo-subtitulo {
    margin: 6px 0 0;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--dniuvo-suave);
}

/* Línea decorativa bajo el título */
.dniuvo-encabezado::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    margin: 14px auto 0;
    border-radius: 3px;
    background: var(--dniuvo-acento);
}

/* ---------- Cuadrícula 2 x 2 ---------- */
.dniuvo-cuadricula {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--dniuvo-espacio);
}

.dniuvo-tarjeta {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--dniuvo-radio);
   
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    transition: box-shadow .4s ease, translate .4s ease;
}

.dniuvo-tarjeta:hover {
    box-shadow: 0 18px 36px rgba(0, 0, 0, .16);
    translate: 0 -4px;
}

.dniuvo-seccion .dniuvo-imagen {
    display: block;

    height: 100%;
 
    object-fit: cover;
    transition: scale .9s cubic-bezier(.2, .7, .2, 1);
}

.dniuvo-tarjeta:hover .dniuvo-imagen {
    scale: 1.06;
}

/* Brillo al pasar el mouse */
.dniuvo-tarjeta::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .4), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.dniuvo-tarjeta:hover::after {
    animation: dniuvo-brillo .9s ease;
}

/* =========================================================
   ANIMACIÓN ÚNICA AL BAJAR — "Cortina Niuvo"
   Cada imagen se abre como una cortina desde el centro,
   entra desde su lado (izquierda / derecha) con un leve giro
   y desenfoque, mientras la foto hace un zoom suave hacia atrás.
   Avanza al ritmo del scroll (sube y baja contigo).
   ========================================================= */
@supports (animation-timeline: view()) {

    /* Título: sube y se aclara */
    .dniuvo-encabezado {
        animation: dniuvo-subir linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 100%;
    }

    .dniuvo-encabezado::after {
        animation: dniuvo-linea linear both;
        animation-timeline: view();
        animation-range: entry 40% entry 100%;
    }

    .dniuvo-punto {
        animation: dniuvo-rebote linear both;
        animation-timeline: view();
        animation-range: entry 60% entry 100%;
    }

    /* Tarjetas: cortina + entrada lateral */
    .dniuvo-tarjeta {
        animation: dniuvo-cortina-izq linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 90%;
    }

    .dniuvo-tarjeta:nth-child(even) {
        animation-name: dniuvo-cortina-der;
        animation-range: entry 15% entry 100%;
        /* la derecha llega un poco después */
    }

    /* Foto interior: zoom hacia atrás (efecto profundidad) */
    .dniuvo-seccion .dniuvo-imagen {
        animation: dniuvo-zoom linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 100%;
    }
}

/* ---------- Keyframes ---------- */
@keyframes dniuvo-subir {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

@keyframes dniuvo-linea {
    from {
        width: 0;
    }

    to {
        width: 60px;
    }
}

@keyframes dniuvo-rebote {
    0% {
        transform: translateY(-30px) scale(0);
    }

    70% {
        transform: translateY(4px) scale(1.4);
    }

    100% {
        transform: none;
    }
}

@keyframes dniuvo-cortina-izq {
    from {
        opacity: 0;
        clip-path: inset(0 50% 0 50% round var(--dniuvo-radio));
        transform: translateX(-80px) rotate(-3deg);
        filter: blur(8px) saturate(.4);
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0 round var(--dniuvo-radio));
        transform: none;
        filter: none;
    }
}

@keyframes dniuvo-cortina-der {
    from {
        opacity: 0;
        clip-path: inset(0 50% 0 50% round var(--dniuvo-radio));
        transform: translateX(80px) rotate(3deg);
        filter: blur(8px) saturate(.4);
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0 round var(--dniuvo-radio));
        transform: none;
        filter: none;
    }
}

@keyframes dniuvo-zoom {
    from {
        transform: scale(1.35);
    }

    to {
        transform: scale(1);
    }
}

@keyframes dniuvo-brillo {
    to {
        left: 130%;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .dniuvo-seccion {
        padding: 32px 16px;
        --dniuvo-espacio: 12px;
    }

    .dniuvo-cuadricula {
        grid-template-columns: 1fr;
    }

    @supports (animation-timeline: view()) {

        .dniuvo-tarjeta,
        .dniuvo-tarjeta:nth-child(even) {
            animation-range: entry 0% entry 100%;
        }
    }
}

/* Usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {

    .dniuvo-encabezado,
    .dniuvo-encabezado::after,
    .dniuvo-punto,
    .dniuvo-tarjeta,
    .dniuvo-seccion .dniuvo-imagen {
        animation: none !important;
    }

    .dniuvo-tarjeta::after {
        display: none;
    }
}