/* ============================================================
   APRENDIZAJE (hub) + ACADEMIA + GLOSARIO
   Estilos propios de la sección (base compartida: style-home.css)
   ============================================================ */

/* Hero un poco más bajo para páginas de listado */
.page-hero-short { min-height: 48vh; }

/* Breadcrumb dentro del kicker */
.crumb-link {
    color: var(--mbi-orange);
    text-decoration: none;
    transition: var(--transition);
}

.crumb-link:hover { color: var(--mbi-orange-dark); }

/* ============================================================
   HUB /aprendizaje — 3 tarjetas grandes
   ============================================================ */
.learn-hub {
    padding: 90px 0;
    background: #000;
}

.hub-card {
    display: flex;
    flex-direction: column;
    background: var(--mbi-panel);
    border: 1px solid var(--mbi-border);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    text-decoration: none;
    transition: var(--transition);
}

.hub-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 131, 42, 0.45);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

/* Tarjeta destacada de la guía: imagen del libro arriba */
.hub-card-featured .hub-card-img {
    background: #000;
    overflow: hidden;
}

.hub-card-featured .hub-card-img img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center 35%;
    display: block;
    transition: transform 0.5s ease;
}

.hub-card-featured:hover .hub-card-img img { transform: scale(1.04); }

/* Variante horizontal (Academia / Glosario) */
.hub-card-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.4rem;
    padding: 1.9rem;
    flex: 1;
}

.hub-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 131, 42, 0.1);
    border: 1px solid rgba(255, 131, 42, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mbi-orange);
    flex-shrink: 0;
}

.hub-card-icon svg { width: 27px; height: 27px; }

.hub-card-body {
    padding: 1.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.hub-card-row .hub-card-body { padding: 0; }

.hub-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mbi-orange);
    margin-bottom: 0.2rem;
}

.hub-card-body h3 {
    font-weight: 600;
    font-size: 1.25rem;
    color: #fff;
    line-height: 1.35;
    margin: 0;
}

.hub-card-body p {
    color: var(--mbi-text-muted);
    font-weight: 300;
    font-size: 0.87rem;
    line-height: 1.65;
    margin: 0;
    flex-grow: 1;
}

/* ============================================================
   ACADEMIA — bloques temáticos + tarjetas de artículo
   ============================================================ */
.academy-block {
    padding: 55px 0;
    background: var(--mbi-dark);
}

.academy-block:first-of-type { padding-top: 80px; }

/* Cabecera de categoría: número gigante + título con línea naranja */
.academy-cat-head {
    display: flex;
    align-items: baseline;
    gap: 1.1rem;
    border-bottom: 1px solid var(--mbi-orange);
    padding-bottom: 1rem;
    margin-bottom: 1.8rem;
}

.academy-cat-num {
    font-size: clamp(2.6rem, 4vw, 3.6rem);
    font-weight: 300;
    color: var(--mbi-orange);
    line-height: 1;
}

.academy-cat-head h2 {
    font-weight: 600;
    color: #fff;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    margin: 0;
}

/* Tarjeta de artículo: título + 1 frase + tiempo de lectura */
.a-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: var(--mbi-panel);
    border: 1px solid var(--mbi-border);
    border-radius: 16px;
    padding: 1.6rem 1.5rem;
    height: 100%;
    text-decoration: none;
    transition: var(--transition);
}

.a-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 131, 42, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.a-card-time {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mbi-orange);
}

.a-card h5 {
    font-weight: 600;
    font-size: 1.02rem;
    color: #fff;
    line-height: 1.4;
    margin: 0;
}

.a-card p {
    color: var(--mbi-text-muted);
    font-weight: 300;
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

/* Artículo aún sin doc: sin link, atenuado */
.a-card-soon {
    opacity: 0.55;
    cursor: default;
}

.a-card-soon:hover {
    transform: none;
    border-color: var(--mbi-border);
    box-shadow: none;
}

/* Banner intermedio → guía PDF */
.academy-banner {
    padding: 40px 0;
    background: var(--mbi-dark);
}

.academy-banner-panel {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 131, 42, 0.1) 0%, transparent 60%),
        #070707;
    border: 1px solid rgba(255, 131, 42, 0.3);
    border-radius: 20px;
    padding: 2.4rem 2.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.academy-banner-panel h3 {
    font-weight: 600;
    color: #fff;
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.academy-banner-panel p {
    color: var(--mbi-text-muted);
    font-weight: 300;
    font-size: 0.88rem;
    margin: 0;
}

/* ============================================================
   GLOSARIO — filtros + lista de términos
   ============================================================ */
.glossary-section {
    padding: 70px 0 90px;
    background: #000;
}

.glossary-filters {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 3rem;
}

/* Buscador (mismo estilo de inputs de la landing CDB) */
.glossary-search {
    width: 100%;
    max-width: 480px;
    background: #e5e5e5;
    border: none;
    border-radius: 50px;
    padding: 0.85rem 1.5rem;
    color: #333;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
}

.glossary-search:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 0.25rem rgba(255, 131, 42, 0.25);
}

/* Filtro alfabético */
.glossary-alpha {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.alpha-btn {
    min-width: 38px;
    height: 38px;
    border-radius: 50px;
    border: 1px solid var(--mbi-border);
    background: transparent;
    color: var(--mbi-text-muted);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    padding: 0 0.8rem;
}

.alpha-btn:hover { border-color: var(--mbi-orange); color: #fff; }

.alpha-btn.active {
    background: var(--mbi-orange);
    border-color: var(--mbi-orange);
    color: #fff;
}

/* Filtro por categoría */
.glossary-cats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cat-btn {
    border-radius: 50px;
    border: 1px solid var(--mbi-border);
    background: transparent;
    color: var(--mbi-text-muted);
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.45rem 1.3rem;
}

.cat-btn:hover { border-color: var(--mbi-orange); color: #fff; }

.cat-btn.active {
    background: rgba(255, 131, 42, 0.14);
    border-color: var(--mbi-orange);
    color: var(--mbi-orange);
}

/* Lista de términos: formato diccionario */
.glossary-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
}

@media (max-width: 991px) { .glossary-list { grid-template-columns: 1fr; } }

.g-term {
    background: var(--mbi-panel);
    border: 1px solid var(--mbi-border);
    border-radius: 16px;
    padding: 1.7rem 1.8rem;
    transition: var(--transition);
}

.g-term:hover { border-color: rgba(255, 131, 42, 0.35); }

/* Los 6 términos con definición ampliada llevan borde destacado */
.g-term-featured { border-color: rgba(255, 131, 42, 0.3); }

.g-term-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.g-term-head h3 {
    font-weight: 600;
    font-size: 1.15rem;
    color: #fff;
    margin: 0;
}

.g-cat-tag {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mbi-orange);
    border: 1px solid rgba(255, 131, 42, 0.4);
    border-radius: 50px;
    padding: 0.2rem 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.g-term p {
    color: var(--mbi-text-muted);
    font-weight: 300;
    font-size: 0.86rem;
    line-height: 1.65;
    margin: 0;
}

.g-more {
    display: inline-block;
    margin-top: 0.8rem;
    color: var(--mbi-orange);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.8rem;
    font-style: italic;
    transition: var(--transition);
}

.g-more:hover { color: var(--mbi-orange-dark); }

/* Botón "Ver definición ampliada" de los 6 términos destacados */
.g-more-btn {
    font-style: normal;
    font-weight: 600;
    border: 1px solid var(--mbi-orange);
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
}

.g-more-btn:hover {
    background: var(--mbi-orange);
    color: #fff;
}

/* Término oculto por filtro */
.g-term.filtered-out { display: none; }

/* Estado vacío */
.glossary-empty {
    text-align: center;
    color: var(--mbi-text-muted);
    font-weight: 300;
    padding: 3rem 0 1rem;
}

.g-reset {
    background: none;
    border: none;
    color: var(--mbi-orange);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

/* ============================================================
   ARTÍCULO DE ACADEMIA (academia/<slug>.html)
   ============================================================ */
.page-hero-article { min-height: 42vh; }

/* Meta del artículo: categoría + tiempo de lectura */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.4rem;
    flex-wrap: wrap;
}

.article-meta .g-cat-tag { font-size: 0.68rem; }

.article-meta .a-card-time { letter-spacing: 0.06em; }

/* Firma: autor + fecha visibles para el lector. El mismo dato vive en el JSON-LD
   (author / datePublished), pero en contenido financiero (YMYL) Google espera
   además que la autoría sea visible en la página, no sólo declarada. */
.article-byline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    margin-top: 0.9rem;
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--mbi-text-muted);
}

.article-byline .byline-por { opacity: 0.6; }

.article-byline .byline-autor {
    color: var(--mbi-text-light);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 131, 42, 0.35);
    transition: var(--transition);
}

.article-byline .byline-autor:hover,
.article-byline .byline-autor:focus-visible {
    color: var(--mbi-orange);
    border-bottom-color: var(--mbi-orange);
}

.article-byline .byline-cargo { opacity: 0.7; }

.article-byline .byline-sep { color: var(--mbi-orange); opacity: 0.55; }

.article-byline time { opacity: 0.75; }

/* En móvil la firma respira mejor en dos líneas que apretada contra el borde */
@media (max-width: 575px) {
    .article-byline { gap: 0.2rem 0.55rem; font-size: 0.78rem; }
    .article-byline .byline-sep { display: none; }
    .article-byline time { flex-basis: 100%; }
}

/* Cuerpo del artículo */
.article-section {
    padding: 70px 0 60px;
    background: #000;
}

.article-container {
    max-width: 780px;
    margin: 0 auto;
}

.article-body h2 {
    font-weight: 700;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.35;
    margin: 2.4rem 0 0.9rem;
    padding-left: 1rem;
    border-left: 3px solid var(--mbi-orange);
}

.article-body h2:first-child { margin-top: 0; }

.article-body p {
    color: var(--mbi-text-muted);
    font-weight: 300;
    font-size: 0.96rem;
    line-height: 1.85;
    margin-bottom: 1.2rem;
}

.article-body strong { color: #fff; font-weight: 600; }

.article-body a {
    color: var(--mbi-orange);
    text-decoration: underline;
    transition: var(--transition);
}

.article-body a:hover { color: var(--mbi-orange-dark); }

.article-body ul,
.article-body ol {
    color: var(--mbi-text-muted);
    font-weight: 300;
    font-size: 0.96rem;
    line-height: 1.8;
    margin-bottom: 1.2rem;
    padding-left: 1.4rem;
}

.article-body li { margin-bottom: 0.55rem; }

.article-body li::marker { color: var(--mbi-orange); font-weight: 600; }

/* Tablas: scroll horizontal en pantallas chicas */
.table-scroll {
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--mbi-border);
    border-radius: 14px;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    min-width: 520px;
}

.article-table th {
    background: rgba(255, 131, 42, 0.1);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--mbi-orange);
    white-space: nowrap;
}

.article-table td {
    color: var(--mbi-text-muted);
    font-weight: 300;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--mbi-border);
    line-height: 1.6;
    vertical-align: top;
}

.article-table tr:last-child td { border-bottom: none; }

.article-table td:first-child { color: #fff; font-weight: 600; }

/* Callout "para llevarlo a la práctica" / menciones MBI Trading */
.article-note {
    background:
        radial-gradient(ellipse at 15% 50%, rgba(255, 131, 42, 0.1) 0%, transparent 60%),
        var(--mbi-panel);
    border: 1px solid rgba(255, 131, 42, 0.35);
    border-radius: 16px;
    padding: 1.5rem 1.8rem;
    margin: 2rem 0;
}

.article-note p { margin: 0; }

.article-note .note-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mbi-orange);
    margin-bottom: 0.5rem;
}

/* ============================================================
   DIAGRAMAS EXPLICATIVOS DEL ARTÍCULO (.article-figure)
   SVG inline: hereda Poppins del documento (un <img src=".svg">
   no puede cargar la fuente). En pantallas chicas el diagrama
   scrollea horizontal, mismo patrón que .table-scroll.
   ============================================================ */
.article-figure {
    margin: 2.2rem 0;
    padding: 1.6rem 1.5rem 1.3rem;
    background: var(--mbi-panel);
    border: 1px solid var(--mbi-border);
    border-radius: 16px;
}

/* Solo el SVG scrollea: el pie es prosa y debe envolver en el ancho visible. */
.article-figure-scroll { overflow-x: auto; }

.article-figure-scroll svg {
    display: block;
    width: 100%;
    min-width: 560px;
    height: auto;
}

.article-figure figcaption {
    margin-top: 1.2rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--mbi-border);
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.5);
}

.article-figure figcaption strong { color: #fff; font-weight: 600; }

/* Tokens tipográficos del diagrama.
   Regla: el texto NUNCA lleva el color del dato — la identidad la
   carga la marca de color al lado (línea, punto, barra). */
.article-figure-scroll svg text { font-family: 'Poppins', sans-serif; }

.dg-val {  /* valor / dato destacado */
    fill: #fff;
    font-size: 13px;
    font-weight: 600;
}

.dg-lbl {  /* etiqueta descriptiva */
    fill: var(--mbi-text-muted);
    font-size: 12.5px;
    font-weight: 300;
}

.dg-key {  /* nombre de una serie / nivel */
    fill: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.dg-mut {  /* eje, unidad, nota al pie */
    fill: rgba(255, 255, 255, 0.45);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.06em;
}

/* Ejes y grillas: hairline sólido, un paso sobre la superficie. */
.dg-axis { stroke: rgba(255, 255, 255, 0.14); stroke-width: 1; }

/* Umbral real (Stop Loss, límite): el punteado aquí SÍ significa
   "nivel definido de antemano", no es una grilla decorativa. */
.dg-thr { stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }

.dg-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dg-panel { fill: rgba(255, 255, 255, 0.03); stroke: var(--mbi-border); stroke-width: 1; }

@media (max-width: 575px) {
    .article-figure { padding: 1.1rem 1rem 1rem; }
}

/* Enlazado interno: "Sigue aprendiendo" */
.article-related {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--mbi-orange);
}

.article-related h4 {
    font-weight: 700;
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
}

.article-related ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.article-related a {
    color: var(--mbi-text-muted);
    text-decoration: none;
    font-weight: 300;
    font-size: 0.92rem;
    transition: var(--transition);
}

.article-related a::before {
    content: '→ ';
    color: var(--mbi-orange);
    font-weight: 600;
}

.article-related a:hover { color: var(--mbi-orange); }

/* Volver a la academia */
.article-back {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--mbi-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 300;
    transition: var(--transition);
}

.article-back::before { content: '← '; color: var(--mbi-orange); }

.article-back:hover { color: var(--mbi-orange); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hub-card-row { flex-direction: column; }

    .academy-cat-head {
        flex-direction: column;
        gap: 0.3rem;
        text-align: center;
        align-items: center;
    }

    .academy-banner-panel {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
    }

    .glossary-search { max-width: 100%; }

    .glossary-filters { align-items: center; }
    .glossary-alpha, .glossary-cats { justify-content: center; }
}
