
.ipr-vn-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 1.5rem auto;
    padding: 1.25rem;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

/* PLANTILLA BASE (se sobreescribe según template) */
.ipr-vn-wrapper.ipr-vn-template-classic {
    background: #020617;
    color: #e5e7eb;
    box-shadow: 0 18px 45px rgba(15,23,42,.55);
}
.ipr-vn-wrapper.ipr-vn-template-classic::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 0 0, rgba(56,189,248,.12), transparent 60%),
                radial-gradient(circle at 100% 100%, rgba(249,115,22,.14), transparent 60%);
    opacity: .7;
    pointer-events: none;
}

/* Plantilla VIDRIO OSCURO DIGITAL */
.ipr-vn-wrapper.ipr-vn-template-dark_glass {
    background: radial-gradient(circle at 0 0, #020617, #020617 40%, #000000 75%);
    color: #e5eaf5;
    box-shadow: 0 26px 65px rgba(15,23,42,.9);
    backdrop-filter: blur(9px);
    border: 1px solid rgba(148,163,184,.55);
}
.ipr-vn-wrapper.ipr-vn-template-dark_glass::before {
    content: "";
    position: absolute;
    inset: -35%;
    background:
        radial-gradient(circle at 10% 0, rgba(56,189,248,.28), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(129,140,248,.22), transparent 52%),
        linear-gradient(135deg, rgba(15,23,42,.7), rgba(5,150,105,.04));
    opacity: .85;
    mix-blend-mode: screen;
    pointer-events: none;
}

/* Plantilla ALERTA AZUL BREAKING NEWS */
.ipr-vn-wrapper.ipr-vn-template-blue_alert {
    background: radial-gradient(circle at 0 0, #001427, #020617 40%, #020617 100%);
    color: #e5f0ff;
    box-shadow: 0 22px 55px rgba(15,23,42,.8);
    border: 1px solid rgba(59,130,246,.6);
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(circle at 0 0, rgba(59,130,246,.45), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(239,68,68,.28), transparent 55%);
    opacity: .75;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.ipr-vn-wrapper > * {
    position: relative;
    z-index: 1;
}

/* CABECERA / TITULAR */
.ipr-vn-headline-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.ipr-vn-headline-main {
    flex: 1 1 auto;
}
.ipr-vn-category {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .12rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    background: rgba(248,250,252,.07);
    border: 1px solid rgba(148,163,184,.5);
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert .ipr-vn-category {
    background: rgba(15,23,42,.9);
    border-color: rgba(59,130,246,.9);
}
.ipr-vn-category:before {
    content: "";
    width: .35rem;
    height: .35rem;
    border-radius: 999px;
    background: #f97316;
    box-shadow: 0 0 0 .12rem rgba(248,250,252,.5);
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert .ipr-vn-category:before {
    background: #38bdf8;
    box-shadow: 0 0 0 .12rem rgba(191,219,254,.7);
}
.ipr-vn-headline {
    margin: .1rem 0 .1rem;
    font-size: 1.15rem;
    line-height: 1.2;
}
.ipr-vn-subheadline {
    margin: 0;
    font-size: .8rem;
    color: #cbd5f5;
}

/* EN VIVO – INSIGNIA ROJA PALPITANDO */
.ipr-vn-live-badge {
    flex: 0 0 auto;
    padding: .28rem .7rem .28rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    background: linear-gradient(135deg,#ef4444,#fb923c);
    color: #f9fafb;
    box-shadow: 0 0 0 1px rgba(248,250,252,.35), 0 0 18px rgba(248,113,113,.6);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    z-index: 4;
}
.ipr-vn-live-badge::before {
    content: "";
    width: .52rem;
    height: .52rem;
    border-radius: 999px;
    background: #fecaca;
    box-shadow: 0 0 0 2px rgba(248,113,113,.8);
    animation: ipr-vn-live-pulse 1.15s ease-out infinite;
}

@keyframes ipr-vn-live-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 2px rgba(248,113,113,.9);
    }
    70% {
        transform: scale(1.25);
        box-shadow: 0 0 0 6px rgba(248,113,113,0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 2px rgba(248,113,113,.9);
    }
}

/* ROTADOR DE TITULARES */
.ipr-vn-headline-rotator {
    position: relative;
    min-height: 2.2rem;
}
.ipr-vn-headline-slot {
    display: none;
}
.ipr-vn-headline-slot.is-active {
    display: block;
    animation: ipr-vn-fade 0.35s ease-in-out;
}

@keyframes ipr-vn-fade {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* SHELL VIDEO */
.ipr-vn-video-shell {
    position: relative;
    border-radius: .9rem;
    overflow: hidden;
    background: radial-gradient(circle at 10% 0, #0f172a, #020617);
    border: 1px solid rgba(148,163,184,.4);
}
.ipr-vn-wrapper.ipr-vn-template-dark_glass .ipr-vn-video-shell {
    background: radial-gradient(circle at 10% 0, #020617, #020617);
    border-color: rgba(148,163,184,.75);
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert .ipr-vn-video-shell {
    background: radial-gradient(circle at 0 0, #0b1735, #020617);
    border-color: rgba(59,130,246,.85);
}
.ipr-vn-video-shell video,
.ipr-vn-video-shell .ipr-vn-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    border-radius: .9rem;
}
.ipr-vn-video-shell video {
    background: #000;
}

/* ASPECT RATIOS */
.ipr-vn-ratio-16-9,
.ipr-vn-ratio-9-16,
.ipr-vn-ratio-1-1 {
    position: relative;
}
.ipr-vn-ratio-16-9::before,
.ipr-vn-ratio-9-16::before,
.ipr-vn-ratio-1-1::before {
    content: "";
    display: block;
    width: 100%;
}
.ipr-vn-ratio-16-9::before { padding-top: 56.25%; }
.ipr-vn-ratio-9-16::before { padding-top: 177.77%; }
.ipr-vn-ratio-1-1::before { padding-top: 100%; }
.ipr-vn-ratio-16-9 > *,
.ipr-vn-ratio-9-16 > *,
.ipr-vn-ratio-1-1 > * {
    position: absolute;
    inset: 0;
}

/* MARCA DE AGUA */
.ipr-vn-watermark {
    position: absolute;
    z-index: 3;
    opacity: var(--ipr-vn-wm-opacity, 0.85);
    pointer-events: none;
}
.ipr-vn-watermark img {
    max-width: var(--ipr-vn-wm-scale, 18%);
    height: auto;
    display: block;
}
.ipr-vn-wm-top_left {
    top: .5rem;
    left: .5rem;
}
.ipr-vn-wm-top_right {
    top: .5rem;
    right: .5rem;
}
.ipr-vn-wm-bottom_left {
    bottom: .5rem;
    left: .5rem;
}
.ipr-vn-wm-bottom_right {
    bottom: .5rem;
    right: .5rem;
}
.ipr-vn-wm-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* MARQUESINA */
.ipr-vn-ticker {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.1rem;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-inline: .75rem;
    background: var(--ipr-vn-ticker-bg, #dc2626);
    color: var(--ipr-vn-ticker-color, #f9fafb);
    font-size: .8rem;
    border-top: 1px solid rgba(15,23,42,.7);
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert .ipr-vn-ticker {
    border-top-color: rgba(59,130,246,.9);
}
.ipr-vn-ticker-inner {
    display: inline-flex;
    align-items: center;
    gap: 3rem;
    white-space: nowrap;
    animation: ipr-vn-marquee var(--ipr-vn-ticker-speed, 25s) linear infinite;
}
.ipr-vn-ticker span {
    display: inline-block;
}
@keyframes ipr-vn-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* TARJETA INFERIOR */
.ipr-vn-card {
    margin-top: .9rem;
    padding: .9rem 1rem;
    border-radius: .9rem;
    background: var(--ipr-vn-card-bg, #020617);
    color: var(--ipr-vn-card-text, #e5e7eb);
    border: 1px solid rgba(148,163,184,.5);
    box-shadow: 0 10px 30px rgba(15,23,42,.7);
    position: relative;
    overflow: hidden;
}
.ipr-vn-wrapper.ipr-vn-template-dark_glass .ipr-vn-card {
    background: rgba(15,23,42,.85);
    border-color: rgba(148,163,184,.75);
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert .ipr-vn-card {
    background: rgba(15,23,42,.95);
    border-color: rgba(59,130,246,.85);
}
.ipr-vn-card:before {
    content: "";
    position: absolute;
    inset-inline: -40%;
    top: -60%;
    height: 140%;
    background: radial-gradient(circle at 0 0, rgba(56,189,248,.25), transparent 60%),
                radial-gradient(circle at 100% 100%, rgba(234,179,8,.28), transparent 55%);
    opacity: .12;
    pointer-events: none;
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert .ipr-vn-card:before {
    background:
        radial-gradient(circle at 0 0, rgba(59,130,246,.55), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(239,68,68,.32), transparent 55%);
}

/* SLOTS DE TARJETA (CAMPAÑAS) */
.ipr-vn-card-slot {
    display: none;
    position: relative;
}
.ipr-vn-card-slot.is-active {
    display: block;
    animation: ipr-vn-fade 0.35s ease-in-out;
}

.ipr-vn-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}
.ipr-vn-card-category {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .13em;
    padding: .14rem .7rem;
    border-radius: 999px;
    border: 1px solid rgba(248,250,252,.45);
    background: rgba(15,23,42,.6);
}
.ipr-vn-wrapper.ipr-vn-template-blue_alert .ipr-vn-card-category {
    border-color: rgba(191,219,254,.85);
}
.ipr-vn-meta {
    font-size: .7rem;
    opacity: .9;
}
.ipr-vn-card-title {
    margin: .35rem 0 .1rem;
    font-size: .95rem;
}
.ipr-vn-card-subtitle {
    margin: 0 0 .35rem;
    font-size: .78rem;
    color: #cbd5f5;
}
.ipr-vn-card-body {
    font-size: .8rem;
}
.ipr-vn-card-body p {
    margin: .1rem 0;
}
.ipr-vn-links {
    margin-top: .6rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.ipr-vn-chip {
    font-size: .75rem;
    border-radius: 999px;
    padding: .2rem .7rem;
    border: 1px solid rgba(248,250,252,.6);
    text-decoration: none;
    color: inherit;
    background: rgba(15,23,42,.7);
    backdrop-filter: blur(6px);
}
.ipr-vn-chip-fb {
    border-color: #60a5fa;
}
.ipr-vn-chip-ig {
    border-image: linear-gradient(135deg,#ec4899,#f97316,#eab308) 1;
}
.ipr-vn-chip-yt {
    border-color: #f87171;
}

/* VISITAS */
.ipr-vn-visits {
    margin-top: .55rem;
    font-size: .75rem;
    opacity: .9;
}

/* BOTÓN VER MÁS CAMPAÑAS */
.ipr-vn-more {
    margin-top: .7rem;
    text-align: right;
}
.ipr-vn-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    padding: .25rem .85rem;
    border-radius: 999px;
    background: linear-gradient(135deg,#0ea5e9,#22c55e);
    color: #f9fafb;
    text-decoration: none;
    box-shadow: 0 0 0 1px rgba(15,23,42,.7), 0 8px 18px rgba(15,23,42,.9);
}

/* BARRA DE COMPARTIR */
.ipr-vn-share-bar {
    margin-top: .7rem;
    padding: .5rem .8rem;
    border-radius: .75rem;
    background: var(--ipr-vn-sharing-bg, #020617);
    color: var(--ipr-vn-sharing-text, #e5e7eb);
    border: 1px dashed rgba(148,163,184,.7);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .75rem;
    font-size: .78rem;
}
.ipr-vn-share-label {
    font-weight: 600;
}
.ipr-vn-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.ipr-vn-share-btn {
    font-size: .75rem;
    border-radius: 999px;
    padding: .16rem .6rem;
    border: 1px solid rgba(148,163,184,.8);
    text-decoration: none;
    color: inherit;
    background: rgba(15,23,42,.8);
    cursor: pointer;
}
.ipr-vn-share-btn:hover {
    filter: brightness(1.1);
}
.ipr-vn-share-wa { border-color: #22c55e; }
.ipr-vn-share-fb { border-color: #3b82f6; }
.ipr-vn-share-x { border-color: #facc15; }
.ipr-vn-share-tg { border-color: #38bdf8; }
.ipr-vn-share-email { border-color: #e5e7eb; }

/* PLACEHOLDER SIN VIDEO */
.ipr-vn-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: .8rem;
    padding: 3rem 1rem;
    text-align: center;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .ipr-vn-wrapper {
        padding: .9rem;
        border-radius: .8rem;
    }
    .ipr-vn-headline-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
    .ipr-vn-live-badge {
        align-self: flex-end;
    }
    .ipr-vn-share-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==== Override insignia EN VIVO con rojo más puro (#ef4444 / #b91c1c) ==== */
.ipr-vn-live-badge {
    position: relative;
    padding: .28rem .75rem .28rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    background: linear-gradient(135deg,#b91c1c,#ef4444);
    color: #f9fafb;
    box-shadow: 0 0 0 1px rgba(248,250,252,.35), 0 0 22px rgba(185,28,28,.9);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    z-index: 4;
}

.ipr-vn-live-badge::before {
    content: "";
    width: .58rem;
    height: .58rem;
    border-radius: 999px;
    background: #ef4444; /* rojo puro */
    box-shadow: 0 0 0 0 rgba(239,68,68,.95);
    display: block;
    transform-origin: center center;
    animation: ipr-vn-live-pulse-strong 1s ease-out infinite;
}

/* Pulso bien rojo tipo REC */
@keyframes ipr-vn-live-pulse-strong {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(239,68,68,1);
        opacity: 1;
    }
    40% {
        transform: scale(1.5);
        box-shadow: 0 0 0 7px rgba(239,68,68,0.7);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(239,68,68,0);
        opacity: 1;
    }
}


/* === Plantilla ROJA · Alerta Máxima (breaking_alert) === */
.ipr-vn-wrapper.ipr-vn-template-breaking_alert {
    background: radial-gradient(circle at top left, #7f1d1d 0, #111827 40%, #020617 100%);
    color: #fef2f2;
    box-shadow: 0 22px 60px rgba(127,29,29,.8);
    border: 1px solid rgba(248,113,113,.7);
}

.ipr-vn-wrapper.ipr-vn-template-breaking_alert .ipr-vn-category {
    background: linear-gradient(135deg,#b91c1c,#f97316);
    color: #fef2f2;
}

.ipr-vn-wrapper.ipr-vn-template-breaking_alert .ipr-vn-headline {
    color: #fee2e2;
    text-shadow: 0 0 14px rgba(0,0,0,.7);
}

.ipr-vn-wrapper.ipr-vn-template-breaking_alert .ipr-vn-subheadline {
    color: #fecaca;
}

.ipr-vn-wrapper.ipr-vn-template-breaking_alert .ipr-vn-ticker {
    background: linear-gradient(90deg,#b91c1c,#f97316);
    color: #fff7ed;
}

/* === Modo Emergencia: refuerzo visual === */
.ipr-vn-wrapper.ipr-vn-emergency {
    box-shadow: 0 26px 70px rgba(185,28,28,.9);
    border: 1px solid rgba(248,113,113,.9);
}

.ipr-vn-wrapper.ipr-vn-emergency .ipr-vn-headline {
    color: #fee2e2;
}

.ipr-vn-wrapper.ipr-vn-emergency .ipr-vn-ticker {
    background: linear-gradient(90deg,#7f1d1d,#b91c1c);
    color: #fee2e2;
}

.ipr-vn-wrapper.ipr-vn-emergency .ipr-vn-share-bar {
    box-shadow: 0 0 0 1px rgba(248,250,252,.2), 0 0 18px rgba(185,28,28,.7);
}

/* === Marco especial para transmisiones críticas (sobre el video) === */
.ipr-vn-wrapper.ipr-vn-emergency .ipr-vn-media {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow:
        0 0 0 3px rgba(239,68,68,.95),
        0 0 40px rgba(185,28,28,.9);
}

.ipr-vn-wrapper.ipr-vn-emergency .ipr-vn-media::before {
    content: "ALERTA IPR";
    position: absolute;
    top: .5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: .15rem .8rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    background: linear-gradient(135deg,#b91c1c,#f97316);
    color: #fef2f2;
    box-shadow: 0 0 14px rgba(0,0,0,.75);
    z-index: 5;
    pointer-events: none;
}

/* === Ajuste insignia EN VIVO: rojo puro, halo mínimo y pulso micro === */
.ipr-vn-live-badge {
    background: linear-gradient(135deg,#b91c1c,#ef4444);
    box-shadow: 0 0 0 1px rgba(248,250,252,.35), 0 0 18px rgba(185,28,28,.7);
}

.ipr-vn-live-badge::before {
    content: "";
    width: .46rem;
    height: .46rem;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,.5);
    display: block;
    transform-origin: center center;
    animation: ipr-vn-pulse-micro 1.1s ease-in-out infinite;
}

@keyframes ipr-vn-pulse-micro {
    0% {
        transform: scale(0.92);
        box-shadow: 0 0 0 0 rgba(239,68,68,0.0);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 1px rgba(239,68,68,0.35);
    }
    100% {
        transform: scale(0.92);
        box-shadow: 0 0 0 0 rgba(239,68,68,0.0);
    }
}
