/**
 * Peru Mag - Hero Slider Styles
 * Estilos complementarios para el slider hero con SwiperJS
 * No modifica los estilos existentes del theme
 */

/* =========================================================================
   SWIPER HERO WRAPPER
   ========================================================================= */
.hero-swiper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 420px;
}

.hero-swiper .swiper-slide {
    overflow: hidden;
    height: 100%;
    /* BUGFIX: En modo fade, todos los slides están superpuestos en el DOM.
       Deshabilitar pointer-events en slides inactivos para que los clics
       no sean interceptados por el slide incorrecto. */
    pointer-events: none;
}

/* Solo el slide activo recibe eventos de ratón/teclado */
.hero-swiper .swiper-slide-active {
    pointer-events: auto;
}

.hero-swiper .swiper-slide .hero-main,
.hero-swiper .swiper-slide .hero-main > a {
    height: 100%;
}

/* Animación de entrada del slide */
.hero-swiper .swiper-slide-active .hero-main-overlay {
    animation: heroOverlayIn 0.6s ease-out forwards;
}

@keyframes heroOverlayIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   PAGINACIÓN CUSTOM CON PROGRESS
   ========================================================================= */
.hero-swiper-pagination {
    position: absolute;
    bottom: 16px;
    left: 30px;
    z-index: 10;
    display: flex;
    gap: 8px;
    align-items: center;
}

.hero-swiper-pagination .swiper-pagination-bullet {
    width: 24px;
    height: 24px;
    background: transparent;
    opacity: 0.6;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.hero-swiper-pagination .swiper-pagination-bullet::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.hero-swiper-pagination .swiper-pagination-bullet-active {
    opacity: 1;
}

.hero-swiper-pagination .swiper-pagination-bullet-active::before {
    background: #fff;
    width: 10px;
    height: 10px;
}

.hero-swiper-pagination .bullet-progress {
    width: 24px;
    height: 24px;
    transform: rotate(-90deg);
    display: none;
}

.hero-swiper-pagination .swiper-pagination-bullet-active .bullet-progress {
    display: block;
}

.hero-swiper-pagination .bullet-progress circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2;
    stroke-dasharray: 62.83;
    stroke-dashoffset: 62.83;
    stroke-linecap: round;
    animation: bulletProgress 5s linear forwards;
}

@keyframes bulletProgress {
    from {
        stroke-dashoffset: 62.83;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* =========================================================================
   NOTICIAS LATERALES - SINCRONIZACIÓN
   ========================================================================= */
.hero-secondary-card[data-slide-index] {
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
}

.hero-secondary-card[data-slide-index]:hover {
    background: var(--bg-alt);
}

/* Estado activo sincronizado */
.hero-secondary-card.hero-secondary-active {
    background: var(--bg-alt);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.12);
}

/* Indicador lateral de slide activo */
.hero-secondary-card.hero-secondary-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 50%;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    animation: activeIndicator 0.3s ease-out forwards;
}

@keyframes activeIndicator {
    from {
        height: 0;
        opacity: 0;
    }

    to {
        height: 50%;
        opacity: 1;
    }
}

/* Badge "EN VIVO" en noticia activa */
.hero-secondary-card.hero-secondary-active .hero-secondary-title a {
    color: var(--primary-color);
}

/* =========================================================================
   SLIDE COUNTER (opcional, esquina superior derecha)
   ========================================================================= */
.hero-slide-counter {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: var(--font-headings);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 768px) {
    .hero-swiper-pagination {
        left: 50%;
        transform: translateX(-50%);
        bottom: 12px;
    }

    .hero-swiper {
        min-height: 300px;
    }

    .hero-secondary-card[data-slide-index] {
        padding: 8px;
    }
}

@media (max-width: 600px) {
    .hero-secondary-card[data-slide-index] {
        padding: 6px;
        border-width: 1px;
    }

    .hero-secondary-card.hero-secondary-active::before {
        display: none;
    }
}