/**
 * TOC colapsable — wrapper universal para [lwptoc]
 * Shortcode: [bfcr_toc_collapsible]
 */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap');

.bfcr-toc-wrap {
    margin: 24px 0 36px 0;
    position: relative;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
}

.bfcr-toc-inner {
    position: relative;
    overflow: hidden;
    transition: max-height 0.45s ease;
    border-radius: 10px;
}

/* Fade overlay al pie — se atenua cuando el TOC se abre */
.bfcr-toc-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.85) 45%, #ffffff 95%);
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 1;
}

/* Boton toggle — sigue el estilo de los botones del bufete */
.bfcr-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #002a28;
    color: #ffffff;
    border: none;
    padding: 13px 24px;
    border-radius: 8px;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: 0.01em;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 2px 10px rgba(0, 42, 40, 0.14);
}

.bfcr-toc-toggle:hover,
.bfcr-toc-toggle:focus {
    background: #00403d;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 42, 40, 0.22);
    color: #ffffff;
    outline: none;
}

.bfcr-toc-toggle-arrow {
    display: inline-block;
    transition: transform 0.32s ease;
    font-size: 0.9em;
    line-height: 1;
}

/* Estado expandido */
.bfcr-toc-wrap[data-collapsed="0"] .bfcr-toc-fade {
    opacity: 0;
}

/* Responsive: mas estrecho el padding en mobile */
@media (max-width: 720px) {
    .bfcr-toc-toggle {
        padding: 12px 18px;
        font-size: 14px;
    }
    .bfcr-toc-fade {
        height: 70px;
    }
}

/* Integracion con el lwptoc de Luckywp */
.bfcr-toc-inner .lwptoc {
    margin-bottom: 0 !important;
}

/* Estado "no hace falta colapsar" (auto-detect JS) */
.bfcr-toc-no-collapse .bfcr-toc-inner {
    max-height: none !important;
}
.bfcr-toc-no-collapse .bfcr-toc-fade,
.bfcr-toc-no-collapse .bfcr-toc-toggle {
    display: none !important;
}
