@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');

/* =========================================
   1. BUSCADOR AJAX MODAL (PRO)
   ========================================= */
body.xxiii-search-open { overflow: hidden !important; height: 100vh; }
.xxiii-fake-search-trigger { background: #f2f0e2; border: none; border-radius: 0; padding: 8px 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: flex-start; transition: all 0.2s ease; width: auto; max-width: 280px; min-width: 200px; color: #1c1c1c; }
.xxiii-fake-search-trigger:hover { background: #e8e6d9; color: #000; }
.xxiii-fake-icon { display: flex; align-items: center; margin-right: 10px; color: #1c1c1c; opacity: 0.7; }
.xxiii-fake-placeholder { font-size: 0.9rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; user-select: none; font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Overlay y Contenedor */
.xxiii-search-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100dvh; background: rgba(242, 240, 226, 0.98); z-index: 999999; display: flex; justify-content: center; align-items: flex-start; padding-top: 80px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s ease, visibility 0.3s ease; backdrop-filter: blur(5px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.xxiii-search-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.xxiii-search-container { width: 90%; max-width: 800px; position: relative; text-align: center; margin-bottom: 50px; }

/* Input */
.xxiii-input-wrapper { position: relative; margin-bottom: 30px; max-width: 700px; margin-left: auto; margin-right: auto; }
#xxiii-search-input { width: 100%; background: transparent; border: none; border-bottom: 2px solid #1c1c1c; font-size: 2.2rem; color: #1c1c1c; padding: 15px 0; outline: none; text-align: center; font-family: inherit; font-weight: 700; text-transform: uppercase; font-style: normal; transition: border-color 0.3s; border-radius: 0; }
#xxiii-search-input:focus { border-bottom-color: #751d2d; }
#xxiii-search-input::placeholder { color: #888; font-weight: 600; text-transform: uppercase; font-style: normal; opacity: 0.5; }
#xxiii-search-advice { display: none; margin-top: 10px; font-size: 0.8rem; color: #751d2d; font-weight: 600; opacity: 0; transform: translateY(-5px); transition: all 0.3s; text-transform: uppercase; letter-spacing: 1px; }
#xxiii-search-advice.is-visible { opacity: 1; transform: translateY(0); }

/* Filtros */
.xxiii-filter-system { margin-bottom: 40px; }
.xxiii-filters-primary { display: flex; justify-content: center; align-items: center; gap: 0; flex-wrap: wrap; border-bottom: 1px solid #ccc; padding-bottom: 20px; }
.filter-btn { background: transparent; border: 1px solid transparent; color: #555; padding: 8px 20px; border-radius: 0; cursor: pointer; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s; margin-right: -1px; font-weight: 600; }
.filter-btn:hover { color: #1c1c1c; border-bottom: 2px solid #ccc; }
.filter-btn.active { background: transparent; color: #751d2d; border-bottom: 2px solid #751d2d; }
.xxiii-filters-secondary { margin-top: 20px; padding-top: 0; animation: slideDown 0.3s ease; display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 8px; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.filter-label { color: #888; font-size: 0.75rem; margin-right: 10px; text-transform: uppercase; font-weight: bold; letter-spacing: 1px; }
.subfilter-btn, .year-btn { background: rgba(0,0,0,0.05); border: 1px solid transparent; color: #444; cursor: pointer; font-size: 0.8rem; padding: 4px 12px; border-radius: 0; transition: all 0.2s; text-transform: uppercase; font-weight: 500; }
.subfilter-btn:hover, .year-btn:hover { color: #1c1c1c; background: rgba(0,0,0,0.1); }
.subfilter-btn.active, .year-btn.active { color: #fff; background: #751d2d; }
#xxiii-search-close { position: absolute; top: 30px; right: 40px; font-size: 3rem; color: #1c1c1c; background: none; border: none; cursor: pointer; transition: transform 0.3s, color 0.3s; line-height: 1; z-index: 100; }
#xxiii-search-close:hover { color: #751d2d; transform: rotate(90deg); }

/* Resultados */
#xxiii-search-results { margin-top: 20px; text-align: left; width: 100%; }
.xxiii-search-item { display: flex; align-items: center; background: #fbfaf5; margin-bottom: 5px; padding: 15px; border-radius: 0; text-decoration: none; border-left: 4px solid transparent; box-shadow: none; border: 1px solid transparent; transition: all 0.2s; }
.xxiii-search-item:hover { background: #fff; border-left-color: #751d2d; transform: translateX(5px); }
.xxiii-search-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 0; margin-right: 20px; background: #eee; }
.xxiii-search-meta { flex-grow: 1; }
.xxiii-search-meta h4 { margin: 0 0 6px; font-size: 1.1rem; color: #1c1c1c; font-weight: 700; letter-spacing: 0.5px; }
.xxiii-highlight-match { color: #751d2d; font-weight: 800; }
.xxiii-search-meta span.search-label { font-size: 0.7rem; color: #666; text-transform: uppercase; letter-spacing: 1px; background: #eee; padding: 3px 6px; border-radius: 0; }
.xxiii-search-meta span.highlight { color: #751d2d; font-weight: bold; }
.xxiii-search-meta span.search-author { display: block; font-size: 0.8rem; color: #666; margin-top: 10px; font-weight: 500; font-style: normal; }

/* Botón Cargar Más y Spinner */
.xxiii-load-more-btn { display: block; width: 100%; padding: 15px; background: #e8e6d9; color: #1c1c1c; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; margin-top: 10px; font-size: 0.9rem; border: none; cursor: pointer; transition: all 0.2s; text-align: center; }
.xxiii-load-more-btn:hover { background: #751d2d; color: #fff; }
.xxiii-load-more-btn.loading { opacity: 0.6; pointer-events: none; }
.xxiii-spinner { border: 2px solid #ccc; border-left-color: #751d2d; border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 30px auto; display: none; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Buscador Responsive */
@media (max-width: 768px) {
    .xxiii-search-overlay { padding-top: 60px; align-items: flex-start; }
    .xxiii-search-container { width: 95%; }
    #xxiii-search-close { top: 15px; right: 15px; font-size: 2.5rem; }
    #xxiii-search-input { font-size: 1.5rem; padding: 10px 0; }
    .xxiii-filters-primary { padding-bottom: 15px; gap: 5px; }
    .filter-btn { padding: 6px 12px; font-size: 0.7rem; border: 1px solid #ccc; margin-bottom: 5px; }
    .xxiii-search-item { padding: 10px; }
    .xxiii-search-thumb { width: 50px; height: 50px; margin-right: 12px; }
    .xxiii-search-meta h4 { font-size: 0.95rem; margin-bottom: 4px; }
}

/* =========================================
   2. TABLA DE CONTENIDO (PRINCIPAL Y LATERAL)
   ========================================= */
.toc-principal-accordion { margin-top: 30px; margin-bottom: 45px; border-radius: 0px; overflow: hidden; }
.toc-principal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; cursor: pointer; transition: background-color 0.3s ease; background-color: var(--custom-color-categoria, #751d2d); }
.toc-principal-header h2 { font-size: 18px !important; text-transform: uppercase; line-height: 1em !important; margin: 0 !important; padding: 0 !important; border: none !important; color: #f2f0e2 !important; }
.toc-principal-header .toc-principal-icon { color: #f2f0e2 !important; font-size: 30px; font-weight: 300; transition: transform 0.4s ease; }
.toc-principal-accordion.is-open .toc-principal-header .toc-principal-icon { transform: rotate(45deg); }
.toc-principal-content { background-color: #fbfaf5; max-height: 0; overflow: hidden; transition: max-height 0.5s ease-out, padding 0.5s ease-out; border: 1px solid #EAE8E1; border-top: none; }
.toc-principal-accordion.is-open .toc-principal-content { max-height: 1000px; padding: 15px 0; border-top: 1px solid var(--custom-color-categoria, #751d2d); }
.toc-principal-accordion nav ul { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.toc-principal-accordion nav li { padding: 0 !important; margin: 0 !important; border-bottom: 1px solid #ebe9da; }
.toc-principal-accordion nav li:last-child { border-bottom: none; }
.toc-principal-accordion nav a { text-decoration: none; color: #5b5b5b !important; font-size: 14px; font-weight: 600 !important; display: block; padding: 12px 25px !important; transition: all 0.2s ease-in-out; text-align: left !important; }
.toc-principal-accordion nav a:hover { color: var(--custom-color-categoria, #751d2d) !important; background-color: #ebe9da; padding-left: 35px !important; }

@media (max-width: 600px) {
    .toc-principal-accordion nav a {
        padding: 12px 15px !important;
        font-size: 13px !important;
    }
    .toc-principal-accordion nav a:hover,
    .toc-principal-accordion nav a:active {
        padding-left: 22px !important;
    }
}


/* TOC LATERAL */
#toc-personalizado { 
    opacity: 0; 
    visibility: hidden; 
    transform: translateX(-15px); 
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0.4s; 
    position: relative; /* LA CLAVE ESTABA AQUÍ */
    max-height: 80vh; 
    overflow-y: auto; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    padding-top: 15px; 
    padding-bottom: 15px; 
    box-sizing: border-box; 
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%); 
    mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%); 
}
#toc-personalizado.visible { 
    opacity: 1; 
    visibility: visible; 
    transform: translateX(0); 
    transition-delay: 0s; 
}
#toc-personalizado::-webkit-scrollbar { display: none; }
.toc-link-independiente { text-decoration: none; color: inherit; cursor: pointer; display: block; margin-bottom: 0px; padding: 0px 25px 10px 25px; transition: color 0.2s ease-in-out, font-weight 0.2s ease-in-out; }
.toc-link-independiente:hover { color: var(--custom-color-categoria, #751d2d); }
.toc-link-independiente.active { color: var(--custom-color-categoria, #751d2d); font-weight: bold; }

/* =========================================
   3. NOTAS TIPPY (Reversión a Inline Puro)
   ========================================= */
.nota-interactiva { 
    cursor: pointer; 
}

.nota-interactiva.nota-interna { 
    color: var(--custom-color-categoria, #751d2d); 
    font-weight: 700; 
    display: inline; 
    margin: 0 0.05em;
    padding: 0px 2px; 
}

.nota-interactiva.nota-comun { 
    background-color: var(--custom-color-categoria, #751d2d); 
    color: #f2f0e2 !important; 
    font-weight: 500; 
    border-radius: 0 !important; 
    font-size: 0.95em; 
    box-decoration-break: clone; 
    -webkit-box-decoration-break: clone;
    margin: 0 0.05em;
    padding: 0.12em 0.25em; 
    text-decoration: none !important;
    display: inline;
}

/* Especificidad ultra-alta para forzar que el texto de la nota wiki sea f2f0e2 (crema) y no herede el color del enlace del tema */
body .nota-interactiva.nota-wiki,
body a.nota-interactiva.nota-wiki,
.contenido-articulo a.nota-interactiva.nota-wiki,
.post-content a.nota-interactiva.nota-wiki,
.entry-content a.nota-interactiva.nota-wiki,
a.nota-interactiva.nota-wiki {
    background-color: var(--custom-color-categoria, #751d2d) !important;
    color: #f2f0e2 !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
    font-size: 0.95em !important;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    margin: 0 0.05em !important;
    padding: 0.12em 0.25em !important;
    text-decoration: none !important;
    display: inline !important;
}

body .nota-interactiva.nota-wiki:hover,
body a.nota-interactiva.nota-wiki:hover,
.contenido-articulo a.nota-interactiva.nota-wiki:hover,
.post-content a.nota-interactiva.nota-wiki:hover,
a.nota-interactiva.nota-wiki:hover {
    background-color: #5a111e !important;
    color: #f2f0e2 !important;
    text-decoration: none !important;
}

/* === ESTILOS EXCLUSIVOS PARA EL EDITOR DE GUTENBERG (EVITAR DESAPARICIÓN) === */
.editor-styles-wrapper .nota-interactiva,
.editor-styles-wrapper .nota-interactiva.nota-comun,
.editor-styles-wrapper .nota-interactiva.nota-wiki,
.editor-styles-wrapper span.nota-interactiva,
.editor-styles-wrapper span.nota-interactiva.nota-comun,
.editor-styles-wrapper span.nota-interactiva.nota-wiki {
    background-color: #751d2d !important;
    color: #f2f0e2 !important;
    padding: 0.12em 0.25em !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    display: inline !important;
}

.editor-styles-wrapper .nota-interactiva.nota-interna,
.editor-styles-wrapper span.nota-interactiva.nota-interna {
    color: #751d2d !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}

/* Forzar visualización correcta en focus y selección */
.editor-styles-wrapper .nota-interactiva:focus,
.editor-styles-wrapper span.nota-interactiva:focus,
.editor-styles-wrapper .nota-interactiva::selection,
.editor-styles-wrapper span.nota-interactiva::selection {
    background-color: #751d2d !important;
    color: #f2f0e2 !important;
}

.nota-indicador.interno { 
    display: inline-block; 
    width: 1.1em; 
    height: 1.1em; 
    /* Separación exacta entre el icono y la primera letra del texto */
    margin-right: 0.2em; 
    background-color: var(--custom-color-categoria, #751d2d); 
    mask-image: url('../images/Isotipo-Blanco.svg'); 
    mask-size: contain; 
    mask-position: center; 
    mask-repeat: no-repeat; 
    -webkit-mask-image: url('../images/Isotipo-Blanco.svg'); 
    -webkit-mask-size: contain; 
    -webkit-mask-position: center; 
    -webkit-mask-repeat: no-repeat; 
    position: relative; 
    top: 2px; 
}

/* Estilos de la Caja del Popup */
.tippy-box[data-theme~='mi-tema'] { z-index: 9999; background-color: var(--custom-color-categoria, #751d2d); color: #f2f0e2; border-radius: 0; box-shadow: none; text-align: left; padding: 20px 25px !important; line-height: 1.6; }
.tippy-box[data-theme~='mi-tema'] a,
.tippy-box[data-theme~='mi-tema'] a:link,
.tippy-box[data-theme~='mi-tema'] a:visited,
.tippy-box[data-theme~='mi-tema'] a:hover,
.tippy-box[data-theme~='mi-tema'] a:active,
.tippy-box[data-theme~='mi-tema'] a:focus,
.tippy-box[data-theme~='mi-tema'] a.nota-tippy-link,
a.nota-tippy-link,
a.nota-tippy-link:link,
a.nota-tippy-link:visited,
a.nota-tippy-link:hover,
a.nota-tippy-link:active,
a.nota-tippy-link:focus {
    color: #f2f0e2 !important;
    text-decoration: underline !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-family: inherit !important;
}
.tippy-box[data-theme~='mi-tema'] .tippy-arrow { color: var(--custom-color-categoria, #751d2d) !important; }
.tippy-box[data-theme~='mi-tema'][data-placement^='bottom'] > .tippy-arrow::before { border-bottom-color: var(--custom-color-categoria, #751d2d) !important; }
.tippy-box[data-theme~='mi-tema'][data-placement^='top'] > .tippy-arrow::before { border-top-color: var(--custom-color-categoria, #751d2d) !important; }
.tippy-box[data-theme~='mi-tema'][data-placement^='left'] > .tippy-arrow::before { border-left-color: var(--custom-color-categoria, #751d2d) !important; }
.tippy-box[data-theme~='mi-tema'][data-placement^='right'] > .tippy-arrow::before { border-right-color: var(--custom-color-categoria, #751d2d) !important; }

/* Tema de Previsualización de Artículo (Wikipedia-style) - Rediseñado Premium */
.tippy-box[data-theme~='wiki-preview'] {
    z-index: 9999;
    background-color: #fbfaf5;
    color: #333333;
    border-radius: 0;
    box-shadow: none !important;
    border: 2px solid #bdbbb1 !important;
    text-align: left;
    padding: 0 !important;
    max-width: 480px !important; /* Aumentado de 440px a 480px */
    line-height: 1.5;
}
.tippy-box[data-theme~='wiki-preview'] .tippy-content {
    padding: 0 !important;
}

/* Lógica de colores de la viñeta (Tippy arrow) según orientación */
.tippy-box[data-theme~='wiki-preview'] .tippy-arrow {
    color: #fbfaf5 !important;
    z-index: 10 !important; /* Asegurar que la viñeta quede sobre la imagen */
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='right'] > .tippy-arrow {
    color: var(--custom-color-categoria, #751d2d) !important;
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='right'] > .tippy-arrow::before {
    border-right-color: var(--custom-color-categoria, #751d2d) !important;
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='left'] > .tippy-arrow {
    color: #fbfaf5 !important;
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='left'] > .tippy-arrow::before {
    border-left-color: #fbfaf5 !important;
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='bottom'] > .tippy-arrow {
    color: #fbfaf5 !important;
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='bottom'] > .tippy-arrow::before {
    border-bottom-color: #fbfaf5 !important;
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='top'] > .tippy-arrow {
    color: #fbfaf5 !important;
}
.tippy-box[data-theme~='wiki-preview'][data-placement^='top'] > .tippy-arrow::before {
    border-top-color: #fbfaf5 !important;
}

/* Tarjeta de Previsualización Interna: Imagen Izquierda, Texto Derecha */
.xxiii-wiki-preview {
    display: flex;
    flex-direction: row; /* Imagen a la izquierda, contenido a la derecha */
    align-items: stretch;
    min-height: 180px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #fbfaf5;
}
.xxiii-wiki-image {
    width: 190px; /* Aumentado de 150px a 190px */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
    display: block;
    background-color: var(--custom-color-categoria, #751d2d);
    position: relative;
}

/* Badge de Logo en el centro-derecho de la imagen (Diamond shape overlay) */
.xxiii-wiki-badge {
    position: absolute;
    top: 50%;
    right: -14px;
    width: 28px;
    height: 28px;
    background-color: var(--custom-color-categoria, #751d2d);
    transform: translateY(-50%) rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    border: 1.5px solid #bdbbb1;
    z-index: 2;
}
.xxiii-wiki-badge::after {
    content: '';
    width: 14px;
    height: 14px;
    background-color: #f2f0e2;
    mask-image: url('../images/Isotipo-Blanco.svg');
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    -webkit-mask-image: url('../images/Isotipo-Blanco.svg');
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    transform: rotate(-45deg); /* Contrarotación para mantener el logo derecho */
}

.xxiii-wiki-content {
    flex: 1;
    padding: 22px 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.xxiii-wiki-title {
    margin: 0 0 12px 0 !important;
    font-size: 18px !important; /* Aumentado de 15px a 18px */
    font-weight: 700 !important;
    line-height: 1.15 !important; /* Interlineado muy bajo */
    font-family: 'Lora', 'Georgia', serif !important; /* Tipografía premium */
}
.xxiii-wiki-title a {
    color: #5a111e !important; /* Tono burdeos oscuro del mockup */
    text-decoration: none !important;
}
.xxiii-wiki-title a:hover {
    color: var(--custom-color-categoria, #751d2d) !important;
}
.xxiii-wiki-excerpt {
    margin: 0 0 15px 0 !important;
    font-size: 13px !important; /* Aumentado de 12px a 13px */
    line-height: 1.55 !important;
    color: #4a4a4a !important; /* Un poco más oscuro */
    display: -webkit-box;
    -webkit-line-clamp: 5; /* Mostrar hasta 5 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xxiii-wiki-readmore-btn {
    display: inline-block;
    background-color: var(--custom-color-categoria, #751d2d);
    color: #f2f0e2 !important; /* Cambiado a crema f2f0e2 */
    text-transform: uppercase;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 1px;
    padding: 9px 18px;
    text-decoration: none !important;
    border-radius: 0;
    align-self: flex-start;
    transition: background-color 0.2s ease, transform 0.2s ease;
    text-align: center;
}
.xxiii-wiki-readmore-btn:hover {
    background-color: #5a111e;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Saltos de línea DENTRO del Popup */
.tippy-content p { display: block !important; margin-bottom: 15px !important; }
.tippy-content p:last-child { margin-bottom: 0 !important; }
.tippy-content br { display: block !important; margin-bottom: 12px !important; content: " "; }

/* =========================================
   4. ZOOM DE IMÁGENES (Medium Zoom)
   ========================================= */
.medium-zoom-overlay, 
.medium-zoom-image {
    z-index: 990; 
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* =========================================
   BOTONES DE COMPARTIR
   ========================================= */
.contenedor-compartir {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0;
    justify-content: center;
}
@media (min-width: 981px) {
    .contenedor-compartir {
        justify-content: flex-end;
    }
}
.boton-compartir {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    color: #51514d;
    background-color: #fbfaf5;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #fbfaf5;
}
.boton-compartir:hover {
    transform: translateY(-2px);
}
.boton-compartir i { margin-right: 8px; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.boton-compartir.facebook:hover { color: #f2f0e2; background-color: #3365a2; border-color: #3365a2; }
.boton-compartir.whatsapp:hover { color: #f2f0e2; background-color: #46ba70; border-color: #46ba70; }
.boton-compartir.telegram:hover { color: #f2f0e2; background-color: #3591bf; border-color: #3591bf; }

.copiar-enlace.copiado {
    background-color: #751d2d;
    color: #f2f0e2;
    border-color: #751d2d;
}

/* =========================================
   EMBEDS (YOUTUBE, INSTAGRAM, ETC)
   ========================================= */
.mi-embed-personalizado {
    margin: 2em auto;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
}

/* YOUTUBE: Responsivo 16:9 */
.mi-embed-personalizado.embed-youtube {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}
.mi-embed-personalizado.embed-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* INSTAGRAM & FACEBOOK */
.mi-embed-personalizado iframe {
    max-width: 100% !important;
    width: 100% !important; 
    border-radius: 0; 
    border: 2px solid #bdbbb1;
    box-shadow: none;
}

.mi-embed-personalizado.embed-instagram {
    overflow: hidden; 
}

/* =========================================
   TAMAÑO DE CITAS
   ========================================= */
.wp-block-quote cite a, 
blockquote cite a { 
    font-size: inherit !important; 
    font-weight: bold !important; 
    color: inherit !important; 
}

/* =========================================
   PERSONALIZACIÓN DE VIDEOS Y CAPTION LINKS
   ========================================= */
.wp-block-video figcaption a,
.wp-block-image figcaption a,
.wp-element-caption a,
.gallery-caption a,
figcaption a {
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit;
    text-decoration: underline;
}

.wp-block-video video {
    background-color: #751d2d !important; 
    display: block; width: 100%; height: auto;
}

.video-wrapper-js {
    position: relative; display: block; width: 100%; overflow: hidden; 
}

.video-wrapper-js.video-muted::after {
    content: "SILENCIADO";
    font-family: 'Poppins', sans-serif;
    font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
    color: #fff; text-transform: uppercase;
    position: absolute; bottom: 15px; right: 15px;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px; border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none; opacity: 1; transition: all 0.3s ease; z-index: 10;
}

.video-wrapper-js.video-muted:hover::after {
    background-color: rgba(117, 29, 45, 0.9);
    backdrop-filter: none; border-color: #751d2d;
    cursor: pointer; pointer-events: auto;
}

/* =========================================
   COMPATIBILIDAD DE FUENTES Y ENLACES (v4.2.0)
   ========================================= */

/* Forzar la fuente Poppins en todos los componentes del plugin para evitar caídas */
.toc-principal-accordion,
.toc-principal-header h2,
.toc-principal-accordion nav a,
.toc-link-independiente,
.nota-interactiva,
.tippy-box[data-theme~='mi-tema'],
.xxiii-search-overlay,
#xxiii-search-input,
.xxiii-search-item,
.xxiii-load-more-btn,
#xxiii-search-close,
.filter-btn,
.subfilter-btn,
.year-btn {
    font-family: 'Poppins', sans-serif !important;
}

.chrono-hotspots-container {
    position: relative;
    display: inline-block;
    width: 100%;
}
.chrono-hotspots-container .chrono-hotspots-bg-img {
    display: block;
    width: 100%;
    height: auto;
}
.chrono-hotspot {
    position: absolute;
    width: 32px;
    height: 32px;
    background: #ffffff !important;
    border: none !important; /* Totalmente plano y sin bordes */
    border-radius: 0 !important; /* Cuadrado */
    box-shadow: none !important; /* Sin sombras */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transform: translate(-50%, -50%) scale(1) !important;
    transform-origin: center center !important; /* Evitar derivas por overrides del tema */
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.2s ease !important;
    z-index: 999;
}
.chrono-hotspot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transform-origin: center center !important; /* Evitar derivas por overrides del tema */
    animation: hotspot-push 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hotspot-push {
    0% {
        transform: scale(1);
        opacity: 0.95;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}
.chrono-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.05) !important; /* Hover sutil */
    background: #751d2d !important;
}
.chrono-hotspot:hover svg {
    stroke: #ffffff !important;
}
.chrono-hotspot:active {
    transform: translate(-50%, -50%) scale(0.95) !important; /* Efecto de presión */
}
.chrono-hotspot svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    transition: stroke 0.2s ease !important;
    stroke: #751d2d !important;
}