/* **************************************************************************
 * The Pope Video Archive 
 * Version 24.0
 *************************************************************************** */

/* --- 1. BLOQUE DE FILTROS (BUSCADOR GLOBAL) --- */
.tpv-filters-container {
    display: flex;
    gap: 15px;
    padding: 20px 2% 10px;
    align-items: center;
    justify-content: flex-start;
}

.tpv-filter-group input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    outline: none !important;
    transition: all 0.3s ease;
    box-shadow: none !important;
    min-width: 320px;
}

.tpv-filter-group input:focus {
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.tpv-filter-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* --- 2. SECCIONES DE AÑO Y LÓGICA DE OCULTACIÓN --- */
.tpv-year-section {
    margin-bottom: 60px;
    opacity: 1; 
    will-change: opacity, transform;
}

.tpv-year-section.section-hidden {
    display: none !important;
}

.tpv-year-section.searching {
    margin-bottom: 40px;
}

.year-title {
    color: #ffffff !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    margin: 30px 2% 15px !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding-left: 15px;
    border-left: 4px solid #ffffff;
    line-height: 1 !important;
}

/* --- 3. CONTENEDOR DE LA FILA (INVISIBLE SCROLL) --- */
.fila-stream { 
    display: flex !important; 
    overflow-x: auto !important; 
    white-space: nowrap !important; 
    padding: 10px 2% 20px !important; 
    scroll-behavior: smooth; 
    gap: 15px; 
    -webkit-overflow-scrolling: touch; 
    background: transparent !important;
    scrollbar-width: none !important; 
    -ms-overflow-style: none !important;
    mask-image: linear-gradient(to right, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 92%, transparent 100%);
}

.fila-stream::-webkit-scrollbar { 
    display: none !important; 
}

.tpv-year-section.searching .fila-stream {
    mask-image: none !important;
    -webkit-mask-image: none !important;
    white-space: normal !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

/* --- 4. CADA TARJETA DE VIDEO --- */
.video-item { 
    flex: 0 0 320px !important; 
    width: 320px !important; 
    margin: 0 !important; 
    display: inline-block !important;
    vertical-align: top;
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1) !important; 
    position: relative;
}

.video-item.tpv-hidden {
    display: none !important;
}

.video-item:hover { 
    transform: scale(1.05); 
    z-index: 10; 
}

.tpv-lightbox-trigger { 
    width: 100% !important; 
    padding-top: 56.25% !important; 
    position: relative !important; 
    display: block !important; 
    overflow: hidden !important; 
    border-radius: 12px !important; 
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    background-color: #000 !important; 
    border: 1px solid rgba(255,255,255,0.08); 
}

.stream-thumb { 
    position: absolute !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100% !important; 
    height: 100% !important; 
    object-fit: cover !important; 
    background: #071121 !important; 
}

.stream-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(0deg, rgba(7, 17, 33, 0.6) 0%, rgba(7, 17, 33, 0) 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-item:hover .stream-overlay { opacity: 1; }

.video-title { 
    font-size: 14.5px !important; 
    font-weight: 500 !important; 
    white-space: normal !important; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    padding: 14px 5px 0; 
    color: #ffffff !important; 
    text-align: left;
    line-height: 1.4em;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

/* --- 5. LIGHTBOX (MAGNIFIC POPUP) --- */
.mfp-bg {
    background: #040a14 !important; 
    opacity: 0.97 !important;
    z-index: 1042 !important;
}

.mfp-wrap {
    z-index: 99999 !important;
}

.mfp-iframe-scaler {
    border-radius: 12px !important;
    overflow: visible !important; 
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
    background: #000;
}

/* Botón Cerrar - ESCRITORIO */
button.mfp-close {
    top: 0 !important;      
    right: -55px !important; 
    color: #ffffff !important;
    font-size: 44px !important; 
    opacity: 0.7 !important;
    transition: all 0.3s ease;
    width: 50px !important;
    height: 50px !important;
    line-height: 50px !important;
    text-align: center !important;
    background: transparent !important; 
    padding: 0 !important;
    cursor: pointer !important;
}

button.mfp-close:hover {
    opacity: 1 !important;
    transform: scale(1.1) rotate(90deg);
}

/* --- 6. AJUSTES RESPONSIVE --- */
@media (max-width: 1100px) {
    /* OCULTAR "X" EN MÓVIL Y TABLET */
    button.mfp-close {
        display: none !important;
    }

    .mfp-iframe-scaler {
        overflow: hidden !important; 
    }
}

@media (max-width: 900px) {
    .tpv-filters-container { padding: 10px 4%; }
    .tpv-filter-group input { min-width: 100%; }

    .year-title {
        font-size: 20px !important;
        margin-top: 20px !important;
    }

    .video-item { 
        flex: 0 0 270px !important; 
        width: 270px !important; 
    }
    
    .fila-stream {
        padding: 10px 4% !important;
        mask-image: none; 
        -webkit-mask-image: none;
    }
}