/* =========================
   1) ESTILOS PARA EL LISTADO
   ========================= */

/* Contenedor principal de las citas */
.citas-programas {
    font-family: 'Roboto Condensed', sans-serif;
}

/* Cada cita en el listado */
.cita {
    position: relative;
    margin-top: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

/* Texto de la cita en el listado */
.texto-cita {
    font-family: 'Caveat', cursive !important;
    font-size: 30px !important;
    margin: 10px 0;
    transition: transform 0.3s ease;
    display: inline-block;
    position: relative;
    padding-left: 35px;    /* Espacio para la comilla izquierda */
    padding-right: 78px;   /* Espacio para la comilla derecha */
    max-width: 625px;      /* Limitar el ancho de la cita */
    width: 1200px;          /* Ancho fijo para la cita (ajusta según tu diseño) */
    line-height: 1.02;     /* Controla la altura de línea */
    box-sizing: border-box; 
    text-align: left;
    overflow: hidden;       
    white-space: nowrap;    
    text-overflow: ellipsis;
    z-index: 99 !important;
    padding-bottom: 5px;
}

/* Efecto hover en la cita y la línea decorativa del listado */
.cita:hover .texto-cita,
.cita:hover .linea-naranja {
    transform: scale(1.01);
}

/* Comillas para el texto de la cita en el listado */
.texto-cita::before {
    content: '';
    background-image: url('https://www.reflectorculturatv.org/wp-content/uploads/2024/12/comillas1.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 30px;
    height: 30px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 9 !important;
    margin-left: 3px;
}
.texto-cita::after {
    content: '';
    background-image: url('https://www.reflectorculturatv.org/wp-content/uploads/2024/12/comillas2.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 30px;
    height: 30px;
    position: absolute; 
    right: 0;
    top: 0;
    z-index: 9 !important;
    margin-right: 3px;
}

/* Autor en el listado */
.autor {
    font-size: 12px;
    font-family: 'Roboto Condensed', sans-serif !important;
    font-weight: bold;
    margin-bottom: -5px;
    display: block;
    padding-left: 35px; /* Alinear con la cita */
    text-align: left;
}

/* Línea decorativa naranja en el listado */
.linea-naranja {
    height: 3px;
    background-color: #F47F16;
    width: 100%;
    max-width: 560px;
    margin-top: 0px;
    margin-left: 30px;
    margin-right: auto;
    margin-bottom: 15px !important;
}

/* =========================
   2) ESTILOS PARA EL POPUP
   ========================= */

/* Overlay del popup - MODIFICADO: sin fondo oscuro */
.popup-cita {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: transparent !important; /* CAMBIO: Fondo transparente */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2147483647 !important;
    overflow: auto !important;
    pointer-events: none; /* Permite clicks a través del overlay transparente */
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* Mostrar el popup cuando tiene la clase "active" */
.popup-cita.active {
    display: flex;
    opacity: 1;
    pointer-events: auto; /* Restaurar eventos cuando está activo */
}

/* Pseudo-elemento para capturar clicks fuera del popup */
.popup-cita.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: auto;
}

/* Contenedor interno del popup - MODIFICADO: fondo blanco y sombra pronunciada */
.contenido-popup {
    background: #FFFFFF !important; /* Fondo blanco puro */
    padding: 20px 25px; /* Ligeramente más padding para mejor espaciado */
    border-radius: 10px; /* Bordes redondeados suaves */
    max-width: 1200px !important;
    height: auto !important;
    width: 85%;
    border: 2px solid #F47F16 !important; /* RESTAURADO: Borde naranja original */
    
    /* SOMBRA MÁS PRONUNCIADA como en la imagen 2 */
    box-shadow: 
    0 6px 18px rgba(0, 0, 0, 0.375),    /* Sombra cercana aumentada */
    0 12px 36px rgba(0, 0, 0, 0.525),   /* Sombra media más oscura */
    0 24px 72px rgba(0, 0, 0, 0.675);   /* Sombra principal más pronunciada */
    
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin: 0;
    z-index: 2147483647 !important;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto; /* Asegurar que el contenido reciba eventos */
}

/* Flecha del popup - ocultarla cuando cubre la frase */
.contenido-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #F47F16; /* RESTAURADO: Flecha naranja */
    display: none; /* Ocultar la flecha ya que el popup cubre la frase */
}

/* Flecha del popup apuntando hacia arriba (cuando está debajo del elemento) */
.contenido-popup.arrow-top::after {
    display: block; /* Mostrar solo cuando está en modo arrow-top */
    bottom: auto;
    top: -8px;
    border-top: none;
    border-bottom: 8px solid #F47F16; /* RESTAURADO: Flecha naranja */
}

/* Columna izquierda del popup (80%) */
.popup-left {
    flex: 0 0 80% !important;
    text-align: left;
    position: relative;
    padding: 0 !important; /* Sin padding adicional */
}

/* Autor del popup */
.popup-autor {
    font-size: 14px !important;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: normal;
    color: #333 !important;
    display: inline;
    margin-left: 40px !important;
    z-index: 2147483647 !important;
}

/* Separador (ej. "|") en el popup */
.popup-separator {
    display: inline;
    margin-left: 1px;
    margin-right: 1px;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: normal;
    color: #333;
    z-index: 2147483647 !important;
}

/* Profesión del popup */
.popup-profesion {
    font-size: 14px !important;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
    color: #333 !important;
    display: inline;
    z-index: 2147483647 !important;
}

/* Texto completo de la cita en el popup */
.popup-texto-cita {
    max-width: 1040px;
    font-family: 'Caveat', cursive !important;
    text-align: left;
    font-size: 35px !important;
    line-height: 1.1 !important; /* Reducido para más compacto */
    color: #222 !important;
    margin: 5px 0 10px 0; /* Márgenes reducidos */
    position: relative;
    padding-left: 40px !important;
    padding-right: 0px !important;
    height: auto !important;
    /* Permitir texto completo sin cortar */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    z-index: 2147483647 !important;
}

/* Comillas en el texto de la cita del popup (izquierda) */
.popup-left .popup-texto-cita::before {
    content: '';
    background-image: url('https://www.reflectorculturatv.org/wp-content/uploads/2024/12/comillas1.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 30px !important;
    height: 30px !important;
    position: absolute;
    left: 0;
    top: 5px !important; /* Ajustado para mejor alineación */
    z-index: 2147483647 !important;
}

/* Comillas en el texto de la cita del popup (derecha) */
.popup-left .popup-texto-cita::after {
    content: '';
    background-image: url('https://www.reflectorculturatv.org/wp-content/uploads/2024/12/comillas2.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 30px !important;
    height: 30px !important;
    position: absolute;
    right: auto !important;
    bottom: 0px !important;
    margin-left: 10px !important;
    z-index: 2147483647 !important;
}

/* Columna derecha del popup (20%) */
.popup-right {
    flex: 0 0 20% !important;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0;
    text-align: right;
}

/* Título (nombre del programa) en el popup */
.popup-titulo {
    grid-row: 1;
    display: block;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px !important; /* Reducido de 20px */
    font-weight: bold;
    color: #181833;
    margin-bottom: 5px !important; /* Reducido de 8px */
    text-decoration: underline;
    z-index: 2147483647 !important;
}

.popup-right .popup-titulo:hover {
    color: #F47F16;             /* Cambia el color al hacer hover */
    text-decoration: underline; /* Mantiene el subrayado */
    z-index: 2147483647 !important;
}

/* Número de capítulo en el popup */
.popup-capitulo {
    grid-row: 2;
    display: block;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 16px !important; /* Reducido de 18px */
    color: #181833;
    margin-bottom: 0px !important;
    z-index: 2147483647 !important;
}

/* Fecha del capítulo en el popup */
.popup-fecha-capitulo {
    grid-row: 3;
    display: inline-block;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 16px !important; /* Reducido de 18px */
    margin-top: 0px !important;
    z-index: 2147483647 !important;
}

/* Media queries para responsive */
@media (max-width: 768px) {
    .contenido-popup {
        max-width: 95% !important;
        max-height: none !important;
        flex-direction: column;
    }
    
    .popup-left,
    .popup-right {
        flex: 0 0 100% !important;
    }
    
    .popup-right {
        margin-top: 15px;
        text-align: left;
    }
}