/* ============================================================
   NEWS — CONTENEDOR GENERAL
============================================================ */

.page-news__inner {
  max-width: 90%;
  margin: 0 auto;
  padding: 2rem 0;
  box-sizing: border-box;
}

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

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

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

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

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

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

/* ============================================================
   NEWS GRID
============================================================ */

.news-grid {
  max-width: 90%;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 960px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ============================================================
   NEWS CARD
============================================================ */

.news-card {
  background: #f9f3e7;
  border: 1px solid #73edff;
  border-radius: 24px;
  padding: 0;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
  overflow: hidden;
}
.news-card a {
  text-decoration: none !important;
}

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

.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* .news-card__img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid #73EDFF;
} */

.news-card__img--ph {
  background: #ddd;
}

.news-card__content {
  padding: 30px 40px;
  flex: 1 1 auto; /* empuja el learn more hacia abajo */
}

.news-card__date {
  display: block;
  font-weight: 700;
  font-style: Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
  color: #575252;
  margin-bottom: 10px;
}

.news-card__title {
  font-weight: 500;
  font-style: Medium;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: 0px;
  margin: 0 0 1rem;
  color: #575252;
}

.news-card__excerpt {
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
  color: #575252;
}

/* ============================================================
   LEARN MORE — ANIMACIÓN
============================================================ */

.news-card__more {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 16px;
  color: #575252 !important;
  text-decoration: none !important;
  position: relative;
  margin: 0 40px 30px;
  align-self: flex-end; /* derecha */
  padding-bottom: 4px;
  transition:
    gap 0.25s ease,
    color 0.25s ease;
}

.news-card__more::after {
  content: "→";
  transition: transform 0.25s ease;
}

.news-card__more::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%; /* solo bajo el texto */
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  opacity: 0.8;
}

.news-card:hover .news-card__more {
  gap: 6px;
  color: #111 !important;
}

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

.news-card:hover .news-card__more::after {
  transform: translateX(4px);
}

/* ============================================
   SINGLE NEWS — CONTENEDOR GENERAL
============================================ */

.site-main.single-news {
  max-width: 90%;
  margin: 25px auto;
  padding: 2rem 1.2rem 4rem;
}

.single-news__inner {
  max-width: 90%;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

@media (max-width: 640px) {
  .site-main.single-news {
    max-width: 100%;
  }
}

/* ============================================
   HERO — 2 COLUMNAS
============================================ */
.single-news-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .single-news-hero {
    grid-template-columns: 1fr;
  }
}

/* TAGS */
.single-news-tags {
  display: flex;
  align-items: center;
  gap: 10px; /* 🔥 separació real entre tags */
  margin-bottom: 14px;
}

.single-news-tags a {
  text-decoration: none !important;
  color: #383131 !important;
}

.single-news-tag {
  display: inline-flex;
  align-items: center;
  background: #38313126;
  padding: 4px 16px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 16px;
  color: #383131 !important;
  text-decoration: none !important;
  text-transform: capitalize;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

/* Hover opcional */
.single-news-tag:hover {
  background: white;
  color: #111 !important;
}

/* Tags a la part inferior del contingut */
.single-news-tags--bottom {
  margin-top: 3rem;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 20%;
}

@media (max-width: 960px) {
  .single-news-tags--bottom {
    padding-right: 0;
    justify-content: flex-start;
  }
}

/* TITLE + SUMMARY */
.single-news-title {
  margin-top: 1rem;
  font-weight: 700;
  font-style: Bold;
  font-size: 56px;
  line-height: 64px;
  letter-spacing: 0px;
}
.single-news-summary {
  font-weight: 400;
  font-style: Regular;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0px;
  margin-bottom: 2rem;
}

.single-news-hero__image {
  width: 35vw;
  height: 452px;
  border-radius: 16px;
  object-fit: cover;
}

.single-news-body__content {
  width: 60%;
  /* Paco ho vol alienat a la esquerra */
  /*   margin-left: auto;
  margin-right: auto; */
}

.single-news-body__content p {
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}

#lipsum {
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}

@media (max-width: 600px) {
  .single-news-hero__image {
    width: 90vw;
    height: auto;
    border-radius: 16px;
  }
  .single-news-body__content {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================
   SINGLE NEWS — AUTHOR (estil idèntic a project-researcher-card)
============================================================ */

.single-news-authors {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 1.5rem;
}

.single-news-author-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.single-news-author-card .ra-resp__photo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

.single-news-author-card .ra-resp__name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

/* Nom — estil exacte dels projectes */
.single-news-author-card .ra-resp__name a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #383131;
  transition: color 0.25s ease;
}

/* HOOVER EXACTE & IDENTIC A PROJECTES */
.single-news-author-card:hover .ra-resp__name a {
  color: #111;
  margin-top: -2rem;
}

/* Posició */
.single-news-author-card .ra-resp__position {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.single-news-author-card .ra-resp__name a {
  position: relative;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #383131;
  transition: color 0.25s ease;
}

/* Línia amagada */
.single-news-author-card .ra-resp__name a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px; /* separació de la lletra */
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  opacity: 0.8;
}

/* Hover real: color + subratllat animat */
.single-news-author-card:hover .ra-resp__name a {
  color: #111;
}

.single-news-author-card:hover .ra-resp__name a::before {
  transform: scaleX(1);
}

/* ============================================
   CONTENT BODY
============================================ */
.single-news-body__content {
  font-size: 18px;
  line-height: 1.7;
  color: #222;
}

/* Imatges dins del contingut de les notícies */
.single-news-body__content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
  border-radius: 8px;
}

/* Vídeos embeguts (iframes) al contingut de les notícies */
.single-news-body__content iframe {
  max-width: 100%;
  width: 100%;
  height: 450px;
  display: block;
  border: none;
  margin: 1.5rem 0;
}

/* Responsive: ajustar alçada en mòbil */
@media (max-width: 768px) {
  .single-news-body__content iframe {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .single-news-body__content iframe {
    height: 200px;
  }
}

/* ============================================
   RELATED NEWS — identical to scientific outputs
============================================ */

.news-output-card {
  background: #f9f3e7;
  border: 1px solid #73edff;
  border-radius: 24px;
  padding: 40px;
  min-width: 340px;
  max-width: 380px;
  height: auto;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

/* Hover effect exactly like outputs */
.news-output-card:hover {
  background: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* Top label (same style as .output-card__area) */
.news-output-card__area {
  font-weight: 700;
  font-style: Bold;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
}

/* Title */
.related-news-title {
  font-weight: 500;
  font-size: 32px;
  line-height: 40px;
  margin: 0 0 1.25rem;
  color: #383131;
}

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

.news-output-card:hover .news-output-card__title a {
  color: #111;
}

/* Year */
.news-output-card__year {
  font-weight: 400;
  font-size: 16px;
  color: #575252;
}

/* Footer */
.news-output-card__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: auto;
}

/* Learn more link */
.news-output-card__more {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  font-weight: 500;
  font-size: 16px;
  color: #575252 !important;
  text-decoration: none !important;
  position: relative;
  padding-bottom: 6px;
  transition:
    gap 0.25s ease,
    color 0.25s ease;
}

.news-output-card__more::after {
  content: "→";
  transition: transform 0.25s ease;
}

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

/* Hover same as outputs */
.news-output-card:hover .news-output-card__more {
  gap: 4px;
  color: #111 !important;
}

.news-output-card:hover .news-output-card__more::before {
  transform: scaleX(1);
}

.news-output-card:hover .news-output-card__more::after {
  transform: translateX(4px);
}

.ra-carousel__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
}

.ra-carousel__track {
  display: flex;
  gap: 2.5rem;
  padding: 1rem 0;
}

.ra-carousel__slide {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

.ra-carousel__slide .news-output-card {
  scroll-snap-align: start;
  flex: 0 0 360px;
  flex-basis: 360px;
  max-width: 100%;
  text-decoration: none !important;
}

/* ============================================================
   RELATED NEWS — Header con dots a la izquierda y flechas a la derecha
============================================================ */

.related-news-carousel {
  position: relative;
  width: 100%;
}

/* Header: dots + flechas alineados horizontalmente */
.related-news-carousel .ra-carousel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  margin-top: auto;
}

/* Flechas a la derecha */
.ra-carousel__arrows {
  display: flex;
  gap: 12px;
  position: static !important; /* <— MUY IMPORTANTE */
}

.ra-carousel__arrow {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 3px solid #73edff;
  background: #f9f3e7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition:
    background 0.25s ease,
    transform 0.2s ease,
    border-color 0.25s ease;
  font-weight: bold;
}

.ra-carousel__arrow:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* ============================================================
   DOTS (idénticos a Outputs)
============================================================ */
.ra-carousel__dots {
  display: flex;
  gap: 0.5rem;
}

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

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

/* ============================================================
 FLECHAS (clavadas a Outputs)
============================================================ */
.ra-carousel__arrows {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  margin-right: 20%;
}

/* Botón circular */
.ra-carousel__arrow {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 3px solid #73edff;
  background: #f9f3e7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition:
    background 0.25s ease,
    transform 0.2s ease,
    border-color 0.25s ease;
}

/* Hover real del diseño Outputs */
.ra-carousel__arrow:hover {
  background: #73edff;
  color: #fff;
  border-color: transparent;
}

/* Disabled */
.ra-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================================
 CONTENEDOR HEADER (dots left + arrows right)
============================================================ */
.ra-carousel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
}

@media (max-width: 600px) {
  .related-news-carousel .ra-carousel__header {
    display: block;
  }
  .ra-carousel__arrows {
    display: block;
    margin: 25px auto;
  }
  .news-output-card {
    width: 100%;
    min-width: auto;
  }
}

/* ===========================================================
   MOBILE - Títols
   =========================================================== */

@media (max-width: 768px) {
  .news-hero__title,
  .single-news-title {
    font-size: 48px !important;
    line-height: 56px !important;
    max-width: 90%;
  }
}

/* Pantalles molt petites */
@media (min-width: 320px) and (max-width: 390px) {
  .news-hero__title,
  .single-news-title {
    max-width: 80vw;
  }

  .single-news-tags {
    flex-direction: column;
    align-items: flex-start;
  }

  .single-news-tag {
    max-width: 80vw;
  }
}
