@font-face {
        font-family: 'FuentePrincipal'; /* Nombre de la fuente */
        src: url('../fonts/Exo2-VariableFont_wght.ttf') format('truetype-variations'); /* Formato específico para fuentes variables TTF */
        
        /* Define el rango completo de pesos que la fuente contiene (e.g., de 100 a 900) */
        font-weight: 100 900; 
        
        /* Define el rango de tamaño óptico (opsz), FuentePrincipal lo usa para microajustes */
        font-optical-sizing: auto; 
        
        /* Muy importante para rendimiento */
        font-display: swap; 
    }
    
    /* Variables de Color (Fusión de ambos bloques) */
        :root {
            --color-primary: #1d4ed8; /* Azul principal */
            --color-secondary: #ee3a05; /* Naranja/Rojo Destacado */
            --color-background: #f7f9fb;
            --color-text-dark: #1f2937;
            --color-text-medium: #4b5563;
            /* Variables del footer del Bloque 1 (se mantienen por ser más completas) */
            --color-footer-bg: #374151; 
            --color-footer-text: #e5e7eb;
            --color-footer-title: #fcd34d; 
            
            /* -- Nuevas variables del footer del Bloque 2 (necesarias para la reutilización del footer) */
            --color-footer-text-b2: #d1d5db; /* color 'a' del footer B2 */
            --color-footer-title-b2: #93c5fd; /* color '.footer-title' del footer B2 */
            --color-footer-border-b2: #374151; /* color 'border-top' del copyright B2 */
        }

        /* ------------------ Base ------------------ */
        body {
            font-family: 'FuentePrincipal', sans-serif;
            background-color: var(--color-background);
            color: var(--color-text-dark);
            margin: 0;
            padding: 0;
            /* Se mantiene el line-height del Bloque 1 */
            line-height: 1.6; 
        }
        img {
            max-width: 100% !important;
            height: auto;
            display: block;
            margin-left:auto;
            margin-right:auto;
        }
        .article-card img {
            max-width: 800px !important;
            height: auto;
            display: block;
        }


        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 1.5rem;
        }
        a {
            color: var(--color-primary);
            text-decoration: none;
            transition: color 0.15s ease-in-out;
        }
        a:hover {
            color: var(--color-secondary);
        }
        .footer-grid a {
            color: #fff;
        }
        .footer-grid a:hover {
            color: #fff;
            text-decoration: underline;
        }
        h2 {
            font-size: 2.25rem;
            font-weight: 800;
            margin-bottom: 2rem;
            padding-bottom: 0.5rem;
            border-bottom: 3px solid var(--color-secondary);
        }
        h3 {
            line-height: 1.3;
        }

        /* ------------------ Header y Navegación ------------------ */
        header {
            background-color: #fff;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
            /* Se mantiene el position: sticky del Bloque 1 */
            position: sticky; 
            top: 0;
            z-index: 100;
            /* Nuevo: margin-bottom del Bloque 2 */
            margin-bottom: 2rem;
        }
        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 80px;
        }
        .logo {
            font-size: 1.8rem;
            font-weight: 900;
            color: var(--color-secondary);
            letter-spacing: -0.05em;
        }
        .logo span {
            color: var(--color-text-dark);
            font-weight: 600;
            font-size: 1.3rem;
        }
        nav {
            display: none;
        }
        /* Nuevo: Estilo de enlace de retroceso del Bloque 2 */
        .back-link {
            font-weight: 600;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            transition: background-color 0.2s;
        }
        .back-link:hover {
            background-color: #eef2ff;
        }
        @media (min-width: 1024px) {
            .mobile-menu-button { display: none; }
            nav {
                display: flex;
                align-items: center;
                gap: 0.5rem; 
            }
            .nav-link {
                padding: 0.5rem 1rem;
                border-radius: 0.5rem;
                font-weight: 600;
                color: var(--color-text-medium); 
                transition: all 0.2s;
                position: relative;
            }
            .nav-link:hover {
                color: var(--color-primary);
                background-color: #eef2ff;
            }
            .dropdown {
                position: relative;
                
            }
            .dropdown-content {
                z-index:1000;
                display: none;
                position: absolute;
                top: 100%;
                left: 0;
                margin-top: 5px;
                background-color: #fff;
                border-radius: 0.5rem;
                box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
                border: 1px solid #e0e7ff;
                min-width: 200px;
                z-index: 10;
                padding: 0.5rem 0;
            }
            .dropdown:hover .dropdown-content, .dropdown:focus-within .dropdown-content { 
                display: block; 
            }
            .dropdown-item {
                display: block;
                padding: 0.5rem 1rem;
                font-size: 0.9rem;
                color: var(--color-text-medium);
            }
            .dropdown-item:hover { 
                background-color: #f3f4f6;
                color: var(--color-secondary);
            }
        }

        /* ------------------ Carrusel Hero ------------------ */
        .hero-carousel {
            position: relative;
            height: 400px;
            overflow: hidden;
            /* El .container ya centra el bloque. Mantener el margen vertical. */
            margin: 2rem 0; 
            border-radius: 1rem;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            width: 100%; 
        }
        .carousel-slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            /* Centrado perfecto del contenido vertical y horizontal */
            justify-content: center;
            align-items: center; 
            /*padding: 2rem;*/
            color: #fff;
            opacity: 0;
            transition: opacity 1s ease-in-out;
            text-align: center;
            background-color: var(--color-primary);
        }
        .carousel-slide.active { opacity: 1; }
        .carousel-slide h1 {
            font-size: 3rem;
            font-weight: 900;
            margin-bottom: 1rem;
            line-height: 1.1;
        }
        .carousel-slide p {
            font-size: 1.2rem;
            font-weight: 400;
            /*max-width: 700px;*/
        }
        .hero-button {
            display: inline-block;
            margin-top: 1.5rem;
            background-color: var(--color-secondary);
            color: #fff;
            font-weight: 700;
            padding: 0.75rem 2rem;
            border-radius: 9999px;
            transition: background-color 0.2s;
        }
        .hero-button:hover {
            background-color: #c93003;
        }
        .carousel-dots {
            position: absolute;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 0.5rem;
            z-index: 10;
        }
        .dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.5);
            cursor: poFuentePrincipal;
            transition: background-color 0.3s, transform 0.3s;
        }
        .dot.active {
            background-color: #fff;
            transform: scale(1.2);
        }
        .carousel-slide {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        min-height: 450px; /* Ajusta según tu diseño */
        color: white; /* Asegura que el texto sea blanco sobre fondos oscuros/imágenes */
        padding: 20px;
        transition: opacity 0.5s ease-in-out;
    }

    .carousel-slide.has-image h1, 
    .carousel-slide.has-image p {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.7); /* Sombra para resaltar texto sobre fotos */
    }

    /* Asegurar que el contenedor del carrusel no oculte el fondo */
    #carousel-container {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

        /* ------------------ Páginas Destacadas ------------------ */
        .featured-pages {
            padding: 2rem 0;
            margin-bottom: 3rem;
        }
        .featured-grid {
            display: grid;
            grid-template-columns: repeat(1, 1fr);
            gap: 1.5rem;
        }
        @media (min-width: 768px) {
            .featured-grid { grid-template-columns: repeat(3, 1fr); }
        }
        .featured-card {
            background-color: #fff;
            padding: 1.5rem;
            border-radius: 0.75rem;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
            border-top: 5px solid var(--color-primary);
            transition: transform 0.3s;
        }
        .featured-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        }
        .featured-card h3 {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.75rem;
            color: var(--color-primary);
        }
        .featured-card p {
            color: var(--color-text-medium);
            font-size: 0.9rem;
        }

        .recurso-portada {
            background-color: #fff;
            padding: 1.5rem;
            border-radius: 0.75rem;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
            border-top: 5px solid var(--color-secondary);
            transition: transform 0.3s;
        }
        .recurso-portada:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        }
        .recurso-portada h3 {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.75rem;
            color: var(--color-secondary) !important;
        }
        .recurso-portada p {
            color: var(--color-text-medium);
            font-size: 0.9rem;
        }

/* ------------------ Últimos Artículos ------------------ */
.article-section {
    padding: 2rem 0;
    margin-bottom: 4rem;
}

.article-grid {
    display: grid;
    /* Móviles: 1 columna (100% de ancho) */
    grid-template-columns: 1fr; 
    gap: 2rem;
}

/* Tabletas y Pantallas Grandes (desde 768px en adelante) */
@media (min-width: 768px) {
    .article-grid { 
        /* Pantallas grandes: 2 columnas (50% de ancho cada una aproximadamente) */
        grid-template-columns: repeat(2, 1fr); 
    }
}

.article-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--color-secondary);
    /* Asegura que las tarjetas tengan la misma altura en la misma fila */
    display: flex;
    flex-direction: column;
}

/* Ajuste opcional para que el botón o meta siempre quede al final */
.article-meta {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
}
.article-image img {
    width: 100%;
    max-width: 100% !important; /* Sobrescribe el estilo en línea del HTML */
    height: 200px;
    object-fit: cover; /* Mantiene la proporción recortando los bordes */
    border-radius: 0.5rem;
}

        /* ------------------ Contenido del Post (NUEVO DEL BLOQUE 2) ------------------ */
        .post-content {
            max-width: 850px;
            margin: 0 auto;
            background-color: #fff;
            padding: 2rem;
            border-radius: 0.75rem;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
            margin-bottom: 4rem;
        }
        .post-header {
            margin-bottom: 2rem;
            padding-bottom: 1.5rem; 
            border-bottom: 1px solid #e5e7eb;
        }
        .post-header h1 {
            font-size: 2.2rem;
            font-weight: 900;
            line-height: 1.2;
            margin-bottom: 0.5rem;
            color: var(--color-text-dark);
        }
        .post-meta {
            font-size: 0.9rem;
            color: var(--color-text-medium);
            margin-top: 10px;
        }
        .post-meta span {
            font-weight: 600;
            margin-right: 1rem;
        }

        .post-body p {
            margin-bottom: 1.5rem;
            text-align: justify;
        }

        h2 {
            font-size: 1.8rem;
            margin-top: 2.5rem;
            margin-bottom: 1rem;
            color: var(--color-primary);
            border-bottom: none; 
            padding-bottom: 0; 
        }
    

        .post-body ul {
            list-style: disc;
            padding-left: 20px;
            margin-bottom: 1.5rem;
        }
        .post-body li {
            margin-bottom: 0.5rem;
        }
        .post-body blockquote {
            border-left: 5px solid var(--color-secondary);
            padding: 1rem 1.5rem;
            margin: 2rem 0;
            background-color: #fef3f2; /* Tono muy claro del secundario */
            font-style: italic;
            color: #b91c1c; /* Color oscuro complementario al secundario */
            border-radius: 0.25rem;
        }

        /* Imagen destacada de ejemplo */
        .featured-image-container {
            margin-bottom: 2rem;
            overflow: hidden;
            border-radius: 0.5rem;
        }
        .featured-image-container img {
            width: 100%;
            height: auto;
            display: block;
        }
        .image-caption {
            font-size: 0.85rem;
            color: #9ca3af;
            text-align: center;
            margin-top: 0.5rem;
        }
        
        /* Botón de volver */
        .btn-volver {
            display: inline-block;
            margin-top: 2rem;
            background-color: var(--color-primary);
            color: #fff;
            padding: 0.75rem 1.5rem;
            border-radius: 0.5rem;
            font-weight: 600;
            transition: background-color 0.2s;
        }
        .btn-volver:hover {
            /* Fondo: Cambia al color secundario, como querías */
            background-color: var(--color-secondary);
            /* Color: Aseguramos que el texto siga siendo BLANCO */
            color: #fff; 
        }

        /* ------------------ Footer (Se mantienen los estilos del Bloque 1, se añaden los nuevos) ------------------ */
        footer {
            /* Se mantiene el background-color: var(--color-footer-bg); del Bloque 1 */
            background-color: var(--color-footer-bg); 
            /* Se mantiene el color: var(--color-footer-text); del Bloque 1 */
            color: var(--color-footer-text);
            padding: 2rem 0;
            margin-top: 4rem;
        }
        .footer-grid {
            display: grid;
            grid-template-columns: repeat(1, 1fr);
            gap: 2rem;
        }
        @media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
        .footer-title {
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 1rem;
            /* Se mantiene el color: var(--color-footer-title); del Bloque 1 */
            color: var(--color-footer-title); 
        }
        .footer ul {
            list-style: none;
            padding: 0;
            margin: 0;
            font-size: 0.9rem;
        }
        .footer li { margin-bottom: 0.5rem; }
        .footer a {
            /* Se mantiene el color: var(--color-footer-text); del Bloque 1 */
            color: var(--color-footer-text); 
        }
        .footer a:hover {
            color: var(--color-secondary);
        }
        .copyright {
            padding-top: 1.5rem;
            margin-top: 1.5rem;
            /* Se mantiene el border-top: 1px solid #4b5563; del Bloque 1 */
            border-top: 1px solid #4b5563; 
            text-align: center;
            font-size: 0.85rem;
            color: #9ca3af; 
        }

        /* FIX: Ocultar el menú móvil por defecto en todo momento, se muestra solo con la clase .open en móvil. */
        #mobile-menu {
            display: none;
        }

        /* Responsive Móvil */
        @media (max-width: 1023px) {
            .mobile-menu-button {
                display: block;
                background: none;
                border: none;
                cursor: poFuentePrincipal;
                padding: 10px;
            }
            #mobile-menu {
                /* Centrado perfecto: Fijo, ocupa toda la pantalla (excepto el header) */
                position: fixed; 
                top: 80px; /* Debajo del header fijo */
                left: 0;
                right: 0;
                bottom: 0;
                background-color: #fff;
                box-shadow: 0 4px 5px rgba(0, 0, 0, 0.05);
                padding: 1rem 1.5rem;
                overflow-y: auto; 
                z-index: 90;
            }
            #mobile-menu.open {
                display: block;
            }
            .mobile-link {
                display: block;
                padding: 0.5rem 0;
                border-bottom: 1px solid #f3f4f6;
                font-weight: 600;
                color: var(--color-text-dark);
            }
            .mobile-sublink {
                display: block;
                padding: 0.25rem 1rem;
                border-bottom: 1px solid #f3f4f6;
                font-weight: 600;
                color: var(--color-text-dark);
            }
            .mobile-link:last-child { border-bottom: none; }

            .hero-carousel { height: 300px; }
            .carousel-slide { 
                padding: 1.5rem; /* Ajuste para que el padding lateral sea menor en móviles */
            }
            .carousel-slide h1 { font-size: 2rem; }
            .carousel-slide p { font-size: 1rem; }
        }


        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-group-checkbox {
            margin-bottom: 1.5rem;
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
        }

        .form-group-checkbox input {
            width: auto;
            margin-top: 0.25rem;
        }

        .form-group-checkbox label {
            font-weight: 400;
            font-size: 0.85rem;
            color: var(--color-text-medium);
            cursor: pointer;
        }

        .form-group-checkbox label a {
            color: var(--color-primary);
            text-decoration: underline;
        }
        label {
            display: block;
            font-weight: 600;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }

        input, textarea, select {
            width: 100%;
            padding: 0.8rem;
            border: 1px solid #d1d5db;
            border-radius: 0.5rem;
            font-family: inherit;
            font-size: 1rem;
            box-sizing: border-box;
            transition: border-color 0.2s, ring 0.2s;
        }

        input:focus, textarea:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
        }

        textarea {
            resize: vertical;
            min-height: 120px;
        }

        .btn-submit {
            background-color: var(--color-secondary);
            color: white;
            border: none;
            padding: 1rem 2rem;
            font-size: 1rem;
            font-weight: 700;
            border-radius: 0.5rem;
            cursor: pointer;
            width: 100%;
            transition: background-color 0.2s, transform 0.1s;
        }

        .btn-submit:hover {
            background-color: #c93003;
        }

        .btn-submit:active {
            transform: scale(0.98);
        }

        .message-box {
            margin-top: 1.5rem;
            padding: 1rem;
            border-radius: 0.5rem;
            display: none;
            font-weight: 600;
            text-align: center;
        }

        .message-success {
            display: block;
            background-color: #d1fae5;
            color: var(--color-success);
            border: 1px solid #6ee7b7;
        }

        .message-error {
            display: block;
            background-color: #fee2e2;
            color: var(--color-error);
            border: 1px solid #fca5a5;
        }

        .back-link {
            display: inline-block;
            margin-bottom: 1rem;
            color: var(--color-primary);
            text-decoration: none;
            font-weight: 600;
            font-size: 0.9rem;
        }

        .back-link:hover {
            text-decoration: underline;
        }        

/* Contenedor general */
#contenedor-recursos {
    width: 100%;
    margin-bottom: 50px;
}

/* Título del Tipo (Ocupa toda la línea) */
.titulo-tipo {
    width: 100%;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-secondary, #ee3a05);
    color: var(--color-secondary, #ee3a05);
    font-size: 1.8rem;
    text-transform: uppercase;
}

/* El Grid que contiene los bloques de cada tipo */
.recursos-grid {
    display: grid;
    gap: 25px;
    /* Por defecto: 1 columna (Móvil) */
    grid-template-columns: 1fr; 
    margin-bottom: 30px;
}

/* Estilo de cada tarjeta */
.recurso-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.recurso-imagen img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    margin: 15px 0;
}

/* --- RESPONSIVE --- */

/* Tabletas: 2 columnas */
@media (min-width: 768px) {
    .recursos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Pantallas grandes: 3 columnas */
@media (min-width: 1024px) {
    .recursos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Nivel 3 en el desplegable Desktop */
.dropdown-item.level-3 {
    padding-left: 2.2rem; /* Sangrado extra */
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Nivel 3 en el menú Móvil */
.mobile-sublink-level3 {
    display: block;
    padding: 0.25rem 2.5rem; /* Sangrado extra */
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: var(--color-text-medium);
}