@import url('https://fonts.googleapis.com/css2?family=Wix Madefor Display: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-color: transparent !important;
    border: 1px solid #ffffff !important;
    border-radius: 0 !important;
    padding: 0 18px !important;
    min-height: 42px !important;
    height: 42px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease !important;
    width: auto !important;
    max-width: 420px !important;
    min-width: 220px !important;
    color: #ffffff !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
.xxiii-fake-search-trigger:hover,
.xxiii-fake-search-trigger:active {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
}
.xxiii-fake-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 12px !important;
    color: #ffffff !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
}
.xxiii-fake-icon svg {
    display: block !important;
    stroke: #ffffff !important;
}
.xxiii-fake-placeholder {
    font-family: 'Wix Madefor Display', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    user-select: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-right: 18px !important; /* Separación generosa entre el texto y el atajo */
}
.xxiii-fake-kbd {
    margin-left: auto !important;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    border-radius: 0 !important;
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: inherit !important;
    flex-shrink: 0 !important;
}
.xxiii-fake-search-trigger:hover .xxiii-fake-kbd {
    border-color: #ffffff !important;
}
@media (max-width: 768px) {
    .xxiii-fake-kbd { display: none !important; }
    .xxiii-fake-search-trigger {
        min-height: 38px !important;
        height: 38px !important;
        max-width: 250px !important;
        padding: 0 12px !important;
    }
}

/* 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: 40px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s 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: 92%;
    max-width: 820px;
    position: relative;
    margin-bottom: 50px;
    color: #1c1c1c;
}

/* Barra superior Códice Suizo (Sin títulos de marca) */
.xxiii-search-topbar {
    position: relative;
    margin-bottom: 16px;
}
.xxiii-search-close {
    position: absolute;
    top: 4px;
    right: 0;
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    z-index: 5;
}
.xxiii-search-close:hover {
    color: #751d2d;
    transform: rotate(90deg);
}

/* Input Códice Suizo */
.xxiii-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(0,0,0,0.14);
    padding: 6px 38px 10px 2px;
    margin-bottom: 8px;
    transition: border-color 0.25s;
    box-shadow: none !important;
}
.xxiii-input-wrapper:focus-within {
    border-bottom-color: #751d2d;
    box-shadow: none !important;
}
.xxiii-search-icon {
    color: #751d2d;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}
#xxiii-search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.25rem;
    color: #1c1c1c;
    padding: 4px 0;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 0;
    box-shadow: none !important;
}
#xxiii-search-input::placeholder {
    color: #9e9c94;
    font-weight: 500;
    font-size: 1.05rem;
    opacity: 1;
}
.xxiii-search-clear {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    margin-right: 4px;
    transition: color 0.2s;
}
.xxiii-search-clear:hover { color: #751d2d; }
#xxiii-search-advice {
    display: none;
    margin-top: 4px;
    font-size: 0.76rem;
    color: #751d2d;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
#xxiii-search-advice.is-visible { display: block; }

/* Sistema de Filtros Híbrido Códice-Gaceta */
.xxiii-filter-container {
    position: relative;
    margin-bottom: 18px;
}

/* Fila 1: Pestañas principales de tipo (Estilo La Gaceta en PC) */
.xxiii-filters-primary {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 12px;
    gap: 4px;
}
.xxiii-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-radius: 0;
}
.xxiii-tab:hover {
    color: #1c1c1c;
}
.xxiii-tab.active {
    color: #751d2d;
    border-bottom-color: #751d2d;
}

/* Fila 2: Subfiltros organizados (Año y Sección a la mano) */
.xxiii-filters-secondary {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}
.xxiii-filter-subgroup {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.xxiii-group-years {
    flex-shrink: 0;
}
.xxiii-group-sections {
    flex-grow: 1;
}
.filter-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #8a8880;
    letter-spacing: 0.8px;
    white-space: nowrap;
    margin-right: 2px;
    line-height: 1.2 !important;
}
.filter-divider {
    color: rgba(0,0,0,0.25);
    font-size: 13px;
    margin: 4px 2px 0 2px;
    user-select: none;
    flex-shrink: 0;
}
.filter-btn, .year-btn, .subfilter-btn {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.12);
    color: #555;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2 !important;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 0;
    box-shadow: none !important;
    transition: all 0.2s ease;
}
.filter-btn:hover, .year-btn:hover, .subfilter-btn:hover {
    border-color: #1c1c1c;
    color: #1c1c1c;
    background: rgba(0, 0, 0, 0.03);
    box-shadow: none !important;
}
.filter-btn.active, .year-btn.active, .subfilter-btn.active {
    background: #751d2d;
    color: #fff;
    border-color: #751d2d;
    box-shadow: none !important;
}
.subfilter-btn[style*="--filter-cat-color"].active, 
.subfilter-btn[style*="--filter-cat-color"]:hover {
    background: var(--filter-cat-color) !important;
    border-color: var(--filter-cat-color) !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="principales"].active, .subfilter-btn[data-slug="principales"]:hover {
    background: #751d2d !important;
    border-color: #751d2d !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="comunidad"].active, .subfilter-btn[data-slug="comunidad"]:hover {
    background: #008749 !important;
    border-color: #008749 !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="deportes"].active, .subfilter-btn[data-slug="deportes"]:hover {
    background: #aa2028 !important;
    border-color: #aa2028 !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="territorio"].active, .subfilter-btn[data-slug="territorio"]:hover {
    background: #bb3734 !important;
    border-color: #bb3734 !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="corrientes"].active, .subfilter-btn[data-slug="corrientes"]:hover {
    background: #435374 !important;
    border-color: #435374 !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="cultura"].active, .subfilter-btn[data-slug="cultura"]:hover {
    background: #d26e2e !important;
    border-color: #d26e2e !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="cosecha"].active, .subfilter-btn[data-slug="cosecha"]:hover {
    background: #536c34 !important;
    border-color: #536c34 !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="innovacion"].active, .subfilter-btn[data-slug="innovacion"]:hover,
.subfilter-btn[data-slug="innovaciones"].active, .subfilter-btn[data-slug="innovaciones"]:hover {
    background: #004c7d !important;
    border-color: #004c7d !important;
    color: #fff !important;
}
.subfilter-btn[data-slug="eteres"].active, .subfilter-btn[data-slug="eteres"]:hover {
    background: #c16153 !important;
    border-color: #c16153 !important;
    color: #fff !important;
}

/* Botón Restablecer Filtros */
.xxiii-reset-filters-btn {
    background: transparent;
    border: 1px solid rgba(117, 29, 45, 0.45);
    color: #751d2d;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 9px;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    margin-left: auto;
}
.xxiii-reset-filters-btn:hover {
    background: #751d2d;
    color: #ffffff;
    border-color: #751d2d;
}

/* Barra de Conteo y Filtro Activo */
.xxiii-search-count-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8a8880;
    line-height: 1.22 !important;
    margin-bottom: 8px;
    padding: 0 4px 6px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.xxiii-search-count-bar span {
    line-height: 1.22 !important;
}

/* Resultados */
#xxiii-search-results {
    margin-top: 10px;
    text-align: left;
    width: 100%;
}
.xxiii-search-item {
    --item-accent: #751d2d;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 8px 10px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
    background: transparent;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.22s ease,
                border-left-color 0.22s ease;
}
.xxiii-search-item:hover,
.xxiii-search-item.is-keyboard-active {
    background: rgba(255, 255, 255, 0.85);
    border-left-color: var(--item-accent);
    transform: translateX(3px);
}
.xxiii-search-item.is-keyboard-active .xxiii-search-title {
    color: var(--item-accent) !important;
}
.xxiii-search-item.is-keyboard-active .xxiii-search-thumb {
    transform: scale(1.04);
}

/* Máscara de Foto Destacada (Alto completo de la tarjeta) */
.xxiii-search-thumb-mask {
    width: 92px;
    min-width: 92px;
    min-height: 70px;
    align-self: stretch;
    overflow: hidden;
    position: relative;
    background: #e8e6d9;
    flex-shrink: 0;
    display: flex;
}
.xxiii-search-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.26s ease;
}
.xxiii-search-item:hover .xxiii-search-thumb {
    transform: scale(1.04);
}

.xxiii-search-meta {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.xxiii-search-badgerow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    line-height: 1 !important;
}
.xxiii-search-badge {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    line-height: 1 !important;
    padding: 3px 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    border-radius: 0 !important;
    color: #f2f0e2 !important;
    background: var(--item-accent, #751d2d);
    vertical-align: middle !important;
}
.xxiii-search-year {
    font-size: 0.68rem !important;
    color: #888 !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
}
.xxiii-search-reading-time {
    font-size: 0.68rem !important;
    color: #888 !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}
.xxiii-search-title {
    margin: 2px 0 2px 0 !important;
    padding: 0 !important;
    font-size: 0.96rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #1c1c1c !important;
    letter-spacing: 0.2px;
    transition: color 0.22s ease;
}
.xxiii-search-item:hover .xxiii-search-title {
    color: var(--item-accent);
}
.xxiii-highlight-match {
    color: #751d2d;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.xxiii-search-snippet {
    margin: 3px 0 2px 0 !important;
    padding: 0 !important;
    font-size: 0.74rem !important;
    color: #6e6d66 !important;
    line-height: 1.3 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xxiii-search-author {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.74rem !important;
    color: #6e6d66 !important;
    line-height: 1.2 !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xxiii-search-author.is-author-match {
    color: #1c1c1c !important;
    font-weight: 700 !important;
}
.xxiii-author-match-icon {
    color: #751d2d;
    margin-right: 4px;
    font-size: 0.72rem;
}

/* Botón Cargar Más y Spinner */
.xxiii-load-more-btn { display: block; width: 100%; padding: 12px; background: #e8e6d9; color: #1c1c1c; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; margin-top: 14px; font-size: 0.82rem; 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: 28px; height: 28px; animation: spin 1s linear infinite; margin: 25px auto; display: none; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Estado Vacío: Temas Sugeridos y Atajos */
.xxiii-search-empty-state {
    padding: 24px 10px 10px 10px;
    text-align: center;
    animation: xxiiiFadeIn 0.25s ease;
}
@keyframes xxiiiFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Historial Reciente */
.xxiii-recent-searches-wrap {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.xxiii-recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.xxiii-recent-header .xxiii-empty-label {
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.xxiii-clear-recents-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.2s ease;
}
.xxiii-clear-recents-btn:hover {
    color: #751d2d;
}
.xxiii-recent-tag {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
}
.xxiii-recent-tag:hover {
    background: #751d2d;
    border-color: #751d2d;
    color: #ffffff;
}
.xxiii-recent-tag:hover i {
    color: #ffffff;
}

.xxiii-empty-label {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8a8880;
    line-height: 1.25 !important;
    margin-bottom: 14px;
}
.xxiii-empty-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}
.xxiii-suggest-tag {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333333;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none !important;
    transition: all 0.2s ease;
}
.xxiii-suggest-tag i {
    font-size: 0.72rem;
    color: #751d2d;
    transition: transform 0.2s ease;
}
.xxiii-suggest-tag:hover {
    background: #751d2d;
    color: #ffffff;
    border-color: #751d2d;
    transform: translateY(-1px);
}
.xxiii-suggest-tag:hover i {
    color: #ffffff;
    transform: translate(2px, -2px);
}
.xxiii-search-hint {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 0.72rem;
    color: #8a8880;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.xxiii-search-hint kbd {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 0 !important;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #444;
    display: inline-block;
    font-family: inherit;
    line-height: 1;
}

@media (max-width: 991px), (pointer: coarse) {
    .xxiii-desktop-only,
    .xxiii-search-hint {
        display: none !important;
    }
}

/* Buscador Responsive */
@media (max-width: 768px) {
    .xxiii-search-overlay { padding-top: 20px; }
    .xxiii-search-container { width: 94%; }
    
    /* En Móvil: Carril continuo horizontal con swipe táctil nativo del dedo */
    .xxiii-filter-container {
        display: flex;
        align-items: center;
        gap: 6px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0 8px 0;
        margin-bottom: 12px;
        flex-wrap: nowrap;
    }
    .xxiii-filter-container::-webkit-scrollbar { display: none; }
    .xxiii-filters-primary,
    .xxiii-filters-secondary,
    .xxiii-filter-subgroup {
        display: contents;
    }
    .xxiii-tab {
        border: 1px solid rgba(0,0,0,0.12);
        padding: 4px 10px;
        font-size: 0.72rem;
        background: transparent;
    }
    .xxiii-tab.active {
        background: #751d2d;
        color: #fff;
        border-color: #751d2d;
    }
    .xxiii-reset-filters-btn {
        font-size: 0.68rem;
        padding: 4px 8px;
    }
    .xxiii-search-empty-state { padding: 16px 4px 6px 4px; }
    .xxiii-recent-searches-wrap { margin-bottom: 14px; padding-bottom: 12px; }
    .xxiii-empty-tags { gap: 6px; margin-bottom: 16px; }
    .xxiii-suggest-tag { font-size: 0.74rem; padding: 5px 10px; }
    .xxiii-search-hint,
    .xxiii-desktop-only { display: none !important; }
    #xxiii-search-input { font-size: 1.1rem; }
    .xxiii-search-thumb-mask { width: 74px; min-width: 74px; min-height: 60px; }
    .xxiii-search-title { font-size: 0.88rem !important; line-height: 1.25 !important; }
    .xxiii-search-reading-time { font-size: 0.64rem !important; }
    .xxiii-search-snippet { font-size: 0.7rem !important; }
    .xxiii-search-item { padding: 8px 6px 8px 8px; gap: 10px; }
    .xxiii-search-count-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        line-height: 1.22 !important;
        font-size: 0.68rem !important;
    }
    .xxiii-search-count-bar span {
        line-height: 1.22 !important;
    }
    .xxiii-empty-label {
        line-height: 1.25 !important;
    }
    .filter-label {
        line-height: 1.2 !important;
    }
    .xxiii-tab {
        line-height: 1.2 !important;
    }
}

/* =========================================
   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 !important; 
    color: #5b5b5b !important; 
    font-size: 0.96rem !important; 
    line-height: 1.4 !important; 
    font-weight: 600 !important; 
    display: block; 
    padding: 13px 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 18px !important;
        font-size: 0.94rem !important;
        line-height: 1.35 !important;
    }
    .toc-principal-accordion nav a:hover,
    .toc-principal-accordion nav a:active {
        padding-left: 24px !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 !important; 
    color: inherit; 
    cursor: pointer; 
    display: block; 
    margin-bottom: 0px; 
    padding: 2px 20px 8px 20px !important; 
    font-size: 0.82rem !important; 
    line-height: 1.35 !important; 
    font-weight: 500; 
    transition: color 0.2s ease-in-out, font-weight 0.2s ease-in-out; 
}
#toc-personalizado a.toc-link-independiente:hover,
.toc-link-independiente:hover { 
    color: var(--custom-color-categoria, #751d2d) !important; 
}
#toc-personalizado a.toc-link-independiente.active,
.toc-link-independiente.active { 
    color: var(--custom-color-categoria, #751d2d) !important; 
    font-weight: 700 !important; 
}

@media (max-width: 980px) {
    #toc-personalizado a.toc-link-independiente,
    .toc-link-independiente {
        font-size: 0.88rem !important;
        line-height: 1.35 !important;
        padding: 2px 16px 8px 16px !important;
    }
}

/* =========================================
   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: 'Wix Madefor Display', -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 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 5px 15px !important;
    min-height: 32px !important;
    height: auto !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    font-family: 'Wix Madefor Display', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #51514d;
    background-color: #fbfaf5;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #fbfaf5 !important;
    box-sizing: border-box !important;
}
button.boton-compartir {
    font-family: inherit;
    outline: none;
}
.boton-compartir:hover {
    transform: translateY(-2px);
}
.boton-compartir i { 
    margin-right: 7px !important; 
    font-size: 13px !important; 
    line-height: 1 !important; 
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
}
.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; }

@media (max-width: 768px) {
    .boton-compartir {
        padding: 6px 15px !important;
        min-height: 34px !important;
        font-size: 0.88rem !important;
    }
}

.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: 'Wix Madefor Display', 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 Wix Madefor Display 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: 'Wix Madefor Display', 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;
}