/* ==========================================================================
   Naia Invest TOC Block — style.css v2.2
   ========================================================================== */

/* Offset scroll para header sticky */
.single-post__content h2,
.single-post__content h3 {
    scroll-margin-top: 100px;
}

/* --------------------------------------------------------------------------
   Contenedor
   -------------------------------------------------------------------------- */

.naia-toc {
    margin: 2.4rem 0 2.8rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 20px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
    font-family: 'General Sans', sans-serif;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Toggle button
   -------------------------------------------------------------------------- */

.naia-toc__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.6rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    color: #111111;
    text-align: left;
    transition: background .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.naia-toc__toggle:hover { background: #f5f5f7; }

.naia-toc__toggle:focus-visible {
    outline: 2px solid #006edb;
    outline-offset: -2px;
    border-radius: 20px;
}

/* --------------------------------------------------------------------------
   Chevron
   -------------------------------------------------------------------------- */

.naia-toc__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b6b6b;
    transition: transform .3s ease, background .25s ease, color .25s ease;
}

.naia-toc.is-open .naia-toc__icon {
    transform: rotate(180deg);
    background: rgba(0, 110, 219, .1);
    color: #006edb;
}

/* --------------------------------------------------------------------------
   Body — elemento animado (contiene título + lista)
   -------------------------------------------------------------------------- */

.naia-toc__body {
    overflow: hidden;
    max-height: 0;
    transition: max-height .35s ease;
}

.naia-toc.is-open .naia-toc__body {
    max-height: 1600px;
}

/* --------------------------------------------------------------------------
   Título del post
   -------------------------------------------------------------------------- */

.naia-toc__post-title {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: 1.1rem 1.6rem 1.2rem;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    background: #fafafa;
}

.naia-toc__post-title-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8e8e93;
}

.naia-toc__post-title-text {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111111;
    line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Lista
   -------------------------------------------------------------------------- */

.naia-toc__list {
    margin: 0;
    padding: 0 1.6rem;
    list-style: none;
    counter-reset: toc-h2;
}

/* Padding bottom solo cuando está abierto: via body */
.naia-toc.is-open .naia-toc__list {
    padding-bottom: 1.6rem;
}

/* --------------------------------------------------------------------------
   Items
   -------------------------------------------------------------------------- */

.naia-toc__item {
    margin: 0;
    counter-increment: toc-h2;
}

.naia-toc__item + .naia-toc__item {
    border-top: 1px solid rgba(0, 0, 0, .04);
}

.naia-toc__item--h3 {
    counter-increment: none;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

.naia-toc__link {
    display: flex;
    align-items: baseline;
    gap: .65rem;
    padding: .85rem 0;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 1.4rem;
    line-height: 1.45;
    transition: color .2s ease, padding-left .2s ease;
}

.naia-toc__item--h2 .naia-toc__link::before {
    content: counter(toc-h2, decimal-leading-zero);
    flex-shrink: 0;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: #c7c7cc;
    min-width: 1.8rem;
    transition: color .2s ease;
}

.naia-toc__link:hover {
    color: #006edb;
    padding-left: .2rem;
}

.naia-toc__link:hover::before,
.naia-toc__link.is-active::before {
    color: #006edb;
}

.naia-toc__link.is-active {
    color: #006edb;
    font-weight: 600;
}

/* H3 */
.naia-toc__item--h3 .naia-toc__link {
    padding-left: 2.4rem;
    font-size: 1.25rem;
    color: #6b6b6b;
}

.naia-toc__item--h3 .naia-toc__link::before {
    content: '—';
    flex-shrink: 0;
    font-size: .9rem;
    color: #c7c7cc;
    min-width: auto;
    transition: color .2s ease;
}

.naia-toc__item--h3 .naia-toc__link:hover,
.naia-toc__item--h3 .naia-toc__link.is-active {
    color: #006edb;
    padding-left: 2.6rem;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {

    .single-post__content h2,
    .single-post__content h3 {
        scroll-margin-top: 90px;
    }

    .naia-toc {
        margin: 2rem 0 2.4rem;
        border-radius: 16px;
    }

    .naia-toc__toggle {
        padding: 1.1rem 1.35rem;
        font-size: 1.05rem;
    }

    .naia-toc__toggle:focus-visible { border-radius: 16px; }

    .naia-toc__post-title { padding: 1rem 1.35rem 1.1rem; }

    .naia-toc__post-title-text { font-size: 1rem; }

    .naia-toc__list { padding: 0 1.35rem; }

    .naia-toc.is-open .naia-toc__list { padding-bottom: 1.35rem; }

    .naia-toc__link {
        font-size: 1.2rem;
        padding: .8rem 0;
    }

    .naia-toc__item--h3 .naia-toc__link { font-size: 1.1rem; }
}
