* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #192734;
    --secondary-color: #008d81;
    --accent-color: #00a693;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center; 
}

/* Desktop: Logo a la izquierda, Texto Centrado, Gran Separación */
.header-content {
    display: flex;
    align-items: center; 
    justify-content: center; 
    gap: 60px; 
    width: fit-content; 
    margin: 0 auto; 
}

/* Estilo para el enlace que contiene solo el logo */
#header-home-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-shrink: 0; 
}

.header-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; 
}

.header-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center; 
    margin-bottom: 0.5rem; 
}

.header-logo {
    width: 120px; 
    height: 120px;
    border-radius: 50%;
    margin-right: 0; 
    flex-shrink: 0; 
    cursor: pointer; /* Indica visualmente que es clickeable */
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0; 
}

.header i {
    margin-right: 0.5rem;
}

/* Sección de Subtítulo*/
.header-description-section {
    background-color: var(--card-background); 
    padding: 2rem 0; 
    text-align: center; 
    color: var(--text-primary); 
    font-size: 1.3rem; 
    font-weight: 500; 
    border-top: 1px solid var(--border-color); 
    box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.1); 
}

.header-description-section p {
    margin: 0; 
}


/* Main */
.main {
    padding: 2rem 0;
}

/* Grid de Docentes */
.docentes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.docente-card {
    display: block; 
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    text-decoration: none; 
    color: inherit; 
}

.docente-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.docente-card:focus { 
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.docente-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.docente-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-color);
}

.docente-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.docente-profesion {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.docente-especialidad {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.docente-body {
    padding: 1.5rem;
}

.docente-estudios {
    margin-bottom: 0;
}

.docente-estudios h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.estudios-list {
    list-style: none;
    padding-left: 1rem;
}

.estudios-list li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    position: relative;
}

.estudios-list li::before {
    content: "•";
    color: var(--secondary-color);
    position: absolute;
    left: -1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- DETALLE DEL DOCENTE --- */
.docente-detalle-section {
    padding: 2rem 0;
    min-height: 80vh;
}

.clear-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn {
    margin: 1rem 0 2rem 0 !important;
    background: var(--primary-color);
    width: auto;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn:hover {
    background: var(--text-primary);
}

#detalle-content {
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.detalle-header-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.detalle-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--secondary-color);
    transition: transform 0.3s ease;
}
.detalle-avatar:hover {
    transform: scale(1.02);
}

.detalle-info-principal h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
    line-height: 1.2;
}

.detalle-profesion {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Contenido en dos columnas */
.detalle-cuerpo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding-top: 1rem;
}
.detalle-columna {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.detalle-seccion {
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border-left: 5px solid var(--accent-color);
}

.detalle-seccion h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Estilo para la biografía */
.docente-biografia {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0;
    text-align: justify; 
}

/* Publicaciones Relevantes y Datos Adicionales */
.detalle-seccion-full-width {
    grid-column: 1 / -1; 
    margin-top: 2rem;
}

.publicaciones-relevantes-list {
    list-style: none;
    padding: 0;
}

.publicaciones-relevantes-list li {
    margin-bottom: 1rem;
    padding-left: 0;
    line-height: 1.5;
    position: relative;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.75rem;
}
.publicaciones-relevantes-list li:last-child {
    border-bottom: none;
}

.publicacion-fuente {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--primary-color); 
    color: white;
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between; 
    gap: 30px;
    flex-wrap: wrap; 
}

.footer-column {
    flex: 1; 
    min-width: 250px; 
}

.footer h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--accent-color); 
}

.footer-info p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* Lista de Contacto */
.footer-contact ul {
    list-style: none;
    padding: 0;
}

.footer-contact ul li {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
}

/* ESTILOS CLAVE PARA LOS ENLACES DE CONTACTO (Mapa, WhatsApp, Correo) */
.footer-contact ul li a {
    color: white; 
    text-decoration: none; 
    display: flex; 
    align-items: flex-start;
    transition: color 0.3s;
    width: 100%; 
}

.footer-contact ul li a:hover {
    color: var(--accent-color); 
}

/* Estilo base de los íconos de contacto (espaciado) */
.footer-contact ul li i {
    margin-right: 10px;
    min-width: 35px; 
    text-align: center;
    color: var(--secondary-color);
    font-size: 1.5rem; 
}

/* Ícono de Google (Mapa) - Color de Marca */
.footer-contact ul li .fab.fa-google {
    color: #DB4437; 
}

/* Ícono de WhatsApp (Marca) */
.footer-contact ul li .fab.fa-whatsapp {
    color: #25D366; 
}

/* Ícono de Correo (Color de Marca) */
.footer-contact ul li .fas.fa-envelope {
    color: #4285F4; 
}


/* Enlaces Sociales (Facebook, Instagram) */
.social-links a {
    color: white;
    font-size: 2rem;
    margin-right: 15px;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent-color); 
}

/* DERECHOS DE AUTOR*/
.footer-copyright {
    padding-top: 20px; 
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
    text-align: center; 
    margin-top: 30px; 
}

.footer-copyright p {
    font-size: 0.9rem;
    opacity: 0.6; 
    margin: 0;
}

/* Responsive */
@media (max-width: 992px) {
    /* Las columnas del detalle pasan a ser una sola columna */
    .detalle-cuerpo {
        grid-template-columns: 1fr;
    }
    
    /* Agregamos una separación adicional entre las secciones apiladas en tablet */
    .detalle-seccion-full-width {
        margin-top: 1.5rem; 
    }
}

@media (max-width: 768px) {
    
    /* 1. Ajuste clave: Reducir el padding del contenedor general para ganar espacio en los lados */
    .container {
        padding: 0 10px; 
    }

    /* 2. Reducir el padding interno de la caja de detalle principal (#detalle-content) */
    #detalle-content {
        padding: 1.5rem; 
    }

    /* 3. Reducir el padding de las secciones internas (Semblanza, Formación, etc.) */
    .detalle-seccion {
        padding: 1rem; 
    }
    
    .detalle-header-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .detalle-info-principal h2 {
        font-size: 2rem;
    }
    .detalle-profesion {
        font-size: 1.2rem;
    }
    .detalle-avatar {
        width: 120px;
        height: 120px;
    }


    /* Header en móvil */
    .header-content {
        flex-direction: column; 
        text-align: center;
        gap: 15px; 
        width: 100%; 
        margin: 0 auto; 
    }
    .header-logo {
        width: 100px; 
        height: 100px;
        margin-bottom: 0; 
    }
    .header-text-wrapper {
        align-items: center; 
        width: 100%; 
    }
    .header h1 {
        font-size: 2rem; 
    }

    /* Subtítulo en móvil */
    .header-description-section {
        padding: 1rem 0; 
        font-size: 1.1rem; 
    }

    /* Footer en móvil */
    .footer-content {
        flex-direction: column; 
        text-align: center;
    }
    .footer-column {
        min-width: 100%;
        margin-bottom: 2rem;
    }
    .footer-contact ul li {
        justify-content: center; 
    }
    .footer-contact ul li a {
        justify-content: center;
    }
    .social-links {
        text-align: center;
    }
}