/* =========================================
   ignit-apuntes.css
   Estilos propios para la sección apuntes:
   contenido de lecciones y componentes.
   ========================================= */

/* =========================================
   Contenido de lecciones (.b-detail)
   ========================================= */

.b-detail {
    font-family: "Lora", serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: #333;
}

/* Encabezados */
.b-detail h1 { font-size: 2em; }
.b-detail h2 { font-size: 1.75em; }
.b-detail h3 { font-size: 1.5em; margin-top: 1em; }
.b-detail h4 { font-size: 1.25em; margin-top: 1.25em; }

/* Texto */
.b-detail p,
.b-detail ul,
.b-detail ol,
.b-detail li {
    font-size: inherit;
    line-height: inherit;
    color: #333;
}

/* Listas */
.b-detail ul,
.b-detail ol {
    padding-left: 1.5em;
    margin-left: 0;
}
.b-detail li {
    font-size: 17px !important; /* anula .page-sidebar .page-content ul li de style.css:871 */
    padding-left: 0.5em;
}
.indice_leccion li {
    font-size: 0.875rem;
}

/* Bloques de código (highlight.js se encarga del color) */
.b-detail pre {
    border-radius: 8px;
    margin: 2em 0;
    padding: 0;
}
.b-detail pre code {
    border-radius: 8px;
    display: block;
    padding: 1em;
}

/* Código inline */
.b-detail p code,
.b-detail li code,
.b-detail blockquote code,
.b-detail table code,
.b-detail h1 code,
.b-detail h2 code,
.b-detail h3 code,
.b-detail h4 code,
span code {
    background-color: #f0f7e6;
    color: #2d6b00;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: monospace;
    line-height: inherit;
}

/* Compensa la navbar fija (90px) al saltar a anchors internos */
.b-detail h2[id],
.b-detail h3[id],
.b-detail h4[id] {
    scroll-margin-top: 90px;
}

/* Responsive */
@media (max-width: 576px) {
    .b-detail p {
        font-size: 1em;
        line-height: 1.5;
    }
    .b-detail ul,
    .b-detail ol {
        padding-left: 0.5em;
        margin-left: 0;
        list-style-position: inside;
    }
}

/* =========================================
   Componentes de apuntes
   ========================================= */

.indice_leccion {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-left: 3px solid #84ba3f;
    padding: 0.3rem 1rem 0.7rem;
    margin: 2rem 0;
    font-size: 0.875rem;
}
.indice_leccion h3 {
    margin-top: 0.3rem;
    font-size: 0.875rem;
}
.indice_leccion ul {
    margin: 0;
}
.indice_leccion a {
    color: #333;
    text-decoration: none;
}
.indice_leccion a:hover {
    text-decoration: underline;
}

/* =========================================
   TOC flotante de lección (generado por JS)
   Botón-pestaña en el borde derecho del viewport.
   Solo visible en desktop (≥992px).
   ========================================= */

#page-toc-wrap {
    display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    z-index: 500;
}

@media (min-width: 992px) {
    #page-toc-wrap {
        display: block;
    }
}

#page-toc-toggle {
    display: block;
    background: #84ba3f;
    color: #fff;
    border: none;
    padding: 10px 7px;
    border-radius: 6px 0 0 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

#page-toc-toggle:hover {
    background: #6fa030;
}

#page-toc-panel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 0.75rem 1rem 0.9rem;
    min-width: 200px;
    max-width: 240px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: -3px 3px 12px rgba(0,0,0,0.1);
    font-family: sans-serif;
}

.page-toc-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    font-weight: 600;
    margin: 0 0 0.4rem;
}

#page-toc-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #e0e0e0;
}

#page-toc-panel li {
    padding: 1px 0;
}

#page-toc-panel a {
    display: block;
    padding: 3px 8px;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color 0.15s, border-color 0.15s;
}

#page-toc-panel a:hover {
    color: #333;
}

#page-toc-panel a.active {
    color: #2d6b00;
    border-left-color: #84ba3f;
    font-weight: 600;
}

.ap_nota {
    background-color: #f0f7e6;
    border-left: 4px solid #84ba3f;
    padding: 0.7rem 1.1rem;
    margin: 1.5rem 0;
    font-size: 0.97rem;
}
.ap_nota i {
    color: #84ba3f;
}

.ap_siguiente {
    border-left: 3px solid #ccc;
    padding: 0.5rem 1.1rem;
    margin: 1.5rem 0;
    font-size: 0.92rem;
    color: #666;
    font-style: italic;
}
.ap_siguiente i {
    color: #aaa;
    font-style: normal;
}
.ap_siguiente strong {
    font-style: normal;
    font-weight: 600;
    color: #555;
}

/* Enlace a ventana de ejemplo */
.enlace-ejemplo {
    font-family: sans-serif;
    font-size: 0.85rem;
    color: #2d6b00;
    text-decoration: underline dotted #84ba3f;
    text-underline-offset: 3px;
}
.enlace-ejemplo:hover {
    color: #84ba3f;
    text-decoration: underline solid #84ba3f;
    text-underline-offset: 3px;
}
