/* ===================================
   Variables y Reset
   =================================== */
:root {
    --primary-color: #1e3a8a;
    /* Azul institucional */
    --secondary-color: #059669;
    /* Verde educativo */
    --accent-color: #f59e0b;
    /* Amarillo/naranja */
    
    /* Variables Semánticas (Light Mode Default) */
    --bg-body: #ffffff;
    --bg-surface: #f9fafb;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-main: #e5e7eb;
    --card-bg: #ffffff;
    --white: #ffffff;
    
    --text-color: var(--text-main);
    --text-light: var(--text-muted);
    --bg-light: var(--bg-surface);
    --border-color: var(--border-main);

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* TipografÃ­a */
    --font-primary: 'Poppins', sans-serif;
}

[data-theme='dark'] {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-main: #334155;
    --card-bg: #1e293b;
    --white: #1e293b;
    --primary-color: #60a5fa; /* Azul más claro para mejor contraste en fondo oscuro */
    --secondary-color: #34d399;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .btn {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   Header y NavegaciÃ³n
   =================================== */
.site-header {
    background: var(--bg-body);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.main-nav a:hover::after {
    width: 100%;
}

/* SubmenÃºs */
.has-submenu {
    position: relative;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    display: block;
}

.submenu a {
    display: block;
    padding: 0.75rem 1.5rem;
}

.submenu a::after {
    display: none;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
    }

    .main-nav.active {
        max-height: 500px;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

    .main-nav a {
        display: block;
        padding: 1rem 1.5rem;
    }

    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-light);
        max-height: 0;
        overflow: hidden;
    }

    .has-submenu.active .submenu {
        max-height: 300px;
    }
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Color anterior: background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(5, 150, 105, 0.6)); */
    background: linear-gradient(135deg, rgba(13, 27, 62, 0.85), rgba(20, 50, 93, 0.75));
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    /* Ajuste para evitar que se vea apretado */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    padding: 0 5%;
    /* Espaciado lateral preventivo */
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
}

@media (max-width: 768px) {
    .hero-section {
        height: 350px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }
}

/* ===================================
   Page Header
   =================================== */
.page-header {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
}

.header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Color anterior: background: rgba(30, 58, 138, 0.7); */
    background: rgba(13, 27, 62, 0.8);
    z-index: 2;
}

.page-title {
    position: relative;
    z-index: 3;
    font-size: 2.5rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .page-header {
        height: 200px;
    }

    .page-title {
        font-size: 1.8rem;
    }
}

/* ===================================
   Main Content
   =================================== */
.main-content {
    padding: 3rem 0;
    min-height: 400px;
}

.intro-section,
.page-intro {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-light);
}

/* Content Blocks */
.content-blocks {
    margin: 2rem 0;
}

.content-heading {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
}

.content-paragraph {
    margin: 1.5rem 0;
    line-height: 1.8;
    padding-left: 20px;
    /* Margen para legibilidad optimizada */
    padding-right: 20px;
}

.content-image {
    margin: 2rem 0;
    text-align: center;
}

.content-image img {
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Image Text Block */
.image-text-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.image-text-block.image-right {
    grid-template-columns: 1fr 1fr;
}

.image-text-block.image-right .image-text-image {
    order: 2;
}

.image-text-image img {
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.image-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

@media (max-width: 768px) {
    .image-text-block {
        grid-template-columns: 1fr;
    }

    .image-text-block.image-right .image-text-image {
        order: 1;
    }
}

/* Quote */
.content-quote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 2rem;
    margin: 2rem 0;
    background: var(--bg-light);
    font-style: italic;
    font-size: 1.1rem;
}

/* Lists */
.content-list {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.content-list li {
    margin: 0.5rem 0;
}

/* Gallery */
.content-gallery,
.gallery-grid {
    margin: 2rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* CTA Block */
.cta-block {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
}

.cta-block h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Embed */
.embed-block {
    margin: 2rem 0;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.embed-block iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-document {
    background: var(--accent-color);
    color: var(--white);
}

/* Fix for outline buttons to prevent border stacking */
.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white) !important;
    /* Forzamos blanco para evitar azul-sobre-azul */
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Fix para botones activos / enfocados */
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn.active {
    background: var(--primary-color) !important;
    color: var(--white) !important;
}

.btn-outline-primary.active:hover,
.btn.active:hover {
    background: var(--primary-color);
    filter: brightness(1.1);
    color: var(--white) !important;
}

/* Limpieza global de estados de enfoque (Eliminar "sobre-bordes") */
.btn:focus,
.btn:active,
.form-control:focus,
.form-select:focus,
[role="button"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.25) !important;
}

.btn-outline-primary:focus {
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.25) !important;
}

.btn-outline-primary:active {
    transform: translateY(0);
}

/* ===================================
   Blog
   =================================== */
.blog-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.blog-post-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: var(--text-color);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-intro {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.recent-posts {
    list-style: none;
}

.recent-posts li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.recent-posts li:last-child {
    border-bottom: none;
}

.recent-posts .post-date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination-link {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
}

.pagination-link:hover {
    background: var(--secondary-color);
    color: var(--white);
}

@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
    }
}

/* ===================================
   Contact Form
   =================================== */
.contact-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.contact-form {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.form-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.contact-info-section {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
    height: fit-content;
}

.contact-info-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-info-item {
    margin-bottom: 1.5rem;
}

.contact-info-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.thank-you-message {
    text-align: center;
    padding: 3rem;
    background: var(--bg-light);
    border-radius: 8px;
}

@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Footer
   =================================== */
.site-footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-column a:hover {
    color: var(--white);
}

.contact-info li {
    margin-bottom: 0.75rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.social-link i {
    font-size: 1.25rem;
    line-height: 1;
}

.social-link:hover {
    background: #ffffff !important;
    color: #1e3a8a !important;
}

.social-link.yt-link:hover {
    color: #ff0000 !important; /* Rojo YouTube opcional, o mantener azul */
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   Lightbox
   =================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2rem;
    color: var(--white);
    cursor: pointer;
    background: none;
    border: none;
}

/* ===================================
   Utilities
   =================================== */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}


/* ===================================
   BLOQUES AVANZADOS
   =================================== */

/* Columnas */
.two-columns-block .columns-wrapper,
.three-columns-block .columns-wrapper,
.four-columns-block .columns-wrapper {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.two-columns-block .columns-wrapper {
    grid-template-columns: 1fr 1fr;
}

.two-columns-block.ratio-60-40 .columns-wrapper {
    grid-template-columns: 60% 40%;
}

.two-columns-block.ratio-40-60 .columns-wrapper {
    grid-template-columns: 40% 60%;
}

.two-columns-block.ratio-70-30 .columns-wrapper {
    grid-template-columns: 70% 30%;
}

.two-columns-block.ratio-30-70 .columns-wrapper {
    grid-template-columns: 30% 70%;
}

.three-columns-block .columns-wrapper {
    grid-template-columns: repeat(3, 1fr);
}

.four-columns-block .columns-wrapper {
    grid-template-columns: repeat(4, 1fr);
}

/* Backgrounds */
.bg-white {
    background: #ffffff;
}

.bg-light {
    background: #f9fafb;
}

.bg-primary {
    background: var(--primary-color);
    color: white;
}

.bg-secondary {
    background: var(--secondary-color);
    color: white;
}

/* Hero Section */
.hero-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-section.height-small {
    height: 400px;
}

.hero-section.height-medium {
    height: 600px;
}

.hero-section.height-large {
    height: 800px;
}

.hero-section.height-full {
    height: 100vh;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Programa AcadÃ©mico */
.programa-academico-block {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin: 2rem 0;
}

.programa-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.programa-meta span {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.9rem;
}

.programa-requisitos {
    margin-top: 1.5rem;
}

.programa-requisitos ul {
    list-style: none;
    padding-left: 0;
}

.programa-requisitos li::before {
    content: "âœ“ ";
    color: var(--secondary-color);
    font-weight: bold;
}

/* Docente */
.docente-block {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.docente-foto img {
    border-radius: 50%;
    width: 100%;
}

.docente-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.cargo {
    font-weight: 600;
    color: var(--secondary-color);
}

.area {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Stats Counter */
.stats-counter-block {
    padding: 4rem 0;
    text-align: center;
}

.stats-counter-block.bg-primary,
.stats-counter-block.bg-secondary,
.stats-counter-block.bg-dark {
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-description {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Team Grid */
.team-grid-block {
    padding: 3rem 0;
}

.team-grid-block .miembros {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.team-grid-block.columnas-2 .miembros {
    grid-template-columns: repeat(2, 1fr);
}

.team-grid-block.columnas-3 .miembros {
    grid-template-columns: repeat(3, 1fr);
}

.team-grid-block.columnas-4 .miembros {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive */
@media (max-width: 1024px) {

    .two-columns-block .columns-wrapper,
    .three-columns-block .columns-wrapper,
    .four-columns-block .columns-wrapper {
        grid-template-columns: 1fr;
    }

    .programa-academico-block,
    .docente-block {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}
/* Fix hover botones (evitar perdida de texto) */
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: white !important;
}


/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    backdrop-filter: blur(10px);
}

/* Modal Styles */
.modal-content {
    border-radius: 1rem;
}

#announcement-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}


/* Perfil / Avatar */
.nav-user-avatar {
    width: 40px;
    height: 40px;
    background: #1e3a8a;
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Modern Back to Top */
.back-to-top-modern {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: none;
}

.back-to-top-modern.active-progress {
    opacity: 1;
    visibility: visible;
}

.back-to-top-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.back-to-top-modern svg {
    position: absolute;
    fill: none;
    stroke-width: 4;
    transform: rotate(-90deg);
}

.progress-circle-bg {
    stroke: #f1f5f9;
}

.progress-circle-bar {
    stroke: #1e3a8a; /* Color primario */
    stroke-linecap: round;
}

.back-to-top-modern i {
    font-size: 1.2rem;
    color: #1e3a8a;
    position: relative;
    z-index: 10;
}


/* ============================================================================
   ESTILOS PARA PÁGINAS INSTITUCIONALES (CONTENIDO HTML)
   ============================================================================ */
/* CONTENEDOR PRINCIPAL */
.institucion-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.institucion-content .section-card {
    margin-bottom: 40px;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #3366CC;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.institucion-content .section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* TÍTULOS Y SUBTÍTULOS */
.institucion-content .section-title {
    color: #3366CC;
    font-size: 2em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3366CC;
    font-weight: 600;
}

.institucion-content .section-subtitle {
    color: #004085;
    font-size: 1.4em;
    margin: 25px 0 20px 0;
    font-weight: 600;
    position: relative;
    padding-left: 20px;
}

.institucion-content .section-subtitle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #3366CC;
}

/* PÁRRAFOS GENERALES */
.institucion-content p {
    text-align: justify;
    margin-bottom: 15px;
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
}

/* TABS - Metas y Desafíos */
.institucion-content .metas-tabs {
    margin-top: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.institucion-content .tab-buttons {
    display: flex;
    background: #3366CC;
}

.institucion-content .tab-btn {
    flex: 1;
    padding: 18px 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.institucion-content .tab-btn.active,
.institucion-content .tab-btn:hover {
    background: #004085;
    transform: translateY(-2px);
}

.institucion-content .tab-content {
    padding: 30px;
    display: none;
}

.institucion-content .tab-content.active {
    display: block;
}

/* DESAFÍOS ESTRATÉGICOS */
.institucion-content .desafio-item {
    background: white;
    margin-bottom: 20px;
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid #3366CC;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.institucion-content .desafio-item::before {
    content: '•';
    position: absolute;
    left: 15px;
    top: 25px;
    font-size: 1.5em;
    color: #3366CC;
}

.institucion-content .desafio-item:hover {
    box-shadow: 0 4px 12px rgba(51, 102, 204, 0.2);
    transform: translateX(5px);
}

.institucion-content .desafio-item p {
    margin: 0 0 0 30px;
    font-size: 1.05em;
}

/* COMPETENCIAS MAESTRO */
.institucion-content .maestro-competencias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.institucion-content .competencia-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e3f2fd 100%);
    padding: 25px;
    border-radius: 12px;
    border-top: 4px solid #3366CC;
    transition: all 0.3s ease;
    position: relative;
}

.institucion-content .competencia-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(51, 102, 204, 0.2);
}

.institucion-content .competencia-card h4 {
    color: #3366CC;
    font-size: 1.2em;
    margin-bottom: 15px;
    font-weight: 700;
    padding-left: 10px;
    border-left: 3px solid #004085;
}

/* POLÍTICAS */
.institucion-content .politica-list {
    list-style: none;
    padding: 0;
}

.institucion-content .politica-item {
    background: #f8f9fa;
    margin-bottom: 25px;
    padding: 25px;
    border-radius: 12px;
    border-top: 4px solid #3366CC;
    transition: all 0.3s ease;
    position: relative;
}

.institucion-content .politica-item:hover {
    background: #e7f1ff;
    transform: translateX(5px);
    box-shadow: 0 6px 15px rgba(51, 102, 204, 0.15);
}

.institucion-content .politica-item h4 {
    color: #3366CC;
    font-size: 1.25em;
    margin-bottom: 15px;
    font-weight: 700;
    padding-left: 10px;
    border-left: 3px solid #004085;
}

/* OBJETIVOS */
.institucion-content .objetivo-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 15px;
}

.institucion-content .objetivo-list li {
    position: relative;
    margin-bottom: 12px;
    padding-left: 25px;
    font-size: 1em;
}

.institucion-content .objetivo-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #3366CC;
    font-weight: bold;
    font-size: 1.2em;
}

/* FUNCIONES NUMERADAS - Consejo Académico */
.institucion-content .funciones-list {
    list-style: none;
    padding: 0;
    margin-top: 25px;
    counter-reset: funcion-counter;
}

.institucion-content .funciones-list li {
    position: relative;
    margin-bottom: 20px;
    padding: 22px 25px 22px 50px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3366CC;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.institucion-content .funciones-list li::before {
    content: counter(funcion-counter) '.';
    counter-increment: funcion-counter;
    position: absolute;
    left: 15px;
    top: 25px;
    background: #3366CC;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.institucion-content .funciones-list li:hover {
    background: #e7f1ff;
    transform: translateX(8px);
    box-shadow: 0 6px 16px rgba(51, 102, 204, 0.15);
    border-left-width: 6px;
}

/* CAJAS ESPECIALES */
.institucion-content .intro-text {
    background: #f0f4ff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #3366CC;
    font-style: italic;
}

.institucion-content .desafio-institucional {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 6px solid #856404;
}

.institucion-content .legal-reference {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    padding: 25px;
    border-radius: 12px;
    border-left: 6px solid #3366CC;
    margin-bottom: 30px;
    position: relative;
}

.institucion-content .legal-reference::before {
    content: '??';
    position: absolute;
    left: 20px;
    top: 25px;
    font-size: 1.8em;
    opacity: 0.8;
}

.institucion-content .legal-reference .reference-text {
    margin-left: 50px;
    font-weight: 600;
    color: #004085;
    font-size: 1.1em;
}

.institucion-content .resumen-final {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    border-left: 6px solid #28a745;
    text-align: center;
}

.institucion-content .resumen-final p {
    font-size: 1.1em;
    font-weight: 600;
    color: #155724;
    margin: 0;
}

/* DIMENSIONES Y PRINCIPIOS */
.institucion-content .dimension-list,
.institucion-content .principio-list {
    list-style: none;
    margin-top: 20px;
    padding: 0;
}

.institucion-content .dimension-list li,
.institucion-content .principio-list li {
    margin-bottom: 25px;
    padding: 0;
}

.institucion-content .dimension-list li strong,
.institucion-content .principio-list li strong {
    color: #3366CC;
    font-size: 1.2em;
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    padding-left: 15px;
    border-left: 4px solid #3366CC;
}

.institucion-content .dimension-list li p,
.institucion-content .principio-list li p {
    margin-left: 19px;
    color: #555;
}

.institucion-content .three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 25px;
}

.institucion-content .dimension-item,
.institucion-content .principio-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-top: 3px solid #3366CC;
    transition: all 0.3s ease;
}

.institucion-content .dimension-item:hover,
.institucion-content .principio-item:hover {
    background: #e7f1ff;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.institucion-content .dimension-item h4,
.institucion-content .principio-item h4 {
    color: #3366CC;
    font-size: 1.1em;
    margin-bottom: 12px;
    font-weight: 600;
}

/* HIGHLIGHT BOX */
.institucion-content .highlight-box {
    background: linear-gradient(135deg, #3366CC 0%, #004085 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    box-shadow: 0 4px 10px rgba(51, 102, 204, 0.3);
}

.institucion-content .highlight-box h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .institucion-content .three-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .institucion-content {
        padding: 20px 15px;
    }

    .institucion-content .section-card {
        padding: 20px;
    }

    .institucion-content .section-title {
        font-size: 1.5em;
    }

    .institucion-content .three-columns {
        grid-template-columns: 1fr;
    }

    .institucion-content .maestro-competencias {
        grid-template-columns: 1fr;
    }

    .institucion-content .tab-buttons {
        flex-direction: column;
    }

    .institucion-content .tab-btn {
        padding: 15px;
    }
}

/* JAVASCRIPT TABS */
.institucion-content .tab-content {
    display: none;
}

.institucion-content .tab-content.active {
    display: block;
}

/* ============================================================================
   BLOQUES INSTITUCIONALES UNIFICADOS
   ============================================================================ */
.block-card-institutional {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    padding: 1.75rem !important;
    margin: 2.5rem 0 !important;
    border: 1px solid rgba(0,0,0,0.03) !important;
    transition: box-shadow 0.3s ease;
}

.block-card-institutional:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.09) !important;
}

.block-card-institutional .row {
    margin-right: 0;
    margin-left: 0;
}
