/* 1. Variables Globales del Contenido */
:root {
    /* Paleta de Colores Neutros */
    --bg-body: #f0f2f5;
    --bg-content: #ffffff;
    --text-main: #313131;
    --title-main: #f1f1f1;
    --text-muted: #0b1214;
    --border-light: #dfe6e9;

    /* Tiempos */
    --transition: all 0.3s ease;

    /* Tipografías */
    --font-heading: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Georgia', serif;
    /* Lectura inmersiva (Clases) */
    --font-sans: 'Segoe UI', sans-serif;
    /* Lectura técnica (Guías/Prácticas) */
    --font-code: 'Consolas', 'Monaco', monospace;

    /* Dimensiones */
    --width-reading: 800px;
    /* Ancho óptimo para lectura */
    --width-wide: 950px;
    /* Ancho para tablas y diagramas */
    --radius: 8px;

    /* Colores Semánticos (Compartidos con main-style si es necesario) */
    --color-primary: #0984e3;
    --color-success: #00b894;
    /* Prácticas */
    --color-warning: #fdcb6e;
    /* Tips */
    --color-danger: #d63031;
    /* Importante */
    --color-code-bg: #2d3436;
}

/* 2. Reset Básico y Body */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-heading);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* 3. Contenedor Principal (.content) */
.content {
    margin: 2rem auto;
    background: var(--bg-content);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    max-width: var(--width-reading);
}

/* Modificador para contenido ancho (Guías/Tablas) */
.content.is-wide {
    max-width: var(--width-wide);
    font-family: var(--font-sans);
    /* Guías suelen usar sans-serif */
    padding: 2.5rem;
}

/* 4. Navegación Breadcrumb */
.breadcrumb {
    max-width: var(--width-reading);
    margin: 1rem auto;
    padding: 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.content.is-wide+.breadcrumb,
/* Si el breadcrumb está antes o después */
.container-wide .breadcrumb {
    max-width: var(--width-wide);
}

.breadcrumb a {
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* 5. Headers de Lección/Artículo */
.lesson-header {
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    background: transparent;
    box-shadow: none;
    color: var(--text-main);
}

.lesson-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.lesson-header .date {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.lesson-header .subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-muted);
}

/* 6. Tipografía del Cuerpo */
/* Por defecto: Estilo Clases (Serif) */
.lesson-body p {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Modificador: Estilo Técnico (Sans) */
.content.mode-tech .lesson-body p,
.content.is-wide .lesson-body p {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
}

.lesson-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    border-left: 4px solid var(--border-light);
    padding-left: 1rem;
    color: var(--text-main);
}

.lesson-body h3 {
    margin-top: 2rem;
    color: var(--text-main);
}

.lesson-body h4 {
    margin-top: 1.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* 7. Imágenes */
.lesson-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: var(--radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 8. Componentes Especiales */

/* Cajas de Información / Tareas */
.box {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--radius);
    border-left: 5px solid #ccc;
    background-color: #f9f9f9;
}

.box-tip {
    background-color: #fff8e1;
    border-left-color: var(--color-warning);
}

.box-practice {
    background-color: #e8f5e9;
    border-left-color: var(--color-success);
    /* Verde general o override por módulo */
}

.box-publisher {
    border-left-color: #077568;
    background-color: #e0f2f1;
}

.box-excel {
    border-left-color: #217346;
    background-color: #e8f5e9;
}

.box-word {
    border-left-color: #2b579a;
    background-color: #eef2f7;
}

.box-title {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

/* Listas */
.lesson-body ul,
.lesson-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.lesson-body li {
    margin-bottom: 0.5rem;
}

/* 9. Tablas (Estilo Guías) */
table.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

table.wiki-table th {
    background-color: var(--text-main);
    color: #fff;
    padding: 10px;
    text-align: left;
}

table.wiki-table td {
    padding: 10px;
    border: 1px solid var(--border-light);
}

table.wiki-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* 10. Código y Atajos */
code,
.shortcut {
    font-family: var(--font-code);
    background: var(--color-code-bg);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* 11. Alias de Compatibilidad (Legacy) */
.task-title {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: inherit;
}

.step-list li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

/* Alias para Guías Antiguas */
.guide-container {
    margin: 2rem auto;
    background: var(--bg-content);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    max-width: var(--width-wide);
    font-family: var(--font-sans);
}

.guide-header {
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
}

.guide-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.tip {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--radius);
    background-color: #fff8e1;
    border-left: 5px solid var(--color-warning);
}

/* Estilo para tablas genéricas en guías legacy */
.guide-container table,
.content table:not(.wiki-table) {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

.guide-container th,
.content table:not(.wiki-table) th {
    background-color: #022d3b;
    color: #fff;
    padding: 10px;
    text-align: left;
}

.guide-container td,
.content table:not(.wiki-table) td {
    padding: 10px;
    border: 1px solid var(--border-light);
}

.guide-container tr:nth-child(even),
.content table:not(.wiki-table) tr:nth-child(even) {
    background-color: #f8f9fa;
}


/* 12. Responsive */
@media (max-width: 768px) {

    .content,
    .content.is-wide {
        padding: 1.5rem;
        margin: 0;
        border-radius: 0;
    }

    .lesson-header h1 {
        font-size: 1.8rem;
    }
}