/**
 * PNTR Video Carousel — Hoja de estilos del frontend.
 *
 * Estructura visual:
 *  ┌─────────────────────────────────────────────────┐
 *  │              [ENCABEZADO LOGO]                  │
 *  │  ●  ●  ●   [═══════REPRODUCTOR═══════]  ●●●●   │
 *  │            [▐▌▶▐▌  controles  ▐▌▶▐▌]           │
 *  │            [    BANNER DE TÍTULO    ]           │
 *  │              [  Sigue al programa  ]            │
 *  └─────────────────────────────────────────────────┘
 *
 * Color primario: Vino institucional #801936
 *
 * @package PNTR_Video_Carousel
 * @since   1.0.0
 */

/* ─────────────────────────────────────────────────────────────────────────────
   IMPORT DE FUENTE
───────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ─────────────────────────────────────────────────────────────────────────────
   TOKENS DE DISEÑO (CSS Custom Properties)
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-root {
    /* Colores institucionales */
    --wine: #801936;
    --wine-dark: #5e1228;
    --wine-mid: #9b2040;
    --wine-glow: rgba(128, 25, 54, 0.45);
    --wine-soft: rgba(128, 25, 54, 0.12);

    /* Azul del logotipo */
    --logo-blue: #1565c0;

    /* Verde del logotipo */
    --logo-green: #2e7d32;

    /* Neutros */
    --white: #ffffff;
    --black: #000000;
    --overlay: rgba(0, 0, 0, 0.30);

    /* Botones circulares */
    --btn-size: 108px;
    --btn-border: 5px;
    --btn-gap: 40px;

    /* Reproductor */
    --frame-radius: 18px;
    --frame-border: 6px;

    /* Transiciones */
    --ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --dur: 0.28s;

    /* Arco – valores base, sobreescritos por cada posición */
    --arc-tx: 0px;
    --arc-ry: 0deg;

    /* Posición vertical de la ilustración de fondo */
    --bg-pos-y: top;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONTENEDOR RAÍZ (Full Width Breakout)
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-root {
    /* Técnica Full Width Breakout para ignorar los márgenes del tema de WP */
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    min-height: var(--app-height, 100vh);
    box-sizing: border-box;

    /* Distribución vertical fluida (Header - Main - Footer) */
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 3vh 2vw 4vh;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--white);

    
    /* 
      ¡ESTE ES EL TRUCO!
      No usamos 'background-image: none' para no romper la herencia.
      Al hacer que mida 0x0 píxeles, la imagen existe para el navegador (y se hereda)
      pero físicamente es invisible en este contenedor.
    */
    background-size: 0px 0px !important;
    
    /* Overlay suave para mejorar legibilidad sobre la ilustración */
    isolation: isolate;
}

/* Overlay semitransparente sobre el fondo ilustrativo */
.pntr-vc-root::before {
    content: '';
    position: fixed; /* Soluciona el zoom en móvil */
    top: 0;
    left: 0;
    width: 100%;
    
    /* Colchón extra de altura para evitar recálculos por barra de navegación */
    height: 115vh; 
    
    /* Hereda limpiamente la imagen dinámica que inyecta Vue */
    background-image: inherit; 
    
    /* 
      Forzamos a que el tamaño de este pseudo-elemento SÍ sea cover,
      sobreescribiendo el 0px del padre.
    */
    background-size: cover !important; 
    background-position: center var(--bg-pos-y);
    
    /* Transición suave para mantener el hermoso efecto de movimiento vertical */
    transition: background-position 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    
    /* Gradiente original de legibilidad + la herencia de la imagen */
    background-image: 
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.06) 45%,
            rgba(0, 0, 0, 0.10) 100%),
        inherit;
        
    pointer-events: none;
    z-index: -1;
}

/* Todo el contenido debe estar por encima del overlay */
.pntr-vc-header,
.pntr-vc-main,
.pntr-vc-footer {
    position: relative;
    z-index: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ENCABEZADO — LOGOTIPO
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-header {
    display: flex;
    justify-content: center;
    margin-bottom: 2vh;
}

.pntr-vc-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 50px;
}

/* Emblema: gota + elementos decorativos */
.pntr-vc-logo-emblem {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.pntr-vc-drop-svg {
    width: 64px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 60, 180, 0.35));
    animation: pntr-float 3.5s ease-in-out infinite;
}

@keyframes pntr-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.pntr-vc-deco {
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 2px;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.2));
}

.pntr-vc-deco--left {
    transform: rotate(-15deg) translateY(4px);
}

.pntr-vc-deco--right {
    transform: rotate(15deg) translateY(4px);
}

/* Textos del logo */
.pntr-vc-logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.pntr-vc-acronym {
    font-size: 2rem;
    font-weight: 900;
    color: var(--wine);
    letter-spacing: 0.08em;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1;
}

.pntr-vc-program-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--logo-green);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    max-width: 380px;
    line-height: 1.3;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SECCIÓN PRINCIPAL — LAYOUT FLEX
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3vw;
    /* Separación adaptativa según el ancho de pantalla */
    flex: 1 1 auto;
    /* Permite que el cuerpo principal expanda el espacio sobrante */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   COLUMNAS DE BOTONES CIRCULARES
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--btn-gap);
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BOTÓN CIRCULAR — Base
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-btn-circle {
    /* Dimensiones y forma */
    position: relative;
    width: var(--btn-size);
    height: var(--btn-size);
    border-radius: 50%;
    flex-shrink: 0;

    /* Borde institucional vino */
    border: var(--btn-border) solid var(--wine);

    /* Apariencia */
    background: var(--white);
    overflow: hidden;
    cursor: pointer;
    padding: 0;

    /* Sombra */
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.22),
        0 0 0 0px var(--wine-glow);

    /* Arco: transform compuesto usando CSS vars por posición */
    transform: translateX(var(--arc-tx)) rotate(var(--arc-ry));
    transition:
        transform var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease-smooth),
        border-color var(--dur) ease;

    /* Eliminar estilos de botón nativo */
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

/* Imagen dentro del botón */
.pntr-vc-btn-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.35s var(--ease-smooth);
}

/* Fallback numérico (sin imagen) */
.pntr-vc-btn-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--wine);
    background: linear-gradient(135deg, #fdf2f5, #fff);
}

/* Capa de color semitransparente para el hover (#c9879c) */
.pntr-vc-btn-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(201, 135, 156, 0.65);
    /* #c9879c semitransparente */
    opacity: 0;
    transition: opacity var(--dur) var(--ease-smooth);
    pointer-events: none;
    z-index: 1;
}

/* ── Estados interactivos ── */
.pntr-vc-btn-circle:hover {
    transform: translateX(var(--arc-tx)) rotate(var(--arc-ry)) scale(1.1);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.30),
        0 0 0 3px var(--wine-glow);
    border-color: var(--wine-mid);
}

.pntr-vc-btn-circle:hover::after {
    opacity: 1;
}

.pntr-vc-btn-circle:hover img {
    transform: scale(1.06);
}

.pntr-vc-btn-circle.is-active {
    transform: translateX(var(--arc-tx)) rotate(var(--arc-ry)) scale(1.06);
    border-color: var(--wine-mid);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.28),
        0 0 0 4px var(--wine-glow),
        inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.pntr-vc-btn-circle:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 3px;
}

/* Anillo de "activo" animado */
.pntr-vc-btn-active-ring {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 3px solid var(--wine);
    animation: pntr-ring-pulse 1.8s ease-out infinite;
    pointer-events: none;
}

@keyframes pntr-ring-pulse {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }

    70% {
        opacity: 0;
        transform: scale(1.25);
    }

    100% {
        opacity: 0;
        transform: scale(1.25);
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   ARCO — Posiciones individuales
   Técnica: CSS custom properties por elemento vía data-position.
   Compose: transform = translateX(arc-tx) rotate(arc-ry) [+ scale en :hover]
───────────────────────────────────────────────────────────────────────────── */

/* ── Columna IZQUIERDA (3 botones, arco hacia la izquierda) ── */
/*   Los botones superior e inferior se acercan al video;
     el del medio se aleja (arqueo convexo mirando al video).   */

.pntr-vc-col--left [data-position="0"] {
    --arc-tx: 5.5vw;
    --arc-ry: -10deg;
}

.pntr-vc-col--left [data-position="1"] {
    --arc-tx: -1vw;
    --arc-ry: 0deg;
}

.pntr-vc-col--left [data-position="2"] {
    --arc-tx: 5.5vw;
    --arc-ry: 10deg;
}

/* ── Columna DERECHA (3 botones, arco hacia la derecha — espejo del izquierdo) ── */
.pntr-vc-col--right [data-position="0"] {
    --arc-tx: -5.5vw;
    --arc-ry: 10deg;
}

.pntr-vc-col--right [data-position="1"] {
    --arc-tx: 1 vw;
    --arc-ry: 0deg;
}

.pntr-vc-col--right [data-position="2"] {
    --arc-tx: -5.5vw;
    --arc-ry: -10deg;
}

/* ─────────────────────────────────────────────────────────────────────────────
   REPRODUCTOR CENTRAL
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-center {
    flex: 1 1 auto;
    width: 100%;
    max-width: 800px;
    /* Se permite crecer más para ser el héroe de la página */
    min-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

/* Marco del reproductor */
.pntr-vc-frame {
    margin: 20px;
    border: var(--frame-border) solid var(--wine);
    border-radius: var(--frame-radius);
    overflow: hidden;
    background: #000;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* ── Área del iframe: aspect ratio 16:9 ── */
.pntr-vc-iframe-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a1a;
    overflow: hidden;
}

.pntr-vc-iframe-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Placeholder (sin video configurado) ── */
.pntr-vc-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a1a 100%);
}

.pntr-vc-placeholder-icon {
    width: 80px;
    height: 80px;
    opacity: 0.5;
    animation: pntr-pulse 2.4s ease-in-out infinite;
}

@keyframes pntr-pulse {

    0%,
    100% {
        opacity: 0.35;
        transform: scale(1);
    }

    50% {
        opacity: 0.60;
        transform: scale(1.08);
    }
}

.pntr-vc-placeholder-txt {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BARRA DE CONTROLES (integrada en el marco inferior)
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 10px 24px;
    background: var(--wine);
}

/* Botón de control */
.pntr-vc-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.82;
    transition: opacity var(--dur), transform var(--dur) var(--ease), background var(--dur);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.pntr-vc-ctrl-btn:hover {
    opacity: 1;
    transform: scale(1.18);
    background: rgba(255, 255, 255, 0.12);
}

.pntr-vc-ctrl-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Botón de Play: más grande y con fondo destacado */
.pntr-vc-ctrl-play {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.18) !important;
    opacity: 1 !important;
}

.pntr-vc-ctrl-play:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: scale(1.22) !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CINTILLO / BANNER DE TÍTULO
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-banner {
    margin-top: 14px;
    padding: 2px 6px;
    display: flex;
    justify-content: center;
}

.pntr-vc-banner-inner {
    display: inline-block;
    background: var(--wine);
    color: var(--white);
    padding: 10px 36px;
    border-radius: 50px;
    /* Forma de píldora */
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow:
        0 5px 18px var(--wine-glow),
        0 2px 4px rgba(0, 0, 0, 0.20);
    transition: opacity 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PIE — Botón "Sigue al sitio"
───────────────────────────────────────────────────────────────────────────── */
.pntr-vc-footer {
    display: flex;
    justify-content: center;
    margin-top: 2vh;
}

.pntr-vc-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wine);
    color: var(--white);
    text-decoration: none;
    padding: 13px 44px;
    border-radius: 50px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    box-shadow:
        0 6px 22px var(--wine-glow),
        0 2px 6px rgba(0, 0, 0, 0.22);
    transition:
        background var(--dur) ease,
        transform var(--dur) var(--ease),
        box-shadow var(--dur) ease;
    outline: none;
}

.pntr-vc-footer-btn:hover,
.pntr-vc-footer-btn:focus-visible {
    background: var(--wine-dark);
    transform: translateY(-3px);
    box-shadow:
        0 10px 32px var(--wine-glow),
        0 4px 10px rgba(0, 0, 0, 0.28);
    color: var(--white);
    text-decoration: none;
}

.pntr-vc-footer-arrow {
    flex-shrink: 0;
    transition: transform var(--dur) var(--ease);
}

.pntr-vc-footer-btn:hover .pntr-vc-footer-arrow {
    transform: translateX(4px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE — TABLET
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pntr-vc-root {
        --btn-size: 88px;
        --btn-gap: 14px;
    }

    .pntr-vc-main {
        gap: 8px;
    }

    .pntr-vc-col--left [data-position="0"],
    .pntr-vc-col--left [data-position="2"] {
        --arc-tx: 14px;
    }

    .pntr-vc-col--right [data-position="0"],
    .pntr-vc-col--right [data-position="2"] {
        --arc-tx: -14px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE — MÓVIL (apilado en cuadrícula)
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .pntr-vc-logo {
        flex-direction: column;
        gap: 10px;
    }
    .pntr-vc-logo > img {
        max-width: 190px !important;
    }
    .pntr-vc-root {
        --btn-size: 72px;
        --btn-border: 4px;
        padding: 20px 16px 24px;
    }

    /* Layout: cuadrícula (pntr-vc-center arriba, pntr-vc-col--left y pntr-vc-col--right abajo juntos) */
    .pntr-vc-main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    /* Botones en fila horizontal centrada */
    .pntr-vc-col {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        width: 100%;
    }

    .pntr-vc-col--left {
        grid-column: span 1;
        order: 2;
    }

    .pntr-vc-col--right {
        grid-column: span 1;
        order: 3;
    }

    .pntr-vc-col--left [data-position="0"] {
        --arc-tx: 10vw;
        --arc-ry: -10deg;
    }

    .pntr-vc-col--left [data-position="2"] {
        --arc-tx: 10vw;
        --arc-ry: 10deg;
    }

    .pntr-vc-col--right [data-position="0"] {
        --arc-tx: -10vw;
        --arc-ry: 10deg;
    }

    .pntr-vc-col--right [data-position="2"] {
        --arc-tx: -10vw;
        --arc-ry: -10deg;
    }

    .pntr-vc-btn-circle:hover {
        transform: translateX(var(--arc-tx)) rotate(var(--arc-ry)) scale(1.1);
        box-shadow:
            0 8px 28px rgba(0, 0, 0, 0.30),
            0 0 0 3px var(--wine-glow);
        border-color: var(--wine-mid);
    }


    /* Reproductor ocupa todo el ancho */
    .pntr-vc-center {
        grid-column: span 2;
        width: 100%;
        max-width: 100%;
        order: 1;
        /* Fuerza a que el reproductor se muestre arriba del todo */
    }

    /* Banner de título: texto más pequeño */
    .pntr-vc-banner-inner {
        font-size: 0.7rem;
        padding: 9px 20px;
        letter-spacing: 0.07em;
    }

    /* Logo ajustado */
    .pntr-vc-acronym {
        font-size: 1.5rem;
    }

    .pntr-vc-program-name {
        font-size: 0.65rem;
    }

    .pntr-vc-drop-svg {
        width: 48px;
    }

    /* Botón de pie */
    .pntr-vc-footer-btn {
        padding: 11px 28px;
        font-size: 0.8rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   ACCESIBILIDAD — Reducir movimiento
───────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
