/*
Theme Name: Tema Secretaría General USACH
Author: Branco García
Description: Tema a medida basado en HTML estático
Version: 1.3
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Variables de colores extraídas de Figma */
    --color-primary: #00A499;
    --color-gradient-start: #00A499;
    --color-gradient-mid: #29BFB5;
    --color-gradient-end: #16E3D5;
    --color-text-dark: #394049;
    --color-text-gray: #61666D;
    --color-orange: #EA7600;
    --color-bg-light: #D9D9D9;
    --font-main: 'Nunito Sans', sans-serif;
}

/* IMPORTANTE: Definir tamaño base para que REM funcione con el Zoom de Accesibilidad */
html {
    font-size: 100%; 
}

body {
    font-family: var(--font-main);
    background-color: #FFFFFF;
    overflow-x: hidden; /* Evita scroll horizontal indeseado */
    font-size: 1rem; /* Base 16px */
}

/* --- HEADER --- */
.site-header {
    padding: 10px 5%;
    margin-bottom: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.btn-recursos {
    background: none;
    border: none;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-primary);
    cursor: pointer;
}

/* Dropdown básico */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100; /* Aumentado para asegurar visibilidad */
}

.dropdown-container:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--color-text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content li {
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eee;
}

.dropdown-content li:last-child {
    border-bottom: none;
}

.dropdown-content li a {
    display: block; 
}

.header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.main-nav li {
    display: flex;
    align-items: center;
}

.main-nav li:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 20px;
    background-color: #C4C4C4;
    margin-left: 15px;
}

.main-nav a {
    text-decoration: none;
    color: var(--color-text-dark);
    font-weight: 700;
    font-size: 1.125rem;
}

/* --- HERO SECTION --- */
.hero-section { width: 100%; }
.hero-image { width: 100%; height: auto; display: block; }

/* --- QUICK LINKS (CORRECCIÓN CHOQUE DE BOTONES) --- */
.quick-links-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px 5% 40px 5%; 
    text-align: center;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* CAMBIO: Flexibilidad para soportar texto grande */
    flex: 0 1 200px; /* Base 200px, puede encogerse pero no crecer infinitamente */
    min-width: 160px; /* Ancho mínimo para que no se aplaste */
    
    position: relative;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-bottom: 20px;
}

.quick-link-item:hover {
    transform: translateY(-5px);
}

.quick-link-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -15px;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: #C4C4C4;
}

/* En tablets o móviles quitamos la línea separadora para evitar líos */
@media (max-width: 900px) {
    .quick-link-item:not(:last-child)::after { display: none; }
}

.icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bg-icon {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    opacity: 0.1;
    border-radius: 50%;
    z-index: -1;
}

.quick-link-item h3 {
    color: var(--color-text-gray);
    font-size: 1.125rem;
    font-weight: 700;
    width: 100%;
    
    /* SOLUCIÓN AL CHOQUE DE TEXTO: */
    overflow-wrap: break-word;
    word-wrap: break-word; 
    hyphens: auto;
    line-height: 1.3;
}

/* --- TÍTULOS VERDES --- */
.section-title-bar {
    width: 100%;
    background: linear-gradient(90deg, var(--color-gradient-start) 0%, var(--color-gradient-mid) 73%, var(--color-gradient-end) 100%);
    padding: 15px 5%;
    margin: 40px 0;
}

.section-title-bar h2 {
    color: #FFFFFF;
    font-size: 1.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- NOTICIAS GRID --- */
.news-section { padding-bottom: 50px; }
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 40px;
    padding: 0 5%;
    max-width: 1600px;
    margin: 0 auto;
}

.news-card { display: flex; flex-direction: column; gap: 15px; }

.news-image-placeholder {
    width: 100%;
    height: 250px;
    background-color: var(--color-bg-light);
    overflow: hidden;
}

.news-title {
    color: var(--color-primary);
    font-size: 1.125rem;
    font-weight: 900;
    line-height: 1.4;
    text-transform: uppercase;
}

.news-summary {
    color: var(--color-text-gray);
    font-size: 1rem;
    line-height: 1.5;
}

.btn-read-more {
    display: inline-block;
    color: var(--color-orange);
    border: 1px solid var(--color-orange);
    padding: 10px 20px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    align-self: flex-start;
    transition: all 0.3s ease;
}

.btn-read-more:hover {
    background-color: var(--color-orange);
    color: white;
}

/* --- VIDEOS GRID --- */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    padding: 0 5%;
    margin-bottom: 50px;
}

.video-item {
    position: relative; 
    background-color: transparent; 
    border-radius: 12px; 
    overflow: hidden;
    transition: transform 0.3s ease; 
    width: 100%; 
    max-width: 600px; 
    margin: 0 auto;
}
.video-item:hover { transform: translateY(-5px); }
.video-item a { text-decoration: none; display: block; }

.video-title {
    font-family: 'Nunito Sans', sans-serif; 
    font-size: 1.125rem; 
    font-weight: 800;
    color: var(--color-text-dark); 
    margin: 0 0 15px 0; 
    text-align: left; 
    line-height: 1.3;
    /* Ajuste para que el título no rompa el layout si es muy largo */
    white-space: normal; 
    overflow: hidden; 
    padding: 0 5px;
}

.video-item:hover .video-title { color: var(--color-primary); }

.video-thumbnail-wrapper {
    position: relative; 
    width: 100%; 
    padding-bottom: 56.25%; 
    background-color: #000;
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    overflow: hidden;
}
.video-thumb { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.95; transition: opacity 0.3s, transform 0.3s; }
.video-item:hover .video-thumb { opacity: 1; transform: scale(1.05); }

.play-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0, 164, 153, 0.9); color: white; width: 60px; height: 60px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; padding-left: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease; z-index: 2;
}
.video-item:hover .play-icon { background: #EA7600; transform: translate(-50%, -50%) scale(1.1); }

@media (max-width: 768px) {
    .videos-grid { grid-template-columns: 1fr; }
    .video-title { font-size: 1rem; }
}

/* --- FOOTER --- */
.site-footer {
    background-color: var(--color-text-dark);
    color: white;
    padding: 50px 5%;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.footer-info { text-align: center; flex: 1; min-width: 300px; }
.footer-info h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 10px; }
.footer-info p { font-size: 0.9375rem; line-height: 1.6; }

@media (max-width: 900px) {
    .footer-container { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   PÁGINA QUIENES SOMOS (CORRECCIONES DE LAYOUT PARA ACCESIBILIDAD)
   ========================================================================== */
.qs-layout {
    display: grid;
    /* CAMBIO CLAVE 1: Sidebar con ancho flexible y mínimo seguro */
    /* Antes: 250px 1fr. Ahora: minmax(250px, 30%) 1fr */
    grid-template-columns: minmax(250px, 25%) 1fr; 
    gap: 40px;
    max-width: 1400px;
    margin: 40px auto 20px auto; 
    padding: 0 20px;
    min-height: 600px;
    align-items: start; /* Alineación superior para evitar estiramientos raros */
}

/* Sidebar */
.qs-sidebar { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    z-index: 10; /* Asegurar que no quede debajo de la tarjeta gris */
    position: relative;
}

/* Botones Sidebar (Menú Principal) */
.qs-btn {
    background-color: transparent;
    border: none;
    text-align: left;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #394049;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    
    /* CAMBIO CLAVE 2: Permitir texto multilínea */
    white-space: normal !important;
    word-break: break-word;
    height: auto !important; 
    padding: 15px 20px;
    line-height: 1.4;
}

.qs-btn:hover { background-color: #e0e0e0; color: #00A499; }
.qs-btn.active { color: #00A499; background-color: #f0fcfb; font-weight: 800; }

/* Submenús */
.submenu-container { display: none; flex-direction: column; margin-bottom: 5px; background-color: #fff; }

/* Botones Submenú */
.sub-btn-sidebar {
    background: transparent; border: none; text-align: left;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.125rem; font-weight: 400; color: #394049;
    cursor: pointer; transition: all 0.2s ease; border-left: 3px solid transparent;
    
    /* CAMBIO CLAVE 3: Permitir texto multilínea en submenús */
    white-space: normal !important;
    word-break: break-word;
    height: auto !important;
    padding: 12px 20px 12px 35px;
    line-height: 1.4;
}

.sub-btn-sidebar.nivel-3 { padding-left: 55px; font-size: 1.125rem; }
.sub-btn-sidebar.nivel-4 { padding-left: 75px; font-size: 0.9375rem; color: #999; }
.sub-btn-sidebar:hover { color: #EA7600; background-color: #f9f9f9; }
.sub-btn-sidebar.active {
    color: #EA7600; font-weight: 700; border-left: 3px solid #EA7600; background-color: #fff8f0;
}

/* Área de Contenido (Tarjeta Gris) */
.qs-content-area {
    min-width: 0; /* Truco de CSS Grid para evitar desbordes con contenido ancho */
    z-index: 5;
}

.qs-card {
    position: relative;
    background: #F4F4F4;
    box-shadow: 0px 9.75px 9.75px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 60px 40px;
    min-height: 600px;
    height: auto !important; /* Permitir crecer si el texto crece */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Icono cerrar */
.close-icon { position: absolute; top: 20px; right: 20px; cursor: pointer; width: 20px; height: 20px; }
.close-icon img { width: 100%; height: auto; }

/* Contenidos Tab */
.tab-content { display: none; animation: fadeIn 0.5s; }
.active-content { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.qs-title {
    font-size: 1.6875rem; font-weight: 800; color: #00A499; margin-bottom: 25px; text-transform: uppercase;
}
.qs-subtitle { font-size: 1.125rem; font-weight: 800; margin-bottom: 10px; }
.qs-text-block { font-size: 1.125rem; line-height: 1.6; color: #394049; font-weight: 500; margin-bottom: 20px; text-align: justify; }
.qs-text-block p { margin-bottom: 20px; line-height: 1.8; }
.qs-text-block p:last-child { margin-bottom: 0; }
.text-teal { color: #00A499; }

/* --- EQUIPO Y ESTRUCTURA (CORRECCIÓN CHOQUE CORREOS) --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px !important; /* Más espacio entre tarjetas para evitar choques */
    margin-top: 40px;
}
.team-card { 
    display: flex; flex-direction: column; align-items: center; text-align: center; 
    width: 100%; /* Asegurar que use el ancho de la celda grid */
}

.photo-frame-wrapper {
    position: relative; width: 140px; height: 140px; margin-bottom: 15px; display: flex; justify-content: center; align-items: center;
}
.frame-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.person-photo { width: 80%; height: 80%; border-radius: 50%; object-fit: cover; z-index: 1; }

.member-name { font-size: 1rem; font-weight: 800; color: #394049; margin-bottom: 5px; }
.member-role { font-size: 0.875rem; font-weight: 700; color: #00A499; line-height: 1.2; word-wrap: break-word; }

/* CAMBIO CLAVE 4: Corrección de Correos */
.member-email { 
    margin-top: 5px; 
    font-size: 0.875rem; 
    line-height: 1.3;
}
.member-email a { 
    color: #EA7600; text-decoration: none; font-weight: 700; transition: color 0.2s; 
    
    /* Esto rompe el correo si es muy largo para que baje a la siguiente línea */
    word-break: break-all; 
    overflow-wrap: break-word; 
    display: inline-block; 
}
.member-email a:hover { color: #00A499; text-decoration: underline; }

/* Responsive ajustes */
@media (max-width: 1024px) { /* Aumentado a 1024px para tablets y zoom alto */
    .qs-layout { grid-template-columns: 1fr; } /* Colapsa a 1 columna antes */
    .qs-sidebar { flex-direction: row; overflow-x: auto; padding-bottom: 15px; margin-bottom: 20px; }
    .qs-btn { white-space: nowrap !important; /* En móvil sí queremos nowrap en el scroll horizontal */ background: #fff; border: 1px solid #ddd; margin-right: 10px; }
    .qs-card { padding: 20px; }
}

/* --- SIMPLE LAYOUT --- */
.simple-layout {
    max-width: 1600px;
    margin: 40px auto 20px auto; 
    padding: 0 20px;
}
.qs-text-block ul { margin-left: 20px; margin-bottom: 20px; list-style-type: disc; }
.qs-text-block li { margin-bottom: 10px; color: #394049; }

/* --- ENLACES GENÉRICOS --- */
.qs-text-block p a, 
.qs-text-block li a,
.qs-text-block a {
    color: #EA7600 !important;
    font-weight: 800 !important;
    text-decoration: underline;
}
.qs-text-block a:hover { color: #00A499 !important; }

/* --- ARREGLO IMÁGENES --- */
.aligncenter { display: block; margin: 0 auto; clear: both; }
.alignleft { float: left; margin-right: 1.5em; margin-bottom: 1.5em; }
.alignright { float: right; margin-left: 1.5em; margin-bottom: 1.5em; }

.qs-text-block img {
    display: block; margin-left: auto; margin-right: auto;
    max-width: 100%; height: auto; margin-bottom: 20px; margin-top: 20px;
}

/* --- SUB-NAVEGACIÓN --- */
.sub-nav-container, .filter-container {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px;
    border-bottom: 1px solid #ddd; padding-bottom: 15px;
}
.sub-btn, .filter-btn {
    background: white; border: 1px solid #00A499; color: #00A499;
    padding: 8px 15px; border-radius: 20px; font-family: 'Nunito Sans', sans-serif;
    font-weight: 700; cursor: pointer; transition: all 0.3s ease;
}
.sub-btn:hover, .filter-btn:hover { background: #00A499; color: white; }
.sub-btn.active, .filter-btn.active { background: #00A499; color: white; box-shadow: 0 4px 6px rgba(0,164,153,0.3); }

/* --- SINGLE NEWS --- */
.single-news-container { max-width: 1500px; margin: 40px auto; padding: 0 20px; }
.article-header { text-align: center; margin-bottom: 30px; }
.article-category a { color: var(--color-primary); text-transform: uppercase; font-weight: 700; font-size: 0.875rem; text-decoration: none; }
.article-title { font-size: 2.25rem; color: var(--color-primary); margin: 15px 0; line-height: 1.2; font-weight: 900; }
.article-meta { color: var(--color-text-gray); font-size: 0.875rem; font-weight: 600; }
.article-featured-image { margin-bottom: 30px; }
.article-featured-image img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.article-excerpt-wrapper {
    margin-bottom: 30px; border-left: 4px solid var(--color-primary);
    padding-left: 20px; background-color: #f9f9f9; padding: 20px; border-radius: 0 8px 8px 0;
}
.excerpt-label { font-size: 1.375rem; color: var(--color-primary); font-weight: 800; margin-bottom: 10px; text-transform: uppercase; }
.article-lead { font-size: 1.125rem; line-height: 1.6; color: var(--color-text-dark); font-style: italic; font-weight: 400; }
.article-content img { max-width: 100%; height: auto; }

/* --- UTILIDADES --- */
.price-table { width: 100%; border-collapse: collapse; margin: 30px 0; font-size: 0.95em; }
.price-table th { background-color: var(--color-primary); color: white; padding: 12px; text-align: left; }
.price-table td { border: 1px solid #ddd; padding: 10px; }
.price-table tr:nth-child(even) { background-color: #f9f9f9; }
.vistos-box { background: #f9f9f9; padding: 20px; border-left: 4px solid var(--color-primary); font-size: 0.9em; margin-top: 15px; }

/* --- BOTÓN DESTACADO ELECCIONES (CORREGIDO BLINDADO) --- */
.qs-text-block a.highlight-link,
a.highlight-link {
    display: inline-block !important;
    background-color: #EA7600 !important; /* Verde base */
    color: #ffffff !important; 
    padding: 12px 25px !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    font-weight: 800 !important;
    margin: 15px 0 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    border: none !important;
}

.qs-text-block a.highlight-link:hover,
a.highlight-link:hover {
    background-color: var(--color-primary) !important; /* Verde más oscuro */
    color: #ffffff !important; /* BLANCO SIEMPRE */
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 8px rgba(0,0,0,0.15) !important;
    text-decoration: none !important;
}

/* --- INFOGRAFÍAS --- */
.infografia-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.infografia-item img { width: 100%; height: auto; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: block; }
@media (max-width: 768px) { .infografia-grid { grid-template-columns: 1fr; } }

/* --- BOTONES TRANSPARENCIA (CORREGIDOS Y FLEXIBLES) --- */
/* --- BOTONES TRANSPARENCIA (FLEXIBLE & ACCESIBLE) --- */

.transparencia-btn-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.transparencia-btn {
    display: inline-block; /* Necesario para el enlace */
    background-color: var(--color-primary);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    text-decoration: none !important;
    transition: transform 0.3s ease;
    
    /* ANCHO Y ALTO FLEXIBLES */
    width: 100%;
    max-width: 450px; 
    min-height: 80px;
    height: auto; /* Permite crecer */
    padding: 15px 25px;
}

.transparencia-btn:hover {
    transform: scale(1.02);
    background-color: #EA7600;
}

/* Contenedor interno Flex */
.transparencia-inner {
    display: flex;
    align-items: center; /* Centrado vertical */
    justify-content: center; /* Centrado horizontal */
    gap: 20px; /* Espacio entre icono y texto */
    width: 100%;
    height: 100%;
}

/* Icono */
.icon-box {
    flex-shrink: 0; /* Evita que el icono se aplaste */
}

.transparencia-btn .btn-icon {
    width: 45px;
    height: auto;
    display: block;
}

/* Texto */
.text-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    flex-grow: 1; /* Ocupa el espacio restante */
}

.transparencia-btn .line-main {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffffff !important;
    line-height: 1.2;
    word-break: break-word; /* Evita desborde horizontal */
}

.transparencia-btn .line-sub {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.95;
    color: #ffffff !important;
    line-height: 1.2;
    margin-top: 3px;
}

/* Modo Oscuro para Botones Transparencia */
body.inverted-colors .transparencia-btn {
    background-color: #333 !important;
    border: 1px solid #555 !important;
}

body.inverted-colors .transparencia-btn:hover {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

/* Ajuste Móvil */
@media (max-width: 600px) {
    .transparencia-inner {
        justify-content: flex-start; /* Alineado a la izquierda en móvil */
    }
}

/* --- UTILIDADES LIMPIEZA --- */
.text-center-spaced { text-align: center; margin: 30px 0; }
.text-center { text-align: center; }
.margin-top-20 { margin-top: 20px; }
.margin-top-30 { margin-top: 30px; }
.margin-bottom-20 { margin-bottom: 20px; }
.margin-bottom-15 { margin-bottom: 15px; }
.img-cover-full { width: 100%; height: 100%; object-fit: cover; }
.img-responsive-max-800 { width: 100%; max-width: 800px; height: auto; }
.list-disc-spaced { margin-left: 20px; list-style-type: disc; margin-bottom: 20px; }
.list-circle-spaced { margin-left: 20px; margin-top: 10px; list-style-type: circle; }
.box-highlight { background-color: #f9f9f9; border-left: 4px solid var(--color-primary); padding: 15px; margin-bottom: 20px; }
.box-alert { background-color: #fff8e1; border-left: 4px solid var(--color-orange); padding: 15px; margin-top: 20px; }
.text-small-gray { font-size: 0.9em; color: var(--color-text-gray); }
.font-bold { font-weight: 700; }
.font-italic { font-style: italic; }
.link-teal { color: var(--color-primary); font-weight: 700; text-decoration: none; }
.link-orange { color: var(--color-orange); font-weight: 700; text-decoration: none; }
.link-dark { color: var(--color-text-dark); font-weight: 700; text-decoration: none; }
.table-responsive { overflow-x: auto; }
.flex-gap-40 { display: flex; gap: 40px; flex-wrap: wrap; }
.flex-item-min-250 { flex: 1; min-width: 250px; }
.min-h-500 { min-height: 500px; }
.separator-line { border: 0; border-top: 1px solid #ddd; margin: 30px 0; }
.list-none-spaced { margin-left: 20px; list-style: none; }
.list-decimal-spaced { margin-left: 20px; margin-bottom: 20px; list-style-type: decimal; }
.list-item-spaced { margin-bottom: 15px; }
.container-content { max-width: 1400px; margin: 40px auto; padding: 0 20px; }
.margin-y-40 { margin-top: 40px; margin-bottom: 40px; }
.margin-left-20 { margin-left: 20px; }
.link-orange-simple { color: var(--color-orange); text-decoration: none; }
.link-teal-simple { color: var(--color-primary); text-decoration: none; }
.link-dark-simple { color: var(--color-text-dark); text-decoration: none; }
.link-orange:hover, .link-orange-simple:hover, .link-teal:hover, .link-teal-simple:hover, .link-dark:hover, .link-dark-simple:hover { text-decoration: underline; }
.grid-junta { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-bottom: 40px; }
.margin-bottom-5 { margin-bottom: 5px; }
.margin-bottom-10 { margin-bottom: 10px; }
.font-extra-bold { font-weight: 800; }
.text-center-simple { text-align: center; }
.img-responsive-centered { max-width: 100%; height: auto; margin-top: 20px; display: block; margin-left: auto; margin-right: auto; }
.img-cover-card { width: 100%; height: 100%; object-fit: cover; }
.text-empty { text-align: center; width: 100%; color: var(--color-text-gray); font-style: italic; padding: 20px; }

/* --- BARRA DE ACCESIBILIDAD --- */
.access-toolbar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background-color: #394049; color: white; z-index: 99999;
    padding: 12px 0; box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    font-family: 'Nunito Sans', sans-serif; border-top: 3px solid var(--color-primary);
}
.access-container { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; align-items: center; padding: 0 20px; }
.access-btn {
    background: transparent; border: 1px solid transparent; color: #fff;
    cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 15px;
    padding: 8px 15px; border-radius: 6px; transition: all 0.2s; font-weight: 600;
}
.access-btn:hover { background-color: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }
.access-btn.active { background-color: var(--color-primary); color: white; border-color: var(--color-primary); }
.access-btn .icon {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    background-color: #f0f0f0; color: #394049; font-weight: 900; border-radius: 4px; font-size: 14px; line-height: 1;
}
.access-close {
    background: #cc0000; border: none; color: white; width: 30px; height: 30px;
    border-radius: 50%; font-size: 16px; cursor: pointer; margin-left: 20px;
    display: flex; align-items: center; justify-content: center;
}

/* --- CLASES DE ACCIÓN (LÓGICA CORREGIDA) --- */

/* 1. DISLEXIA */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('fonts/OpenDyslexic-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
body.dyslexia-mode, body.dyslexia-mode * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
    letter-spacing: 0.03em !important;
    word-spacing: 0.1em !important;
    line-height: 1.6 !important;
}

/* 2. CONTRASTE (Nitidez) */
body.high-contrast { filter: contrast(130%) saturate(140%); }
/* 3. MODO OSCURO (CORRECCIONES ESPECÍFICAS) */
body.inverted-colors {
    background-color: #121212 !important;
    color: #eeeeee !important;
}

/* Contenedores principales oscuros */
body.inverted-colors header, 
body.inverted-colors footer, 
body.inverted-colors .qs-card,
body.inverted-colors .box-highlight, 
body.inverted-colors .vistos-box,
body.inverted-colors .submenu-container, 
body.inverted-colors .dropdown-content,
body.inverted-colors .video-item, 
body.inverted-colors .news-card,
body.inverted-colors .qs-text-block {
    background-color: #1E1E1E !important; 
    color: #eeeeee !important; 
    border-color: #444 !important; 
    box-shadow: none !important;
}

/* CORRECCIÓN CAJA AMARILLA (.box-alert) */
/* En modo oscuro, la caja de alerta será gris muy oscuro con borde naranja, y texto blanco */
body.inverted-colors .box-alert {
    background-color: #2D2D2D !important; /* Gris un poco más claro para diferenciar */
    color: #ffffff !important; 
    border-left: 4px solid #EA7600 !important; /* Mantenemos el borde naranja */
}
/* Asegurar que el texto dentro de la caja amarilla sea blanco */
body.inverted-colors .box-alert p,
body.inverted-colors .box-alert li,
body.inverted-colors .box-alert strong {
    color: #ffffff !important;
}

/* CORRECCIÓN TABLA DE PRECIOS (.price-table) */
/* Cabecera */
body.inverted-colors .price-table th {
    background-color: #004d47 !important; /* Verde muy oscuro */
    color: #ffffff !important;
    border-color: #555 !important;
}
/* Celdas */
body.inverted-colors .price-table td {
    color: #ffffff !important;
    border-color: #444 !important;
}
/* Filas pares (las que eran blancas/grises) ahora oscuras */
body.inverted-colors .price-table tr:nth-child(even) {
    background-color: #2a2a2a !important; /* Gris medio */
}
/* Filas impares (el fondo base) */
body.inverted-colors .price-table tr:nth-child(odd) {
    background-color: #1a1a1a !important; /* Gris oscuro */
}
/* Hover en filas */
body.inverted-colors .price-table tr:hover {
    background-color: #333333 !important;
}

/* REGLA MAESTRA: Forzar color claro en TODOS los textos dentro de contenedores oscuros */
body.inverted-colors .qs-card *, 
body.inverted-colors .qs-text-block *,
body.inverted-colors .box-highlight *,
body.inverted-colors footer * {
    color: #eeeeee !important;
}

/* Excepciones específicas */
body.inverted-colors h1, 
body.inverted-colors h2, 
body.inverted-colors h3, 
body.inverted-colors h4,
body.inverted-colors strong,
body.inverted-colors .qs-title,
body.inverted-colors .qs-subtitle {
    color: #ffffff !important; 
}

/* Títulos Turquesa */
body.inverted-colors .text-teal,
body.inverted-colors h2.text-teal,
body.inverted-colors h3.text-teal {
    color: #4DB6AC !important; 
}

/* Enlaces */
body.inverted-colors a {
    color: #4DB6AC !important; 
}
body.inverted-colors a:hover {
    color: #80CBC4 !important;
}

/* Enlaces naranjas específicos */
body.inverted-colors .link-orange,
body.inverted-colors .link-orange-simple {
    color: #FFB74D !important; /* Naranja claro */
}

/* Botones Sidebar */
body.inverted-colors .qs-btn { 
    background-color: #333 !important; 
    color: #fff !important; 
    border: 1px solid #555 !important; 
}
body.inverted-colors .qs-btn:hover, 
body.inverted-colors .qs-btn.active { 
    background-color: var(--color-primary) !important; 
    border-color: var(--color-primary) !important; 
    color: #fff !important;
}

/* Sub-botones del Sidebar */
body.inverted-colors .sub-btn-sidebar {
    color: #ffffff !important;
}
body.inverted-colors .sub-btn-sidebar:hover {
    background-color: #2c2c2c !important;
}
body.inverted-colors .sub-btn-sidebar.active {
    background-color: #333 !important;
    color: #EA7600 !important; 
}

/* Imágenes normales */
body.inverted-colors img, 
body.inverted-colors video, 
body.inverted-colors iframe { 
    opacity: 0.9; 
}

/* 4. PAUSAR ANIMACIONES */
body.pause-animations *, 
body.pause-animations *::before, 
body.pause-animations *::after {
    transition: none !important; 
    animation: none !important; 
    transform: none !important;
}

/* --- ESTADO ACTIVO DEL MENÚ (Highlight) --- */

/* Menú Principal */
.main-nav li.current-menu-item > a,
.main-nav li.current_page_item > a,
.main-nav li.current-menu-parent > a {
    color: var(--color-primary); /* Texto verde */
    position: relative;
}

/* Línea debajo del ítem activo para destacarlo más */
.main-nav li.current-menu-item > a::after,
.main-nav li.current_page_item > a::after {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-orange); /* Línea naranja */
    position: absolute;
    bottom: -5px;
    left: 0;
}

/* Menú Recursos de Interés (Dropdown) */
.dropdown-content li.current-menu-item > a {
    background-color: #f0f0f0; /* Fondo gris claro */
    color: var(--color-primary); /* Texto verde */
    font-weight: 800;
    border-left: 4px solid var(--color-orange); /* Borde naranja lateral */
}

/* --- ESTADO ACTIVO EN MODO OSCURO --- */

/* Menú Principal Oscuro */
body.inverted-colors .main-nav li.current-menu-item > a {
    color: #4DB6AC !important; /* Turquesa claro brillante */
}

body.inverted-colors .main-nav li.current-menu-item > a::after {
    background-color: #4DB6AC !important; /* Línea turquesa */
}

/* Dropdown Oscuro */
body.inverted-colors .dropdown-content li.current-menu-item > a {
    background-color: #333 !important;
    color: #4DB6AC !important;
    border-left-color: #4DB6AC !important;
}

/* --- ESTADO ACTIVO PARA BOTONES HOME (FOOTER) --- */

/* 1. Modo Normal (Claro) */
.quick-link-item.active h3 {
    color: var(--color-primary); /* Texto verde turquesa */
    font-weight: 900; /* Más gordito */
    text-decoration: underline; /* Opcional: subrayado para reforzar */
    text-decoration-thickness: 3px;
    text-decoration-color: var(--color-orange);
}

.quick-link-item.active .bg-icon {
    opacity: 0.25; /* El círculo de fondo del icono se hace un poco más visible */
    background-color: var(--color-primary);
}

.quick-link-item.active {
    transform: translateY(-5px); /* Se mantiene "elevado" */
}


/* 2. Modo Oscuro (Inverted Colors) */
body.inverted-colors .quick-link-item.active h3 {
    color: #4DB6AC !important; /* Turquesa claro brillante */
    text-decoration-color: #4DB6AC !important;
}

body.inverted-colors .quick-link-item.active .bg-icon {
    background-color: #4DB6AC !important;
    opacity: 0.3 !important;
}

/* --- AJUSTE VIDEOS HOME (ESPACIADO CORREGIDO) --- */
.home-videos-grid {
    /* Forzamos 2 columnas grandes si hay espacio */
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); 
    gap: 30px; 
    justify-content: center;
    
    /* CORRECCIÓN: Agregar espacio abajo para despegar del footer */
    padding-bottom: 60px; /* Suficiente aire */
    margin-bottom: 20px;
}

.home-videos-grid .video-item {
    max-width: 100%;
    width: 100%;
}

/* En pantallas muy grandes, limitamos y centramos */
@media (min-width: 1400px) {
    .home-videos-grid {
        max-width: 1300px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* En móvil */
@media (max-width: 768px) {
    .home-videos-grid {
        grid-template-columns: 1fr;
        padding-bottom: 40px; /* Un poco menos en móvil */
    }
}

/* --- CORRECCIÓN TEXTO NOTICIAS (MODO OSCURO) --- */
body.inverted-colors .news-summary,
body.inverted-colors .news-summary p {
    color: #ffffff !important; /* Blanco puro para máxima legibilidad */
}

/* Opcional: Asegurar que el título de la noticia también se vea bien */
body.inverted-colors .news-title {
    color: #4DB6AC !important; /* Turquesa claro brillante para el título */
}

/* --- CORRECCIONES MODO OSCURO (BOTÓN Y RESUMEN) --- */

/* 1. Botón "Seguir Leyendo" (.btn-read-more) */
/* Estado Normal en Modo Oscuro: Naranja */
body.inverted-colors .btn-read-more {
    color: white !important; /* Texto Naranja */
    border: 1px solid #EA7600 !important; /* Borde Naranja */
    background-color: #EA7600 !important;
}

/* Estado Hover (al pasar el mouse): Celeste/Turquesa */
body.inverted-colors .btn-read-more:hover {
    background-color: #4DB6AC !important; /* Fondo Turquesa */
    border-color: #4DB6AC !important;
    color: #ffffff !important; /* Texto blanco para contraste */
}

/* 2. Título "Resumen" en la noticia individual (Single) */
/* Forzamos que el título "RESUMEN" sea negro/gris oscuro para que se lea sobre el fondo blanco */
body.inverted-colors .excerpt-label {
    color: #333333 !important; 
}

/* Opcional: Asegurar que el texto del resumen también sea legible si el fondo es blanco */
body.inverted-colors .article-lead {
    color: #333333 !important;
}