/********************** LLISTAT PROJECTES ***************************************************/

/* Estils generals */
.titol-container {
  margin-bottom: 2rem;
  /* text-align: center; */
}

/* Estils per a les imatges */
.projecte-imatge-container {
  height: 200px;
  overflow: hidden;
  position: relative;
  background-color: #f5f5f5;
}

.projecte-imatge {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.projecte-imatge-default {
  background-color: #e0e0e0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.projecte-imatge-default .text-imatge-default {
  color: #999;
  font-size: 2rem;
  font-weight: bold;
}

.projecte-card:hover .projecte-imatge {
  transform: scale(1.05);
}

/* Mantenim els estats com abans */
.projecte-estat {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.projecte-estat.actiu {
  background-color: #4caf50;
  color: white;
}

.projecte-estat.finalitzat {
  background-color: #f44336;
  color: white;
}

/* Estils per als projectes */
.projectes-container {
  max-width: 1200px;
  margin: 35px auto;
  margin-bottom: 35px;
  background-color: #f9f9f9;
  padding: 2rem 1rem;
}

.tipus-projecte-container {
  margin-bottom: 3rem;
  transition: all 0.3s ease;
  background-color: #f9f9f9;
}

.projecte-title {
  font-family: "Muli", sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.1;
  color: #66a1bc;
  margin-top: 10px;
  margin-left: 25px;
  margin-bottom: 10px;
}

.estat-title {
  color: #444;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #eee;
}

.projectes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.projecte-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  background: white;
}

.projecte-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.projecte-imatge-container {
  height: 200px;
  overflow: hidden;
}

.projecte-imatge-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.projecte-card:hover .projecte-imatge-container img {
  transform: scale(1.05);
}

.projecte-info {
  padding: 1.5rem;
}

.projecte-titol {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
  text-transform: uppercase;
}

.projecte-titol a:hover {
  text-decoration: underline;
}

.projecte-subtitol {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
}

.projecte-subtitol a:hover {
  text-decoration: underline;
}

.projecte-tipus {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  margin: 1rem 0;
  color: #555;
  background-color: #e9f2f7;
  border-radius: 4px;
  font-weight: 600;
}

.projecte-agencia {
  font-size: 0.9rem;
  color: #555;
  margin: 5px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.projecte-agencia:before {
  content: "🏛️"; /* O pots usar un icono de fontawesome si prefereixes */
  font-size: 1rem;
}

.projecte-investigador,
.projecte-dates {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.projecte-investigador-nom {
  color: #66a1bc;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 400;
}

.projecte-dates strong {
  display: inline-block;
  min-width: 50px;
}

.projecte-resum {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
}

.projecte-enllac {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* ETIQUETAS DE ESTADO MEJORADAS */
.projecte-estat {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.projecte-estat.actiu {
  background-color: #4caf50;
  color: white;
  border: 1px solid #3d8b40;
}

.projecte-estat.finalitzat {
  background-color: #f44336;
  color: white;
  border: 1px solid #d32f2f;
}

.projecte-card:hover .projecte-estat {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Borde lateral según estado */
.projecte-card.actiu {
  border-left: 4px solid #4caf50;
}

.projecte-card.finalitzat {
  border-left: 4px solid #f44336;
  opacity: 0.95;
}

.projecte-card.finalitzat:hover {
  opacity: 1;
}

/* Transicions per als contenidors filtrables */
.projectes-actius-container,
.projectes-finalitzats-container {
  transition: all 0.3s ease;
}

/************************************************** RESPONSIVE MOBILE ***************************************************************/
@media (max-width: 768px) {
  .page-title {
    font-size: 1.6rem;
    padding: 20px 15px;
  }

  .titol-container {
    margin-bottom: 1.5rem;
    padding: 0 1rem;
  }

  /* Targetes de projectes */
  .projectes-container {
    padding: 1rem;
  }

  .projecte-card {
    margin-bottom: 1.5rem;
  }

  .projecte-info {
    padding: 1rem;
  }

  .projecte-title {
    font-size: 1.2rem;
  }

  .projecte-titol,
  .projecte-subtitol {
    font-size: 1rem;
  }

  .projecte-tipus {
    font-size: 0.75rem;
  }

  .projecte-agencia,
  .projecte-investigador,
  .projecte-dates,
  .projecte-resum {
    font-size: 0.85rem;
  }

  .projecte-investigador-nom {
    font-size: 0.9rem;
  }

  .projecte-imatge-container {
    height: 180px;
  }

  .projecte-estat {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    top: 8px;
    right: 8px;
  }
}

/************************************************** RESPONSIVE TABLETS ***************************************************************/
@media (min-width: 769px) and (max-width: 1024px) {
  .projectes-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}
