/*
    Estilos de <active-image>. Los colores salen de variables para que cada aplicacion ponga
    los suyos sin tocar este fichero: basta con redefinir --active-image-accent en su site.css
    (Cuaderno lo tenia clavado en su verde dentro de la propia vista, que es lo que impedia
    reutilizar el control).
*/
/* Los valores por defecto van en cada uso, no en :root: esta hoja se carga despues del
   site.css de las aplicaciones, asi que un :root de aqui le ganaria al de la web y no
   habria manera de cambiar el color desde fuera. */

.active-image {
    display: flex;
    align-items: center;
    /* El bloque ocupa todo el ancho del formulario: sin esto la foto y su texto se quedan
       pegados al borde izquierdo y en una pantalla ancha se ven perdidos en la esquina. */
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: 1rem;
    background: var(--active-image-bg, var(--bs-tertiary-bg, #f8f9fa));
    margin-bottom: 1rem;
}

.active-image-frame {
    position: relative;
    width: var(--active-image-size, 112px);
    height: var(--active-image-size, 112px);
    flex: 0 0 var(--active-image-size, 112px);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    background: color-mix(in srgb, var(--active-image-accent, var(--bs-primary, #0d6efd)) 12%, #fff);
    box-shadow: 0 .45rem 1.25rem rgba(0, 0, 0, .14) !important;
}

.active-image-frame > img,
.active-image-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.active-image-fallback {
    display: grid;
    place-items: center;
    color: var(--active-image-accent, var(--bs-primary, #0d6efd));
    font-size: 2.6rem;
}

.active-image-camera {
    position: absolute;
    right: .4rem;
    bottom: .4rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--active-image-accent, var(--bs-primary, #0d6efd));
    color: #fff;
    box-shadow: 0 .2rem .6rem rgba(0, 0, 0, .24) !important;
}

@media (max-width: 575.98px) {
    .active-image { align-items: flex-start; }
    .active-image-frame { --active-image-size: 92px; }
}

/* Solo enseñar (readonly): sin borde de puntos ni relleno, que va dentro de una ficha. */
.active-image-solo {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: none;
    margin-bottom: 0;
}

.active-image-solo .active-image-frame { cursor: default; }
