/* content/_index.md */

/* ---------- Portada ---------- */

.home-hero {
  position: relative;
  overflow: hidden;
  background: #0b1626;
  color: #fff;
  border-bottom: 1px solid var(--border);
}

.home-hero-media {
  position: absolute;
  inset: 0;
}

.home-hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.home-hero-media img.is-active {
  opacity: 1;
}

.home-hero-overlay {
  position: relative;
  padding: 4.5rem 0 3rem;
  background: linear-gradient(
    180deg,
    rgba(8, 18, 32, 0.35) 0%,
    rgba(8, 18, 32, 0.82) 65%,
    rgba(8, 18, 32, 0.9) 100%
  );
}

.home-hero h1 {
  margin: 0 0 1.5rem;
  color: #fff;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  letter-spacing: -0.02em;
}

.home-hero .hero-content {
  max-width: none;
  color: rgba(255, 255, 255, 0.88);
  font-size: var(--fs-300);
  column-count: 2;
  column-gap: 2.5rem;
}

.home-hero .hero-content h2 {
  margin: 0 0 0.35rem;
  font-size: var(--fs-500);
  color: #fff;
  break-after: avoid;
}

.home-hero .hero-content p {
  margin: 0 0 1.1rem;
  break-inside: avoid;
}

@media (max-width: 767px) {
  .home-hero-media {
    position: relative;
    height: 220px;
  }

  .home-hero-overlay {
    background: #fff;
    color: var(--text);
    padding: 1.5rem 0 2.25rem;
  }

  .home-hero h1 {
    color: var(--text);
    font-size: clamp(1.6rem, 6vw, 2.1rem);
  }

  .home-hero .hero-content {
    column-count: 1;
    color: var(--muted);
    font-size: var(--fs-400);
  }

  .home-hero .hero-content h2 {
    color: var(--text);
  }
}

/* ---------- Contadores del grupo ---------- */

.home-stats {
  padding: 2.5rem 0 3rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.home-stats-title {
  margin: 0 0 1.5rem;
  font-size: var(--fs-600);
  color: var(--accent-strong);
}

.stats-groups {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.stats-group {
  flex: 1 1 0;
  min-width: 0;
  padding: 1.1rem 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stats-group--people {
  flex-grow: 1;
}

.stats-group--publications {
  flex-grow: 3;
}

.stats-group--theses {
  flex-grow: 2;
}

.stats-group--projects-contracts {
  flex-grow: 2;
}

.stats-group-title {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: var(--fs-200);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.stats-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.stat-link {
  display: block;
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.stat-link:hover {
  text-decoration: none;
}

.stat-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stat-link:hover .stat-icon {
  background: var(--accent);
  color: #fff;
}

.stat-link:hover .stat-number {
  color: var(--accent);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.55rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-number {
  display: block;
  color: var(--accent-strong);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: var(--fs-200);
  line-height: 1.3;
}

@media (max-width: 1099px) {
  .stats-group {
    flex: 1 1 calc(50% - 0.5rem);
  }
}

@media (max-width: 700px) {
  .home-stats {
    padding: 2rem 0;
  }

  .home-stats-title {
    margin-bottom: 1.25rem;
  }

  .stats-group {
    flex-basis: 100%;
  }

  .stats-list {
    gap: 1rem 0.5rem;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
  }

  .stat-icon svg {
    width: 20px;
    height: 20px;
  }

  .stat-number {
    font-size: clamp(2.1rem, 9vw, 2.8rem);
  }
}

/* ---------- Research lines ---------- */

.home-research {
  padding: 3rem 0 0;
}

.research-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.research-card {
  flex: 0 1 calc((100% - 4rem) / 5);
  min-width: 0;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.research-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.research-icon svg {
  width: 22px;
  height: 22px;
}

.research-card h3 {
  margin: 0.8rem 0 0.4rem;
  font-size: var(--fs-500);
  line-height: 1.3;
}

.research-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-300);
  line-height: 1.55;
}

.research-source {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: var(--fs-100);
  text-align: right;
}

@media (max-width: 1099px) {
  .research-card {
    flex-basis: calc((100% - 2rem) / 3);
  }
}

@media (max-width: 767px) {
  .home-research {
    padding-top: 2.5rem;
  }

  .research-card {
    flex-basis: 100%;
  }

  .research-source {
    text-align: left;
  }
}
