/* Variables de colores basados en tu diseño */
:root {
    --color-fondo: #F6F4EA; /* Crema claro */
    --color-texto: #333333; /* Gris oscuro / Negro */
    --color-dorado: #AE8B5C; /* Bronce / Dorado */
    --color-barra-top: #111111; /* Negro */
    --color-footer-bottom: #E8E5D8; /* Crema más oscuro */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--color-fondo);
    color: var(--color-texto);
}

/* --- CABECERA (HEADER) --- */
.top-bar {
    background-color: var(--color-barra-top);
    height: 12px;
    width: 100%;
}

.main-header {
    background-color: #F6F4EB; /* O el color de fondo institucional que tengas */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Aumentamos el espacio vertical (arriba y abajo) de 10px a 22px */
    padding: 22px 30px; 
}

.logo-container img {
    height: 90px; /* Altura equilibrada para que luzca imponente sin romper el diseño */
    object-fit: contain;
}

.main-nav {
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--color-texto);
    font-weight: 600;
    font-size: 15px; 
    letter-spacing: 1.5px; /* Un poco más de espacio entre cada letra */
    text-transform: uppercase;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--color-dorado);
}

.social-icons {
    display: flex;
    gap: 10px;
}

.social-icons a {
    background-color: var(--color-dorado);
    color: white;
    width: 42px; /* Antes 35px */
    height: 42px; /* Antes 35px */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px; /* Antes 16px */
    transition: background 0.3s;
}

.social-icons a:hover {
    background-color: #92734A;
}

/* --- PIE DE PÁGINA (FOOTER) --- */
.main-footer {
    background-color: var(--color-fondo);
    padding-top: 50px;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 50px;
}

.footer-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0 2% 40px 2%;
    gap: 30px;
}

.footer-col {
    flex: 1;
    min-width: 220px;
}

.footer-col h3 {
    color: var(--color-texto);
    font-size: 18px; /* Antes 16px */
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-dorado);
    display: inline-block;
    padding-bottom: 5px;
}

.footer-col p, .footer-col ul {
    font-size: 16px; /* Antes 14px */
    line-height: 1.8;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li a {
    text-decoration: none;
    color: var(--color-texto);
}

.footer-col i {
    color: var(--color-dorado);
    margin-right: 8px;
    width: 15px;
}

.footer-bottom {
    background-color: var(--color-footer-bottom);
    text-align: center;
    padding: 15px;
    font-size: 13px;
}

/* --- MENÚ DESPLEGABLE (SUBPESTAÑAS) --- */
.main-nav {
    display: flex;
    gap: 45px; /* Antes era 25px. Esto les dará mucho aire */
    align-items: center;
}

.dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 10px; /* Evita que el menú desaparezca rápido al mover el mouse */
    margin-bottom: -10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-fondo);
    min-width: 240px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 100;
    border-top: 3px solid var(--color-dorado);
}

.dropdown-content a {
    color: var(--color-texto);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    text-transform: none; /* Las subpestañas llevan mayúsculas y minúsculas */
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 500;
}

.dropdown-content a:hover {
    background-color: var(--color-footer-bottom);
    color: var(--color-dorado);
}

/* Mostrar el menú al pasar el mouse */
.dropdown:hover .dropdown-content {
    display: block;
}

/* --- CORRECCIÓN PARA COMPUTADORAS (Evitar que las redes bajen) --- */
.header-container {
    flex-wrap: nowrap; /* Fuerza a que todo se quede en una sola línea horizontal */
}

/* --- DISEÑO RESPONSIVO: TABLETS (Pantallas medianas) --- */
@media (max-width: 1024px) {
    .main-nav {
        gap: 15px; /* Reducimos el espacio entre pestañas */
    }
    .main-nav a {
        font-size: 13px; /* Achicamos un poco la letra */
    }
    .logo-container img {
        height: 70px; /* Reducimos el logo un poco */
    }
}

/* --- DISEÑO RESPONSIVO: CELULARES (Pantallas pequeñas) --- */
.header-container {
    flex-wrap: wrap; /* Permitimos que el menú baje si falta espacio */
    row-gap: 20px; /* Da un respiro visual si los elementos saltan de línea */
}

/* --- DISEÑO RESPONSIVO: TABLETS Y PANTALLAS MEDIANAS --- */
@media (max-width: 1200px) {
    .header-container {
        justify-content: center; /* Centra el logo, menú y redes elegantemente */
    }
    .main-nav {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .main-nav a {
        font-size: 14px;
    }
    .logo-container img {
        height: 85px; /* Achicamos ligeramente el logo para que encaje mejor */
    }
}

/* --- DISEÑO RESPONSIVO: CELULARES (Pantallas pequeñas) --- */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column; 
        padding-top: 20px;
        padding-bottom: 20px;
        gap: 20px;
    }
    
    .footer-container {
        flex-direction: column; 
        text-align: center; /* Centra los textos del pie de página */
    }

    .footer-col {
        min-width: 100%; 
        margin-bottom: 20px;
    }
    
    .dropdown-content {
        position: static; /* Evita que los submenús floten y tapen la pantalla */
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var(--color-dorado);
        margin-top: 10px;
        background-color: transparent;
    }
}

/* =========================================
   ESTILOS PARA LA SECCIÓN: RESEÑA HISTÓRICA
   ========================================= */
.resena-hero {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('../img/instituto_fachada.jpeg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 70px 20px;
    margin-bottom: 50px;
}
.resena-hero h1 {
    font-size: 34px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #fff;
}
.resena-hero p {
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
    color: #f0ebd8;
    line-height: 1.6;
}

.resena-container {
    max-width: 1000px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

.seccion-editorial {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    padding: 45px;
    margin-bottom: 40px;
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
    border-left: 5px solid #900000;
}

.editorial-texto {
    flex: 1;
    min-width: 300px;
}

.editorial-texto h2 {
    color: #900000;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.editorial-texto p {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 15px;
    text-align: justify;
}

.editorial-imagen {
    width: 300px;
    text-align: center;
}

.editorial-imagen img {
    width: 100%;
    max-width: 250px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 3px solid #F6F4EB;
}

.linaje-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    padding: 40px;
    text-align: center;
    border-top: 4px solid #AE8B5C;
}

.linaje-box h3 {
    color: #000;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.linaje-box p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

@media (max-width: 768px) {
    .seccion-editorial { flex-direction: column; padding: 25px; }
    .editorial-imagen { width: 100%; }
    .resena-hero h1 { font-size: 26px; }
}

/* =========================================
   ESTILOS PARA LA SECCIÓN: CONSEJO DIRECTIVO
   ========================================= */
.consejo-hero {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('../img/instituto_fachada.jpeg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 70px 20px;
    margin-bottom: 50px;
}
.consejo-hero h1 {
    font-size: 34px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
}
.consejo-hero p {
    font-size: 15px;
    color: #f0ebd8;
    max-width: 600px;
    margin: 0 auto;
}

.consejo-container {
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

/* Cuadrícula para acomodar las 3 personas en columnas ordenadas */
.grid-consejo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    justify-content: center;
}

/* Tarjeta individual de cada directivo */
.card-directivo {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 4px solid #900000;
    transition: transform 0.3s ease;
}
.card-directivo:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

/* Foto en círculo o rectángulo elegante */
.card-foto {
    width: 160px;
    height: 190px;
    margin-bottom: 20px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #F6F4EB;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: #F6F4EB;
    display: flex;
    justify-content: center;
    align-items: center;
}
.card-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Orden vertical solicitado por ti */
.card-cargo {
    color: #900000;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.card-nombre {
    color: #000;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
}

.card-grado {
    color: #AE8B5C;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.card-biografia {
    color: #555;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: justify;
    flex-grow: 1; /* Empuja el correo hacia abajo para que queden alineados */
}

.card-correo {
    font-size: 13px;
    color: #333;
    padding-top: 15px;
    border-top: 1px solid #eee;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.card-correo i {
    color: #900000;
}

/* =========================================
   ESTILOS PARA LA SECCIÓN: MIEMBROS
   ========================================= */
.miembros-hero {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('../img/instituto_fachada.jpeg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 70px 20px;
    margin-bottom: 50px;
}
.miembros-hero h1 {
    font-size: 34px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
}
.miembros-hero p {
    font-size: 15px;
    color: #f0ebd;
    max-width: 600px;
    margin: 0 auto;
}

.miembros-container {
    max-width: 1000px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

/* Tabla de Listado de Miembros */
.tabla-miembros {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border-collapse: collapse;
    overflow: hidden;
}
.tabla-miembros th {
    background-color: #900000;
    color: white;
    padding: 15px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
}
.tabla-miembros td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 14px;
}
.tabla-miembros tr:hover {
    background-color: #fcfbfa;
}

.miniatura-foto {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #F6F4EB;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-ver-perfil {
    background-color: #AE8B5C;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.3s;
    display: inline-block;
    white-space: nowrap;
}
.btn-ver-perfil:hover {
    background-color: #967448;
}

/* Estilos para la vista de Detalle del Miembro (perfil_miembro.php) */
.perfil-container {
    max-width: 900px;
    margin: 50px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 40px;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.perfil-foto-grande {
    width: 300px;
    text-align: center;
}
.perfil-foto-grande img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 3px solid #F6F4EB;
}
.perfil-info {
    flex: 1;
    min-width: 300px;
}
.perfil-cargo {
    color: #900000;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}
.perfil-nombre {
    color: #000;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}
.perfil-grado {
    color: #AE8B5C;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
}
.perfil-bio-titulo {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    border-bottom: 2px solid #F6F4EB;
    padding-bottom: 5px;
}
.perfil-bio-texto {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
    text-align: justify;
}
.perfil-correo {
    font-size: 14px;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #F6F4EB;
    padding: 10px 15px;
    border-radius: 4px;
}
.perfil-correo i {
    color: #900000;
}

@media (max-width: 768px) {
    .perfil-container { flex-direction: column; padding: 25px; }
    .perfil-foto-grande { width: 100%; }
}

/* =========================================
   ESTILOS PARA LA SECCIÓN: MISIÓN Y ORGANIZACIÓN
   ========================================= */
.mision-hero {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('../img/mision_banner.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 70px 20px;
    margin-bottom: 50px;
}
.mision-hero h1 {
    font-size: 34px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
}
.mision-hero p {
    font-size: 15px;
    color: #f0ebd8;
    max-width: 650px;
    margin: 0 auto;
}

.mision-container {
    max-width: 1000px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

/* Tarjetas de Contenido Institucional */
.card-institucional {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    padding: 40px;
    margin-bottom: 30px;
    border-left: 5px solid #900000;
}
.card-institucional h2 {
    color: #900000;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-institucional h2 i {
    color: #AE8B5C;
}

/* Listas ordenadas estéticas */
.lista-fines {
    list-style: none;
    padding: 0;
}
.lista-fines li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.7;
    color: #444;
    text-align: justify;
}
.lista-fines li::before {
    content: "■";
    position: absolute;
    left: 0;
    color: #AE8B5C;
    font-size: 12px;
    top: 2px;
}

/* Grid para Organigrama / Cargos Fundadores */
.grid-organigrama {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.cargo-box {
    background: #F6F4EB;
    border-radius: 6px;
    padding: 20px;
    border-top: 3px solid #AE8B5C;
}
.cargo-titulo {
    font-size: 12px;
    font-weight: 700;
    color: #900000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}
.cargo-nombre {
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

/* =========================================
   ESTILOS PARA LA SECCIÓN: LIBRERÍA
   ========================================= */
.libreria-hero {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('../img/instituto_fachada.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 70px 20px;
    margin-bottom: 50px;
}
.libreria-hero h1 {
    font-size: 34px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
}
.libreria-hero p {
    font-size: 15px;
    color: #f0ebd8;
    max-width: 600px;
    margin: 0 auto;
}

.libreria-container {
    max-width: 900px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    text-align: center;
}

/* Caja de aviso o próximamente */
.aviso-proximamente {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    padding: 50px 30px;
    border-top: 5px solid #AE8B5C;
}
.aviso-proximamente i {
    font-size: 45px;
    color: #900000;
    margin-bottom: 20px;
}
.aviso-proximamente h3 {
    font-size: 22px;
    color: #000;
    margin-bottom: 15px;
    text-transform: uppercase;
}
.aviso-proximamente p {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

 /* =========================================
   BANNER PRINCIPAL PERFECTO (SIN BARRAS NEGRAS)
   ========================================= */
.hero-index {
    position: relative;
    width: 100%;
    height: 480px;
    background-color: #1a1a1a;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* La imagen real adaptada para verse completa y fluida */
.hero-img-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene la proporción cubriendo todo el ancho de forma natural */
    object-position: left center; /* Asegura que el rostro y la figura del personaje queden visibles a la izquierda */
    z-index: 1;
}

/* Capa sutil de sombreado solo detrás del texto para que los letras resalten perfectamente */
.hero-index::before {
    content: "";
    position: absolute;
    top: 0; right: 0; width: 65%; height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 50%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 520px;
    margin-left: auto;
    margin-right: 8%; /* Ubicado cómodamente hacia la derecha */
    text-align: right;
}
.hero-content h2 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 25px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.btn-conocer-mas {
    display: inline-block;
    background-color: #AE8B5C;
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.btn-conocer-mas:hover {
    background-color: #967448;
    transform: translateY(-2px);
}

/* 2. Contenedor General de Secciones */
.home-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}
.home-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #900000;
    text-transform: uppercase;
    margin-bottom: 30px;
    border-bottom: 2px solid #AE8B5C;
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.home-section-title a {
    font-size: 13px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
}
.home-section-title a:hover {
    color: #900000;
}

/* 3. Cuadrículas de Tarjetas (Exactamente 3 columnas para lograr los 6 cuadros: 3x2) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 60px;
}
.card-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    border-top: 3px solid #900000;
}
.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.card-img-container {
    height: 150px;
    background: #eee;
    overflow: hidden;
}
.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.card-fecha {
    font-size: 11px;
    color: #AE8B5C;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.card-titulo-item {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    margin-bottom: 10px;
    flex-grow: 1;
}
.card-enlace {
    font-size: 12px;
    color: #900000;
    font-weight: 600;
    text-decoration: none;
    margin-top: auto;
}
.card-enlace:hover {
    text-decoration: underline;
}

/* 4. Sección de Instituciones Afines (Logos) */
.grid-instituciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    align-items: center;
    margin-bottom: 60px;
}
.logo-afn-box {
    background: white;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid #eee;
    transition: transform 0.3s;
}
.logo-afn-box:hover {
    transform: scale(1.05);
}
.logo-afn-box img {
    height: 50px;
    max-width: 140px;
    object-fit: contain;
}

@media (max-width: 900px) {
    .grid-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .hero-index { justify-content: center; text-align: center; padding: 40px 20px; }
    .hero-content { margin-right: auto; text-align: center; }
    .hero-index::before { background: rgba(0,0,0,0.7); }
    .grid-cards { grid-template-columns: 1fr; }
}

/* =========================================
   ESTILOS PARA LISTADOS PÚBLICOS (ACTIVIDADES Y ARTÍCULOS)
   ========================================= */
.seccion-hero {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('../img/instituto_fachada.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 70px 20px;
    margin-bottom: 40px;
}
.seccion-hero h1 {
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
}
.seccion-hero p {
    font-size: 15px;
    color: #f0ebd8;
}

.public-container {
    max-width: 1100px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

/* Barra de Filtros y Búsqueda */
.filtro-barra {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-top: 4px solid #AE8B5C;
}
.filtro-barra form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}
.filtro-barra input, .filtro-barra select {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    flex: 1;
    min-width: 200px;
}
.btn-buscar {
    background-color: #900000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-buscar:hover {
    background-color: #750000;
}
.btn-limpiar {
    background-color: #eee;
    color: #333;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

/* Tarjetas de Publicaciones (Diseño tipo Blog/Portal) */
.grid-publicaciones {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.pub-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 3px solid #900000;
    transition: transform 0.3s;
}
.pub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.pub-img {
    height: 180px;
    background: #f0f0f0;
    overflow: hidden;
}
.pub-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pub-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.pub-cat {
    font-size: 11px;
    font-weight: 700;
    color: #AE8B5C;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}
.pub-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    margin-bottom: 12px;
}
.pub-autor {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pub-autor img {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
}
.pub-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pub-fecha {
    font-size: 12px;
    color: #888;
}
.btn-leer {
    background-color: #900000;
    color: white;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.3s;
}
.btn-leer:hover {
    background-color: #750000;
}

/* =========================================
   ESTILOS PARA DISEÑO DE PORTAL (2 COLUMNAS + SIDEBAR)
   ========================================= */

/* Contenedor general en formato Grid (Izquierda: Contenido, Derecha: Sidebar) */
.portal-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr; /* Columna principal más ancha y barra lateral */
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

.portal-principal {
    display: flex;
    flex-direction: column;
}

/* Título de la sección tipo cabecera de diario */
.portal-titulo-seccion {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    border-left: 4px solid #900000;
    padding-left: 12px;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

/* Cuadrícula interna de 2 columnas para las tarjetas */
.grid-dos-columnas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

/* Tarjeta individual de estilo periodístico */
.pub-card-portal {
    background: white;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #eaeaea;
    transition: transform 0.2s;
}
.pub-card-portal:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.pub-card-img {
    height: 170px;
    background: #f5f5f5;
    overflow: hidden;
}
.pub-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pub-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.pub-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 10px;
}
.pub-card-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
}
.pub-card-extracto {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
    text-align: justify;
}
.pub-card-btn {
    font-size: 12px;
    font-weight: 600;
    color: #900000;
    text-decoration: none;
    align-self: flex-start;
}
.pub-card-btn:hover {
    text-decoration: underline;
}

/* =========================================
   BARRA LATERAL (SIDEBAR DERECHA)
   ========================================= */
.portal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #eaeaea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.sidebar-widget h3 {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 2px solid #111;
    padding-bottom: 8px;
}

/* Buscador en el Sidebar */
.sidebar-search-form {
    display: flex;
}
.sidebar-search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
}
.sidebar-search-form button {
    background: #900000;
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
}

/* Lista de categorías en el Sidebar */
.sidebar-list {
    list-style: none;
    padding: 0;
}
.sidebar-list li {
    margin-bottom: 10px;
}
.sidebar-list a {
    text-decoration: none;
    color: #444;
    font-size: 13px;
    display: block;
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
    transition: color 0.2s;
}
.sidebar-list a:hover {
    color: #900000;
    padding-left: 4px;
}

/* Últimas actualizaciones mini tarjetas */
.sidebar-mini-post {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}
.sidebar-mini-post:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.sidebar-mini-img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    background: #eee;
}
.sidebar-mini-info h4 {
    font-size: 12px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    margin-bottom: 4px;
}
.sidebar-mini-info span {
    font-size: 11px;
    color: #888;
}

@media (max-width: 900px) {
    .portal-layout { grid-template-columns: 1fr; }
    .grid-dos-columnas { grid-template-columns: 1fr; }
}

/* =========================================
   ESTILOS PARA LA SECCIÓN: CONTACTO
   ========================================= */
.contacto-hero {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), url('../img/instituto_fachada.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 70px 20px;
    margin-bottom: 50px;
}
.contacto-hero h1 {
    font-size: 34px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
}
.contacto-hero p {
    font-size: 15px;
    color: #f0ebd8;
    max-width: 600px;
    margin: 0 auto;
}

.contacto-container {
    max-width: 1100px;
    margin: 0 auto 70px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 40px;
}

/* Tarjeta de Información de Contacto (Izquierda) */
.contacto-info-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    padding: 40px;
    border-top: 5px solid #900000;
}
.contacto-info-box h2 {
    font-size: 20px;
    color: #111;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}
.contacto-info-box p {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 30px;
}
.info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}
.info-item i {
    font-size: 18px;
    color: #AE8B5C;
    margin-top: 3px;
}
.info-item div h4 {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin-bottom: 2px;
}
.info-item div span {
    font-size: 13px;
    color: #666;
}

/* Tarjeta del Formulario (Derecha) */
.contacto-form-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    padding: 40px;
    border-top: 5px solid #AE8B5C;
}
.contacto-form-box h2 {
    font-size: 20px;
    color: #111;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}
.form-grupo {
    margin-bottom: 20px;
}
.form-grupo label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.form-grupo input, .form-grupo textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s;
}
.form-grupo input:focus, .form-grupo textarea:focus {
    outline: none;
    border-color: #900000;
}
.btn-enviar-mensaje {
    background-color: #900000;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s;
    width: 100%;
}
.btn-enviar-mensaje:hover {
    background-color: #750000;
}
.alerta-exito {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    border-left: 4px solid #4caf50;
}

@media (max-width: 900px) {
    .contacto-container { grid-template-columns: 1fr; }
}

/* =========================================
   ESTILOS PARA LOS LOGOS DE INSTITUCIONES AFINES
   ========================================= */

/* Contenedor en cuadrícula general */
.grid-instituciones {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px; /* Espacio generoso entre los logos */
    margin: 30px 0 50px 0;
}

/* La cajita de cada logo: SIN FONDO BLANCO, TOTALMENTE TRANSPARENTE */
.logo-afn-box {
    background: transparent !important; /* Adiós al fondo blanco */
    border: none !important;            /* Adiós a cualquier borde */
    box-shadow: none !important;       /* Adiós a las sombras de caja */
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo-afn-box:hover {
    transform: translateY(-5px); /* Efecto flotante elegante al pasar el cursor */
}

/* El tamaño de los logos: Más grandes y limpios respetando su transparencia PNG */
.logo-afn-box img {
    width: 120px !important;    /* Ancho grande para que destaquen */
    height: 120px !important;   /* Altura proporcional */
    object-fit: contain;        /* Mantiene la proporción sin deformar */
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06)); /* Sombra sutil opcional para dar relieve */
}

/* ========================================================
   ALINEACIÓN Y EXPANSIÓN DE ENCABEZADO Y PIE DE PÁGINA
   ======================================================== */

/* 1. Contenedor del Encabezado */
.header-container {
    max-width: 1400px !important; /* Aumenta el ancho hacia los laterales */
    width: 100%;
    margin: 0 auto;
    padding: 10px 40px !important; /* Distancia uniforme desde los bordes de la pantalla */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* 2. Contenedor del Pie de Página (Footer) */
.footer-container, 
footer .container, 
.pie-container {
    max-width: 1400px !important; /* Mismo ancho exacto que el encabezado */
    width: 100%;
    margin: 0 auto;
    padding: 0 40px !important;    /* Misma separación lateral exacta */
    box-sizing: border-box;
}

/* Distribución uniforme para que el contenido del footer use todo el espacio */
.footer-grid, 
.footer-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr 1.1fr; /* Distribuye las 4 columnas de forma proporcional */
    gap: 30px;
}

/* =========================================
   SUBMENÚS MULTINIVEL (AUTORIDADES)
   ========================================= */

/* Posición relativa en cada nivel padre */
.dropdown-submenu, 
.dropdown-submenu-nested {
    position: relative;
}

/* Nivel 2: Despliegue de Autoridades hacia la derecha */
.dropdown-submenu-content {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.15);
    border-radius: 4px;
    z-index: 1000;
}

/* Nivel 3: Despliegue de los miembros del Consejo Directivo hacia la derecha */
.dropdown-submenu-nested-content {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: #ffffff;
    min-width: 240px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.15);
    border-radius: 4px;
    z-index: 1001;
}

/* Mostrar al hacer hover */
.dropdown-submenu:hover > .dropdown-submenu-content {
    display: block;
}

.dropdown-submenu-nested:hover > .dropdown-submenu-nested-content {
    display: block;
}

/* Enlaces internos de los submenús */
.dropdown-submenu-content a,
.dropdown-submenu-nested-content a {
    color: #333 !important;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.dropdown-submenu-content a:hover,
.dropdown-submenu-nested-content a:hover {
    background-color: #f6f4eb;
    color: #900000 !important;
}