/* ===========================================================
   RESEARCH AREA — Layout bàsic
   =========================================================== */

.single-research-area .research-area__header {
  margin-top: 60px;
}

/* Contenidor comú per intro, seccions i news */
.single-research-area .research-area__intro,
.single-research-area .research-area__sections,
.single-research-area .home-news {
  max-width: 90%;
  margin: 0 auto;
  padding: 0 20px;
}

.research-area__col.research-area__col--main {
  max-width: 760px;
}

.research-area__header {
  max-width: 90%;
  margin: 0 auto 2.5rem;
  padding: 0 20px;
}

.research-area__title {
  font-weight: 700;
  font-style: Bold;
  font-size: 56px;
  line-height: 64px;
  letter-spacing: 0;
}

/* Intro 2 columnes (50/50) */
.research-area__intro {
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.pre-section {
  font-weight: 700;
  font-style: Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  margin-bottom: -25px;
}

.research-area__description {
  font-family: Inter;
  font-weight: 400;
  font-style: Regular;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0;
}

/* Responsable block */
.ra-resp {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 50px;
}

.ra-resp__photo-link {
  display: block;
  flex-shrink: 0;
}

.ra-resp__photo {
  margin-top: 20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.ra-resp__photo--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0d1b2a;
  color: #fff;
  font-weight: 600;
  font-size: 32px;
}

.ra-resp__meta {
  flex: 1;
}

.ra-resp__name {
  font-family: Inter;
  font-weight: 400;
  font-style: Regular;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0;
}

.ra-resp__name a {
  color: #0d1b2a;
  text-decoration: none;
}

.ra-resp__position,
.ra-resp__role {
  font-family: Inter;
  font-weight: 600;
  font-style: Semi Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  margin-top: -20px;
}

.ra-resp__email a {
  font-size: 14px;
  color: #000000;
  text-decoration: none;
}
.ra-resp__email a:hover {
  text-decoration: underline;
}

/* Responsive intro */
@media (max-width: 768px) {
  .research-area__intro {
    grid-template-columns: 1fr;
  }

  .ra-resp {
    flex-direction: row;
  }
}

/* ===========================================================
     RESEARCH AREA — Seccions (Scientific outputs / Projects / People)
     =========================================================== */

.research-area__sections {
  margin: 0 auto 4rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.research-area__section-title {
  font-weight: 400;
  font-style: Regular;
  font-size: 52px;
  line-height: 60px;
  letter-spacing: 0;
}

.research-area__section-content {
  position: relative;
}

/* ===========================================================
     CARRUSEL — estructura general (scroll-snap + puntets + fletxes)
     =========================================================== */

.ra-carousel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ra-carousel__viewport {
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.ra-carousel__track {
  display: flex;
  gap: 1.5rem;
  margin: 25px 0;
}

/* Slides (cards) */
.ra-carousel__track > * {
  scroll-snap-align: start;
  flex: 0 0 280px;
  max-width: 100%;
}

@media (min-width: 768px) {
  .ra-carousel__track > * {
    flex-basis: 320px;
  }
}

@media (min-width: 1024px) {
  .ra-carousel__track > * {
    flex-basis: 405px;
    height: 400px;
  }
  .ra-carousel__track > *.ra-person-card {
    flex-basis: 300px;
    height: 400px;
  }
}

/* Controls: puntets esquerra, fletxes dreta */

.ra-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
}

.ra-carousel__dots {
  display: flex;
  gap: 0.5rem;
}

.ra-carousel__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #575252;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.ra-carousel__dot.is-active {
  background: #575252;
}

.ra-carousel__arrows {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
  margin-right: 20%;
}

.ra-carousel__arrow {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 3px solid #73edff;
  background: #f9f3e7;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: larger;
  font-weight: bold;
}

.ra-carousel__arrow:hover {
  background: #73edff;
  color: #fff;
  border-color: transparent;
}

/* Amagar controls si hi ha 0 o 1 slide */
.ra-carousel--no-controls .ra-carousel__controls {
  display: none;
}

/* Controls Mobile */
@media (max-width: 600px) {
  .ra-carousel__controls {
    display: block;
  }
  .ra-carousel__arrows {
    margin: 25px auto;
  }
}

/* ===========================================================
   OUTPUTS — estils idèntics a PROJECTS
   =========================================================== */

/* Targeta */
.output-card {
  background-color: #f9f3e7;
  border-radius: 24px;
  border: 1px solid #73edff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 240px;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.25s ease;
}

.output-card:hover {
  background: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

/* Contingut intern */
.output-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Any — equival a ra-project-card__years */
.output-year {
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  color: #575252;
  margin-bottom: 0;
}

/* Títol — mateix que project-card */
.output-title a {
  font-weight: 500;
  font-style: Medium;
  font-size: 32px;
  /*   line-height: 40px; */
  letter-spacing: 0px;
  text-decoration: none;
  color: #383131;
}

.output-title a:hover {
  text-decoration: underline;
}

/* Botó Learn more — idèntic al de projectes */
.output-learnmore {
  position: relative;
  align-self: flex-end;
  margin-top: auto;
  padding-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  font-family: Inter;
  font-weight: 500;
  font-size: 16px;
  color: #575252 !important;
  text-decoration: none !important;
  transition:
    transform 0.3s ease,
    gap 0.3s ease;
}

.output-learnmore::after {
  content: "→";
  font-size: 1rem;
}

/* Línia del subratllat */
.output-learnmore::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

/* Hover: subratllat + animació */
.output-card:hover .output-learnmore::before {
  transform: scaleX(1);
}

.output-card:hover .output-learnmore {
  gap: 0.4rem;
  transform: translateX(6px);
}

/* ===========================================================
     CARRUSEL — PROJECTES
     =========================================================== */

.ra-project-card {
  background: #f9f3e7;
  border: 1px solid #73edff;
  border-radius: 24px;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 600px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.ra-project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.ra-project-card__years {
  font-weight: 700;
  font-style: Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
}

.ra-project-card__title a {
  font-weight: 700;
  font-style: Bold;
  font-size: 40px;
  line-height: 48px;
  letter-spacing: -0.3px;
  text-decoration: none;
  color: #383131;
}

.ra-project-card__title a:hover {
  text-decoration: underline;
}

.ra-project-card__excerpt {
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
}

.ra-project-card__more {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-decoration: none;
  color: #000;
  transition:
    gap 0.3s ease,
    color 0.3s ease;
}

/* ===========================================================
     PROJECTS — Hover igual que OUTPUTS
     =========================================================== */

/* Efecte general de card */
.ra-project-card {
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.25s ease;
}

.ra-project-card:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

/* Botó Learn more dins de projectes → comportament idèntic al dels outputs */
.ra-project-card .news-learnmore {
  position: relative;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  padding-bottom: 4px;
  margin-top: auto;
  font-family: Inter;
  font-weight: 500;
  font-size: 16px;
  color: #575252 !important;
  text-decoration: none !important;
  transition:
    transform 0.3s ease,
    gap 0.3s ease;
}

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

.ra-project-card .news-learnmore::after {
  content: "→";
  font-size: 1rem;
}

/* Hover igual que outputs */
.ra-project-card:hover .news-learnmore::before {
  transform: scaleX(1);
}

.ra-project-card:hover .news-learnmore {
  gap: 0.4rem;
  transform: translateX(6px);
}

/* ===========================================================
     PEOPLE — Card estil propi
     =========================================================== */

.ra-person-card {
  background-color: #f9f3e7;
  border-radius: 24px;
  border: 1px solid #73edff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.8rem 1.2rem 1.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.25s ease;
}

/* Link que ocupa tota la targeta */
.ra-person-card__link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none !important;
  color: inherit !important;
}

.ra-person-card__photo-wrap {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1rem;
}

.ra-person-card__photo-wrap img,
.person-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Borde per a fotos placeholder */
.person-photo--ph {
  border: 1px solid #ddd;
  filter: grayscale(100%);
  transition: filter 0.35s ease;
}

.ra-person-card__name {
  font-weight: 400;
  font-style: Regular;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0px;
  text-align: center;
  color: #383131;
  text-decoration: none !important;
}
.ra-person-position {
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
  text-align: center;
  text-decoration: none !important;
}

.ra-person-card:hover {
  background: #fff;
  transform: translateY(-6px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* En hover, la imatge torna al color */
.ra-person-card:hover .ra-person-card__photo-wrap img {
  filter: grayscale(0%);
}

/* ==========================================
   PEOPLE — fer que la targeta sencera siga clicable
   i evitar subratllat del nom
   ========================================== */

/* El link ocupa tota la targeta */
.ra-person-card__link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none !important;
  color: inherit !important; /* evita blau de link */
}

/* El nom NO té subratllat mai */
.ra-person-card__name,
.ra-person-card__name a {
  text-decoration: none !important;
  color: #383131 !important;
}

/* NI en hover */
.ra-person-card__name:hover,
.ra-person-card__name a:hover {
  text-decoration: none !important;
}

/* ===========================================================
     NEWS (igual que home)
     =========================================================== */
.home-news-card {
  background-color: #f9f3e7;
  border-radius: 24px;
  border: 1px solid #73edff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
  /* height: 365px; */
}

.news-content {
  padding: 2rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-date {
  font-weight: 700;
  font-style: Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
  color: #575252;
}

.news-card-title a {
  color: #0d1b2a;
  text-decoration: none;
  font-weight: 700;
  font-style: Bold;
  font-size: 30px;
  line-height: 34px;
  letter-spacing: -0.3px;
}

.news-excerpt {
  font-weight: 400;
  font-style: Regular;
  line-height: 24px;
  letter-spacing: 0px;
}

/* Header de secció amb View All a la dreta (outputs / projects) */
.header_titol_seccio,
.ras-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 2rem;
}

.ras-viewall,
.home-news-viewall {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 200px;
  height: 48px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #575252 !important;
  text-decoration: none !important;
  border: 1px solid #575252;
  border-radius: 30px;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    gap 0.25s ease;
}

.ras-viewall {
  margin-right: 20%;
}

.ras-viewall::after,
.home-news-viewall::after {
  content: "→";
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.home-news-viewall span {
  transition: transform 0.45s ease;
}

.ras-viewall:hover,
.home-news-viewall:hover {
  background-color: #73edff;
  color: #fff !important;
  border: none;
}

.home-news-viewall:hover span {
  transform: translateX(10px);
}

.ras-viewall:hover::after,
.home-news-viewall:hover::after {
  transform: translateX(-8px);
}

/* Bloc de notícies */
.single-research-area .home-news {
  margin: 60px auto;
}

.home-news {
  margin: 4rem auto 5rem;
}

.home-news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.home-news-title {
  font-weight: 400;
  font-style: Regular;
  font-size: 52px;
  line-height: 60px;
  letter-spacing: 0px;
}

/* Graella de notícies */
.home-news-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .home-news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===========================================================
   NEWS — Hover igual que outputs i projects
   =========================================================== */

.home-news-card {
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.home-news-card:hover {
  background: #fff;
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* Botó Learn More — subratllat animat + moviment */
.home-news-card:hover .news-learnmore {
  gap: 0.4rem;
  transform: translateX(6px);
}

.news-learnmore {
  position: relative;
  padding-bottom: 4px;
  display: inline-flex;
  align-self: flex-end;
  align-items: center;
  gap: 1.4rem;
  color: #575252 !important;
  text-decoration: none !important;
  transition:
    transform 0.3s ease,
    gap 0.3s ease;
}

.news-learnmore::after {
  content: "→";
}

.news-learnmore::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;
}

.home-news-card:hover .news-learnmore::before {
  transform: scaleX(1);
}

/* =======================================
   RESPONSIVE — CARDS
   ======================================= */

@media (max-width: 600px) {
  .output-card {
    padding: 2.5rem;
  }
  .ra-project-card {
    padding: 2.5rem;
  }
  .news-content {
    padding: 2.5rem;
  }
}

/* =======================================
   RESPONSIVE — HEADER + INTRO (mobile)
   ======================================= */
@media (max-width: 768px) {
  /* Evitar que el títol/traduccions se'n isquen */
  .research-area__header,
  .research-area__intro {
    padding-left: 16px;
    padding-right: 16px;
  }

  .research-area__title {
    font-size: 36px;
    line-height: 44px;
    word-break: break-word;
  }

  .research-area__description {
    font-size: 18px;
    line-height: 28px;
  }

  /* Layout en una sola columna */
  .research-area__intro {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 2rem;
  }
}

/* =======================================
   RESPONSIVE — VIEW ALL buttons
   ======================================= */
@media (max-width: 768px) {
  .header_titol_seccio,
  .home-news-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ras-viewall,
  .home-news-viewall {
    width: auto;
    padding: 10px 20px;
    margin-right: 0 !important;
    align-self: flex-start;
  }
}

/* =======================================
   RESPONSIVE — NEWS height fix
   ======================================= */
@media (max-width: 900px) {
  .home-news-card {
    height: auto;
    min-height: 260px; /* un poc d'estabilitat visual */
  }

  .news-content {
    padding: 1.5rem;
  }
}
