@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* 1. Variables Globales — Estilo Warm Paper & Obsidian Retro Minimalista */
:root {
    --bg-color: #F7F6F3;
    --bg-body: #F7F6F3;
    --bg-content: #FFFFFF;
    
    --text-color: #1A1A1A;
    --text-main: #1A1A1A;
    --text-muted: #5C5955;
    
    --title-main: #111111;
    --white: #FFFFFF;
    --border-light: #D9D7CE;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 2px 3px 0px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s ease-in-out;

    --font-heading: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-code: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

    --width-reading: 800px;
    --width-wide: 950px;
    --radius: 4px;

    /* Muted Retro Color Palette por Módulo */
    --color-win: #295F85;
    --color-word: #254875;
    --color-excel: #1E5E3A;
    --color-ppt: #9E3B2B;
    --color-pub: #1B5E55;
    --color-net: #9E771D;
    --color-ia: #5B3A70;
    --color-access: #A4373A;
    --color-herramientas: #D96B27;
    
    --primary-color: #2B2B2B;
    --accent-color: #5C5955;
    
    --color-success: #1E5E3A;
    --color-warning: #9E771D;
    --color-danger: #9E3B2B;
    --color-code-bg: #F0EEE9;
}

/* 1b. Dark Mode — Obsidian Terminal */
[data-theme="dark"] {
    --bg-color: #121212;
    --bg-body: #121212;
    --bg-content: #1C1C1C;

    --text-color: #E6E6E6;
    --text-main: #E6E6E6;
    --text-muted: #9E9E9E;

    --title-main: #F0F0F0;
    --white: #1C1C1C;
    --border-light: #2E2E2E;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 2px 3px 0px rgba(0, 0, 0, 0.4);

    --color-code-bg: #262626;

    --primary-color: #E6E6E6;
    --accent-color: #9E9E9E;
}

[data-theme="dark"] header {
    background: #161616;
    border-bottom-color: #2E2E2E;
}

[data-theme="dark"] header h1 {
    color: #F0F0F0;
    background: none;
    -webkit-text-fill-color: initial;
}

[data-theme="dark"] .modal {
    background-color: rgba(18, 18, 18, 0.95);
}

[data-theme="dark"] .essentials-note {
    background: #242018;
    color: #E5A93C;
}

[data-theme="dark"] table.wiki-table th, 
[data-theme="dark"] .guide-container th, 
[data-theme="dark"] .content table:not(.wiki-table) th {
    background-color: #161616;
    color: #F0F0F0;
}

[data-theme="dark"] .card[data-module="win"]:hover { background: #1E262E; }
[data-theme="dark"] .card[data-module="word"]:hover { background: #1B222C; }
[data-theme="dark"] .card[data-module="ppt"]:hover { background: #2A1D1B; }
[data-theme="dark"] .card[data-module="xls"]:hover { background: #1B261F; }
[data-theme="dark"] .card[data-module="pub"]:hover { background: #192624; }
[data-theme="dark"] .card[data-module="net"]:hover { background: #262319; }
[data-theme="dark"] .card[data-module="ia"]:hover { background: #231B28; }
[data-theme="dark"] .card[data-module="access"]:hover { background: #2A1C1E; }
[data-theme="dark"] .card[data-module="herramientas"]:hover { background: #2A2019; }

/* 2. Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* 3. Header y Footer Compactos */
header {
    background: var(--bg-content);
    color: var(--title-main);
    padding: 1.2rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
}

.header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 850px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.header-text {
    flex: 1;
    min-width: 200px;
}

.theme-btn {
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: var(--font-code);
    font-size: 0.95rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    flex-shrink: 0;
}

.theme-btn:hover {
    background: var(--border-light);
    transform: translateY(-1px);
}

.theme-btn:active {
    transform: translateY(0);
}

header h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 0.15rem;
    color: var(--title-main);
}

header h2 {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto;
}

footer {
    text-align: center;
    padding: 1.2rem 1rem;
    margin-top: auto;
    background: var(--bg-content);
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-light);
    width: 100%;
}

/* 4. Layout Compacto */
.container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0 auto;
    padding: 1.2rem 1rem;
    flex: 1;
    width: 100%;
    max-width: 1150px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

/* 5. Tarjetas (Cards) Retro Minimalistas */
.card {
    background: var(--bg-content);
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: default;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: #B5B2A6;
    transform: translateY(-2px);
}

.card-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-bottom: 0.6rem;
    transition: var(--transition);
}

.card:hover .card-icon {
    transform: scale(1.1);
}

.card h2 {
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--title-main);
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card h2 .module-badge {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Colores de badge por módulo */
.card[data-module="win"] .module-badge { background: var(--color-win); }
.card[data-module="word"] .module-badge { background: var(--color-word); }
.card[data-module="ppt"] .module-badge { background: var(--color-ppt); }
.card[data-module="xls"] .module-badge { background: var(--color-excel); }
.card[data-module="pub"] .module-badge { background: var(--color-pub); }
.card[data-module="net"] .module-badge { background: var(--color-net); }
.card[data-module="ia"] .module-badge { background: var(--color-ia); }
.card[data-module="access"] .module-badge { background: var(--color-access); }
.card[data-module="herramientas"] .module-badge { background: var(--color-herramientas); }

/* Fondo wash sutil por módulo en hover */
.card[data-module="win"]:hover { background: #F3F7FA; }
.card[data-module="word"]:hover { background: #F2F5F9; }
.card[data-module="ppt"]:hover { background: #FAF3F2; }
.card[data-module="xls"]:hover { background: #F1F7F3; }
.card[data-module="pub"]:hover { background: #F1F7F6; }
.card[data-module="net"]:hover { background: #FAF7F0; }
.card[data-module="ia"]:hover { background: #F6F2FA; }
.card[data-module="access"]:hover { background: #F9F1F1; }
.card[data-module="herramientas"]:hover { background: #FAF3ED; }

/* 6. Enlaces de Navegación Compactos */
.links {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.78rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
    flex: 1;
    text-align: center;
    background: var(--bg-body);
}

.links a:hover {
    background-color: var(--border-light);
    color: var(--title-main);
}

.links a:active {
    transform: scale(0.97);
}

.links a:visited {
    color: var(--text-muted);
}

/* 7. Colores de borde por módulo en tarjetas */
.card[data-module="win"] { border-top: 2px solid var(--color-win); }
.card[data-module="word"] { border-top: 2px solid var(--color-word); }
.card[data-module="ppt"] { border-top: 2px solid var(--color-ppt); }
.card[data-module="xls"] { border-top: 2px solid var(--color-excel); }
.card[data-module="pub"] { border-top: 2px solid var(--color-pub); }
.card[data-module="net"] { border-top: 2px solid var(--color-net); }
.card[data-module="ia"] { border-top: 2px solid var(--color-ia); }
.card[data-module="access"] { border-top: 2px solid var(--color-access); }
.card[data-module="herramientas"] { border-top: 2px solid var(--color-herramientas); }

[data-module="win"] { --module-color: var(--color-win); }
[data-module="word"] { --module-color: var(--color-word); }
[data-module="ppt"] { --module-color: var(--color-ppt); }
[data-module="xls"] { --module-color: var(--color-excel); }
[data-module="pub"] { --module-color: var(--color-pub); }
[data-module="net"] { --module-color: var(--color-net); }
[data-module="ia"] { --module-color: var(--color-ia); }
[data-module="access"] { --module-color: var(--color-access); }
[data-module="herramientas"] { --module-color: var(--color-herramientas); }

/* ----------------------------------------------------------------
   Índices de Módulo
-------------------------------------------------------------------- */

.breadcrumb-nav {
    background: var(--bg-content);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-code);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.breadcrumb-nav .theme-btn {
    margin-left: auto;
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    flex-shrink: 0;
}

.breadcrumb-nav .theme-btn:hover {
    color: var(--text-main);
    background: var(--bg-body);
}

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

.breadcrumb-nav a:hover {
    color: var(--text-main);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.8rem;
}

/* Sección de módulo con color dinámico vía data-module */
.module-section {
    background: var(--bg-content);
    padding: 1.2rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.module-section h2 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--title-main);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-color: var(--module-color, var(--text-muted));
    color: var(--module-color, var(--text-muted));

}

/* Listas de Ítems */
.item-list {
    list-style: none;
}

.item-list li {
    margin-bottom: 0.8rem;
}

.item-list a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    color: var(--text-color);
    transition: var(--transition);
}

.item-list a:hover {
    background: var(--bg-content);
    border-left: 3px solid var(--module-color, var(--text-muted));
    box-shadow: var(--shadow-sm);
    transform: translateX(3px);
}

.item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.item-title {
    font-weight: 500;
}

.badge {
    display: inline-block;
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-right: 8px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.key-box {
    font-family: var(--font-code);
    background-color: var(--color-code-bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    display: inline-block;
    color: var(--text-main);
    font-size: 0.85em;
}

/* 8. Estilos para Imágenes y Modal */
.guide-img-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.guide-img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.shortcut-thumbnail {
    width: 120px;
    height: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: block;
    margin: 0 auto;
}

.shortcut-thumbnail:hover {
    border-color: #aaa;
    box-shadow: var(--shadow-sm);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text-muted);
    font-size: 35px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: var(--text-muted);
    padding: 10px 0;
    font-size: 0.9rem;
}

/* Buscador */
.buscador-index {
    width: 100%;
    padding: 0.5rem 0.8rem;
    font-size: 0.88rem;
    font-family: var(--font-sans);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-body);
    color: var(--text-main);
    margin-bottom: 1.2rem;
    outline: none;
    transition: var(--transition);
}

.buscador-index:focus {
    border-color: #B5B2A6;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
    background: var(--bg-content);
}

/* ==========================================================================
   CONTENIDO DE CLASES Y GUÍAS (COMPACTO & RETRO)
   ========================================================================== */

.content {
    margin: 1.2rem auto;
    background: var(--bg-content);
    padding: 1.8rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    max-width: var(--width-reading);
    box-shadow: var(--shadow-sm);
}

.content.is-wide {
    max-width: var(--width-wide);
    padding: 1.8rem;
}

.breadcrumb {
    max-width: var(--width-reading);
    margin: 0 auto 1rem;
    padding: 0;
    font-size: 0.8rem;
    font-family: var(--font-code);
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.content.is-wide + .breadcrumb,
.container-wide .breadcrumb {
    max-width: var(--width-wide);
}

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

.breadcrumb a:hover {
    color: var(--text-main);
}

.lesson-header {
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.lesson-header h1 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--title-main);
    margin-bottom: 0.3rem;
}

.lesson-header .date {
    display: inline-block;
    font-size: 0.72rem;
    font-family: var(--font-code);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.lesson-header .subtitle {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.45;
}

.lesson-body p {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: var(--text-color);
}

.content.mode-tech .lesson-body p,
.content.is-wide .lesson-body p {
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

.lesson-body h2 {
    font-family: var(--font-heading);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--title-main);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.4rem;
}

.lesson-body h3 {
    font-family: var(--font-heading);
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--title-main);
}

.lesson-body h4 {
    margin-top: 1.2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-code);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lesson-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.8rem auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Cajas de Información */
.box {
    padding: 1rem 1.2rem;
    margin: 1.4rem 0;
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--radius);
    background-color: var(--bg-content);
}

.box-tip { border-left-color: var(--color-warning); }
.box-practice { border-left-color: var(--color-success); }
.box-publisher { border-left-color: var(--color-pub); }
.box-excel { border-left-color: var(--color-excel); }
.box-word { border-left-color: var(--color-word); }
.box-win { border-left-color: var(--color-win); }

.box-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabla de atajos esenciales (destacada al inicio de cada guía) */
.essentials-note {
    display: block;
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
    background: var(--bg-body);
    border-left: 3px solid var(--color-warning);
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-warning);
}

table.essentials-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.8rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

table.essentials-table thead th {
    background: var(--color-warning);
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.essentials-table thead th:first-child {
    border-radius: var(--radius) 0 0 0;
}

table.essentials-table thead th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

table.essentials-table tbody tr {
    transition: var(--transition);
}

table.essentials-table tbody tr:hover {
    background: var(--bg-body);
}

table.essentials-table tbody td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
}

table.essentials-table tbody td:first-child {
    font-family: var(--font-code);
    font-weight: 600;
    white-space: nowrap;
    color: var(--title-main);
}

table.essentials-table tbody td:last-child {
    color: var(--text-muted);
}

table.essentials-table + h2 {
    margin-top: 1.5rem;
}

.lesson-body ul, .lesson-body ol {
    margin-bottom: 1.2rem;
    padding-left: 1.2rem;
    font-family: var(--font-sans);
}

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

/* Tablas General Compactas */
table.wiki-table, .guide-container table, .content table:not(.wiki-table) {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

table.wiki-table th, .guide-container th, .content table:not(.wiki-table) th {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
}

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

/* Código y Atajos */
code, .shortcut {
    font-family: var(--font-code);
    background: var(--color-code-bg);
    color: var(--text-main);
    padding: 0.15rem 0.35rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 0.83em;
}

/* Alias de Compatibilidad (Legacy) */
.task-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.step-list li {
    margin-bottom: 0.6rem;
}

.guide-container {
    margin: 1.4rem auto;
    background: var(--bg-content);
    padding: 1.8rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    max-width: var(--width-wide);
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
}

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

.guide-header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.tip {
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--color-warning);
    border-radius: var(--radius);
    background-color: var(--bg-content);
}

/* Button descarga */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.download-btn:hover {
    background: var(--border-light);
    border-color: #bbb;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .content, .guide-container {
        padding: 2rem;
    }

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

/* Móviles */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .content, .content.is-wide, .guide-container {
        padding: 1.25rem;
        margin: 0.5rem 0;
        border-radius: var(--radius);
        border: 1px solid var(--border-light);
    }

    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    header h2 {
        font-size: 1rem;
    }

    .lesson-header h1, .guide-header h1 {
        font-size: 1.6rem;
    }
    
    .lesson-body p {
        font-size: 1rem;
    }
    
    .lesson-body h2 {
        font-size: 1.3rem;
        margin-top: 2rem;
    }

    .box {
        padding: 1.2rem;
        margin: 1.5rem 0;
    }
    
    table.wiki-table, .guide-container table, .content table:not(.wiki-table) {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .breadcrumb-nav {
        padding: 0.8rem 1rem;
        font-size: 0.8rem;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 90vh;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   IMPRESIÓN
   ========================================================================== */
@media print {
    @page {
        size: letter;
        margin: 1.5cm 2cm;
    }

    body {
        font-size: 11pt;
        color: #000;
        background: #fff;
        line-height: 1.6;
    }

    /* Ocultar elementos no imprimibles */
    nav,
    footer,
    .buscador-index,
    .theme-btn,
    .modal,
    .links,
    .card-icon,
    .badge,
    .step-list,
    script {
        display: none !important;
    }

    /* Contenido principal sin bordes ni sombras */
    .content, .content.is-wide, .guide-container {
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
    }

    .lesson-header {
        border-bottom: 1px solid #ccc;
    }

    .lesson-header h1 {
        font-size: 18pt;
        margin: 0;
        padding: 0;
    }

    .lesson-header .date,
    .lesson-header .subtitle {
        font-size: 10pt;
    }

    .lesson-body p {
        font-size: 11pt;
        line-height: 1.7;
    }

    .lesson-body h2 { font-size: 15pt; }
    .lesson-body h3 { font-size: 12pt; }

    .lesson-body img {
        max-width: 80% !important;
        margin: 1.5rem auto;
        border: 0.5px solid #ddd;
        box-shadow: none;
    }

    table.wiki-table, .guide-container table, .content table {
        font-size: 9.5pt;
    }

    table.wiki-table th, .guide-container th, .content th {
        background-color: #eee !important;
        color: #000 !important;
    }

    .box, .tip {
        border: 1px solid #ccc;
        background: #f9f9f9;
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .box-title {
        font-size: 10pt;
    }

    code, .shortcut, .key-box {
        border: 0.5px solid #ccc;
        background: #f4f4f4;
        color: #000;
    }

    .guide-img {
        border: 0.5px solid #ddd;
    }

    /* Encabezado de impresión con 3 columnas */
    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 9pt;
        color: #444;
        border-bottom: 1px solid #999;
        padding-bottom: 0.3cm;
        margin-bottom: 1cm;
    }

    .print-header-left {
        text-align: left;
        width: 30%;
    }

    .print-header-center {
        text-align: center;
        width: 40%;
        font-weight: 600;
        font-size: 10pt;
    }

    .print-header-right {
        text-align: right;
        width: 30%;
        font-size: 8.5pt;
    }

    /* Pie de página con número de página */ 
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 8pt;
        color: #888;
        border-top: 1px solid #ccc;
        padding-top: 0.2cm;
    }

    .print-footer::after {
        content: "Página " counter(page);
    }
}
