/* =========================================
   1. VARIABLES Y RESET (Base del sistema)
   ========================================= */
:root {
    /* COLORES BASE: Se sobrescriben desde PHP (header.php) si es necesario */
    --primary: #2c3e50;       /* Color principal (se inyectará el de config.php aquí) */
    --accent: #d35400;        /* Color secundario/acción (Naranja/Dorado) */
    --light-bg: #f4f6f8;      /* Fondos grises suaves */
    --text-main: #333333;     /* Texto principal */
    --text-muted: #666666;    /* Texto secundario */
    --border-color: #dddddd;  /* Bordes suaves */
    --sidebar-width: 260px;   /* Ancho del menú lateral del admin */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--light-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: underline;          /* Activamos el subrayado */
    text-decoration-color: #3c2156;      /* Color del tema (o pon 'currentColor' para sutil) */
    text-decoration-thickness: 1px;      /* Línea fina */
    text-underline-offset: 3px;          /* Separación del texto (la clave de la elegancia) */
    color: inherit;
    transition: all 0.2s ease;
}

a:hover {
    text-decoration-thickness: 2px;      /* Al pasar el ratón, se hace más grueso */
    color: #3c2156;                      /* Opcional: cambia el color del texto */
}

ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; display: block; }

/* Contenedor centralizado */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* =========================================
   2. FRONTEND: CABECERA Y MENÚ
   ========================================= */

/* Parte Superior: Logos (Fondo Blanco) */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logos {
    padding: 15px 0;
    background: white;
}

.logos-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Ajuste visual del logo US */
.logo-us img { height: 55px; }

/* Separador vertical entre logos */
.logo-separator {
    display: inline-block;
    height: 40px;
    width: 1px;
    background: #e0e0e0;
}

/* Título del Máster */
.logo-master {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary); /* Usa el color del máster */
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

/* Parte Inferior: Barra de Navegación (Fondo Color Principal) */
.main-nav-wrap {
    background: var(--primary); /* Barra sólida del color principal */
    color: white;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap; /* Evita que se rompa en pantallas pequeñas */
}

.main-nav > ul > li {
    position: relative;
}

/* Enlaces del menú principal */
.main-nav a {
    display: block;
    padding: 15px 25px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    border-bottom: 4px solid transparent; /* Para el hover */
}

.main-nav a:hover {
    background: rgba(255,255,255, 0.1);
    border-bottom-color: var(--accent); /* Subrayado de color secundario */
}

/* --- SUBMENÚS (Dropdowns) --- */
.main-nav li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 350px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-top: 3px solid var(--accent);
    z-index: 1001;
    flex-direction: column;
}

.main-nav li:hover > ul { display: flex; }

.main-nav li ul a {
    color: #444; /* Texto oscuro en submenú */
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    text-transform: none;
    font-weight: 500;
}

.main-nav li ul a:hover {
    background: #f9f9f9;
    color: var(--primary);
    border-bottom-color: #eee;
}

/* Flechita para indicar submenú */
.has-children > a::after {
    content: ' ▾';
    font-size: 0.8em;
    margin-left: 6px;
    opacity: 0.7;
}

/* Toggle Móvil (Oculto en PC) */
.mobile-toggle { display: none; }


/* =========================================
   3. FRONTEND: CONTENIDO Y GRID
   ========================================= */
.page-content {
    padding: 40px 20px;
    flex: 1; /* Empuja el footer hacia abajo */
    background: white;
}

.content-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
}

.meta-date {
    display: inline-block;
    background: var(--light-bg);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Estilos para el texto de las páginas (CKEditor) */
.content-body { font-size: 1.1rem; color: #444; }
.content-body p { margin-bottom: 1.5em; }
.content-body h2 { color: var(--primary); margin-top: 30px; }

/* Zona de Banners Destacados */
.banner-zone {
    background: #fff;
    border: 2px dashed var(--primary);
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    margin: 40px 0;
}

/* --- GRID DE NOTICIAS (2 Grandes + 4 Pequeñas) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Columnas base */
    gap: 30px;
    margin-top: 30px;
}

.news-card {
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--accent);
}

.news-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-title { margin: 0 0 10px 0; font-size: 1.25rem; line-height: 1.3; }
.card-title a { color: var(--primary); font-weight: 700; }
.card-date { color: #999; font-size: 0.8rem; margin-bottom: 8px; display: block; }
.card-excerpt { font-size: 0.95rem; color: #666; margin-bottom: 15px; flex: 1; }
.read-more { color: var(--primary); font-weight: bold; font-size: 0.9rem; text-transform: uppercase; margin-top: auto;}

/* Modificadores del Grid */
.news-item-full { 
    /* Las noticias destacadas ocupan todo el ancho en móvil, o se quedan grandes */
    grid-column: span 1; 
} 
/* En pantallas grandes, podemos hacer que las primeras destaquen más si queremos, 
   pero la estructura 2 columnas está bien para "2 grandes". 
   Si quieres que sean ENORMES, usa grid-column: 1 / -1; */


/* =========================================
   4. PIE DE PÁGINA (Footer)
   ========================================= */
.site-footer {
    background: var(--primary);
    color: white;
    padding: 50px 0;
    margin-top: auto;
    text-align: center;
    border-top: 5px solid var(--accent);
}

.site-footer p { margin: 5px 0; opacity: 0.9; }
.site-footer a { color: var(--accent); border-bottom: 1px dotted var(--accent); }


/* =========================================
   5. RESPONSIVE (Móvil)
   ========================================= */
@media (max-width: 768px) {
    .logos-wrapper { flex-direction: column; text-align: center; gap: 15px; }
    .logo-separator { display: none; }
    
    .mobile-toggle { 
        display: block; 
        background: none; border: none; 
        color: white; font-size: 1.8rem; 
        position: absolute; right: 20px; top: 15px;
        cursor: pointer;
    }

    .main-nav-wrap { position: relative; }
    .main-nav ul { 
        flex-direction: column; 
        display: none; /* Oculto por defecto */
        width: 100%;
    }
    .main-nav.open ul { display: flex; } /* Clase JS para abrir */
    
    .main-nav a { border-bottom: 1px solid rgba(255,255,255,0.1); padding: 15px; }
    .main-nav li ul { position: static; box-shadow: none; border-top: none; background: rgba(0,0,0,0.1); }
    .main-nav li ul a { color: white; padding-left: 40px; }

    .news-grid { grid-template-columns: 1fr; } /* 1 columna en móvil */
}


/* =========================================================
   6. ADMIN PANEL (Correcciones Específicas para el Backend)
   ========================================================= */

/* Solo aplica si el body tiene clase admin o estructura de admin */
/* Pero como compartes CSS, usaremos selectores específicos del admin */

.sidebar {
    width: var(--sidebar-width);
    background: #1a252f;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 2000;
}

.sidebar a {
    color: #bdc3c7;
    padding: 15px 20px;
    display: block;
    border-left: 4px solid transparent;
}

.sidebar a:hover, .sidebar a.active {
    background: #2c3e50;
    color: white;
    border-left-color: var(--accent);
}

/* Ajuste del contenido principal admin para no chocar con sidebar */
body.admin-body { display: block; } /* Reset flex body if needed */
.admin-main {
    margin-left: var(--sidebar-width);
    padding: 40px;
    background: #f4f6f8;
    min-height: 100vh;
}

/* LISTAS DE GESTIÓN (Arreglo para el error de la imagen 2) */
.admin-list-item {
    background: white;
    border: 1px solid #ddd;
    border-left: 4px solid var(--primary); /* Borde decorativo */
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.admin-list-item:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateX(2px);
    transition: all 0.2s;
}

/* Botones de acción en listas */
.actions-group a {
    margin-left: 10px;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
}
.actions-group a.edit { background: #e1ecf4; color: #39739d; }
.actions-group a.delete { background: #fdeded; color: #c0392b; }

/* Botones Generales Admin */
.btn-primary { 
    background: var(--primary); 
    color: white; 
    padding: 10px 20px; 
    border-radius: 4px; 
    border: none; 
    cursor: pointer; 
    display: inline-block;
    margin-bottom: 20px;
}
.btn-primary:hover { background: #1a252f; }

.btn-danger {
    background: #c0392b;
    color: white;
    text-align: center;
}

/* Tablas Admin */
table.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

table.admin-table th { background: var(--primary); color: white; padding: 15px; text-align: left; }
table.admin-table td { padding: 15px; border-bottom: 1px solid #eee; }
table.admin-table tr:last-child td { border-bottom: none; }

/* =========================================================
   6. ADMIN PANEL - FIX DE ESTRUCTURA
   ========================================================= */

/* Estilos de la barra lateral (Sidebar) */
.sidebar {
    width: 260px; /* Ancho fijo */
    height: 100vh;
    background: #2c3e50; /* Color oscuro */
    position: fixed; /* Fija a la izquierda */
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar a {
    color: #ecf0f1;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.95rem;
}

.sidebar a:hover {
    background: #34495e;
    border-left: 4px solid var(--accent); /* Naranja/Dorado */
}

/* --- CLAVE DEL ARREGLO: EL CONTENEDOR DEL CONTENIDO --- */
.admin-main {
    margin-left: 260px; /* Mismo ancho que la sidebar */
    padding: 40px;
    background-color: #f4f6f8;
    min-height: 100vh;
    width: calc(100% - 260px); /* Ocupar el resto del ancho */
}

/* IMPORTANTE: Si usas .container dentro del admin, hay que ajustarlo */
.admin-main .container {
    max-width: 100%; /* Que ocupe todo el espacio disponible en admin */
    margin: 0;
    padding: 0;
}

/* Arreglo para las listas que se ven raras en tu captura */
.admin-list-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    justify-content: space-between; /* Texto a la izq, botones a la der */
    align-items: center;
}

/* Títulos que se escondían */
.admin-main h1, .admin-main h2 {
    margin-top: 0;
    color: var(--primary);
}

/* =========================================================
   7. ELEMENTOS DEL ADMIN (Dashboard y Docs)
   ========================================================= */

/* --- TARJETAS DE ESTADÍSTICAS (Dashboard) --- */
.dashboard-cards { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.stat-card { 
    background: white; 
    padding: 25px; 
    flex: 1; 
    min-width: 200px;
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    border-top: 4px solid var(--accent); /* Color por defecto */
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 5px; }
.stat-label { color: #7f8c8d; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; font-weight: 600; }

/* --- GESTOR DE DOCUMENTOS (Docs List) --- */
.toolbar { 
    display: flex; gap: 15px; margin-bottom: 25px; align-items: center; 
    background: white; padding: 15px; border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); flex-wrap: wrap; 
}
.search-box { flex: 1; position: relative; }
.search-box input { width: 100%; padding: 10px 10px 10px 40px; border: 1px solid #ddd; border-radius: 50px; outline: none; }
.search-icon { position: absolute; left: 15px; top: 10px; opacity: 0.5; }

.view-toggles button {
    background: #ecf0f1; border: none; padding: 8px 12px; cursor: pointer; border-radius: 4px; font-size: 1.1rem; color: #7f8c8d;
}
.view-toggles button.active { background: var(--primary); color: white; }

/* Vista Grid (Iconos grandes) */
.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.view-grid .file-item { 
    background: white; padding: 20px; border-radius: 8px; border: 1px solid #eee; 
    text-align: center; transition: all 0.2s; position: relative; 
}
.view-grid .file-item:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-color: var(--accent); }
.view-grid .file-icon { font-size: 3rem; margin-bottom: 10px; display: block; }
.view-grid .file-name { font-weight: 600; font-size: 0.9rem; word-break: break-all; margin-bottom: 5px; display: block; color: var(--primary); }
.view-grid .file-meta-group { font-size: 0.75rem; color: #999; margin-bottom: 15px; display: block; }
.view-grid .file-actions { display: flex; justify-content: center; gap: 5px; }

/* Vista Lista (Tabla) */
.view-list { display: flex; flex-direction: column; gap: 5px; }
.view-list .file-item { 
    display: flex; align-items: center; background: white; padding: 10px 20px; 
    border-radius: 4px; border: 1px solid #eee; justify-content: space-between; 
}
.view-list .file-main-info { display: flex; align-items: center; gap: 15px; flex: 1; }
.view-list .file-meta-group { display: flex; gap: 20px; color: #666; font-size: 0.85rem; margin-right: 20px; }

/* Botones pequeños docs */
.btn-mini { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; cursor: pointer; border: 1px solid transparent; }
.btn-copy { background: #e1ecf4; color: #39739d; }
.btn-del { background: #fdeded; color: #c0392b; text-decoration: none; }



/* --- BANNERS SECTION --- */
.banners-grid {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.banner-item {
    flex: 0 0 25%;    /* 25% de ancho */
    max-width: 25%;
    height: 160px;    /* <--- HE REDUCIDO LA ALTURA AQUÍ (Antes 300px) */
    margin-top: 10px;
    position: relative;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    overflow: hidden; /* Importante para que no se salga nada */
    display: flex;
    align-items: flex-end; /* Alinea el contenido abajo */
    border-right: 1px solid rgba(255,255,255,0.5); /* Separador blanco */
    box-sizing: border-box;
}

/* Título visible siempre (Barra inferior) */
.banner-title {
    width: 100%;
    padding: 10px 15px;
    font-size: 1rem;       /* Letra un poco más pequeña para que encaje mejor */
    font-weight: 600;
    color: white;
    z-index: 2;            /* Nivel 2: Sobre la imagen */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: absolute;
  bottom: 0 !important;
    
    /* Pequeño truco: opacidad ligera para que se integre mejor con la foto */
    opacity: 0.95; 
}

/* Capa oculta que aparece al hover */
.banner-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;            /* Invisible por defecto */
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    text-align: center;
    color: white;
    z-index: 3;            /* Nivel 3: Tapa al título y a la imagen */
}

/* Títulos y textos dentro del Hover */
.banner-overlay h3 { 
    margin: 0 0 10px 0; 
    font-size: 1.2rem; 
    border-bottom: 2px solid rgba(255,255,255,0.3); 
    padding-bottom: 5px; 
}
.banner-desc { 
    font-size: 0.9rem; 
    line-height: 1.3; 
}

/* Efecto Hover */
.banner-item:hover .banner-overlay { opacity: 0.98; } /* Casi sólido al pasar el ratón */
.banner-item:hover .banner-title { opacity: 0; }      /* Ocultamos la barra original para que no moleste */

/* RESPONSIVE */
@media (max-width: 992px) {
    .banner-item { flex: 0 0 50%; max-width: 50%; height: 160px; }
}
@media (max-width: 576px) {
    .banner-item { flex: 0 0 100%; max-width: 100%; height: 140px; }
}

/* --- HERO SLIDER --- */
.hero-slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: #333;
    /* Para que el usuario pueda seleccionar texto si quiere, pero no arrastrar imágenes */
    user-select: none; 
}

.slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

/* CAJA DE TEXTO */
.slide-content {
    position: absolute;
    bottom: 50px;
    left: 50px;
    max-width: 600px;
    padding: 30px;
    color: #fff;
    z-index: 3;
    border-radius: 4px;
}
.slide-content h2 { margin-top: 0; font-size: 2rem; margin-bottom: 10px; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }
.slide-content p { font-size: 1.1rem; margin-bottom: 20px; }

/* --- CONTROLES DEL SLIDER (NUEVO) --- */

/* Flechas navegación */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    border-radius: 4px;
}
.slider-btn:hover { background: rgba(0,0,0,0.8); }
.slider-btn.prev { left: 20px; }
.slider-btn.next { right: 20px; }

/* Puntos indicadores (Abajo a la derecha) */
.slider-dots {
    position: absolute;
    bottom: 30px;
    right: 50px; /* Aquí los colocamos a la derecha */
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.dot.active {
    background: white;
    transform: scale(1.2);
    border-color: rgba(0,0,0,0.1);
}

.dot:hover {
    background: rgba(255,255,255,0.8);
}

/* Responsive Ajustes */
@media (max-width: 768px) {
    .hero-slider { height: 350px; }
    .slide-content { left: 0; bottom: 0; width: 100%; max-width: 100%; border-radius: 0; padding: 20px 20px 60px 20px; } 
    /* Damos padding bottom extra para que el texto no se monte sobre los puntos */
    .slider-dots { bottom: 20px; right: 50%; transform: translateX(50%); } /* En móvil mejor centrados */
    .slider-btn { display: none; } /* Opcional: ocultar flechas en móvil para ver mejor la foto */
}

/* =========================================
   NAVEGACIÓN PRINCIPAL (FIX DEFINITIVO)
   ========================================= */

/* --- 1. CONTENEDOR HEADER --- */
.main-nav-wrap {
    background: var(--primary);
    position: relative;
    z-index: 1000;
}

/* --- 2. BOTÓN MÓVIL (SOLUCIÓN VISIBILIDAD) --- */
.mobile-toggle {
    display: none; /* Oculto en PC */
    
    /* CAJA SÓLIDA */
    background-color: var(--primary); 
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    
    /* POSICIÓN FLOTANTE SEGURA */
    position: absolute; 
    right: 20px;
    top: 15px; /* Ajusta esto si tu header es muy alto o bajo */
    z-index: 9999; /* Por encima de todo, incluido el slider */
    box-shadow: 0 2px 10px rgba(0,0,0,0.5); /* Sombra fuerte para destacar */
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px 0;
}

/* --- 3. NIVEL 1 (PRINCIPAL) --- */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Horizontal */
}

.main-nav > ul > li {
    position: relative;
}

.main-nav a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: background 0.3s;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.1);
}

/* --- 4. NIVEL 2 (DESPLEGABLE) --- */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 250px; /* Ancho suficiente */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-top: 3px solid var(--accent);
    z-index: 1100;
}

//* =========================================
   CORRECCIÓN ESPECÍFICA NIVEL 3 (DESKTOP)
   ========================================= */

/* 1. EL PADRE (Item del Submenú Nivel 2) */
/* Es CRUCIAL que este LI tenga position relative para que el hijo se pegue a él */
ul.submenu > li {
    position: relative !important; 
    display: block;
}

/* 2. EL HIJO (El menú desplegable Nivel 3) */
ul.submenu-level-2 {
    /* Posicionamiento */
    position: absolute !important;
    bottom: 0 !important;       /* Al mismo nivel vertical que su padre */
    left: 100% !important;   /* Empieza justo donde termina el ancho del padre */
    
    /* Estética */
    width: 220px;            /* Ancho fijo para evitar deformaciones */
    background: #fff;
    border-left: 4px solid var(--primary); /* Borde visual a la izquierda */
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    z-index: 1500;
    margin-top: -50px;
    
    /* Estado inicial */
    display: none;
    margin-left: 0; /* Evitar márgenes extraños */
}

/* 3. LA INTERACCIÓN */
/* Al pasar el ratón por el LI padre, mostramos el UL hijo */
ul.submenu > li:hover > ul.submenu-level-2 {
    display: block !important;
}

/* Ajuste visual para los enlaces del nivel 3 */
ul.submenu-level-2 a {
    font-size: 0.9rem;
    color: #555;
    padding-left: 15px; /* Un poco menos de padding que el nivel anterior */
    background-color: #fff;
}
/* Mostrar Nivel 3 */
.has-submenu-level-2:hover > .submenu-level-2 { 
    display: block; 
}

/* Flechitas indicadoras (CSS puro) */
.has-submenu > a::after { content: ' ▾'; float: right; font-size: 0.8em;}
.has-submenu-level-2 > a::after { content: ' ›'; float: right; font-weight: bold; font-size: 1.2em; line-height: 1; }


/* --- 6. VERSIÓN MÓVIL (RESPONSIVE) --- */
@media (max-width: 768px) {
    .mobile-toggle { display: block; } /* Mostrar botón */

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    .main-nav.active { display: block; }

    /* Todo vertical */
    .main-nav ul { flex-direction: column; }
    
    /* Enlaces principales en oscuro */
    .main-nav a { color: var(--primary); border-bottom: 1px solid #eee; }
    .main-nav a:hover { background: #f0f0f0; }

    /* Resetear submenús para que no floten */
    .submenu, .submenu-level-2 {
        position: static; /* Ya no es absolute */
        display: none;    /* Oculto */
        width: 100%;
        box-shadow: none;
        border: none;
        background: #f9f9f9;
    }

    /* Indentación (Sangría) */
    .submenu a { padding-left: 40px; color: #666; font-size: 0.9rem; }
    .submenu-level-2 a { 
        padding-left: 60px; 
        background: #f0f0f0; 
        border-left: 4px solid var(--primary);
    }

    /* Mostrar al hacer hover/tap */
    .has-submenu:hover > .submenu, 
    .has-submenu-level-2:hover > .submenu-level-2 {
        display: block;
    }
    
    /* Quitar flechas laterales en móvil */
    .has-submenu-level-2 > a::after { content: ' ▾'; }
}

/* =========================================
   ESTILOS SECCIÓN INTRO (HOME)
   ========================================= */

.intro-section {
    background-color: #fff;
    padding: 50px 0;         /* Más espacio arriba y abajo */
    border-bottom: 1px solid #eee; /* Separador sutil con las noticias */
}

/* Contenedor estrecho para lectura */
.intro-readable-container {
    max-width: 860px;        /* Ancho máximo ideal para lectura */
    margin: 0 auto;          /* Centrado horizontalmente */
    padding: 0 20px;         /* Margen lateral en móviles */
}

/* Título de la sección */
.intro-title {
    text-align: center;      /* Centrado */
    color: var(--primary);   /* Morado corporativo */
    font-size: 2rem;         /* Grande y claro */
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

/* Pequeña línea decorativa debajo del título */
.intro-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent); /* Naranja/Dorado */
    margin: 15px auto 0;       /* Centrado debajo del texto */
    border-radius: 2px;
}

/* Ajustes del texto */
.intro-readable-container .content-body {
    font-size: 1.15rem;      /* Un pelín más grande que el estándar */
    color: #444;             /* Gris oscuro para buen contraste */
    line-height: 1.8;        /* Más aire entre líneas */
}

/* Primer párrafo destacado (Opcional pero muy pro) */
.intro-readable-container .content-body p:first-child {
    font-size: 1.25rem;
    color: #222;
    font-weight: 400;
}
 
/* --- ARREGLO DE LISTAS (BULLETS) --- */

/* 1. Apuntamos a la clase que REALMENTE tienes en tu HTML */
.user-generated-content ul {
    list-style-type: disc !important; /* Pone el punto sólido */
    padding-left: 40px !important;    /* Empuja la lista a la derecha (INDENTACIÓN) */
    margin-top: 15px;
    margin-bottom: 15px;
}

/* 2. Estilo para listas dentro de listas (anidadas) */
.user-generated-content ul ul {
    list-style-type: circle !important; /* Círculo hueco para el segundo nivel */
    margin-top: 5px;
    margin-bottom: 5px;
}

/* 3. Asegurar que los elementos se comporten como items de lista */
.user-generated-content li {
    display: list-item !important;
    margin-bottom: 8px; /* Un poco de aire entre cada línea */
}

/* 4. (Opcional) Si quieres que los enlaces de la lista se vean mejor */
.user-generated-content li a {
    text-decoration: underline;
    color: var(--primary, #541548); /* Usa tu color corporativo */
}

/* --- ESTILOS DE TABLAS CORPORATIVAS --- */

/* Títulos de las secciones */
.section-title {
    color: var(--primary);     /* Color morado corporativo */
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-transform: uppercase;
}

/* Contenedor para móviles (Scroll horizontal si la tabla es muy ancha) */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 30px;
    border: 1px solid #eee;
    border-radius: 8px; /* Bordes redondeados */
}

/* La Tabla en sí */
.corporate-table {
    width: 100%;
    border-collapse: collapse; /* Quita los espacios dobles entre bordes */
    font-family: sans-serif;
    font-size: 0.95rem;
}

/* Cabecera (Aquí usamos el color corporativo) */
.corporate-table thead {
    background-color: var(--primary); /* ¡AQUÍ ESTÁ TU COLOR! */
    color: white;
}

.corporate-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Celdas del cuerpo */
.corporate-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    vertical-align: top; /* Texto alineado arriba siempre */
    color: #333;
    line-height: 1.5;
}

/* Efecto Cebra (Filas pares de otro color) */
.corporate-table tbody tr:nth-of-type(even) {
    background-color: #f9f9f9;
}

/* Efecto Hover (Al pasar el ratón) */
.corporate-table tbody tr:hover {
    background-color: rgba(84, 21, 72, 0.05); /* Tu color muy clarito */
}

/* Negritas dentro de la tabla (Nombres principales) */
.corporate-table strong {
    color: var(--primary);
}

/* =========================================
   COMPONENTES: BOTONES
   ========================================= */

/* Estilo base para todos los botones */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0; /* Mantenemos el estilo recto/sharp */
    text-align: center;
}

/* --- Opción A: Botón Sólido (Principal) --- */
.btn-primary {
    background-color: var(--primary); /* Usa el color configurado */
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: #222222; /* Se vuelve oscuro al pasar el ratón */
    border-color: #222222;
    color: #ffffff;
}

/* --- Opción B: Botón Bordeado (Secundario) --- */
.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 22px; /* Ajuste óptico por el borde más grueso */
}

.btn-outline:hover {
    background-color: var(--primary);
    color: #ffffff;
}

/* --- Opción C: Enlace simple con flecha --- */
.btn-link {
    padding: 0;
    color: var(--primary);
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-link:hover {
    color: #000; /* O var(--accent) si prefieres */
    text-decoration: underline;
}

.btn-link .arrow {
    transition: transform 0.3s ease;
}

.btn-link:hover .arrow {
    transform: translateX(5px);
}

/* =========================================
   TABLA ESTILO MÁSTER (Igual a la imagen)
   ========================================= */

.table-responsive-custom {
    overflow-x: auto;
    margin-bottom: 2rem;
    background: #fff;
    /* Sombra suave opcional para darle profundidad */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px; /* Bordes redondeados en el contenedor */
}

.master-table {
    width: 100%;
    border-collapse: separate; /* Necesario para el border-radius en thead */
    border-spacing: 0;
    font-size: 0.95rem;
    min-width: 700px;
}

/* --- CABECERA (Estilo imagen) --- */
.master-table thead tr {
    background-color: var(--primary); /* El color morado oscuro */
    color: #ffffff;
    text-align: left;
}

.master-table th {
    padding: 15px 20px;
    font-weight: 700;
    text-transform: capitalize; /* O 'uppercase' si prefieres todo mayúsculas */
    font-size: 1rem;
    letter-spacing: 0.5px;
    border: none;
}

/* Redondear esquinas superiores de la cabecera */
.master-table th:first-child {
    border-top-left-radius: 8px;
}
.master-table th:last-child {
    border-top-right-radius: 8px;
}

/* --- CUERPO --- */
.master-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0; /* Línea separadora gris suave */
    vertical-align: top;
    line-height: 1.6;
    color: #444;
}

/* Quitar borde de la última fila para que quede limpio */
.master-table tbody tr:last-child td {
    border-bottom: none;
}

/* Efecto Hover en las filas */
.master-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* --- ESTILOS ESPECÍFICOS --- */

/* Asignatura */
.subject-title {
    font-weight: 500;
    color: #333;
}

/* Enlace de Email */
.email-link {
    color: var(--primary); /* Usa el color del tema */
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted var(--primary);
    transition: all 0.2s;
}

.email-link:hover {
    background-color: var(--primary);
    color: white;
    border-bottom: none;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Nombre del Coordinador (Negrita y subrayado como en la foto) */
.prof-coord {
    font-weight: 700;
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 2px; /* Subrayado un poco más grueso */
    text-underline-offset: 3px;     /* Separado del texto */
}

.btn-master {
    display: inline-block;
    background-color: #be0f2e;
    color: #fff;
    padding: 12px 35px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border-radius: 4px;
}