/* --- Estilos de la Galería --- */
.galeria-contenedor {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 40px;
    /* Nuevo */
    /* Forzamos exactamente 2 columnas simétricas en pantallas grandes */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}


.video-tarjeta {
    position: relative;
    cursor: pointer;
    background: #f4f4f4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    /* Nuevo */
    width: 70% !important;
    height: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.video-tarjeta:hover {
    transform: scale(1.03);
}

.video-tarjeta img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Forzamos la miniatura a 16:9 también */
    object-fit:fill; /*contain;/* cover; modificado */
    display: block;
}

.video-tarjeta h3 {
    padding: 15px;
    margin: 0;
    text-align: center;
}

.capa-reproductor {
    position: absolute;
    top: 0; left: 0; width: 100%; height: calc(100% - 50px);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-tarjeta:hover .capa-reproductor {
    opacity: 1;
}

/* --- Estilos del MODAL (Efecto Zoom Proyección) --- */
.modal-proyeccion {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Fondo oscuro por detrás */
    z-index: 9999; /* Por delante de todo */
    justify-content: center;
    align-items: center;
    animation: zoomIn 0.3s ease;
}

.modal-contenido {
    width: 80%;
    max-width: 960px; /* Tamaño máximo en pantallas grandes */
}

/* Truco técnico para mantener estrictamente la relación 16:9 adaptable */
.video-aspecto-16-9 {
    position: relative;
    padding-top: 56.25%; /* (9 / 16) * 100 = 56.25% */
    height: 0;
}

.video-aspecto-16-9 video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Botón Cerrar */
.btn-cerrar {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-cerrar:hover {
    color: #ff4d4d;
}

/* Animación del Zoom */
@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}