/* ==========================================================================
   OPENLAB HERO
   Carrusel Bootstrap 5
   ========================================================================== */

.openlab-hero {
  --openlab-hero-height: clamp(580px, 72vh, 760px);

  position: relative;
  width: 100%;
  overflow: hidden;
  color: #ffffff;
  background: #060b18;
}

/* ==========================================================================
   ESTRUCTURA DEL CARRUSEL
   ========================================================================== */

.openlab-hero .carousel-inner,
.openlab-hero .carousel-item,
.openlab-hero__slide {
  height: var(--openlab-hero-height);
}

.openlab-hero .carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.openlab-hero .carousel-item {
  width: 100%;
  overflow: hidden;
}

.openlab-hero__slide {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

/* ==========================================================================
   IMAGEN
   ========================================================================== */

.openlab-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/*
 * Envoltorios que pueden ser generados por Views, Media o campos de Drupal.
 */
.openlab-hero__media > div,
.openlab-hero__media .field-content,
.openlab-hero__media .field,
.openlab-hero__media .field__item,
.openlab-hero__media article,
.openlab-hero__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.openlab-hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
}

/* ==========================================================================
   SUPERPOSICIÓN
   ========================================================================== */

.openlab-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background:
    linear-gradient(
      90deg,
      rgba(4, 8, 20, 0.96) 0%,
      rgba(4, 8, 20, 0.88) 30%,
      rgba(4, 8, 20, 0.58) 58%,
      rgba(4, 8, 20, 0.18) 100%
    ),
    linear-gradient(
      0deg,
      rgba(4, 8, 20, 0.66) 0%,
      rgba(4, 8, 20, 0) 52%
    );
}

/* ==========================================================================
   CONTENEDOR Y CONTENIDO
   ========================================================================== */

.openlab-hero__container {
  position: relative;
  z-index: 2;
  width: 100%;
}

.openlab-hero__content {
  width: min(100%, 650px);
  padding-top: 96px;
  padding-bottom: 96px;
}

/* ==========================================================================
   TÍTULO
   ========================================================================== */

.openlab-hero__title {
  max-width: 680px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.75rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

/*
 * Evita márgenes inesperados si Views o el campo agrega contenido interno.
 */
.openlab-hero__title > :first-child {
  margin-top: 0;
}

.openlab-hero__title > :last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   CUERPO
   ========================================================================== */

.openlab-hero__body {
  max-width: 600px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.7;
}

.openlab-hero__body > :first-child {
  margin-top: 0;
}

.openlab-hero__body > :last-child {
  margin-bottom: 0;
}

.openlab-hero__body a {
  color: inherit;
}

/* ==========================================================================
   ACCIONES
   ========================================================================== */

.openlab-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.openlab-hero__action {
  display: inline-flex;
}

.openlab-hero__action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.openlab-hero__action a:hover,
.openlab-hero__action a:focus-visible {
  transform: translateY(-2px);
}

/* Botón principal */

.openlab-hero__action--primary a {
  color: #ffffff;
  background: #663bdc;
  border-color: #663bdc;
}

.openlab-hero__action--primary a:hover,
.openlab-hero__action--primary a:focus-visible {
  color: #ffffff;
  background: #7952e8;
  border-color: #7952e8;
}

/* Botón secundario */

.openlab-hero__action--secondary a {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(10px);
}

.openlab-hero__action--secondary a:hover,
.openlab-hero__action--secondary a:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: #ffffff;
}

/* ==========================================================================
   CONTROLES DE BOOTSTRAP
   ========================================================================== */

.openlab-hero .carousel-control-prev,
.openlab-hero .carousel-control-next {
  z-index: 4;
  width: 7%;
  min-width: 54px;
  max-width: 88px;
  opacity: 0.82;
  transition:
    opacity 180ms ease,
    background-color 180ms ease;
}

.openlab-hero .carousel-control-prev:hover,
.openlab-hero .carousel-control-prev:focus,
.openlab-hero .carousel-control-next:hover,
.openlab-hero .carousel-control-next:focus {
  opacity: 1;
}

.openlab-hero .carousel-control-prev-icon,
.openlab-hero .carousel-control-next-icon {
  width: 48px;
  height: 48px;
  padding: 10px;
  background-color: rgba(4, 9, 22, 0.52);
  background-size: 45%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   INDICADORES
   ========================================================================== */

.openlab-hero .carousel-indicators {
  z-index: 4;
  bottom: 26px;
  gap: 8px;
  margin-bottom: 0;
}

.openlab-hero .carousel-indicators [data-bs-target] {
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  opacity: 0.48;
  background-color: #ffffff;
  transition:
    width 180ms ease,
    opacity 180ms ease,
    border-radius 180ms ease;
}

.openlab-hero .carousel-indicators .active {
  width: 30px;
  border-radius: 999px;
  opacity: 1;
}

/* ==========================================================================
   TRANSICIÓN
   ========================================================================== */

.openlab-hero.carousel-fade .carousel-item {
  transition: opacity 750ms ease;
}

.openlab-hero:not(.carousel-fade) .carousel-item {
  transition: transform 700ms ease-in-out;
}

/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 991.98px) {
  .openlab-hero {
    --openlab-hero-height: 650px;
  }

  .openlab-hero__content {
    width: min(100%, 590px);
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .openlab-hero__media img {
    object-position: 62% center;
  }

  .openlab-hero__overlay {
    background:
      linear-gradient(
        90deg,
        rgba(4, 8, 20, 0.97) 0%,
        rgba(4, 8, 20, 0.86) 52%,
        rgba(4, 8, 20, 0.42) 100%
      ),
      linear-gradient(
        0deg,
        rgba(4, 8, 20, 0.68) 0%,
        rgba(4, 8, 20, 0.05) 58%
      );
  }
}

/* ==========================================================================
   MÓVIL
   ========================================================================== */

@media (max-width: 767.98px) {
  .openlab-hero {
    --openlab-hero-height: 680px;
  }

  .openlab-hero__slide {
    align-items: flex-end;
  }

  .openlab-hero__media img {
    object-position: 64% center;
  }

  .openlab-hero__overlay {
    background:
      linear-gradient(
        0deg,
        rgba(4, 8, 20, 1) 3%,
        rgba(4, 8, 20, 0.92) 39%,
        rgba(4, 8, 20, 0.34) 78%,
        rgba(4, 8, 20, 0.14) 100%
      );
  }

  .openlab-hero__content {
    width: 100%;
    padding-top: 76px;
    padding-bottom: 72px;
  }

  .openlab-hero__title {
    font-size: clamp(2.25rem, 10.5vw, 3.5rem);
    line-height: 1.04;
  }

  .openlab-hero__body {
    margin-top: 18px;
    font-size: 1rem;
    line-height: 1.6;
  }

  .openlab-hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 26px;
  }

  .openlab-hero__action,
  .openlab-hero__action a {
    width: 100%;
  }

  .openlab-hero .carousel-control-prev,
  .openlab-hero .carousel-control-next {
    display: none;
  }

  .openlab-hero .carousel-indicators {
    bottom: 18px;
  }
}

/* ==========================================================================
   MÓVIL PEQUEÑO
   ========================================================================== */

@media (max-width: 575.98px) {
  .openlab-hero {
    --openlab-hero-height: 700px;
  }

  .openlab-hero__container {
    padding-right: 20px;
    padding-left: 20px;
  }

  .openlab-hero__title {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }
}

/* ==========================================================================
   REDUCCIÓN DE MOVIMIENTO
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .openlab-hero .carousel-item,
  .openlab-hero .carousel-indicators [data-bs-target],
  .openlab-hero__action a {
    transition: none;
  }
}