/* CSS ULTRA-ESPECÍFICO PARA LAYOUTS PROTEGIDOS - MÁXIMA PRIORIDAD */
/* Este CSS debe cargarse AL FINAL para sobrescribir TODO */

/* CONTENEDOR PRINCIPAL - Forzar estructura */
html body .xioleni-post-content [data-protected-layout="true"],
html body #xioleni-editor [data-protected-layout="true"],
html body div div div [data-protected-layout="true"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 15px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    position: relative !important;
    clear: both !important;
    background: transparent !important;
    border: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    line-height: inherit !important;
    display: block !important;
}

/* SISTEMA 2 COLUMNAS - Forzar estructura grid */
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-grid-section,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-grid-section,
html body div div div [data-protected-layout="true"] .xioleni-grid-section {
    display: grid !important;
    gap: 20px !important;
    align-items: start !important;
    justify-items: start !important;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    min-height: 104px !important;
    overflow: visible !important;
    float: none !important;
    clear: none !important;
}

/* Grid template columns según alineación */
html body .xioleni-post-content [data-grid-alignment="left"] .xioleni-grid-section,
html body #xioleni-editor [data-grid-alignment="left"] .xioleni-grid-section,
html body div div div [data-grid-alignment="left"] .xioleni-grid-section {
    grid-template-columns: auto 1fr !important;
}

html body .xioleni-post-content [data-grid-alignment="right"] .xioleni-grid-section,
html body #xioleni-editor [data-grid-alignment="right"] .xioleni-grid-section,
html body div div div [data-grid-alignment="right"] .xioleni-grid-section {
    grid-template-columns: 1fr auto !important;
}

/* SISTEMA 3 COLUMNAS - Forzar estructura grid */
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-grid-section-3col,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-grid-section-3col,
html body div div div [data-protected-layout="true"] .xioleni-grid-section-3col {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    gap: 15px !important;
    align-items: start !important;
    justify-items: start !important;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    min-height: 104px !important;
    overflow: visible !important;
    float: none !important;
    clear: none !important;
}

/* COLUMNA ETIQUETA - Posicionamiento perfecto */
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-etiqueta,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-etiqueta,
html body div div div [data-protected-layout="true"] .xioleni-col-etiqueta {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    width: auto !important;
    max-width: 200px !important;
    min-width: 140px !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    grid-row: 1 !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
    float: none !important;
    clear: none !important;
    line-height: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
}

/* Posicionamiento específico de columna etiqueta según alineación */
html body [data-grid-alignment="left"] .xioleni-col-etiqueta {
    grid-column: 1 !important;
}
html body [data-grid-alignment="right"] .xioleni-col-etiqueta {
    grid-column: 2 !important;
}

/* COLUMNA CENTRO para sistema 3 columnas */
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-centro,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-centro,
html body div div div [data-protected-layout="true"] .xioleni-col-centro {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    width: auto !important;
    max-width: 180px !important;
    min-width: 140px !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
    float: none !important;
    clear: none !important;
}

/* COLUMNAS DE TEXTO - ALTURA EXACTA FORZADA */
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-texto,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-texto,
html body div div div [data-protected-layout="true"] .xioleni-col-texto,
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-izq,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-izq,
html body div div div [data-protected-layout="true"] .xioleni-col-izq,
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-der,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-der,
html body div div div [data-protected-layout="true"] .xioleni-col-der {
    width: 100% !important;
    height: 104px !important;
    max-height: 104px !important;
    overflow: hidden !important;
    text-align: justify !important;
    line-height: 1.22 !important;
    font-size: inherit !important;
    font-family: inherit !important;
    color: inherit !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    grid-row: 1 !important;
    background: transparent !important;
    border: none !important;
    display: block !important;
    white-space: normal !important;
    text-overflow: visible !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    float: none !important;
    clear: none !important;
}

html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-texto,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-izq,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-col-der {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Posicionamiento específico de columnas texto según alineación */
html body [data-grid-alignment="left"] .xioleni-col-texto {
    grid-column: 2 !important;
}
html body [data-grid-alignment="right"] .xioleni-col-texto {
    grid-column: 1 !important;
}
html body [data-grid-type="3-columns"] .xioleni-col-izq {
    grid-column: 1 !important;
}
html body [data-grid-type="3-columns"] .xioleni-col-der {
    grid-column: 3 !important;
}

/* TEXTO RESTANTE - Espaciado perfecto */
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-texto-restante,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-texto-restante,
html body div div div [data-protected-layout="true"] .xioleni-texto-restante,
html body .xioleni-post-content [data-protected-layout="true"] .xioleni-texto-restante-3col,
html body #xioleni-editor [data-protected-layout="true"] .xioleni-texto-restante-3col,
html body div div div [data-protected-layout="true"] .xioleni-texto-restante-3col {
    width: 100% !important;
    max-width: 100% !important;
    text-align: justify !important;
    line-height: 1.22 !important;
    font-size: inherit !important;
    font-family: inherit !important;
    color: inherit !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    margin: 15px 0 0 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    clear: both !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    float: none !important;
}

/* IMÁGENES ETIQUETA - Tamaño forzado */
html body .xioleni-post-content [data-protected-layout="true"] img[data-tag-size],
html body #xioleni-editor [data-protected-layout="true"] img[data-tag-size],
html body div div div [data-protected-layout="true"] img[data-tag-size] {
    width: 90px !important;
    height: 90px !important;
    object-fit: cover !important;
    border-radius: 10px !important; /* Forzado 10px */
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    z-index: 2 !important;
    float: none !important;
    clear: none !important;
}

@media (max-width: 768px) {
    html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-texto,
    html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-izq,
    html body .xioleni-post-content [data-protected-layout="true"] .xioleni-col-der {
        height: 84px !important;
        max-height: 84px !important;
    }

    html body .xioleni-post-content [data-protected-layout="true"] .xioleni-grid-section,
    html body .xioleni-post-content [data-protected-layout="true"] .xioleni-grid-section-3col {
        min-height: 84px !important;
    }

    html body .xioleni-post-content [data-protected-layout="true"] img[data-tag-size] {
        width: 70px !important;
        height: 70px !important;
    }
}

/* ANULAR cualquier regla de float o text-wrapping que interfiera */
html body .xioleni-post-content [data-protected-layout="true"] *,
html body #xioleni-editor [data-protected-layout="true"] *,
html body div div div [data-protected-layout="true"] * {
    float: none !important;
    clear: none !important;
    shape-outside: none !important;
    -webkit-shape-outside: none !important;
    -moz-shape-outside: none !important;
}

/* REFUERZO FINAL - Prevenir interferencia de cualquier CSS externo */
html body .xioleni-post-content [data-protected-layout="true"]:not([data-allow-override]),
html body #xioleni-editor [data-protected-layout="true"]:not([data-allow-override]),
html body div div div [data-protected-layout="true"]:not([data-allow-override]) {
    all: unset !important;
    /* Luego re-aplicar solo lo que necesitamos */
    display: block !important;
    width: 100% !important;
    margin: 15px 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    line-height: inherit !important;
} 
