﻿/* ===== Enlaces de Interés — Cards ===== */
:root {
  --ei-top-bg: #e9e9e9; /* fondo superior */
  --ei-band-bg: #078738; /* franja inferior */
  --ei-icon-bg: #2f2f2f; /* círculo negro */
  --ei-icon-color: #ffffff;
  --band-start: 6%; /* altura inicial de la franja */
  --band-hover: 55%; /* altura en hover (sube hasta ~la mitad) */
  --color6: #0971b7;
}

#enlaces-interes {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Card base */
.ei-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* centro vertical */
  gap: 12px;
  width: 100%;
  height: 240px; /* alto fijo */
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  background: var(--ei-top-bg);
  transition: transform 0.25s ease;
}
.ei-card:hover {
  transform: translateY(-2px);
}

/* Franja inferior animada */
.ei-card__band {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--band-start);
  background: var(--color6);
  transition: height 0.35s ease;
  z-index: 1;
}

/* ✅ Hover efectivo en ambos modos:
   - Hover sobre la card (grid)
   - Hover sobre la slide de Splide (slider)
   - También al tener foco con teclado (accesible) */
.ei-card:hover .ei-card__band,
.ei-card:focus-within .ei-card__band,
.ei-splide .splide__slide:hover .ei-card__band {
  height: var(--band-hover);
}

/* Círculo del ícono */
.ei-card__icon {
  --size: 6.5rem; /* base móvil */
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--ei-icon-bg);
  display: grid;
  place-items: center;
  z-index: 2; /* sobre la franja */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 2px solid #fff;
  margin-top: 1.5rem;
}

/* Ícono dentro del círculo */
.ei-card__icon img {
  display: block;
  width: 60%;
  height: 60%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Título debajo del círculo */
.ei-card__title {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  text-align: center;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}
.ei-card:hover .ei-card__title {
  color: #ffffff;
}

/* Focus accesible */
.ei-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color6) 60%, #fff);
  outline-offset: 3px;
}

/* ===== Ajustes al estar dentro del slider (Splide) ===== */
.ei-splide .splide__track {
  height: auto;
}
.ei-splide .splide__list {
  align-items: stretch;
} /* todas las slides igual alto */
.ei-splide .splide__slide {
  display: flex; /* permite que la card se centre y llene la slide */
  align-items: stretch;
}
.ei-splide .splide__slide > .ei-card {
  width: 100%;
  height: 100%;
  min-height: 240px;
  display: flex; /* asegura centrado dentro de la card */
  align-items: center;
  justify-content: center;
}

/* Desktop */
@media (min-width: 1024px) {
  .ei-card {
    height: 260px;
  }
  .ei-splide .splide__slide > .ei-card {
    min-height: 260px;
  }
  .ei-card__icon {
    --size: 8.5rem;
  }
  .ei-card__title {
    font-size: 1.1rem;
    margin-top: 12px;
  }
}

/* ====== CONTENEDOR CENTRADO CUANDO NO ES SLIDER ====== */
.ei-flexgrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* ✅ centra horizontalmente */
  gap: 1rem;
  padding: 0;
  margin: 0;
}
.ei-flexgrid__item {
  /* ancho base de cada card para que se centre bonito */
  flex: 0 1 220px;
}
@media (min-width: 1024px) {
  .ei-flexgrid__item {
    flex-basis: 240px;
  }
}

/* ====== AJUSTES EN SLIDER (ya los tenías) ====== */
.ei-splide .splide__list {
  align-items: stretch;
}
.ei-splide .splide__slide {
  display: flex;
}
.ei-splide .splide__slide > .ei-card {
  width: 100%;
  height: 100%;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 1024px) {
  .ei-splide .splide__slide > .ei-card {
    min-height: 260px;
  }
}
