.documento-embed-container {
    background: white;
    border: 1px solid #ddd;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.documento-embed-container.transparente {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.documento-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.documento-loading p {
    margin-top: 15px;
    font-size: 16px;
    color: #666;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.documento-contenido {
    line-height: 1.6;
    font-family: 'Calibri', Arial, sans-serif;
    color: #333;
}

.documento-contenido p {
    margin: 10px 0;
}

.documento-contenido h1, 
.documento-contenido h2, 
.documento-contenido h3 {
    margin: 15px 0 10px 0;
}

.documento-contenido img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

.documento-contenido table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.documento-contenido table, 
.documento-contenido th, 
.documento-contenido td {
    border: 1px solid #ccc;
}

.documento-contenido th,
.documento-contenido td {
    padding: 8px;
    text-align: left;
}

/* v1.7: boton de ensanchar + zoom de imagenes */
.documento-embed-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.documento-embed-ensanchar {
    background: #f3f3f3;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #333;
}

.documento-embed-ensanchar:hover {
    background: #e6e6e6;
}

/* Modo ancho: rompe el ancho del contenido del tema y se centra en el viewport. */
.documento-embed-container.docemb-ancho {
    max-width: none;
    width: min(96vw, 1600px);
    margin-left: calc(50% - min(96vw, 1600px) / 2);
    margin-right: calc(50% - min(96vw, 1600px) / 2);
    position: relative;
    left: 0;
}

.documento-contenido img {
    cursor: zoom-in;
}

/* Lightbox (clic en una imagen la abre a tamano grande; clic fuera la cierra) */
.docemb-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    cursor: zoom-out;
    padding: 24px;
    box-sizing: border-box;
}

.docemb-lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    cursor: zoom-out;
}

.docemb-lightbox-cerrar {
    position: fixed;
    top: 16px;
    right: 24px;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
