/* ============================================================
   Smart TOC – Estilos del Índice Automático
   Versión: 1.7.0
   ============================================================ */

.smart-toc {
    border: 1px solid #e0ddd8;
    padding: 20px 24px;
    max-width: 100%;
    border-radius: 16px;
    background: #FFFFFF;
}

/* ── Cabecera ── */
.smart-toc__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dcd9d5;
}

.smart-toc__icon {
    display: flex;
    align-items: center;
    color: #002559;
    flex-shrink: 0;
}

.smart-toc__title {
    color: #002559;
    font-family: 'Helvetica LST', Helvetica, Arial, sans-serif;
    font-size: 19px;
    font-weight: 400;
    line-height: 32px;
    flex: 1;
}

/* ── Lista ── */
.smart-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ── Ítem ── */
.smart-toc__item {
    margin: 0;
    padding: 0;
}

/* ── Enlace ── */
.smart-toc__link {
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, font-weight 0.18s ease;
    color: #4A586E;
    font-family: 'Helvetica LST', Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 20px;
    padding: 6px 0;
    text-decoration: none;
}

/* Punto decorativo */
.smart-toc__link::before {
    content: '';
    display: none;
    width: 8px;
    height: 8px;
    background-color: #002559;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    flex-shrink: 0;
    transition: background-color 0.18s ease;
}

/* Hover */
.smart-toc__link:hover {
    color: #002559;
    font-weight: 400;
	background: #F3F5F7;
    text-decoration: none;
}

/* Estado ACTIVO */
.smart-toc__link--active {
    color: #002559;
    font-weight: 600 !important;
    border-radius: 8px;
    background: #F3F5F7;
    padding: 6px 13px;
}

.smart-toc__link--active::before {
    background-color: #002559;
    transform: scale(1.3);
    display: inline-block;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .smart-toc {
        padding: 16px 18px;
    }
}

/* ============================================================
   Offset scroll para menú fijo
   ============================================================ */
html {
    scroll-padding-top: 146px;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 90px;
    }
}

.entry-content h2,
.post-content h2,
article h2,
.wp-block-post-content h2 {
    scroll-margin-top: 146px;
}

@media (max-width: 768px) {
    .entry-content h2,
    .post-content h2,
    article h2,
    .wp-block-post-content h2 {
        scroll-margin-top: 90px;
    }
}

/* ============================================================
   Visibilidad por breakpoint
   ============================================================ */
.indice-desktop { display: block; }
@media (max-width: 768px) {
    .indice-desktop { display: none; }
}

.indice-mobile { display: none; }
@media (max-width: 768px) {
    .indice-mobile { display: block; }
}

/* ============================================================
   VERSIÓN MÓVIL – Botón trigger (solo cabecera)
   ============================================================ */
.smart-toc--mobile-trigger {
    border-radius: 16px;
    background: #FFFFFF;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
    border: none;
}

/* El header se convierte en botón */
.smart-toc--mobile-trigger .smart-toc__header {
    width: 100%;
    background-color: #FFFFFF !important;
    border: none !important;
    cursor: pointer;
    padding: 16px 20px;
    margin: 0;
    border-bottom: none;
    justify-content: space-between;
    transition: background-color 0.18s ease;
}

.smart-toc--mobile-trigger .smart-toc__header:hover {
    background-color: #F3F5F7;
}

/* Chevron */
.smart-toc__chevron-wrap {
    display: flex;
    align-items: center;
    color: #002559;
    transition: transform 0.25s ease;
}

.smart-toc__modal-open[aria-expanded="true"] .smart-toc__chevron-wrap {
    transform: rotate(180deg);
}

/* ============================================================
   MODAL
   ============================================================ */

/* Bloquear scroll del body cuando el modal está abierto */
body.smart-toc-modal--open {
    overflow: hidden;
}

.smart-toc-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;  /* panel sube desde abajo */
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.smart-toc-modal.is-visible {
    opacity: 1;
    pointer-events: all;
}

/* Overlay oscuro */
.smart-toc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

/* Panel que sube desde abajo */
.smart-toc-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    background: #FFFFFF;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    -webkit-overflow-scrolling: touch;
}

.smart-toc-modal.is-visible .smart-toc-modal__panel {
    transform: translateY(0);
}

/* Cabecera del modal */
.smart-toc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #dcd9d5;
}

/* Botón cerrar (X) */
.smart-toc-modal__close {
    background: #FFFFFF !important;
    padding: 0;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.18s ease;
}
.smart-toc-modal__close svg{
	width: 40px;
}

/* Links dentro del modal */
.smart-toc-modal .smart-toc__link {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 22px;
}

.smart-toc-modal .smart-toc__link:hover {
    background: #F3F5F7;
}

/* Separador entre ítems del modal */
.smart-toc-modal .smart-toc__item + .smart-toc__item {
    border-top: 1px solid #f0eeed;
}
.title_mdlind{
	font-weight: 700 !important;
    font-size: 26px !important;
}

@media(min-width:100px){
	.smart-toc__title {
		font-size: 19px;
		font-weight: 400;
	}
	.icolist_ind{
		display: block;
	}
}
@media(min-width:992px){
	.icolist_ind{
		display: none;
	}
	.smart-toc__title {
		font-size: 24px;
		font-weight: 700;
	}
}


/* ============================================================
   FIXED MÓVIL – cuando el índice entra al viewport
   ============================================================ */
@media (max-width: 768px) {

    .smart-toc--is-fixed {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        border-radius: 0 0 16px 16px;
        border-top: none;
    }

    .smart-toc--mobile-trigger {
        transition: box-shadow 0.25s ease, border-radius 0.25s ease;
    }
}
