/* ============================================================
 * Testimonios Video Widget — estilos
 * ============================================================ */

.tvw-wrapper {
    display: grid;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Modo destacada: columna grande + grilla lateral */
.tvw-wrapper.tvw-mode-featured {
    grid-template-columns: 55% 1fr;
    align-items: stretch;
}

.tvw-featured-col {
    display: flex;
}

.tvw-side-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Modo grilla uniforme */
.tvw-wrapper.tvw-mode-grid {
    display: block;
}
.tvw-full-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ----------------- Card ----------------- */
.tvw-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    width: 100%;
    background: #0a1428;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tvw-card-featured {
    aspect-ratio: 3 / 4;
}
.tvw-card-side {
    aspect-ratio: 4 / 3;
}

.tvw-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform 0.4s ease;
}
.tvw-card:hover .tvw-cover {
    transform: scale(1.04);
}

/* Capa de gradiente para legibilidad del texto */
.tvw-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 45%);
    pointer-events: none;
}

/* ----------------- Botón play ----------------- */
.tvw-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.tvw-card-side .tvw-play {
    width: 46px;
    height: 46px;
}
.tvw-card-side .tvw-play svg {
    width: 24px;
    height: 24px;
}
.tvw-play:hover {
    background: #ffffff;
    transform: translate(-50%, -50%) scale(1.08);
}
.tvw-play svg {
    fill: #1A6BFF;
    width: 34px;
    height: 34px;
    margin-left: 3px;
    pointer-events: none;
}
.tvw-play i {
    color: #1A6BFF;
    font-size: 24px;
    line-height: 1;
    pointer-events: none;
}

/* ============================================================
 * Rotación (slots fijos, cards que se mueven con FLIP)
 * ============================================================ */
.tvw-card-pool { display: none; }

.tvw-slot {
    position: relative;
    width: 100%;
}
/* El slot define la forma; la card adentro la ocupa por completo. */
.tvw-slot-featured { aspect-ratio: 3 / 4; }
.tvw-slot-side     { aspect-ratio: 4 / 3; }

.tvw-rotating .tvw-slot .tvw-card {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    height: 100%;
    width: 100%;
}

/* Tamaño del botón play según el tipo de slot */
.tvw-slot-featured .tvw-card .tvw-play { width: 64px; height: 64px; }
.tvw-slot-side .tvw-card .tvw-play { width: 46px; height: 46px; }
.tvw-slot-side .tvw-card .tvw-play svg { width: 24px; height: 24px; }

/* Crossfade del contenido (la estructura no se mueve). */
.tvw-rotating .tvw-slot .tvw-card.tvw-fade {
    transition: opacity var(--tvw-dur, 700ms) ease;
}
.tvw-rotating .tvw-slot .tvw-card.tvw-fade-in {
    opacity: 0;
}
/* Mientras hay dos cards en el slot, ambas se superponen. */
.tvw-rotating .tvw-slot .tvw-card {
    z-index: 1;
}
.tvw-rotating .tvw-slot .tvw-card.tvw-fade {
    z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
    .tvw-rotating .tvw-slot .tvw-card.tvw-fade {
        transition: none;
    }
}

/* Bloque SEO: visible en el código fuente, invisible para el usuario */
.tvw-seo-block {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tvw-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tvw-modal.tvw-open {
    display: flex;
    opacity: 1;
}
.tvw-modal-inner {
    position: relative;
    width: min(90vw, 960px);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.tvw-modal.tvw-open .tvw-modal-inner {
    transform: scale(1);
}
.tvw-modal-inner iframe,
.tvw-modal-inner video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.tvw-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #111;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
@media (max-width: 600px) {
    .tvw-close { top: 8px; right: 8px; }
}

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 1024px) {
    .tvw-wrapper.tvw-mode-featured {
        grid-template-columns: 1fr;
    }
    .tvw-side-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .tvw-side-grid {
        grid-template-columns: 1fr;
    }
    .tvw-name { font-size: 22px; }
    .tvw-line { font-size: 16px; }
}
