/*
 * ==========================================================
 * INSTITUTE — THEME COMPATIBILITY V1-A
 * ==========================================================
 *
 * Adaptador cromático entre utilidades legacy de Rocket LMS
 * y la Central de Temas.
 *
 * Esta primera capa cubre familias de baja ambigüedad.
 *
 * Principio:
 * - Light  -> tokens semánticos de la Central de Temas.
 * - Dark   -> apariencia histórica de Institute/Rocket.
 *
 * text-white queda deliberadamente fuera de V1-A porque
 * también representa texto legítimamente blanco sobre media,
 * botones, badges y estados.
 *
 * Los fallbacks previos a light-dark() mantienen el aspecto
 * histórico en navegadores que no soporten esa función.
 * ==========================================================
 */


/* ==========================================================
 * TEXTO SECUNDARIO
 * ========================================================== */

.text-gray {
    color: #818894 !important;
    color: light-dark(
        var(--theme-text-muted, #818894),
        #818894
    ) !important;
}

a.text-gray:hover,
a.text-gray:focus {
    color: #5c626c !important;
    color: light-dark(
        color-mix(
            in srgb,
            var(--theme-text-muted, #818894) 70%,
            var(--theme-text, #343434) 30%
        ),
        #5c626c
    ) !important;
}


/* ==========================================================
 * TEXTO PRINCIPAL LEGACY
 * ========================================================== */

/*
 * Institute oscuro convirtió text-dark-blue en blanco.
 * Conservamos exactamente ese comportamiento en Dark.
 */
.text-dark-blue {
    color: #ffffff !important;
    color: light-dark(
        var(--theme-text, #343434),
        #ffffff
    ) !important;
}


/*
 * text-dark conserva el color original efectivo de Rocket
 * en Dark y pasa al texto semántico en Light.
 */
.text-dark {
    color: #343434 !important;
    color: light-dark(
        var(--theme-text, #343434),
        #343434
    ) !important;
}

a.text-dark:hover,
a.text-dark:focus {
    color: #0e0e0e !important;
    color: light-dark(
        var(--theme-text, #343434),
        #0e0e0e
    ) !important;
}


/* ==========================================================
 * TÍTULOS DE SECCIÓN LEGACY
 * ========================================================== */

.section-title {
    color: #ffffff !important;
    color: light-dark(
        var(--theme-text, #343434),
        #ffffff
    ) !important;
}


/* ==========================================================
 * LABELS LEGACY
 *
 * institute-form-fields.css se carga después de esta capa,
 * por lo que los campos con semántica propia conservan su
 * sistema field-bg / field-text / field-scheme.
 * ========================================================== */

.form-group .control-label,
.form-group > label {
    color: #ffffff !important;
    color: light-dark(
        var(--theme-text, #343434),
        #ffffff
    ) !important;
}


/*
 * ==========================================================
 * INSTITUTE — THEME COMPATIBILITY V1-B / TEXT-WHITE
 * ==========================================================
 *
 * Rocket utiliza text-white tanto como utilidad cromática
 * general como para texto deliberadamente blanco sobre
 * fotografías, vídeo, acentos, badges y estados.
 *
 * Regla general:
 * - Light -> texto semántico del tema.
 * - Dark  -> blanco histórico.
 *
 * Las excepciones inferiores representan superficies donde
 * el blanco posee significado de contraste local.
 * ==========================================================
 */


/* ----------------------------------------------------------
 * TEXT-WHITE GENERAL
 * ---------------------------------------------------------- */

.text-white {
    color: #ffffff !important;

    color: light-dark(
        var(--theme-text, #343434),
        #ffffff
    ) !important;
}


/* Hover histórico de enlaces */
a.text-white:hover,
a.text-white:focus {
    color: #d9d9d9 !important;

    color: light-dark(
        var(--theme-text, #343434),
        #d9d9d9
    ) !important;
}


/* ==========================================================
 * EXCEPCIONES SEMÁNTICAS
 * ========================================================== */


/*
 * 1. MEDIA / FOTOGRAFÍA / BANNERS
 */

.site-top-banner .text-white,
.cart-banner .text-white,

.course-body-on-cover.text-white,
.course-body-on-cover .text-white,

.upcoming-course-body-on-cover.text-white,
.upcoming-course-body-on-cover .text-white {
    color: #ffffff !important;
}


/*
 * 2. SUPERFICIES CROMÁTICAS ROCKET
 */

.bg-primary .text-white,
.course-content-section .nav-tabs.bg-secondary .text-white,
.bg-danger .text-white,
.bg-success .text-white,
.bg-dark .text-white,

.text-white.bg-primary,
.text-white.bg-danger,
.text-white.bg-success,
.text-white.bg-dark {
    color: #ffffff !important;
}


/*
 * 3. BADGES / ESTADOS / ETIQUETAS
 */

.badge.text-white,
.course-count-badge.text-white,
.off-label.text-white {
    color: #ffffff !important;
}


/*
 * 4. ICONOS SOBRE CAJAS CROMÁTICAS
 */

.contact-icon-box .text-white {
    color: #ffffff !important;
}


/*
 * 5. CONTROLES DE ARCHIVO
 *
 * panel-file-manager tiene superficie propia y necesita
 * conservar contraste local.
 */

.panel-file-manager.text-white,
.panel-file-manager .text-white {
    color: #ffffff !important;
}


/*
 * 6. BOTONES QUE DECLARAN EXPLÍCITAMENTE TEXT-WHITE
 */

.btn.text-white,
.btn .text-white {
    color: #ffffff !important;
}


/* ----------------------------------------------------------
 * HOVER DE EXCEPCIONES
 * ---------------------------------------------------------- */

.site-top-banner a.text-white:hover,
.site-top-banner a.text-white:focus,

.cart-banner a.text-white:hover,
.cart-banner a.text-white:focus,

.course-body-on-cover a.text-white:hover,
.course-body-on-cover a.text-white:focus,

.upcoming-course-body-on-cover a.text-white:hover,
.upcoming-course-body-on-cover a.text-white:focus,

.bg-primary a.text-white:hover,
.bg-primary a.text-white:focus,

.course-content-section .nav-tabs.bg-secondary a.text-white:hover,
.course-content-section .nav-tabs.bg-secondary a.text-white:focus,

.bg-danger a.text-white:hover,
.bg-danger a.text-white:focus,

.bg-success a.text-white:hover,
.bg-success a.text-white:focus,

.bg-dark a.text-white:hover,
.bg-dark a.text-white:focus,

.btn.text-white:hover,
.btn.text-white:focus {
    color: #d9d9d9 !important;
}


/*
 * ==========================================================
 * INSTITUTE — THEME COMPATIBILITY V1-C / HERENCIA GLOBAL
 * ==========================================================
 *
 * Legacy Global contiene:
 *
 *   * { color: #e1e1e1; }
 *
 * Esa regla rompe la herencia cromática normal de CSS:
 * aunque un contenedor tenga un color semántico correcto,
 * cada descendiente recibe directamente #e1e1e1.
 *
 * La capa de compatibilidad restaura la herencia normal.
 * Las reglas específicas de componentes/utilidades siguen
 * prevaleciendo por especificidad.
 * ==========================================================
 */

* {
    color: inherit;
}


/*
 * ==========================================================
 * INSTITUTE — THEME COMPATIBILITY V1-D / PRIMARY
 * ==========================================================
 *
 * Traduce la familia Primary histórica de Rocket LMS
 * al acento semántico definido por la Central de Temas.
 *
 * No modifica --secondary.
 * ==========================================================
 */

:root {
    --primary: var(--theme-accent, #b4283e) !important;

    --primary-hover:
        var(--theme-accent-strong, var(--theme-accent, #b4283e));

    --primary-border:
        var(--theme-accent, #b4283e);

    --primary-border-hover:
        var(--theme-accent-strong, var(--theme-accent, #b4283e));

    --primary-btn-color:
        var(--theme-accent-contrast, #ffffff);

    --primary-btn-color-hover:
        var(--theme-accent-contrast, #ffffff);

    --primary-btn-shadow:
        0 3px 6px 0
        color-mix(in srgb, var(--theme-accent, #b4283e) 30%, transparent);

    --primary-btn-shadow-hover:
        0 3px 8px 0
        color-mix(in srgb, var(--theme-accent, #b4283e) 30%, transparent);
}

