   /* RESET Y ESTILOS GENERALES */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

body {
    background-color: #f4f6f9;  /* Tono gris muy suave */
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: 80px; /* espacio para el header fijo */
}

/* 1. Estilo base (Móvil primero): Las columnas ocupan todo el ancho */
.contenedor-pagina {
  display: flex;
  flex-direction: column; /* Por defecto, una debajo de otra */
  gap: 20px;
}

/* 2. Pantallas grandes: Cuando la pantalla mide más de 768px */
@media (min-width: 768px) {
  .contenedor-pagina {
    flex-direction: row; /* Se ponen una al lado de la otra */
  }

  .columna-principal {
    flex: 3; /* Ocupa el 75% del espacio aprox. */
  }

  .columna-lateral {
    flex: 1; /* Ocupa el 25% restante */
  }
}
/* ============================================
   TARJETAS (CARDS) - Versión final
   ============================================ */

/* Estructura base de tarjeta (para contenido principal) */
.card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    width: 100%; /* Ocupa todo el ancho de su contenedor */
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: #e0e0e0;
}

.card-content {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #222;
    line-height: 1.3;
}

.card-title a {
    text-decoration: none;
    color: inherit;
}

.card-title a:hover {
    color: #0077ff;
}

.card-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    flex: 1;
}

.card-meta {
    font-size: 0.85rem;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    margin-top: auto;
}

/* Mini tarjetas para la franja lateral */
.card-mini {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    width: 100%; /* Ocupa todo el ancho de la sidebar */
}

.card-mini-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.card-mini-content {
    flex: 1;
    min-width: 0; /* Evita desbordes del texto */
}

.card-mini-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.card-mini-title a {
    text-decoration: none;
    color: #333;
}

.card-mini-text {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contenedor para listas verticales (tanto principal ☰como lateral) */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* (Opcional) Si en algún lugar necesitas cuadrícula */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* Ajustes responsive */
@media (max-width: 768px) {
    .cards-list {
        gap: 1rem;
    }
    /* Las mini tarjetas ya tienen width:100%, no hace falta cambiarlas */
}
        /* HEADER FIJO */
        .header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background-color: #ffffff;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            z-index: 1000;
        }

        /* CONTENEDOR DEL MENÚ */
        .navbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0.5rem 1rem;
        }

        /* LOGO (imagen) */
        .nav-logo {
            display: flex;
            align-items: center;
            text-decoration: none;
            color: #333;
            font-weight: 700;
            font-size: 1.5rem;
        }
        .nav-logo img {
            height: 40px; /* ajusta según tu imagen */
            width: auto;
            margin-right: 10px;
        }
        .nav-logo span {
            display: inline-block;
        }

        /* BOTÓN HAMBURGUESA */
        .hamburger {
            display: block !important;
        background: none;
        border: none;
        font-size: 2rem; /* Tamaño grande para que sea fácil de pulsar */
        cursor: pointer;
        color: #333;
        padding: 0.5rem;
        line-height: 1;
        z-index: 1002; /* Por encima de todo */
        }

/* ==========================================
/* RESET GENERAL DE LISTAS */
#nav-menu, #nav-menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-indent: 0 !important;
}

/* ESTRUCTURA DE LOS ITEMS */
.nav-item {
    position: relative;
    display: block;
}

/* Contenedor flexible para alinear texto y flecha */
.menu-item-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-link {
    flex-grow: 1;
    color: #333;
    text-decoration: none !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    display: block;
}

/* BOTÓN FLECHA (Toggle) */
.dropdown-toggle {
    display: none; /* Se activa en móvil */
    background: none;
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: #666;
}

.dropdown-toggle::before {
    content: "▼";
}

/* --- ESCRITORIO --- */
@media (min-width: 769px) {
    .hamburger { display: none !important; }
    .nav-menu { display: flex; gap: 1rem; }

    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        min-width: 200px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-radius: 6px;
        z-index: 1000;
    }

    /* Nivel 3 a la derecha */
    .dropdown-menu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-left: 2px;
    }

    .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
    }
}

/* --- MÓVIL --- */
@media (max-width: 768px) {
    .hamburger {
        display: block !important;
        font-size: 2rem;
        background: none;
        border: none;
        cursor: pointer;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .nav-menu.active { display: block; }

    /* Forzamos que la flecha se vea en móvil si es un dropdown */
    .dropdown > .menu-item-container > .dropdown-toggle {
        display: block !important;
    }

    /* SUBMENÚS: Alineación y márgenes */
    .dropdown-menu {
        display: none;
        background-color: #f9f9f9;
    }

    .dropdown-menu.show { display: block; }

    /* INDENTACIÓN IGUAL PARA TODOS (Aumenta según nivel) */
    .dropdown-menu .nav-link { padding-left: 2.5rem !important; }
    .dropdown-menu .dropdown-menu .nav-link { padding-left: 4rem !important; }
}
/************************************ /         
   /* paginación */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
    list-style: none; /* por si acaso */
    padding: 0;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border-radius: 4px;
    background-color: white;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #e0e0e0; /* opcional, para dar más relieve */
}

.pagination .on {
    background-color: #0077ff;
    color: white;
    border-color: #0077ff;
}   
.pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pagination li {
    display: flex;
}     

/* breadcrumb */
.breadcrumb {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.5rem 0;
    margin-bottom: 2rem;
}
.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}
.breadcrumb a {
    color: #0077ff;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb .sep {
    color: #999;
    margin: 0 0.25rem;
}
.breadcrumb .current {
    color: #6c757d;
    font-weight: 500;
}
.article-mots {
    margin: 0.5rem 0 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.mot-link {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.mot-link:hover {
    background: #dee2e6;
    color: #212529;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.mat-breadcrumb {
    margin-bottom: 1.5rem;
}

/* Fila de dos columnas: contenido + aside */
.mat-fila {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .mat-fila {
        flex-direction: row;
        align-items: flex-start;
    }
    .mat-content {
        flex: 3;
        min-width: 0;
    }
    .mat-aside {
        flex: 1;
        min-width: 220px;
        max-width: 280px;
    }
}

/* ============================================
   ASIDE / SIDEBAR
   ============================================ */
.aside-nav {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.aside-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 0.75rem 0;
}

.aside-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aside-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.aside-nav li:last-child {
    border-bottom: none;
}

.aside-nav a {
    display: block;
    padding: 0.5rem 0.25rem;
    color: #444;
    text-decoration: none;
    font-size: 0.9rem;
}

.aside-nav a:hover {
    color: #0077ff;
}

.aside-nav li.active > a {
    color: #0077ff;
    font-weight: 600;
}

.aside-nav ul ul {
    padding-left: 1rem;
}

/* ============================================
   RESUELTOS
   ============================================ */

.resueltos-enunciado {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border-left: 4px solid #0077ff;
}

.resueltos-enunciado-texto {
    margin-bottom: 0.75rem;
}

.resueltos-enunciado-link {
    margin: 0;
}

.btn-solucion {
    display: inline-block;
    background: #0077ff;
    color: #fff !important;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-solucion:hover {
    background: #0056b3;
}
.resueltos-tema {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

.resueltos-tema a {
    color: #333;
    text-decoration: none;
}

.resueltos-tema a:hover {
    color: #0077ff;
}

.resueltos-count {
    color: #0077ff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

#spip-admin {
    top: auto !important;
    bottom: 0 !important;
    position: fixed !important;
    z-index: 10000 !important;
}

/* ============================================
   COMENTARIOS / FORO
   ============================================ */
.num-comentarios {
    margin: 0.25rem 0 1rem 0;
    font-size: 0.9rem;
}
.num-comentarios a {
    color: #666;
    text-decoration: none;
}
.num-comentarios a:hover {
    color: #0077ff;
}

.repondre {
    margin: 1rem 0 0.5rem 0;
}
.repondre a {
    color: #0077ff;
    font-weight: 500;
    text-decoration: none;
}
.repondre a:hover {
    text-decoration: underline;
}

/* ============================================
   PÁGINA DE PALABRA CLAVE (mot)
   ============================================ */
.mot-menu {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
.mot-menu-item {
    border-bottom: 1px solid #f0f0f0;
}
.mot-menu-item:last-child {
    border-bottom: none;
}
.mot-menu-item a {
    display: block;
    padding: 0.75rem 0.5rem;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.15s;
}
.mot-menu-item a:hover {
    color: #0077ff;
}

/* ============================================
   ÁRBOL DE SUB-RUBRIQUES (rubrique-66)
   ============================================ */
.rubriques-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
.rubrique-item {
    margin-bottom: 0.5rem;
}
.rubrique-item > a {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}
.rubrique-item > a:hover {
    color: #0077ff;
    border-bottom-color: #0077ff;
}
.rubriques-sublist {
    list-style: none;
    margin: 0.35rem 0 0.75rem 1rem;
    padding-left: 1rem;
    border-left: 3px solid #e8e8e8;
}
.rubriques-sublist .rubrique-item {
    margin-bottom: 0.25rem;
}
.rubriques-sublist .rubrique-item > a {
    font-size: 0.95rem;
    font-weight: 400;
    color: #444;
    border-bottom: none;
    padding: 0.2rem 0;
}
.rubriques-sublist .rubrique-item > a:hover {
    color: #0077ff;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.formulaire_spip fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.formulaire_spip legend {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    padding: 0 0.5rem;
}
.formulaire_spip .editer {
    margin-bottom: 1rem;
}
.formulaire_spip label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.35rem;
}
.formulaire_spip input.text,
.formulaire_spip input[type="text"],
.formulaire_spip input[type="email"],
.formulaire_spip textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.85rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.15s;
}
.formulaire_spip input.text:focus,
.formulaire_spip input[type="text"]:focus,
.formulaire_spip input[type="email"]:focus,
.formulaire_spip textarea:focus {
    outline: none;
    border-color: #0077ff;
    box-shadow: 0 0 0 3px rgba(0,119,255,0.12);
}
.formulaire_spip textarea {
    resize: vertical;
    min-height: 140px;
}
.formulaire_spip .erreur {
    border-color: #e53935 !important;
}
.formulaire_spip .erreur_message {
    display: block;
    color: #e53935;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}
.formulaire_spip .reponse_formulaire_ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.formulaire_spip .reponse_formulaire_erreur {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.formulaire_spip .boutons {
    margin: 1rem 0 0 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.formulaire_spip .boutons input[type="submit"],
.formulaire_spip .boutons .btn {
    background: #0077ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.formulaire_spip .boutons input[type="submit"]:hover,
.formulaire_spip .boutons .btn:hover {
    background: #0056b3;
}
.formulaire_spip .explication {
    font-size: 0.85rem;
    color: #777;
    margin: 0.2rem 0 0.5rem 0;
}
.mat-form {
    max-width: 680px;
}

/* ============================================
   TABLA GENÉRICA
   ============================================ */
.mat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1rem 0;
}
.mat-table th,
.mat-table td {
    border: 1px solid #e0e0e0;
    padding: 0.55rem 0.75rem;
    text-align: left;
    vertical-align: top;
}
.mat-table thead th {
    background: #f0f5ff;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}
.mat-table tbody tr:nth-child(even) {
    background: #fafafa;
}
.mat-table tbody tr:hover {
    background: #f0f5ff;
}

/* ============================================
   LISTA DE EJERCICIOS (liste/articles-ejercicios)
   ============================================ */
.lista-ejercicios {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
.ejercicio-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.9rem;
}
.ejercicio-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.ejercicio-ver-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #0077ff;
    text-decoration: none;
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.ejercicio-ver-btn:hover {
    background: #005ecc;
    color: #fff;
}
.ejercicio-seleccionar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #666;
}
.ejercicio-seleccionar input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.ejercicio-seleccionar label {
    cursor: pointer;
}
@keyframes check-bounce {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.animar-check {
    animation: check-bounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#toast-cesta {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #27ae60;
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    z-index: 9999;
    font-weight: bold;
}

/* ============================================
   CESTA LATERAL (inc-seleccion-lateral)
   ============================================ */
.caja-lateral {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.caja-lateral h4 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #f1f4f9;
    padding-bottom: 8px;
    font-size: 1.1rem;
}
.caja-lateral .contador {
    background: #823d76;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    float: right;
}
.caja-lateral .lista-ids {
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    word-wrap: break-word;
}
.caja-lateral .boton-ver {
    display: block;
    background: #2ecc71;
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}
.caja-lateral .boton-ver:hover {
    background: #27ae60;
}

/* ============================================
   ASIDE MOT — cabecera con contadores
   ============================================ */
.mot-aside-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.mot-aside-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #222;
}
.mot-aside-titulo a {
    color: #222;
    text-decoration: none;
}
.mot-aside-titulo a:hover {
    color: #0077ff;
}
.mot-aside-contadores {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mot-contador {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    background: #f4f7ff;
    border: 1px solid #dce6ff;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.mot-contador:hover {
    background: #e0eaff;
    border-color: #0077ff;
}
.mot-contador-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0077ff;
    line-height: 1;
}
.mot-contador-label {
    font-size: 0.95rem;
    color: #555;
}
.video-responsive {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0; /* Quita el borde por defecto */
}
