/* ==========================================================================
   Tabla de contenidos (TOC) — Heroic TOC plugin
   ========================================================================== */
.wp-block-ht-block-toc {
    border: none !important;
    border-radius: var(--block-radius);
    /* Background layers: SVG icon behind text, gradient underneath */
    background-image:
      url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDggNDgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNDcuNTM3IDQuMTU5Yy0uMDEzLS4wMzUtLjAxNy0uMDctLjAzLS4xQTYuNTU3IDYuNTU3IDAgMDA0My45NDIuNDk2Yy0uMDMtLjAxMy0uMDY2LS4wMjEtLjA5Ni0uMDM0QTYuNDk5IDYuNDk5IDAgMDA0MS40NTUgMEg2Ljc1OWE2LjU0NSA2LjU0NSAwIDEwMCAxMy4wOWgxOC44OTVMMS45MTYgMzYuODI2YTYuNTQ3IDYuNTQ3IDAgMTA5LjI2IDkuMjZsMjMuNzMzLTIzLjczOXYxOC45YTYuNTQ1IDYuNTQ1IDAgMTAxMy4wOSAwTDQ4IDYuNTQ3VjYuNTRhNi41NiA2LjU2IDAgMDAtLjQ2My0yLjM4MiIvPjwvc3ZnPg=="),
      linear-gradient(90deg, #f1f1f1 42%, rgba(241, 241, 241, 0) 98%);
    background-repeat: no-repeat, no-repeat;
    background-position: bottom 30px right 30px, center center;
    background-size: 48px 48px, auto;
    position: relative;
    padding: 24px 32px !important;
}

.wp-block-ht-block-toc a {
    text-decoration: none;
}

.ht_toc_title {
    font-size: 20px;
    line-height: 24px;
    font-weight: 400;
    font-weight: bold;
}

.ht_toc_title:after {
    content: ":";
}

.htoc__toggle {
    display: none;
}



/* Numeración jerárquica de TOC: h2 y h3 */
.ht_toc_list {
    counter-reset: h2counter;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.ht_toc_list > li {
    counter-increment: h2counter;
    counter-reset: h3counter;
    list-style: none !important;
    margin-bottom: 0.75em;
}
.ht_toc_list > li > a::before {
    content: counter(h2counter) " ";
    display: inline-block;
    margin-right: 8px;
    width: 1.5em;
    text-align: center;
    padding: 2px;
    background-color: var(--main-blue);
    color: white;
    border-radius: var(--quote-radius);
    font-weight: bold;
}
/* Grid para ítems h2 */
.ht_toc_list > li > a {
    display: grid;
    grid-template-columns: min-content 1fr;
    column-gap: 8px;
    align-items: center;
}
.ht_toc_list .ht_toc_child_list {
    counter-reset: h3counter;
    list-style: none !important;
    margin: 0.5em 0 0.75em 1.5em;
    padding: 0;
}
.ht_toc_list .ht_toc_child_list > li {
    counter-increment: h3counter;
    list-style: none !important;
}
.ht_toc_list .ht_toc_child_list > li > a::before {
    content: counter(h2counter) "." counter(h3counter) " ";
    display: inline-block;
    width: auto;
    margin-right: 8px;
    padding: 2px 6px;
    background-color: var(--main-blue);
    color: white;
    border-radius: 3px;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
}
/* Grid solo para ítems h3 */
.ht_toc_list .ht_toc_child_list > li > a {
    display: grid;
    grid-template-columns: min-content 1fr;
    column-gap: 8px;
    align-items: center;
}

/* TOC list desktop-only customizations */
@media (min-width: 1151px) {
    /*.ht_toc_list a {*/
    /*    color: green !important;*/
    /*}*/
    .ht_toc_list a:hover {
        color: #ff0f0f;
    }
    /* Smooth transition for TOC items on hover */
    .ht_toc_list li a {
        transition: margin-left 0.3s ease;
    }
    /* Hover independiente para h2 y h3 */
    .ht_toc_list > li:hover > a,
    .ht_toc_list .ht_toc_child_list > li:hover > a {
        margin-left: 11px;
    }
}

.htoc__itemswrap {
    margin-top: 4px !important;
}

.ht_toc_list li {
    margin-bottom: 8px !important;
}

.ht_toc_list a {
    font-weight: 800;
    font-size: var(--h3-size);
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1150px) {
    .wp-block-ht-block-toc {
        border-radius: var(--quote-radius);
        padding: 24px 24px !important;
    }
    .ht_toc_title {
        font-size: 16px;
        line-height: 24px;
    }
    .htoc__itemswrap {
        margin-top: 8px !important;
    }
    .ht_toc_list a {
        font-size: 18px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .wp-block-ht-block-toc {
        padding: 24px 16px !important;
    }
    .ht_toc_title {
        font-size: 18px;
        line-height: 24px;
    }
    .htoc__itemswrap {
        margin-top: 10px !important;
    }
    .ht_toc_list a {
        font-size: 18px;
    }
}
