.mulish-font {
  font-family: "Mulish", sans-serif;
  font-optical-sizing: auto;
  font-weight: 20px;
  font-style: normal;
}


body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: large;
}
body p {
    color: #444;
}

.fondo-transparente {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/*******************/
/* MENÚ HORIZONTAL */
/*******************/
nav {
    display: flex;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 100px;
    font-size: clamp(12px, 2vw, 17px);
    padding-right: 20px;
}

/* Logo */
#logo-lab {
    width: 100px;
    margin: 10px;
}

/* Bot n hamburguesa */
#menu-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    margin-left: auto;
    padding: 10px;
    color: black;
}

/* Men  principal */
nav ul {
    list-style: none;
    margin: 0;
    margin-bottom: 10px;
    padding: 0;
    display: flex;
    margin-left: auto;
}

/* Items */
nav ul li {
    position: relative;
    
}

nav ul li a {
    display: block;
    padding: 15px 20px;
    color: black;
    text-decoration: none;
}

/* Hover */
nav ul li:hover {
    background-color: rgba(58, 142, 142, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Submen  */
nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: rgba(31, 78, 78, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Subitems */
nav ul li ul li a {
    padding: 10px;
    color: white;
}

/* Mostrar submen  */
nav ul li:hover ul {
    display: block;
}

/* Hover submenú  */
nav ul li ul li:hover {
    background-color: rgba(17, 43, 43, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/*******************/
/*   RESPONSIVE    */
/*******************/
@media (max-width: 1050px) {

    nav {
        flex-wrap: wrap;
	font-size: 20px;
	padding-bottom: 12px;
    }

    #menu-toggle {
        display: block;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        display: none;
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        padding: 15px;
        border-top: 1px solid #444;
    }

    /* Submen s en m vil */
    nav ul li ul {
        position: static;
    }

    nav ul li:hover ul {
        display: none; /* quitamos hover en m vil */
    }
    /* Submen s ocultos en m vil */
    nav ul li ul {
        display: none;
    }

    /* Clase para mostrar submen  */
    nav ul li.open > ul {
        display: block !important;
    }
}


/* Para que el men  de enlaces no se pegue al login */
nav ul {
    margin-left: auto;
}

/* Cabecera */
.cabecera {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    justify-content: center;
}

/* A adimos esto para que se lea bien la letra */
.distinto, .user-info {
    color: #174a48;
}
.distinto div {
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Dimensiones fijas */
    
    
    /* Espacio interno para que el logo no toque los bordes */
    padding: 40px; 
    
    /* Centrado en la pantalla */
    margin: 0 auto 20px auto; 
}
.distinto div img {
    width: 300px; 
    height: 350px;
}
.distinto div img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
.distinto div h1 {
    font-size: 50px;
}
.black{
    color: #36373a;
}

/* Contenido */
.contenido {
    text-align: center;
    align-items: center;
    margin: 0;
    padding: 20px;
    background-color: white;
}
.contenedor-flex {
    display: flex;
    align-items: center; /* Centra verticalmente la imagen con el texto */
    justify-content: center;
    gap: 40px; /* Espacio entre el texto y la foto */
    flex-wrap: wrap; /* En m viles, la foto bajar  autom ticamente debajo del texto */
    margin-bottom: 50px;
}

.contenido button {
    padding: 10px 20px;
    background-color: #2ebcfc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;

}

.img-principal{
    padding: 20px;
    width: 1000px;
    max-width: 600px;
}
.imis-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 20px;
    max-width: 1200px;
    margin: 40px auto;
}

.imis-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.imis-right {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 1rem;
}

.imis-photo {
    width: 400px;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
}

.imis-bottom-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
}

.imis-btn {
    background: #3a3a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
}
.imis-map {
    height: 300px;
    width: 400px;
    overflow: hidden;
    border-radius: 8px;
}

/* Este estilo es para cada tarjeta */
/* Contenedor principal con Grid */
.grid-container {
    display: grid;
    /* Divide el contenedor en 3 columnas iguales y ocupa todo el ancho */
    grid-template-columns: repeat(3, 1fr);
    gap: 25px; /* Espacio de separaci n entre columnas y filas */
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Tarjetas individuales */
.card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Ajuste de la imagen */
.card img {
    width: 90%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    margin: 0 auto 15px auto;
    display: block
    ñ,;
}

/* Tipograf a */
.card h3 {
    font-size: 1.4rem;
    color: #222222;
    margin-bottom: 8px;
}

.card p {
    font-size: 0.95rem;
    color: #666666;
    line-height: 1.4;
}

.card:hover{
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.card a {
    color: #108585;
    text-decoration: none;
    font-weight: 500;
    margin-top: auto; /* Empuja el enlace hacia abajo */
}

.card a:hover {
    color:rgb(0, 196, 196)
}

/* Adaptabilidad para pantallas peque as (m viles) */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr; /* Las tarjetas se apilan una debajo de otra */
    }
}
.btn-login {
    background-color: #007bff;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-login:hover {
    background-color: #0056b3;
}

.btn-logout {
    background-color: #dc3545;
}

.btn-logout:hover {
    background-color: #bd2130;
}

.user-info {
    color: white;
    margin-left: 15px;
    font-size: 0.9em;
}
.media {
    display: flex;
    gap: 20px;
    margin: 20px;
    color: white;
    margin: 0px;
    padding: 3px;
    padding-left: 20px;
    background-color: #1f4f4f;
}
.media img {
    width: 24px;
    height: 24px;
    margin: 0px;
    padding-right: 10px;
}
.media a {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 0.9em;
}
.media a:hover {
    color: #2ebcfc;
}
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background-color: #000000; /* Fondo negro base para evitar destellos blancos */
}
#background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5); /* Capa negra al 40% de opacidad */
    z-index: 2;
}

/* Esta clase es la clave: permite que el JS controle el desvanecido */
.bg-media {
    position: absolute; /* Importante: permite que se encimen una sobre otra */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Por defecto invisibles */
    transition: opacity 1.5s ease-in-out; /* El efecto de "poco a poco" */
}

/* Cuando el JS a ade esta clase, la imagen aparece suavemente */
.bg-media.visible {
    opacity: 1;
}



/* Aseguramos que la cabecera y el contenido tengan fondo transparente 
   o colores que permitan ver el fondo din mico */
.cabecera, .contenido {
    position: relative;
    z-index: 1;
}

/* Estilo para el formulario */
.form-container {
    gap: 2rem;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 20px;
    max-width: 1200px;
    margin: 40px auto;
}
.contact-form {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 30px;
    background: #fff;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.contact-form label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #555;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    padding: 14px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: #f5f5f5;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: #888;
    background: #fff;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #aaa;
}

.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form button {
  padding: 16px;
  background: #345e5c;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
}

.contact-form button:hover {
  background: #77a9a9;
}

/* Estilo del pie de p gina */
footer {
  background: white;
  padding: 20px 10px; /* Un poco m s de aire arriba y abajo */
}

.footer-grid {
  display: flex;
  align-items: center; /* Alinea verticalmente logos y texto */
  justify-content: space-around;
  gap: 10px;
}

/* Estilo general para las celdas */
.footer-item {
  flex: 1;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* EL SEGUNDO LOGO (UGR): Es el 3er hijo porque los divisores cuentan */
.footer-item:nth-child(3) {
  flex: 2; /* Ocupa el doble de espacio */
}

/* Ajustes para los enlaces */
.footer-item a {
  color: black;
  text-decoration: none;
  /* Fuente fluida: m nimo 12px, ideal 1.5% del ancho, m ximo 18px */
  font-size: clamp(12px, 1.5vw, 18px); 
  line-height: 1.2;
}

/* Control de las im genes/logos */
.footer-item img {
  width: auto;
  max-width: 100%; /* No se desborda de su celda */
  height: auto;
  max-height: 80px; /* Evita que logos muy altos rompan el dise o */
  object-fit: contain;
}

/* Ajuste espec fico para que la imagen del segundo logo sea notablemente m s grande */
.footer-item:nth-child(3) img {
  max-height: 120px; /* Le damos m s margen de altura que a los dem s */
  max-width: 350px; 
}

/* Las l neas divisorias */
.footer-divider {
  width: 2px; /* Un poco m s fina suele quedar m s elegante */
  height: 90px; /* Altura fija para que no cruce todo el footer */
  background: #345e5c;
  align-self: center;
}

/* El copyright de abajo */
.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #eeeeee;
  font-size: 13px;
  color: #666;
}

/* Responsivo: Si la pantalla es muy peque a, los ponemos uno debajo de otro en el footer */
@media (max-width: 600px) {
  .footer-grid {
    flex-direction: column;
    gap: 20px;
  }
  
  .footer-divider {
    display: none; /* Escondemos las l neas en m vil */
  }
  
  .footer-item a {
    font-size: 16px; /* Texto m s legible en m vil */
  }
}

/* Esto es para organizar correctamente el contenido de la p gina team */
.contenido-team {
    align-items: center;
    margin: 0;
    padding: 20px;
    background-color: white;
    position: relative;
    z-index: 1;
}
.contenido-team button {
    padding: 10px 20px;
    background-color: #2ebcfc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;

}

/* Tarjetas individuales de profesores */
.card-proffesor {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #1f4f4f;
    padding: 20px;
    text-align: center;
    align-items: center;
    display: flex;
    flex-direction: column;
}

/* Ajuste de la imagen */
.card-proffesor img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 15px;
}

/* Tipograf a */
.card-proffesor h3 {
    margin-bottom: 8px;
    height: 50px;
}

.card-proffesor p {
    color: #666666;
    line-height: 1.4;
}

.card-proffesor:hover{
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.card-proffesor a {
    color: #108585;
    text-decoration: none;
    margin-top: auto; /* Empuja el enlace hacia abajo */
}

.card-proffesor a:hover {
    color:rgb(0, 196, 196)
}
.card-proffesor main{
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border-radius: 20px;
    background: linear-gradient(to bottom, #1f4f4f, #ffffff);
    box-sizing: border-box;
}

/* Esta clase es para el contenedor de los postdocs */
.postdoc {
    display: flex;
    flex-direction: column;
    margin: 20px;
}
.postdoc div{
    height: 200px;
    display: flex;
}
.postdoc div img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}
.postdoc .texto {
    margin-left: 20px;
    padding-top: 50px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.postdoc div .texto * {
    margin: 0;
}

/* Contenedor para el que esten las 4 imagenes de las personas opcupando una fila */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px;
}
.grid-4 div {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.grid-4 div p {
    text-align: center;
}
.grid-4 div img {
    width: 60%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
}
.card-project {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.card-project img {
    width: 100%;
}
.card-project div:nth-child(2) {
    border: 2px solid #108585;
    padding: 10px;
    border-radius: 30px;
    max-width: 600px;
}
.card-project div table {
    width: 100%;
}
.card-project div table * {
    padding-left: 20px;
    padding-right: 20px;
}
@media (max-width: 800px) {
    .card-project {
        grid-template-columns: 1fr;
    }
}

.card-mission {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.card-mission p {
    padding-right: 20px;
}
.card-mission img {
    width: 100%;
    max-width: 600px;
    justify-self: end;
    margin-right: 5%;
}
@media (max-width: 800px) {
    .card-mission {
        grid-template-columns: 1fr;
    }
    .card-mission img {
        justify-self: center;
        margin-right: 0;
    }
}
.grid-5{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 20px;
}
@media (max-width: 800px) {
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 500px) {
    .grid-5 {
        grid-template-columns: 1fr;
    }
}
.card-research {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}
.card-research img {
    width: 15vw;
    max-width: 200px;
    justify-self: center;
    margin: 0 auto;
}

/********************************/
/* PUBLICATIONS */
/********************************/

/********************************/
/* PUBLICATIONS                 */
/********************************/

/* Variables solo para publicaciones */
.pub-wrapper {
  --border:       #e2ddd6;
  --text-main:    #174a48;
  --text-authors: #4c4a47;
  --text-muted:   #7a7773;
  --accent:       #1a56db;
  --accent-hover: #1740a8;
  --badge-bg:     #1a56db;
  --badge-text:   #ffffff;
  --shadow:       0 1px 2px rgba(0,0,0,.06), 0 3px 12px rgba(0,0,0,.07);
  --radius:       5px;
  --ease:         0.16s ease;
  background-color: white;
  margin: 0 auto;
  padding: 52px 28px 96px;
  box-sizing: border-box;
}

/* T tulo principal */
.pub-main-title {
  margin-bottom: 44px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  color: var(--text-main);
}

/* Bloque de a o */
.pub-year-block {
  margin-bottom: 52px;
}

.pub-year-heading {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

/* Lista */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/*  tem */
.pub-item {
  display: grid;
  grid-template-columns: 26px 90px 1fr;
  column-gap: 18px;
  padding: 22px 6px 22px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  box-sizing: border-box;
}
.pub-item:first-child {
  border-top: 1px solid var(--border);
}

/* N mero */
.pub-num {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  padding-top: 1px;
  text-align: right;
  user-select: none;
  margin: 0;
}

/* Portada */
.pub-cover-col {
  width: 90px;
}

.pub-cover {
  display: block;
  width: 90px;
  height: 115px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--border);
  margin: 0;
}

.pub-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 115px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, #bfdbfe 0%, #6366f1 100%);
  font-size: 1.8rem;
  box-shadow: var(--shadow);
}

/* Contenido */
.pub-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pub-authors {
  font-size: 0.82rem;
  color: var(--text-authors);
  font-weight: 300;
  line-height: 1.45;
  margin: 0;
}

.pub-title-line {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--text-main);
  letter-spacing: -0.008em;
  margin: 0;
}

.pub-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 3px;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
  position: relative;
  top: -1px;
}

.pub-journal-line {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}
.pub-journal-line em { font-style: italic; }

/* Acciones */
.pub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 10px;
  margin-top: 5px;
}

.pub-action-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--ease);
}
.pub-action-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.pub-sep {
  color: var(--border);
  font-size: 0.85rem;
  user-select: none;
}

.pub-tags-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Barra de controles */
.pub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  align-items: center;
}

.pub-search-input {
  flex: 1 1 220px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  background: #fafaf9;
  outline: none;
  transition: border-color 0.16s ease;
}
.pub-search-input:focus {
  border-color: var(--accent);
  background: #fff;
}
.pub-search-input::placeholder {
  color: var(--text-muted);
}

.pub-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  background: #fafaf9;
  outline: none;
  cursor: pointer;
  transition: border-color 0.16s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.pub-select:focus {
  border-color: var(--accent);
  background-color: #fff;
}

@media (max-width: 560px) {
  .pub-controls {
    flex-direction: column;
  }
  .pub-search-input,
  .pub-select {
    width: 100%;
    box-sizing: border-box;
  }
}

/* T tulo clicable cuando hay enlace */
.pub-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.16s ease;
}
.pub-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Estados loading/error */
.pub-loading,
.pub-error {
  text-align: center;
  padding: 72px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.pub-error { color: #dc2626; }

/* Responsive */
@media (max-width: 560px) {
  .pub-item {
    grid-template-columns: 22px 70px 1fr;
    column-gap: 12px;
  }
  .pub-cover-col { width: 70px; }
  .pub-cover { width: 70px; height: 90px; }
  .pub-cover-placeholder { width: 70px; height: 90px; }
  .pub-title-line { font-size: 0.93rem; }
}

/*************************/
/* CONTENIDO LABORATORIO */
/*************************/
.contenido-lab {
    align-items: center;
    margin: 0;
    padding: 20px;
    background-color: white;
    position: relative;
    z-index: 1;
}

.contenido-lab div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 90%;
    max-width: 1200px;
    margin-left: 20px;
    gap: 20px;
    justify-content: center;
}
.contenido-lab div img {
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    justify-self: center;
}
.social-media {
    color : #174a48;
    font-size: 1.5em;
}
.social-media img {
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
}
.social-media a {
    color: #174a48;
    text-decoration: none;
    padding: 0;
    margin: 0;
}
.social-media a:hover {
    color: #2ebcfc;
}


/************************************************************/
/* RESPONSIVE M VIL   SOLO MODO VERTICAL (portrait)         */
/* En horizontal la web no cambia nada                      */
/************************************************************/

@media (max-width: 768px) and (orientation: portrait) {

  /* ---------------------------------------------
     GENERALES: evitar desbordamientos horizontales
  --------------------------------------------- */
  body {
    overflow-x: hidden;
  }
  .contenido,
  .contenido-team,
  .contenido-lab,
  .pub-wrapper {
    padding: 14px;
    overflow-x: hidden;
  }

  /* ---------------------------------------------
     BARRA SUPERIOR (media)
  --------------------------------------------- */
  .media {
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 6px 12px;
  }
  /* Solo icono, ocultar texto del email */
  .media a[href^="mailto"] {
    font-size: 0;
  }
  .media a[href^="mailto"] img {
    font-size: initial;
    padding-right: 0;
  }

  /* ---------------------------------------------
     CABECERA HERO (todas las p ginas)
  --------------------------------------------- */
  .cabecera {
    padding: 10px 8px;
    margin: 8px auto;
  }
  .distinto div {
    flex-direction: column;
    padding: 12px 8px;
    gap: 8px;
  }
  .distinto div img {
    width: 160px !important;
    height: auto !important;
  }
  .distinto div h1 {
    font-size: 26px !important;
    text-align: center;
  }
  .cabecera h3 {
    font-size: 12px;
    line-height: 1.6;
    padding: 0 6px;
  }
  /* Foto del equipo (equipo.html) */
  .cabecera div img[style*="border-radius"],
  .cabecera div img[style*="border-radius: 10px"] {
    width: 88vw !important;
    max-width: 100% !important;
  }

  /* ---------------------------------------------
     TARJETA PRINCIPAL DE INICIO (imis-container)
     Problema: foto y mapa se desbordaban
  --------------------------------------------- */
  .imis-container {
    grid-template-columns: 1fr;   /* una sola columna */
    padding: 14px;
    margin: 14px 8px;
    gap: 1rem;
    box-sizing: border-box;
  }
  /* Columna derecha: flex en vez de grid-rows para control total */
  .imis-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  /* Foto: ancho completo dentro del contenedor */
  .imis-photo {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    box-sizing: border-box;
  }
  /* Fila inferior (mapa + direcci n): columna  nica */
  .imis-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    box-sizing: border-box;
  }
  /* Mapa: ancho completo */
  .imis-map {
    width: 100%;
    max-width: 100%;
    height: 200px;
    box-sizing: border-box;
  }
  /* iframe dentro del mapa */
  .imis-map iframe {
    width: 100%;
    height: 100%;
  }

  /* ---------------------------------------------
     CARDS RESEARCH (index)   3 col ? 1 col
  --------------------------------------------- */
  .grid-container {
    grid-template-columns: 1fr;
    padding: 0 8px;
    margin: 14px auto;
  }

  /* ---------------------------------------------
     EQUIPO   Profesores
     grid-container ya va a 1 col, ajustamos interior
  --------------------------------------------- */
  .card-proffesor {
    width: 100%;
    box-sizing: border-box;
  }
  .card-proffesor main {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .card-proffesor img {
    width: 55%;
    max-width: 180px;
  }

  /* ---------------------------------------------
     EQUIPO   Postdocs
  --------------------------------------------- */
  .postdoc div {
    height: auto;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
  }
  .postdoc .texto {
    margin-left: 0;
    padding-top: 0;
    align-items: center;
    text-align: center;
  }

  /* ---------------------------------------------
     EQUIPO   PhD Students / Collaborators
     Problema: en 4 col ? 2 col el texto largo
     se estiraba mucho hacia abajo. Soluci n:
     recortar descripci n a 3 l neas con line-clamp.
  --------------------------------------------- */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    margin: 8px;
    gap: 14px;
  }
  .grid-4 div {
    align-items: center;
  }
  .grid-4 div img {
    width: 72%;
  }
  /* Primer p rrafo = nombre */
  .grid-4 div p:first-of-type {
    font-weight: 600;
    font-size: 0.82rem;
    text-align: center;
    margin-bottom: 3px;
  }
  /* Segundo p rrafo = descripci n larga ? recortar */
  .grid-4 div p:last-of-type {
    font-size: 0.73rem;
    line-height: 1.4;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #666;
  }

  /* ---------------------------------------------
     PROYECTOS
  --------------------------------------------- */
  .card-project {
    grid-template-columns: 1fr;
  }

  /* ---------------------------------------------
     RESEARCH   Misi n y l neas
  --------------------------------------------- */
  .card-mission {
    grid-template-columns: 1fr;
  }
  .card-mission img {
    justify-self: center;
    margin-right: 0;
    max-width: 100%;
  }
  .grid-5 {
    grid-template-columns: repeat(2, 1fr);
    margin: 8px;
  }

  /* ---------------------------------------------
     LABORATORIO   im genes en columna
  --------------------------------------------- */
  .contenido-lab div {
    grid-template-columns: 1fr;
    width: 100%;
    margin-left: 0;
    box-sizing: border-box;
  }
  .contenido-lab div img {
    max-width: 100%;
    width: 100%;
  }

  /* ---------------------------------------------
     FORMULARIO DE CONTACTO
  --------------------------------------------- */
  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-container {
    padding: 12px 10px;
    margin: 14px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
  }
  .contact-form {
    padding: 10px 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 12px;
  }
  .form-group {
    width: 100%;
    box-sizing: border-box;
  }
  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 12px;
    font-size: 14px;
  }
  .contact-form button {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: 30px;
  }

  /* ---------------------------------------------
     PUBLICACIONES
  --------------------------------------------- */
  .pub-wrapper {
    padding: 24px 12px 56px;
  }
  .pub-item {
    grid-template-columns: 22px 68px 1fr;
    column-gap: 10px;
  }
  .pub-cover-col { width: 68px; }
  .pub-cover { width: 68px; height: 88px; }
  .pub-cover-placeholder { width: 68px; height: 88px; }
  .pub-badge {
    display: block;
    margin: 4px 0 0 0;
  }

  /* ---------------------------------------------
     FOOTER
  --------------------------------------------- */
  .footer-grid {
    flex-direction: column;
    gap: 16px;
  }
  .footer-divider {
    display: none;
  }
  .footer-item:nth-child(3) {
    flex: 1;
  }

  /* ---------------------------------------------
     REDES SOCIALES (contacto)
  --------------------------------------------- */
  .social-media {
    font-size: 1.05em;
    line-height: 2.4;
  }

}
/*************************/
/*    PHD THESES         */
/*************************/
.thesis-wrapper {
    max-width: 1100px;
    margin: 0 auto 20px;
    padding: 0 30px 40px;
}
/* Distinción CUM LAUDE / EXCELLENT */
.thesis-distinction {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #174a48;
    background: #d8e8e8;
    border-radius: 4px;
    padding: 2px 7px;
    vertical-align: middle;
}
.thesis-distinction--excellent {
    color: #7a4800;
    background: #fdefd4;
}

/* Bloque oculto de tesis extra */
.theses-hidden-block {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}
.theses-hidden-block > div {
    overflow: hidden;
}
.theses-hidden-block.open {
    grid-template-rows: 1fr;
}

/* Botón Show more */
.thesis-showmore-row {
    display: flex;
    justify-content: center;
    padding: 22px 0 6px;
}
.thesis-showmore-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #174a48;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 11px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}
.thesis-showmore-btn:hover {
    background: #108585;
}

.thesis-card {
    border-bottom: 1px solid #d8e8e8;
}
.thesis-card:first-child {
    border-top: 1px solid #d8e8e8;
}

.thesis-main {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    padding: 24px 0;
    align-items: start;
}

.thesis-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.thesis-title {
    color: #108585;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    line-height: 1.45;
}
.thesis-title:hover {
    text-decoration: underline;
    color: #0a6565;
}

.thesis-author {
    color: #555;
    font-weight: 600;
    font-size: 0.88rem;
    margin: 0;
}

.thesis-program {
    color: #555;
    font-weight: 600;
    font-size: 0.84rem;
    margin: 0;
    line-height: 1.4;
}

/* Botón leer más */
.thesis-toggle-col {
    padding-top: 2px;
}

.thesis-toggle-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    color: #444;
    white-space: nowrap;
    min-width: 140px;
    justify-content: flex-start;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
}
.thesis-toggle-btn:hover {
    background: #d8e8e8;
    color: #174a48;
}
.thesis-toggle-btn[aria-expanded="true"] {
    background: #d8e8e8;
    color: #174a48;
}

.thesis-icon {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1;
    min-width: 12px;
    text-align: center;
}

/* Acordeón suave con grid-template-rows */
.thesis-abstract-outer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}
.thesis-abstract-outer.open {
    grid-template-rows: 1fr;
}
.thesis-abstract-inner {
    overflow: hidden;
}
.thesis-abstract-inner p {
    padding: 0 0 26px 0;
    margin: 0;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 860px;
}

/* Responsive */
@media (max-width: 600px) {
    .thesis-main {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 0;
    }
    .thesis-toggle-btn {
        width: 100%;
        justify-content: center;
    }
    .thesis-wrapper {
        padding: 0 12px 30px;
    }
}
/* Subtítulo de sección dentro de Theses */
.thesis-section-heading {
    font-size: 1.3rem;
    font-weight: 700;
    color: #174a48;
    margin: 36px 0 4px;
    padding-bottom: 8px;
    border-bottom: 2px solid #d8e8e8;
}
.thesis-section-heading:first-of-type {
    margin-top: 8px;
}