/* ===========================================================
   PROJECT HUB (archive-projects.php)
   =========================================================== */

/* ===========================================================
   1) LAYOUT GLOBAL
   =========================================================== */

.archive-projects {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Contenidor global per alinear-ho TOT */
.archive-projects__inner {
  max-width: 90%; /* mateix ample que vols per a tot */
  margin: 0 auto; /* centra */
  width: 100%;
}
/* Header */
.projects-header {
  padding-bottom: 1rem;
  margin-top: 8rem;
}
.projects-title {
  font-weight: 700;
  font-size: 56px;
  line-height: 64px;
}

@media (max-width: 600px) {
  .archive-projects {
    width: 90%;
    margin: auto;
  }
}

/* ===========================================================
     2) LATEST PROJECT
     =========================================================== */

/* Contenidor d'àrees múltiples */
.project-card__areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 10;
}

/* Tag */
.latest-project__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* background: #38313126; */
  color: #383131;
  border-radius: 30px;
  /* padding: 0 14px; */
  height: 32px;
  margin-bottom: 0;
  font-weight: 500;
  font-size: 16px;
  text-transform: capitalize;
  position: relative;
  z-index: 10;
}

/* Layout */
.latest-project {
  width: 100%;
  margin: 0 auto 60px;
  padding: 40px 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

/* Títol */
.latest-project__title a {
  font-weight: 400;
  font-size: 52px;
  line-height: 60px;
  color: #383131;
  text-decoration: none;
}

/* Extracte */
.latest-project__excerpt {
  font-size: 24px;
  line-height: 36px;
  max-width: 80%;
}

/* Imatge */
.latest-project__img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid #73edff;
  background: #f9f3e7;
}
.latest-project__img--ph {
  object-fit: contain;
  opacity: 0.7;
}

/* Responsive Latest Project */
@media (max-width: 900px) {
  .latest-project {
    grid-template-columns: 1fr;
  }
  .latest-project__right {
    order: -1;
  }
  .latest-project__title a {
    font-size: 28px;
    line-height: 34px;
  }
  .latest-project__excerpt {
    font-size: 18px;
    line-height: 26px;
  }
}

/* ============================================================
   HERO — 1/3 IMG + 2/3 TEXT
============================================================ */

.projects-hero {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: center;
  margin: 4rem auto 3rem;
  max-width: 90%;
  padding: 0 1rem;
}

.projects-hero__img {
  width: 100%;
  max-width: 380px;
  border-radius: 14px;
  display: block;
}

.projects-hero__title {
  font-weight: 700;
  font-size: 56px;
  line-height: 64px;
  margin-bottom: 1rem;
  color: #383131;
}

.projects-hero__text {
  font-weight: 400;
  font-size: 24px;
  line-height: 36px;
  max-width: 760px;
  color: #383131;
}

@media (max-width: 860px) {
  .projects-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .projects-hero__img {
    margin: 0 auto 1.5rem;
    max-width: 260px;
  }
}

/* === GRID AUTO — FINS A 3 o 4 INVESTIGADORS PER FILA === */
.latest-project__researchers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px 22px; /* més compacte */
  margin-top: 20px;
}

/* Targeta de cada investigador */
.project-researcher-card {
  display: flex;
  align-items: center;
  gap: 10px; /* abans 14px */
  padding: 4px 0;
}

/* Foto */
.project-researcher-card .ra-resp__photo {
  width: 58px; /* abans 64 */
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

/* Text */
.project-researcher-card .ra-resp__name {
  margin: 0;
  font-size: 15px; /* una mica més compacte */
  font-weight: 600;
}

.project-researcher-card .ra-resp__position {
  font-size: 12px;
  color: #666;
}

/* Botó únic */
.latest-project__researchers-more {
  margin-top: 18px;
}

/* Mòbil: 1 columna */
@media (max-width: 600px) {
  .latest-project__researchers-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================================================
     3) FILTRES EN LÍNIA (ALINEATS A L’ESQUERRA)
     =========================================================== */

.projects-filters-row {
  width: 100%;
  margin: 40px auto 0;
  padding: 20px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.projects-filters--inline {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* Cada filtre */
.projects-filter-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Label */
.projects-filter-item label {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  margin: 0;
  color: #383131;
}

/* SELECT amb fletxa SVG */
.projects-filter-item select {
  padding: 8px 34px 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  background: #fff;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' stroke='%23383131' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.projects-filter-item select:hover {
  border-color: #999;
}

/* ============================
     Responsive filtres
     ============================ */
@media (max-width: 640px) {
  .projects-filters--inline {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    width: 100%;
  }

  .projects-filter-item {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
  }

  .projects-filter-item label {
    font-size: 15px;
    margin-bottom: 2px;
    width: 100%;
    text-align: left;
  }

  .projects-filter-item select {
    width: 100%;
    padding: 10px 40px 10px 14px;
    background-position: right 12px center;
  }
}

/* ===========================================================
     4) GRID DE PROJECTES
     =========================================================== */

.projects-grid-wrapper {
  width: 100%;
  margin: 40px auto 0;
}

/* Grid centrat automàtic */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(445px, 1fr));
  justify-items: center;
  gap: 50px;
  margin-bottom: 50px;
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Targeta */
.project-card {
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
  overflow: hidden;
  transition: background-color 0.2s ease;
  height: auto;
  min-height: 540px; /* equilibrat */
}

.project-card__link {
  display: block;
  text-decoration: none !important;
  color: inherit;
}

/* Imatge */
.project-card__img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

/* Borde per a imatges placeholder */
.project-card__img--ph {
  border: 1px solid #ddd;
  border-radius: 16px;
}

/* Contingut */
.project-card__content {
  padding: 0.75rem 1rem;
}

/* Títol */
.project-card__title {
  font-weight: 600;
  font-size: 32px;
  line-height: 40px;
  color: #383131;
  margin-top: 0;
}

/* Extracte */
.project-card__excerpt {
  font-size: 16px;
  line-height: 24px;
  margin-top: -15px;
  color: #383131;
}

/* Anys */
.project-card__years {
  font-weight: 500;
  font-style: Medium;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
  color: #383131;
}

/* Botó READ MORE */
.project-card__more-wrapper {
  margin-top: auto;
  padding: 0 1rem 1rem;
}

.project-card__more {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: #575252 !important;
  text-decoration: none !important;
  font-weight: 600;
  position: relative;
  padding-bottom: 4px;
  transition:
    gap 0.25s ease,
    transform 0.25s ease;
}

.project-card__more span {
  font-weight: 600;
  font-style: Semi Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}

.project-card__more::after {
  content: "→";
}

.project-card__more::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.project-card__more:hover {
  gap: 0.3rem;
  transform: translateX(6px);
}
.project-card__more:hover::before {
  transform: scaleX(1);
}

/* ===========================================================
     5) AUTHOR BLOCK — LATEST PROJECT
     =========================================================== */

.project-author {
  display: flex;
  gap: 18px;
  margin-top: 32px;
}

.ra-resp__photo {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  object-fit: cover;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}
.ra-resp__photo-link:hover .ra-resp__photo {
  transform: scale(1.07);
  opacity: 0.9;
}

.ra-resp__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ra-resp__name a {
  color: #383131;
  text-decoration: none;
  position: relative;
  font-weight: 600;
}

.ra-resp__name a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.25s ease;
}
.ra-resp__name a:hover::after {
  transform: scaleX(1);
}

.ra-resp__position {
  font-size: 14px;
  color: #555;
}

/* Botó Learn more */
.contenidor_llegir_mes {
  margin-top: auto;
  padding-top: 12px;
}

.ra-resp__more {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: #575252 !important;
  text-decoration: none !important;
  position: relative;
  padding-bottom: 4px;
  transition:
    gap 0.25s ease,
    transform 0.25s ease;
}

.ra-resp__more span {
  font-weight: 600;
  font-style: Semi Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}

.ra-resp__more::after {
  content: "→";
}
.ra-resp__more::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.25s ease;
}
.ra-resp__more:hover {
  gap: 0.3rem;
  transform: translateX(6px);
}
.ra-resp__more:hover::before {
  transform: scaleX(1);
}

/* ===========================================================
     6) NETEJA D’ESTILS ANTICS
     =========================================================== */

.projects-layout,
.projects-sidebar,
.projects-list {
  all: unset !important;
}

/* ===========================================================
     7) RESPONSIVE FIX – LATEST PROJECT IMAGE + TAGS
     =========================================================== */

@media (max-width: 640px) {
  .latest-project__img {
    height: auto !important;
    max-height: 320px;
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
  }

  .latest-project__tag {
    height: auto !important;
    padding: 6px 14px;
    white-space: normal !important;
    line-height: 1.2;
    text-align: center;
    display: inline-flex;
  }

  .latest-project__title a {
    font-size: 24px;
    line-height: 30px;
  }

  .latest-project__excerpt {
    font-size: 16px;
    line-height: 24px;
    max-width: 100%;
  }
}
