.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 20px 0 10px;
    margin-bottom: 0;
    font-size: clamp(12px, 2vw, 17px);
    position: relative;
    z-index: 9999;
    overflow: visible;
}

/* FOR DEBUGGING ONLY
.cabecera {
    border: 3px solid red;
}

.cabecera h3 {
    border: 3px solid blue;
}
*/

/* 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 0 10px auto;
    padding: 0;
    display: flex;
}

/* Items */
nav ul li {
    position: relative;
}

nav ul li a {
    display: block;
    padding: 15px 20px;
    color: black;
    text-decoration: none;
}

/* Hover principal */
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 {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);

    position: absolute;
    top: calc(100% - 1px);
    left: 0;

    min-width: 240px;
    margin: 0;
    padding: 8px 0;

    list-style: none;
    background-color: rgba(40, 103, 101, 0.95);
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.18);

    z-index: 10000;

    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* Invisible bridge */
nav ul li > ul::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
}

/* Mostrar submenú */
nav ul li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Subitems */
nav ul li > ul li a {
    padding: 12px 18px;
    color: white;
    white-space: nowrap;
}

nav ul li > ul li:hover {
    background-color: rgba(255,255,255,0.10);
}


/*******************/
/*   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;
    }

    nav ul li ul {
        display: none;
    }

    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: 0px auto;
    justify-content: flex-start;
}

/* 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;
    padding: 5px;
    margin: 0 auto 20px auto;
}
.distinto div img {
    width: 300px;
    height: 350px;
}
.distinto div img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

h1.distinto {
    text-align: center;
}

.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;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    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;
}

/* Grid de tarjetas de investigación */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    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;
}

.card img {
    width: 90%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    margin: 0 auto 15px auto;
    display: block;
}

.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;
}

.card a:hover {
    color:rgb(0, 196, 196)
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
}
.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;
}
#background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    z-index: 2;
}
.bg-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1.8s ease-in-out;
    will-change: opacity, transform;
}

.bg-media.visible {
    opacity: 1;
    animation: kenburns 14s ease-out forwards;
}

.bg-media.fade-out {
    opacity: 0;
    transform: scale(1.08);
}

@keyframes kenburns {
    from {
        transform: scale(1.04);
    }
    to {
        transform: scale(1.08);
    }
}

.cabecera, .contenido {
    position: relative;
    z-index: 1;
}

/* 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;
}

/* Footer */
footer {
  background: white;
  padding: 20px 10px;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
}

.footer-item {
  flex: 1;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-item:nth-child(3) {
  flex: 2;
}

.footer-item a {
  color: black;
  text-decoration: none;
  font-size: clamp(12px, 1.5vw, 18px);
  line-height: 1.2;
}

.footer-item img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80px;
  object-fit: contain;
}

.footer-item:nth-child(3) img {
  max-height: 120px;
  max-width: 350px;
}

.footer-divider {
  width: 2px;
  height: 90px;
  background: #345e5c;
  align-self: center;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #eeeeee;
  font-size: 13px;
  color: #666;
}

@media (max-width: 600px) {
  .footer-grid {
    flex-direction: column;
    gap: 20px;
  }
  .footer-divider {
    display: none;
  }
  .footer-item a {
    font-size: 16px;
  }
}

/* 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;
}

.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;
}

.card-proffesor img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 15px;
}

.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;
}

.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;
}

.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;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
    justify-content: center;
    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: 500px 500px;
    gap: 40px;

    width: fit-content;
    margin: 0 auto;
}
.project-title{
    text-align:center;
    color:#0f4c5c;
    font-size:2rem;
    margin-bottom:20px;
    font-weight:700;
}
.card-project img {
    width: 100%;
}

/* Project metadata table */
.card-project table {
    width: 100%;
    text-align: center;
}

.card-project td {
    padding: 4px 10px;
}

.card-project tr:first-child td {
    padding-bottom: 10px;
}

.project-separator {
    margin: 60px 0;
    border: none;
    border-top: 1px solid #d0d0d0;
}

.card-project > div:last-child {
    display: flex;
    flex-direction: column;
}

.card-project p {
    text-align: justify;
}

.project-link {
    display: inline-block;
    margin: 15px auto 0 auto;
    margin-top: 10px;
    padding: 8px 16px;
    border: 1.5px solid #008b8b;
    border-radius: 20px;
    color: #008b8b;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95em;
}

.project-link:hover {
    background-color: #008b8b;
    color: white;
}

.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 {
    padding-left: 50px;
    display: grid;
    text-align: justify;
    text-justify: inter-word;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    line-height: 2.0;
}


.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                 */
/********************************/

.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;
}

.pub-main-title {
  margin-bottom: 44px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  color: var(--text-main);
}

.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;
}

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.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);
}

.pub-num {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  padding-top: 1px;
  text-align: right;
  user-select: none;
  margin: 0;
}

.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);
}

.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; }

.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);
}

.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;
  }
}

.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;
}

.pub-loading,
.pub-error {
  text-align: center;
  padding: 72px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.pub-error { color: #dc2626; }

@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: 0 auto;   /* <- center */
    gap: 20px;
}
.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;
}

.electronics-gallery{
    cursor: pointer;
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;

    width:90%;
    max-width:1200px;
    margin:40px auto;
}

.electronics-gallery img{
    width:100%;
    border-radius:10px;
}

.mission_photo {
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
}

.mission_photo img {
    border-radius: 10px;
    transition: transform 0.3s ease;
}
    
.mission_photo img:hover {
    transform: scale(1.05);
}

.image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.image-lightbox.active {
    display: flex;
}

.image-lightbox img {
    max-width: 85%;
    max-height: 85%;
    border-radius: 8px;
}

/************************************************************/
/* RESPONSIVE MÓVIL — SOLO MODO VERTICAL (portrait)         */
/************************************************************/

@media (max-width: 768px) and (orientation: portrait) {

  body {
    overflow-x: hidden;
  }
  .contenido,
  .contenido-team,
  .contenido-lab,
  .pub-wrapper {
    padding: 14px;
    overflow-x: hidden;
  }

  .media {
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 6px 12px;
  }
  .media a[href^="mailto"] {
    font-size: 0;
  }
  .media a[href^="mailto"] img {
    font-size: initial;
    padding-right: 0;
  }

  .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;
  }
  .cabecera div img[style*="border-radius"],
  .cabecera div img[style*="border-radius: 10px"] {
    width: 88vw !important;
    max-width: 100% !important;
  }

  .imis-container {
    grid-template-columns: 1fr;
    padding: 14px;
    margin: 14px 8px;
    gap: 1rem;
    box-sizing: border-box;
  }
  .imis-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  .imis-photo {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    box-sizing: border-box;
  }
  .imis-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    box-sizing: border-box;
  }
  .imis-map {
    width: 100%;
    max-width: 100%;
    height: 200px;
    box-sizing: border-box;
  }
  .imis-map iframe {
    width: 100%;
    height: 100%;
  }

  .grid-container {
    grid-template-columns: 1fr;
    padding: 0 8px;
    margin: 14px auto;
  }

  .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;
  }

  .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;
  }

    .grid-4 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
        justify-content: center;
        margin: 8px;
        gap: 14px;
    }

  .grid-4 div {
    align-items: center;
  }
  .grid-4 div img {
    width: 72%;
  }
  .grid-4 div p:first-of-type {
    font-weight: 600;
    font-size: 0.82rem;
    text-align: center;
    margin-bottom: 3px;
  }
  .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;
  }

  .card-project {
    grid-template-columns: 1fr;
  }

  .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;
  }



  .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;
  }

  .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-grid {
    flex-direction: column;
    gap: 16px;
  }
  .footer-divider {
    display: none;
  }
  .footer-item:nth-child(3) {
    flex: 1;
  }

  .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;
}
.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;
}

.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;
}

.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;
}

.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;
}

.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;
}

@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;
    }
}

.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;
}


/* ================================================ */
/* NUEVAS CLASES — Research Lines Cards (index.html) */
/* No modifica ninguna clase existente              */
/* ================================================ */

.grid-5-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
    margin: 10px auto 30px;
    padding: 0 10px;
}

.card-research-icon {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(23,74,72,0.10);
    padding: 30px 20px 22px;
    flex: 1 1 165px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: default;
}

.card-research-icon:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(23,74,72,0.18);
}

.card-research-icon .ri-icon-wrap {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.card-research-icon .ri-icon-wrap img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.card-research-icon p {
    font-size: 0.85rem;
    font-weight: 700;
    color: #174a48;
    margin: 0 0 14px;
    line-height: 1.4;
}

.card-research-icon::after {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    background: #174a48;
    border-radius: 2px;
    margin-top: auto;
}

@media (max-width: 800px) {
    .grid-5-cards { gap: 12px; }
    .card-research-icon { flex: 1 1 140px; max-width: 165px; padding: 22px 14px 18px; }
    .card-research-icon .ri-icon-wrap { width: 95px; height: 95px; }
    .card-research-icon .ri-icon-wrap img { width: 58px; height: 58px; }
}

@media (max-width: 500px) {
    .grid-5-cards { gap: 10px; }
    .card-research-icon { flex: 1 1 120px; max-width: 150px; }
    .card-research-icon .ri-icon-wrap { width: 80px; height: 80px; }
    .card-research-icon .ri-icon-wrap img { width: 48px; height: 48px; }
}

@media (max-width: 800px) {
    .card-mission {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }

    .card-mission p {
        order: 1 !important;
        padding-right: 0 !important;
        text-align: justify !important;
        line-height: 1.7 !important;
    }

    .card-mission img {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 25px auto 0 auto !important;
        justify-self: center !important;
    }
}