/* Imágenes y archivos dentro de los textos enriquecidos (módulo editor-medios). */

/* ---- Contenido (área de trabajo y web pública) ---- */
img.ae-img-centro, figure.ae-img-centro { display: block; margin: 1.2em auto; max-width: 100%; }
img.ae-img-ancho, figure.ae-img-ancho { display: block; margin: 1.2em 0; width: 100%; max-width: 100%; }
img.ae-img-ancho, figure.ae-img-ancho img { width: 100%; }
img.ae-img-izquierda, figure.ae-img-izquierda { float: left; margin: .3em 1.4em 1em 0; max-width: 45%; }
figure.ae-img-centro, figure.ae-img-izquierda { width: fit-content; }
figure[class*="ae-img-"] img { display: block; max-width: 100%; height: auto; margin: 0; }
img[class*="ae-img-"] { height: auto; }
figure[class*="ae-img-"] figcaption { margin-top: .5em; font-size: .85em; line-height: 1.45; color: #5A6480; }
.prose::after, .rte-content::after { content: ""; display: table; clear: both; }
@media (max-width: 600px) {
	img.ae-img-izquierda, figure.ae-img-izquierda { float: none; max-width: 100%; margin: 1.2em 0; }
}
a.ae-file { display: inline-flex; align-items: center; gap: .4em; padding: .15em .55em; border: 1px solid #E2E6F0; border-radius: 7px; background: #FAFBFD; text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
a.ae-file::before { content: ""; width: .95em; height: .95em; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M12 12v6M9 15l3 3 3-3'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M12 12v6M9 15l3 3 3-3'/%3E%3C/svg%3E") center / contain no-repeat; }
a.ae-file:is(:hover, :focus-visible) { border-color: currentColor; }

/* ---- Editor ---- */
.ae-app .rte-content img, .ae-app .prose img { max-width: 100%; height: auto; }
.ae-app .rte-content img, .ae-app .rte-content figure { cursor: pointer; }
.ae-app .rte-content .ProseMirror-selectednode, .ae-app .rte-content img.ProseMirror-selectednode { outline: 3px solid var(--azul, #002193); outline-offset: 2px; border-radius: 2px; }
.ae-app .rte-imgbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--borde-2, #EEF1F7); background: var(--info-bg, #EEF2FC); }
.ae-app .rte-imgbar-label { font-size: .8rem; font-weight: 700; margin-right: 4px; }
.ae-app .rte-imgbar .btn[aria-pressed=true] { background: var(--azul, #002193); color: #fff; border-color: var(--azul, #002193); }
.ae-app .rte-alt { padding: 10px 12px; border-bottom: 1px solid var(--borde-2, #EEF1F7); background: #fff; }
.ae-app .rte-alt-title { margin: 0 0 8px; font-weight: 700; font-size: .9rem; }
.ae-app .rte-alt-body { display: flex; gap: 12px; align-items: flex-start; }
.ae-app .rte-alt-preview { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--borde, #E2E6F0); flex: none; background: var(--tenue-2, #FAFBFD); }
.ae-app .rte-alt-fields { flex: 1; min-width: 0; display: grid; gap: 8px; }
.ae-app .rte-alt-fields .field { margin: 0; }
.ae-app .rte-alt-fields input { width: 100%; }
.ae-app .rte-alt-fields .muted { margin: 4px 0 0; }
.ae-app .rte-alt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ae-app .rte-status { padding: 6px 12px; font-size: .82rem; color: var(--tinta-2, #2A3350); border-bottom: 1px solid var(--borde-2, #EEF1F7); }
.ae-app .rte-progress { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ae-app .rte-progress progress { flex: 1; min-width: 80px; height: 8px; }
.ae-app .rte-error { margin: 0; padding: 6px 12px; font-size: .82rem; color: var(--rojo, #B42318); background: #FEF3F2; border-bottom: 1px solid #FECDCA; }
@media (max-width: 480px) {
	.ae-app .rte-alt-body { flex-direction: column; }
	.ae-app .rte-alt-preview { width: 100%; height: 120px; }
}
