/* ========================================================================= */
/* ¿QUIÉNES SOMOS? + HISTORIA + CARRUSEL HISTORIA */
/* ========================================================================= */

.history-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
  text-align: left;
  margin-bottom: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.history-text-block {
  flex: 1;
  min-width: 450px;
  background-color: var(--cecns-blue);
  color: white;
  padding: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.history-subtitle {
  color: white;
  margin-bottom: 1rem;
}

.history-text-block p {
  margin-bottom: 1rem;
  color: white;
  font-size: 1.05rem;
}

.history-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
  padding-top: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.history-list li {
  font-size: 1.1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.history-list li i {
  color: var(--cecns-gold);
  font-size: 1.2rem;
  margin-top: 3px;
}

.history-closing {
  margin-top: 1rem;
}

/* Carrusel historia */
.history-carousel-container {
  flex: 1;
  min-width: 400px;
  height: 450px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  background-color: #f0f0f0;
}

.history-carousel-track {
  /*
    Ajuste solicitado (Tarea 2):
    - Evitar desbordamiento y que las imágenes "pasen" horizontalmente.
    - Mostrar UNA imagen a la vez en el mismo espacio (fade), sin carrusel.
    - El JS (app.js) añade .is-fade y alterna .is-active.
  */
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

.history-carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity 850ms ease;
}

/* Estado activo controlado por JS */
.history-carousel-img.is-active {
  opacity: 1;
}

/* Fallback sin JS: deja la primera visible */
html:not(.js) .history-carousel-img {
  position: static;
  opacity: 1;
  display: none;
  transform: none;
}
html:not(.js) .history-carousel-img:first-child {
  display: block;
}

/* Responsive */
@media (max-width: 992px) {
  .history-flex-container {
    flex-direction: column;
    gap: 20px;
  }

  .history-text-block {
    min-width: unset;
    width: 100%;
    padding: 1.5rem;
  }

  .history-carousel-container {
    min-width: unset;
    width: 100%;
    height: 300px;
  }
}
