/* Style to make the scroll to links inside the same page go smoother. */
html {
    scroll-behavior: smooth;
}

/* Generic reset for CSS properties.*/
* {
    margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
    overflow-x: auto;
    scrollbar-width: none;
}

/* styles for the main.*/
main{
    background-color: #252d23;
}

/* Styles for the nav-bar and Hero elements.*/
.bgHero{
    background-color: #A07D5D;
    background-image: url('../imgs/heroElement.png');
    background-repeat: repeat; 
    background-size: cover;
    background-position: center center;
    min-height: 60vh;
    min-width: 60vw;
    padding-top: 15px; 
}

.containerHead{
    display: flex;
    gap: 100px;

}

.logo{
    margin-left: 15px;
    flex: 1;
    max-height: 100px;
    max-width: 250px;
}

.nav-bar{
    flex: 2;
    
    padding: 0;
}

.ulNav{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    height: 100px;
    gap: 25px;
}

.liNav a {
    font-size: 18px;
    text-decoration: none;
    color: #ffffff;
}

.hero{
    text-align: center;
}

.hero h1{
    color: #ffffff;
    font-size: 45px;
    line-height: 1.2;
    
    /* Option B: Use a percentage width (best for responsive layouts) */
    width: 50%;
    
    /* Center the block if you used a fixed max-width */
    margin-left: auto;
    margin-right: auto;	
}

.menuB {
    display: none;
}

/* Styles for the main section.*/
    /* Styles for the about us section */
.aboutUsI {
    background-color: #659A5A;
    padding: 10px; 
}

.aboutUsI .container h2 {
    margin-bottom: 15px; 
}

.aboutUsI .container p {
    font-size: 22px;
    max-width: 1300px;
    line-height: 1.6;
    margin-left: 20px;
    text-align: justify;
}

    /* styles for the members section.*/
.membersI{
    background-color: #252d23;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.inv{
    color: white;
}

#contenedor-investigadores .card {
    background-color: #f4f4f4; /* Un gris muy claro, color hueso */
    color: #333;              /* Texto principal en gris oscuro */
    border: none;              /* Opcional: quita el borde para un look más limpio */
    display: flex;
    align-content: center;
    flex-wrap: wrap;
}


#contenedor-investigadores .card-title {
    color: #1a1a1a; /* Un título un poco más oscuro para que resalte */
}

#contenedor-investigadores .card-subtitle {
    color: #555;
}

.card-body {
    text-align: center;
}

#contenedor-investigadores .card-img-top{
    width: 318px;
    height: 400px;
    border-radius: 50%;
    object-fit: cover; 
    margin: 20px auto 10px; 
}


/* Styles for the research and publications.*/
    /* Styles for the research section */
.sectionResearch {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start; 
    flex-wrap: wrap;
    gap: 50px;
    background-color: #659A5A;
    padding: 50px 20px;
}

.research-column,
.publications-column {
    flex: 1 1 400px; 
    max-width: 600px; 
    
    display: flex;
    flex-direction: column;
    align-items: center;

    background-color: rgba(0, 0, 0, 0.15);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.research-column h2,
.publications-column h2 {
    font-size: 2em;
    color: #fff;
    margin-bottom: 25px;
    border-bottom: 2px solid #659A5A;
    padding-bottom: 10px;
    text-align: center;
}

.research-items-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.research-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    border-radius: 8px;
    color: #f0f0f0;
    font-weight: 500;
}

.research-item span{
    max-width: 450px;
}

.modal-open-btn {
    background-color: #659A5A;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-open-btn:hover {
    background-color: #4a7c41;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 1050; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

i {
    font-style: italic;
}

.modal .modal-content {
    background-color: #474747; 
    margin: 10% auto; 
    padding: 30px;
    border-radius: 12px;
    max-width: 800px; 
    width: 80%; 
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

.modal-close-btn {
    color: #bbbbbb;
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s ease;
    width: 44px;  
    height: 44px; 
    display: flex; 
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: #ffffff;
    text-decoration: none;
}

.modal-content h3 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 25px;
    color: #ffffff;
}

.modal-body {
    display: flex;
    gap: 30px;
    align-items: flex-start; 
}

.modal-body img {
    flex-shrink: 0; 
    width: 250px; 
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.modal-body p { 
    font-size: 1em;
    line-height: 1.6;
    color: #dcdcdc;
}

/* Styles for the services section */
.sectionServs {
    display: flex;
    flex-direction: row; /* Mantenemos las columnas en escritorio */
    justify-content: center;
    align-items: flex-start; 
    flex-wrap: wrap; /* Permite que se apilen en móvil */
    gap: 50px;
    background-color: #252d23;
    padding: 50px 20px;
}

.services-column h2{
    font-size: 2em;
    color: #fff;
    margin-bottom: 25px;
    border-bottom: 2px solid #659A5A;
    padding-bottom: 10px;
    text-align: center;
}

button.modal-open-btn {
    justify-content: center;
    display: flex;
    width: 30px;
;
}

#contenedor-servicios {
    width: 100%;
    max-width: 600px;
}

.custom-accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.accordion-title {
    /* Reseteamos los estilos de botón */
    background: none;
    border: none;
    width: 100%;
    padding: 18px 5px;
    cursor: pointer;
    
    /* Flexbox para alinear título e icono */
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    /* Estilos del texto */
    color: #fff;
    font-weight: 600;
    font-size: 1.1em;
    text-align: left;
    transition: background-color 0.3s ease;
}

.accordion-title:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.accordion-icon {
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    position: relative;
    transition: transform 0.3s ease;
}
.accordion-icon::before,
.accordion-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.7);
    transform: translate(-50%, -50%);
}

.accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: transform 0.3s ease;
}

.accordion-content {
    max-height: 0; 
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    color: #cccccc;
    font-size: 0.95em;
    line-height: 1.6;
}

.accordion-content p {
    padding: 0 5px 18px 5px; 
}

.custom-accordion-item.active .accordion-title {
    color: #a3d996;
}

.custom-accordion-item.active .accordion-icon::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

.custom-accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

.custom-accordion-item.active .accordion-content {
    max-height: 200px; 
}

.sectionNews {
    background-color: #659A5A;
    padding: 50px 20px;
    text-align: center;
}

.sectionNews h2 {
    font-size: 2.5em;
    color: white;
    margin-bottom: 40px;
    border-bottom: 2px solid #659A5A;
    padding-bottom: 10px;
}

#twitter-feed-container {
    max-width: 600px; /* ✅ Ancho máximo para hacerlo más pequeño */
    margin: 0 auto; /* ✅ Centra el contenedor horizontalmente */
    background-color: #4a7c41; /* ✅ Fondo verde oscuro */
    padding: 20px; /* ✅ Espacio interno */
    border-radius: 12px; /* ✅ Bordes redondeados */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* ✅ Sombra sutil */
    overflow: hidden; /* Asegura que cualquier cosa que sobresalga se corte */
}

/* Styles for the pubs section.*/
.publications-column #contenedor-publicaciones {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 600px;
}

.publications-column .publication-item a {
    display: block;
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 18px 5px;
    text-decoration: none;
    transition: background-color 0.3s ease; 
}

.publications-column .publication-item a:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.publications-column .publication-item .publication-title {
    color: #fff;
    font-weight: 600;
}

.publications-column .publication-item .publication-meta {
    display: block;
    color: #cccccc;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 5px;
}

.btn-ver-todos {
    display: block;
    width: fit-content;
    margin: 30px auto 0;
    padding: 10px 25px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-ver-todos:hover {
    background-color: #f4f4f4;
    color: #252d23;
    border-color: #f4f4f4;
}

.publication-item .publication-authors {
    color: #a3d996; /* Un verde claro para que resalte */
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 8px;
    font-style: normal; /* Asegura que no sea itálica como el meta */
}

/* Styles for the contact Section.*/
.contactS{
    display: flex;
    flex-direction: row;
    gap: 100px;
    
    /* Puts the content at the top and manages spacing between columns */
    align-items: flex-start; 
    justify-content: space-between; 
    
    padding: 40px; /* Add some overall padding (adjust as needed) */

}

.contactLinks{
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-left: 30px;
}

.containerContactLinks{
    display: flex;
    flex-direction: column;
}

.infoContact{
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 200px;
    gap:5px;
    flex-basis: 350px; /* Gives a fixed minimum width to the contact column */
    flex-shrink: 0;
    

}

.contactTitle{
    margin-left: 15px;
    margin-bottom: 20px;
    font-size: 2em; 
}

.iframeContainer {
    /* 1. Limiter (from previous steps) */
    max-width: 800px; /* Limits the max width of the map on large screens */
    flex-grow: 1; 
    width: 100%; 
    
    /* 2. SET A FIXED HEIGHT */
    height: 250px; /* Set a specific height in pixels (adjust this value!) */
    
    /* Reset all position/padding to let the fixed height work */
    position: relative;
    padding-bottom: 0; /* Ensures the proportional padding is gone */
    
    overflow: hidden; 
}

/* The iframe itself */
.iframeContainer iframe {
    /* Ensures the iframe fills the 400px tall container */
    width: 100%;
    height: 100%; 
    
    /* Reset position rules used for the padding trick */
    position: static; /* Or you can keep it as 'absolute' if you prefer */
    top: auto;
    left: auto;
    border: none;
}

.anchorMail{
    text-decoration: none;
    color: white;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.anchorTwitter{
    text-decoration: none;
    color: white;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.anchorTwitter:hover, .anchorMail:hover, .anchorD:hover {
    text-decoration: underline;
    color: lightgreen;
}

.bgColor{
    background-color: #1b201a;
    color: white;
}

.anchorD{
    text-decoration: none;
    color: white
}

/* Media queries */
/* --- PARA PANTALLAS GRANDES --- */
@media (max-width: 1024px){
    .containerHead {
        gap: 10px;
    }

    .ulNav{
        height: 60px;
        padding: 0;
    }

    li.liNav {
        text-align: center;
        overflow: clip;
    }

    h4#researcher-modal-title {
        overflow: hidden;
    }

    .research-item span {
        max-width: 330px;
    }
    
    .research-item{
        gap: 7px;
    }

    i.bi.bi-geo-alt {
        width: 37px;
    }
}

/* --- PARA TABLETS Y PANTALLAS MEDIANAS--- */
@media (max-width: 992px) {
    .logo {
        margin-left: 0;
        max-height: 100px;
        max-width: 170px;
    }

    h4#researcher-modal-title {
        overflow: hidden;
    }
    
    .hero h1 {
        font-size: 38px;
        width: 80%; 
    }

    .containerHead {
        gap: 0;
    }

    .ulNav {
        padding-left: 0;
        gap: 0;
        height: 60px;
    }

    .liNav a {
        font-size: 14px
    }

    li.liNav {
        max-width: 84px;
    }

    .sectionServs, .contactS {
        flex-direction: column; 
        align-items: center;
    }

    .services-column,
    .publications-column,
    .infoContact,
    .iframeContainer {
        width: 90%;
        max-width: 600px;
        flex-basis: auto;
    }
    
    .contactS {
        gap: 40px;
    }
    #contenedor-investigadores.researcher-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 700px;
    }
}

/* --- PARA MÓVILES --- */
@media (max-width: 767px) {
    .anchorD:hover{
        text-decoration: underline;
        color: lightgreen;
    }

    i.bi.bi-geo-alt {
        width: 40px;
    }
    
    span#researcher-modal-close-btn {
        width: auto;
    }

    span#modal-close-btn {
        top: 3px;
        right: 3px;
    }

    button.modal-open-btn {
        font-size: 2rem;
        width: 100px;
        height: 40px;
        align-content: center;
        flex: 0.3;
    }

    span.accordion-title-text {
        max-width: 200px;
    }

    .research-item{
        gap: 5px;
    }

    .accordion-icon{
        width: 1.2rem
    }

    footer.d-flex.flex-wrap.justify-content-between.align-items-center.py-3.border-top.bgColor {
        gap: 10px;
    }

    p.col-md-4.mb-0.text-body-light.mx-5 {
        margin-left: 1rem !important;
    }

    span.research-title {
        flex: 2;
    }

    .menuB {
        display: flex;
        align-items: center;
        justify-content: end;
        width: 44px;
        height: 44px;
        padding: 0;
        
        margin-left: auto;
        margin-right: 0;

        background: none;
        border: none;
        color: white;
        font-size: 2.1rem;
        cursor: pointer;    
        z-index: 1001;
        transition: transform 0.3s ease;
    }

    .menuB.active {
        transform: rotate(90deg);
    }

    .nav-bar {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        height: auto;
        backdrop-filter: none; 
    }

    .containerMedia{
        display: flex;
    }

    .nav-bar.active {
        max-height: 1000px;
    }

    .ulNav {
        flex-direction: column;
        width: 100%;
        align-items: center;
        padding: 20px;
        gap: 15px;
        height: auto;
    }

    .liNav a {
        font-size: 20px;
        color: #f97e04;
    }
    
    .containerHead {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 20px; 
        padding: 0 15px; 
    }

    .logo {
        max-width: 150px;
        margin: 0;
    }
    
    .logo img {
        width: 100%;
        height: auto;
    }

    .bgHero {
        background-image: url('../imgs/heroElement-mobile.png');
        position: relative; /* Permite posicionar el menú desplegable debajo */
        min-height: auto; /* Dejamos que la altura se ajuste al contenido */
        padding-bottom: 20px; /* Espacio inferior */
    }

    .hero h1 {
        font-size: 28px;
        width: 90%;
    }

    .aboutUsI .container p {
        font-size: 16px;
        text-align: center;
    }

    #contenedor-investigadores.researcher-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }


    .services-column h2,
    .publications-column h2,
    .contactTitle {
        font-size: 1.8em;
    }

    .modal-content {
        width: 90%;
        margin: 15% auto;
        padding: 20px;
    }

    .modal-body {
        flex-direction: column; 
        align-items: center; 
    }
    
    .modal-body img {
        width: 100%;
        max-width: 300px;
        margin-bottom: 20px;
    }
    
    .modal-body p {
        text-align: center;
    }

    #contenedor-investigadores.researcher-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil */
        max-width: 400px;
    }
}

#team { 
    background-color: #252d23;
    padding: 50px 0;
}

#team h2 {
    color: white;
    text-align: center;
    margin-bottom: 40px;
}

.researcher-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px; 
    justify-items: center; 
    max-width: 900px;
    margin: 0 auto;
}

.researcher-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 15px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.researcher-card:hover,
.researcher-card:focus { 
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    outline: 2px solid #a3d996; 
}

.researcher-card img {
    width: 100px; 
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.2); 
}

.researcher-name {
    color: #f0f0f0;
    font-weight: 600;
    font-size: 1.1em;
}