/* ==========================================================================
   1. ESTILOS GENERALES Y ESTRUCTURA DE TARJETAS (FRONTEND)
   ========================================================================== */
.cev-wrap {
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    width: 100%;
    box-sizing: border-box;
}

.cev-wrap *, .cev-wrap *::before, .cev-wrap *::after {
    box-sizing: border-box;
}

.cev-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cev-lista h3 {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #0f172a;
}

/* Listado de tarjetas */
.cev-cards-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.cev-card-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.cev-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Enlace/Contenedor flex de la tarjeta */
.cev-card-link {
    display: flex !important;
    align-items: center !important;
    padding: 12px !important;
    text-decoration: none !important;
    gap: 15px !important;
}

/* Control estricto de la miniatura para evitar deformaciones */
.cev-card-thumb {
    flex: 0 0 80px !important;  /* Ancho fijo de la caja */
    width: 80px !important;
    height: 80px !important; /* Alto fijo */
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f1f5f9 !important;
}

.cev-card-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important; /* Recorta proporcionalmente sin estirar */
    display: block !important;
    margin: 0 !important;
}

/* Información del texto */
.cev-card-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 1 !important;
}

.cev-card-cat {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #ff5722 !important;
    letter-spacing: 0.5px !important;
}

.cev-card-title {
    font-size: 14px !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    font-family: 'Sora', sans-serif !important;
}

.cev-card-date {
    font-size: 12px !important;
    color: #64748b !important;
}


/* ==========================================================================
   2. VENTANA MODAL / POPUP
   ========================================================================== */
.cev-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cev-modal-box {
    background-color: #ffffff;
    margin: auto;
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 90vh;
    overflow-y: auto;
}

.cev-close {
    color: #94a3b8;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.cev-close:hover {
    color: #0f172a;
}

.cev-popup {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.cev-popup-izq {
    flex: 1 1 300px;
}

.cev-popup-der {
    flex: 1 1 400px;
}

/* Badges / Etiquetas en el popup */
.cev-header-badges { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    margin-bottom: 12px; 
}

.cev-badge-tipo {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.cev-badge-cat { 
    display: inline-block; 
    background: #fff3ed; 
    color: #ff5722; 
    border: 1px solid #ffd8c7; 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 12px; 
    font-weight: 600; 
}

/* Reproductor de Video en Popup */
.cev-video {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.cev-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* ==========================================================================
   3. FICHA TÉCNICA / BIBLIOGRÁFICA Y BOTONES ACCIÓN
   ========================================================================== */
.cev-biblio-table { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    padding: 15px; 
    border-radius: 10px; 
    margin: 15px 0; 
}

.cev-biblio-table h4 { 
    margin: 0 0 10px 0; 
    font-family: 'Sora', sans-serif; 
    font-size: 14px; 
    color: #1e293b; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 5px; 
}

.cev-biblio-table ul { 
    list-style: none !important; 
    padding: 0 !important; 
    margin: 0 !important; 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 8px; 
    font-size: 13px; 
}

.cev-biblio-table li { 
    color: #475569; 
}

.cev-biblio-table li strong { 
    color: #0f172a; 
}

/* Botones de acción */
.cev-acciones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.cev-btn {
    display: inline-block;
    background: #0f172a;
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.cev-btn:hover {
    background: #334155;
}

.cev-btn-archivo {
    background: #2563eb;
}

.cev-btn-archivo:hover {
    background: #1d4ed8;
}