/* ===========================================================
   Turba — Home (plantilla Home)
   =========================================================== */

/* ===== Hero amb vídeo de fons ===== */
.home-hero {
  position: relative;
  height: 800px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -75px;
}

/* El vídeo de fons */
.home-hero .hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* el vídeo llena el área */
  filter: contrast(30%);
  z-index: -1; /* detrás del contenido */
}

/* Superposición per a foscor addicional */
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4); /* oscurece un 40% */
  z-index: 1;
}
.hero-left {
  width: 405px;
  height: 356px;
  margin-top: 60px;
  margin-left: 105px;
}

.hero-left img {
  width: 341px;
  height: 107px;
}

.hero-right {
  display: grid;
  width: 588px;
  height: 356px;
  color: #73edff !important;
}
/* Contenido sobre el vídeo */
.home-hero .hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1200px;
}

.hero-tittle {
  font-weight: 400;
  font-style: Regular;
  font-size: 56px;
  line-height: 56px;
  letter-spacing: 0px;
  vertical-align: middle;
  width: 450px;
  height: 112px;
}

.hero-text {
  color: #f9f3e7;
  font-family: Inter;
  font-weight: 600;
  font-style: Semi Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}

.hero-button {
  width: 250px;
  height: 48px;
  border-radius: 33554400px;
  background-color: #73edff;
  font-family: Inter;
  font-weight: 600;
  font-style: Semi Bold;
  font-size: 16px;
  color: #383131 !important;
  line-height: 24px;
  margin-top: 25px;
  align-content: center;
  text-decoration: none !important;
}
/* TEXT DEL BOTÓ */
.hero-button span {
  display: inline-block;
  transition: transform 0.35s ease;
  margin-left: 30px;
}
/* FLETXA */
.hero-button::after {
  content: "→";
  display: inline-block;
  font-size: 1.1em;
  margin-left: 1em;
  transition: transform 0.35s ease;
}
/* --- HOVER --- */
.hero-button:hover {
  background-color: #605a5a;
  color: white !important;
}

/* El TEXT es mou a la dreta */
.hero-button:hover span {
  transform: translateX(6px);
}
/* La FLETXA es mou a l'esquerra */
.hero-button:hover::after {
  transform: translateX(-6px);
}

/* ===== Intro Research Areas ===== */
.home-intro-areas {
  max-width: 90vw;
  margin: 60px auto 40px;
  padding-inline: 12px;
}
.intro-areas-inner {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}
.intro-areas-left {
  font-weight: 400;
  font-style: Regular;
  font-size: 52px;
  line-height: 60px;
  letter-spacing: 0px;
}
.intro-areas-right {
  font-family: Inter;
  font-weight: 400;
  font-style: Regular;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0px;
  width: 100%;
  max-width: 619px;
}
/* Intro-areas per pantalles grans (1600px+) */
@media (min-width: 1600px) {
  .intro-areas-inner {
    grid-template-columns: 1fr 2fr;
  }
  .intro-areas-left h2 {
    padding-left: 4rem;
    font-size: 52px;
  }
  .intro-areas-right p {
    text-align: left;
    font-size: 24px;
    line-height: 36px;
    margin-left: -75px;
  }
}

/* Intro-areas per pantalles 1200-1600px (títol més estret per forçar 2 línies) */
@media (min-width: 1200px) and (max-width: 1599px) {
  .intro-areas-inner {
    grid-template-columns: 1fr 2fr;
  }
  .intro-areas-left {
    max-width: 75%;
  }
  .intro-areas-left h2 {
    padding-left: 2rem;
    font-size: 44px;
    line-height: 52px;
  }
  .intro-areas-right p {
    text-align: left;
    font-size: 22px;
    line-height: 34px;
    margin-left: -40px;
  }
}

/* Intro-areas per pantalles mitjanes (900-1200px) */
@media (min-width: 900px) and (max-width: 1199px) {
  .intro-areas-inner {
    grid-template-columns: 1fr;
  }
  .intro-areas-left h2 {
    padding-left: 0;
    font-size: 44px;
  }
  .intro-areas-right {
    max-width: 100%;
  }
  .intro-areas-right p {
    font-size: 20px;
    line-height: 32px;
    margin-left: 0;
  }
}

/* Responsive intro-areas per pantalles petites */
@media (max-width: 899px) {
  .intro-areas-left {
    font-size: 36px;
    line-height: 42px;
  }
  .intro-areas-left h2 {
    padding-left: 0;
    font-size: 36px;
  }
  .intro-areas-right {
    max-width: 100%;
  }
  .intro-areas-right p {
    font-size: 18px;
    line-height: 28px;
    margin-left: 0;
  }
}

/* ===== Àrees de recerca (a 3 columnes) ===== */
.area-block {
  max-width: 85vw;
  margin: 60px auto;
  display: grid;
  gap: 24px;
  padding: 70px 45px;
  align-items: start;
  border: 1px solid #73edff;
  border-radius: 30px;
  transition: padding 0.5s ease;
}
.area-col--title .area-title {
  font-size: 1rem;
  margin: 0;
  font-weight: 800;
  color: #0d1b2a;
  font-weight: 700;
  font-style: Bold;
  font-size: 40px;
  line-height: 48px;
  letter-spacing: -0.3px;
}
.area-col--what .area-subtitle {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: #0d1b2a;
  font-weight: 700;
  font-style: Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}
.area-col--what .area-desc p {
  margin: 0 0 1rem;
  line-height: 1.6;
  color: #333;
  font-family: Inter;
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}
.area-col--pi {
  display: block;
}
.area-col--pi .area-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1b2a;
  margin-bottom: 1.5rem;
}
.pi-card {
  display: flex;
  gap: 1rem;
}
.pi-photo {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  object-fit: cover;
}
.pi-name {
  margin-top: 10px;
  margin-left: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}
.pi-role {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-left: 10px;
  margin-top: -15px;
}
.pi-email {
  text-decoration: none;
  font-size: 0.9rem;
  color: #000000;
  margin-left: 10px;
  margin-top: -5px;
}
.pi-email:hover {
  text-decoration: underline;
}
/* Footer del bloc (botó abaix a la dreta) */
.area-col--footer {
  grid-column: 1 / -1; /* que ocupe tota l’amplària */
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}
.btn-learn-more {
  display: inline-flex;
  /* margin-top: -4rem; */
  margin-right: 10%;
  color: #575252 !important;
  text-decoration: none;
  border: 1px solid #575252;
  border-radius: 30px;
  font-weight: 600;
  padding: 0.6em 1.4em 0.6em 1.2em;
  position: relative;
  width: 250px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.3s ease;
}
.btn-learn-more span {
  margin-left: 10px;
}
.btn-learn-more::after {
  content: "→"; /* la flecha */
  position: absolute;
  right: 1.5em; /* separada del texto */
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.5s ease;
}

/*Efecte on hover INICI*/
.area-block:hover {
  background-color: white;
}
.area-block:hover .btn-learn-more {
  background-color: #73edff;
  color: white;
  border: none;
  transition: transform 0.5s ease;
  transform: translatex(40px);
}
/* Efecte hover suau en àrees — sense trencar la graella */
.area-block {
  overflow: hidden; /* Evita que res ixca de la targeta */
}
.area-block .area-col {
  transition: transform 0.5s ease;
}
/* Quan faça hover, TOTES les columnes pugen */
.area-block:hover .area-col:not(.area-col--footer) {
  transform: translateY(-12px);
}
.area-block:hover .btn-learn-more::after {
  transform: translate(-20px, -50%); /* només es mou a l’esquerra */
}
/*Efecte on hover FI*/
@media (min-width: 900px) {
  .area-block {
    grid-template-columns: 1fr 1.5fr 1fr;
  }
  .area-col--title {
    padding-right: 1rem;
  }
  .area-col--what {
    padding-right: 1rem;
  }
}

/* PI card en columna per pantalles mitjanes */
@media (min-width: 900px) and (max-width: 1200px) {
  .pi-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .pi-name,
  .pi-role,
  .pi-email {
    margin-left: 0;
  }
  .pi-name {
    margin-top: 1rem;
  }
}

/* ===== Home — 3 targetes de seccions ===== */
.home-cpts {
  width: 80%;
  margin: 100px auto;
  padding-inline: 12px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  justify-content: center; /* Centra la grid dins del contenidor */
  justify-items: center; /* Centra cada targeta */
}

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

@media (max-width: 600px) {
  .home-cpts {
    width: 90%;
  }
  .cpt-tile {
    width: 100%;
  }
}

.cpt-tile {
  background: #f9f3e7;
  border: 1px solid #73edff;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  width: 95%;
  height: 600px;
  padding: 40px;
}
.cpt-img {
  width: 240px;
  height: 220px;
  opacity: 60%;
  align-self: center;
  transition: all 0.45s ease;
  transform: scale(1);
  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
}
.cpt-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-self: center;
}
.cpt-title {
  font-weight: 500;
  font-style: Medium;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: 0px;
  text-align: center;
  color: #0d1b2a;
  align-self: center;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.cpt-desc {
  flex: 1;
  font-size: 1rem;
  color: #333;
  font-family: Inter;
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  margin-top: -5px;
}
.cpt-btn {
  position: relative;
  display: inline-flex;
  align-self: center;
  background: transparent;
  color: black !important;

  text-decoration: none !important;
  font-family: Inter;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;

  gap: 0.6rem;
  padding-bottom: 8px;
  overflow: visible;
  transition:
    gap 0.25s ease,
    transform 0.25s ease;
}

.cpt-btn .arrow {
  margin-left: 1em;
  transition: transform 0.25s ease;
}

/* SUBRATLLAT (independent del text-decoration) */
.cpt-btn::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

/* HOVER */
.cpt-tile:hover {
  background: white;
  border: none;
  transform: translateY(-10px); /* flota cap amunt */
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12); /* ombra suau */
}
.cpt-tile:hover .cpt-img {
  transform: scale(1.25);
  opacity: 100% !important;
  align-self: center;
}
.cpt-tile:hover .cpt-btn::before {
  transform: scaleX(1);
}
.cpt-tile:hover .cpt-btn {
  gap: 0.2rem;
}
.cpt-tile:hover .arrow {
  transform: translateX(-6px);
}

/* ===========================================================
   HOME — NEWS
   =========================================================== */

.home-news {
  max-width: 90%;
  margin: 100px auto 80px;
  padding: 0 20px;
}

/* Fila superior */
.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;
  margin: 0;
}

/* Botó "View all" amb fletxa animada*/
.home-news-viewall {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem; /* separació inicial text–fletxa */

  width: 200px;
  height: 48px;

  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;

  text-decoration: none !important;
  color: #575252 !important;

  border: 1px solid #575252;
  border-radius: 30px;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    gap 0.25s ease;
  margin-right: 30px;
}

/* FLETXA */
.home-news-viewall::after {
  content: "→";
  display: flex;
  font-size: 1.1rem;
  margin-left: 0.5em; /* la centra un poc millor */
  transition: transform 0.3s ease;
}

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

/* HOVER */
.home-news-viewall:hover {
  background-color: #73edff;
  color: white !important;
  border: none;
}

/* HOVER — animació d’acostament text + fletxa */
.home-news-viewall:hover span {
  transform: translateX(10px); /* text cap a la dreta */
}

.home-news-viewall:hover::after {
  transform: translateX(-8px); /* fletxa cap a l'esquerra */
}
/* Graella */
.home-news-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

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

/* Card noticies */
.home-news-card {
  width: 95%;
  /* height: 365px; */
  background-color: #f9f3e7;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #73edff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
/* Contingut */
.news-content {
  padding: 40px;
  flex: 1;
}

/* Data */
.news-date {
  color: black;
  margin-bottom: 0.4rem;
  display: block;
  font-weight: 700;
  font-style: Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}

/* Títol */
.news-card-title {
  font-weight: 700;
  font-style: Bold;
  font-size: 30px;
  line-height: 34px;
  letter-spacing: -0.3px;
  margin: 0.4rem 0 0.8rem;
}

/* Excerpt */
.news-excerpt {
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
  color: black;
  margin-bottom: 1rem;
}

/* Enllaç Learn more */
.news-learnmore {
  position: relative;
  display: inline-flex;
  align-self: end;

  font-weight: 600;
  color: #575252 !important;
  text-decoration: none !important;

  padding-bottom: 4px;
  gap: 1.5rem; /* separació text–fletxa */
  transition:
    transform 0.3s ease,
    gap 0.3s ease;
}

/* Fletxa (estàtica)*/
.news-learnmore::after {
  content: "→";
  font-size: 1rem;
  transition: none; /* No es mou */
}

/* ON HOVER */
/* La CARD NO ES MOU en hover */
.home-news-card:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* El contingut puja un poc */
.news-content {
  transition: transform 0.35s ease;
}

.home-news-card:hover .news-content {
  transform: translateY(-8px); /* ajustable */
}

/* Botó Learn more – fletxa fixa + subratllat en hover de card */
.news-learnmore {
  position: relative;
  display: inline-flex;
  align-self: end;
  font-weight: 600;
  color: #575252 !important;
  text-decoration: none !important;
  padding-bottom: 4px;
  gap: 1.5rem; /* separació inicial text-fletxa */
  transition:
    transform 0.3s ease,
    gap 0.3s ease;
}

/* Fletxa estàtica */
.news-learnmore::after {
  content: "→";
  font-size: 1rem;
}

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

/* En hover de card → subratllat + text s’acosta */
.home-news-card:hover .news-learnmore::before {
  transform: scaleX(1);
}

.home-news-card:hover .news-learnmore {
  gap: 0.2rem; /* text s’acosta a la fletxa */
  transform: translateX(6px);
}

/* ===========================================================
   RESPONSIVE FIXES — MOBILE < 768px
   =========================================================== */

@media (max-width: 768px) {
  /* ===== HERO ===== */
  .home-hero {
    height: auto;
    padding: 120px 20px 80px;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-left,
  .hero-right {
    width: 100% !important;
    height: auto;
    margin: 0 !important;
  }

  .hero-tittle {
    width: 100%;
    font-size: 36px;
    line-height: 40px;
    height: auto;
    margin-bottom: 20px;
  }

  .hero-text {
    font-size: 16px;
    line-height: 24px;
    width: 100%;
    margin-bottom: 20px;
  }

  .hero-button {
    margin: 20px auto 0;
  }

  /* ===== INTRO — RESEARCH AREAS ===== */
  .intro-areas-right {
    width: 100% !important;
  }

  .intro-areas-right p {
    margin-left: 0 !important;
    font-size: 18px;
    line-height: 26px;
  }

  /* ===== AREAS OF RESEARCH – CARDS ===== */
  .area-block {
    grid-template-columns: 1fr !important;
    padding: 40px 20px;
  }

  .area-title {
    font-size: 32px !important;
    line-height: 40px !important;
  }

  .area-col--what,
  .area-col--pi {
    width: 100%;
  }

  .btn-learn-more {
    width: 100%;
    margin: 2rem 0 0;
    justify-content: center;
  }

  /* ===== HOME – CPT TILES ===== */
  .cpt-tile {
    height: auto !important;
    padding: 30px 20px;
  }

  .cpt-img {
    width: 180px !important;
    height: 160px !important;
  }

  .cpt-title {
    font-size: 26px !important;
    line-height: 32px !important;
  }

  .cpt-desc {
    font-size: 14px !important;
    line-height: 22px !important;
  }

  .cpt-btn {
    margin-top: 10px;
  }

  /* ===== HOME — NEWS ===== */

  .home-news-grid {
    grid-template-columns: 1fr !important;
  }

  .home-news-card {
    height: auto;
  }

  .news-content {
    padding: 25px !important;
  }

  .news-card-title {
    font-size: 28px !important;
    line-height: 34px !important;
  }

  .news-excerpt {
    font-size: 14px !important;
    line-height: 20px !important;
  }

  /* Si el text es massa llarg → no tapa el “Learn more” */
  .news-excerpt {
    max-height: 80px;
    overflow: hidden;
  }

  /* Botó Learn more separadets */
  .news-learnmore {
    margin-top: 12px;
    gap: 0.8rem;
  }
}

/* ===========================================================
   HOME — Responsive fix per al botó "View all" (NEWS)
   =========================================================== */

@media (max-width: 768px) {
  /* Converteix el header en dos línies */
  .home-news-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* El botó passa baix del títol i queda alineat a l’esquerra */
  .home-news-viewall {
    width: auto;
    padding: 10px 20px;
    align-self: flex-start;
    margin: 0; /* elimina marges estranys */
  }
}

/* ===========================================================
   HOME — Responsive fixes
   =========================================================== */

@media (max-width: 1200px) {
  .btn-learn-more {
    margin-right: inherit;
  }
}
