/* =========================================================
RESET AISLADO
========================================================= */
.laeca-servicios-grid,
.laeca-servicios-grid *,
.laeca-servicios-grid *::before,
.laeca-servicios-grid *::after {
  box-sizing: border-box;
}

.laeca-servicios-grid h2,
.laeca-servicios-grid h3,
.laeca-servicios-grid p {
  margin: 0;
  padding: 0;
}

/* =========================================================
SECCIÓN
========================================================= */
.laeca-servicios-grid {
  position: relative;
  z-index: 10;
  width: 100%;
  background: #ffffff;
  overflow: visible;
  font-family: "Inter", Arial, sans-serif;
}

/* =========================================================
DEGRADADO HERO → SERVICIOS
Se monta sobre la parte inferior del Hero y termina en blanco.
========================================================= */
.laeca-servicios-grid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -230px;
  height: 300px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 12%,
    rgba(255, 255, 255, 0.28) 28%,
    rgba(255, 255, 255, 0.58) 48%,
    rgba(255, 255, 255, 0.82) 67%,
    rgba(255, 255, 255, 0.96) 84%,
    #ffffff 100%
  );
}

.laeca-servicios-grid__container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 5rem 3rem;
}

/* =========================================================
TÍTULO
========================================================= */
.laeca-servicios-grid__title {
  margin-bottom: 2.5rem !important;
  color: #1a40ff;
  font-family: "Barlow Condensed", "Inter", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

/* =========================================================
GRID
========================================================= */
.laeca-servicios-grid__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* =========================================================
CARD
========================================================= */
.laeca-servicios-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.375rem;
  background: #0a1929;
  cursor: pointer;
}

.laeca-servicios-card__image {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s ease;
}

.laeca-servicios-card:hover .laeca-servicios-card__image {
  transform: scale(1.10);
}

/* =========================================================
OVERLAY
========================================================= */
.laeca-servicios-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(10, 25, 41, 0.56);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 1;
  transition:
    opacity 0.5s ease,
    backdrop-filter 0.5s ease;
}

.laeca-servicios-card:hover .laeca-servicios-card__overlay {
  opacity: 1;
}

/* =========================================================
CONTENIDO HOVER
========================================================= */
.laeca-servicios-card__content {
  transform: translateY(0);
  transition: transform 0.5s ease;
}

.laeca-servicios-card:hover .laeca-servicios-card__content {
  transform: translateY(0);
}

.laeca-servicios-card__content h3 {
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-family: "Barlow Condensed", "Inter", sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.laeca-servicios-card__content p {
  max-width: 28rem;
  margin-bottom: 1rem;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.625;
}

/* =========================================================
BOTÓN
========================================================= */
.laeca-servicios-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.375rem 1.25rem;
  border: 1px solid #ffffff;
  border-radius: 0.25rem;
  background: transparent;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-decoration: none !important;
  text-transform: uppercase;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.laeca-servicios-card__btn:hover {
  background: #ffffff;
  color: #0a1929;
}

/* =========================================================
TABLET
========================================================= */
@media (max-width: 1023px) {
  .laeca-servicios-grid::before {
    top: -190px;
    height: 250px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .laeca-servicios-grid__container {
    padding: 5rem 2.5rem;
  }

  .laeca-servicios-grid__title {
    font-size: 3rem;
  }

  /* En tablet las tarjetas necesitan más alto para que
     título + descripción + botón entren completos al hacer hover. */
  .laeca-servicios-card {
    aspect-ratio: auto;
    height: 360px;
    min-height: 360px;
  }

  .laeca-servicios-card__overlay {
    padding: 1.35rem;
    overflow: hidden;
  }

  .laeca-servicios-card__content {
    width: 100%;
    max-width: 100%;
  }

  .laeca-servicios-card__content h3 {
    margin-bottom: 0.55rem;
    font-size: 1.45rem;
    line-height: 1.04;
    letter-spacing: 0.035em;
  }

  .laeca-servicios-card__content p {
    max-width: 100%;
    margin-bottom: 0.9rem;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .laeca-servicios-card__btn {
    padding: 0.35rem 1.05rem;
    font-size: 0.72rem;
  }
}

@media (min-width: 768px) and (max-width: 860px) {
  .laeca-servicios-grid__container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .laeca-servicios-card {
    height: 380px;
    min-height: 380px;
  }

  .laeca-servicios-card__overlay {
    padding: 1.2rem;
  }

  .laeca-servicios-card__content h3 {
    font-size: 1.35rem;
  }

  .laeca-servicios-card__content p {
    font-size: 0.8rem;
    line-height: 1.48;
  }
}

/* =========================================================
MÓVIL
========================================================= */
@media (max-width: 767px) {
  .laeca-servicios-grid::before {
    top: -150px;
    height: 210px;
  }

  .laeca-servicios-grid__container {
    padding: 4rem 1.25rem;
  }

  .laeca-servicios-grid__title {
    margin-bottom: 2rem !important;
    font-size: 2.25rem;
  }

  .laeca-servicios-grid__items {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* En móvil algunas tarjetas requerían más alto para que
     título + descripción + botón no se corten. */
  .laeca-servicios-card {
    aspect-ratio: auto;
    height: 340px;
    min-height: 340px;
  }

  .laeca-servicios-card__overlay {
    padding: 1.2rem 1.15rem;
    overflow: hidden;
  }

  .laeca-servicios-card__content {
    width: 100%;
    max-width: 100%;
    transform: none;
  }

  .laeca-servicios-card__content h3 {
    margin-bottom: 0.55rem;
    font-size: 1.3rem;
    line-height: 1.04;
    letter-spacing: 0.03em;
  }

  .laeca-servicios-card__content p {
    max-width: 100%;
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .laeca-servicios-card__btn {
    padding: 0.38rem 1rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 420px) {
  .laeca-servicios-grid__container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .laeca-servicios-card {
    height: 360px;
    min-height: 360px;
  }

  .laeca-servicios-card__overlay {
    padding: 1.1rem 1rem;
  }

  .laeca-servicios-card__content h3 {
    font-size: 1.18rem;
    line-height: 1.03;
  }

  .laeca-servicios-card__content p {
    font-size: 0.79rem;
    line-height: 1.46;
  }

  .laeca-servicios-card__btn {
    font-size: 0.7rem;
  }
}

/* =========================================================
MÓVIL TÁCTIL
En dispositivos sin hover mostramos el contenido para que
las tarjetas sigan siendo utilizables.
========================================================= */
@media (hover: none) {
  .laeca-servicios-card__overlay {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(10, 25, 41, 0.85) 0%,
      rgba(10, 25, 41, 0.38) 55%,
      rgba(10, 25, 41, 0.08) 100%
    );
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .laeca-servicios-card__content {
    transform: none;
  }
}

/* =========================================================
ENTRADA SUAVE
El contenido queda visible por defecto; la animación solo se activa
cuando JavaScript detecta que la tarjeta está fuera del editor y del viewport.
========================================================= */
.laeca-servicios-grid__title,
.laeca-servicios-card {
  opacity: 1;
  transform: none;
}

.laeca-servicios-grid .laeca-grid-item-pending {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .7s cubic-bezier(.22,1,.36,1),
    transform .7s cubic-bezier(.22,1,.36,1);
}

.laeca-servicios-grid .laeca-grid-item-pending.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.laeca-servicios-card:nth-child(1) { transition-delay: .08s; }
.laeca-servicios-card:nth-child(2) { transition-delay: .16s; }
.laeca-servicios-card:nth-child(3) { transition-delay: .24s; }
.laeca-servicios-card:nth-child(4) { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .laeca-servicios-grid__title,
  .laeca-servicios-card,
  .laeca-servicios-card__image,
  .laeca-servicios-card__overlay,
  .laeca-servicios-card__content {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
