/* ================================
   RESEÑA HISTÓRICA
   Coherente con main.css / home.css
================================ */

/* ================================
   HERO PARALLAX
================================ */

.history-hero {
  position: relative;
  /* ALTURA FIJA (no min-height): así el nº de líneas del título/texto
     NO cambia la altura. Las 4 páginas quedan idénticas en cualquier
     pantalla. El contenido va centrado y overflow:hidden lo contiene. */
  height: max(82vh, 780px);
  display: flex;
  align-items: center;
  padding: 210px 0 130px;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.80), rgba(0,0,0,.46), rgba(0,0,0,.22)),
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.66)),
    url("/img/nosotros/banner-reseña.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* parallax */
}

.history-hero::after {
  /* línea de acento inferior, coherente con la barra de progreso del home */
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: var(--red);
  z-index: 4;
}

.history-hero__content {
  position: relative;
  z-index: 3;
  width: min(820px, 100%);
}

.history-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: rgba(255,255,255,.82);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.history-hero__eyebrow::before {
  content: "";
  width: 36px;
  height: 3px;
  background: var(--red);
}

.history-hero__title {
  margin: 0 0 26px;
  color: var(--white);
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  font-weight: 900;
  line-height: .92;
  letter-spacing: -2px;
  text-transform: uppercase;
}

.history-hero__title em {
  font-style: normal;
  color: var(--red);
}

.history-hero__desc {
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,.9);
  font-size: 1.08rem;
  line-height: 1.75;
}

.history-hero__cue {
  position: absolute;
  left: 50%;
  width: 100%;
  bottom: 10px;
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.7);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.history-hero__cue i {
  font-size: 1.4rem;
  animation: historyCueBounce 2s ease-in-out infinite;
}

@keyframes historyCueBounce {
  50% { transform: translateY(8px); }
}

/* ================================
   SECCIÓN HISTORIA / TIMELINE
================================ */

.history {
  padding: 120px 0;
  background: #fff;
  color: #111;
  overflow: hidden;
}

.history__head {
  max-width: 820px;
  margin: 0 auto 80px;
  text-align: center;
}

.history__head h2 {
  margin: 12px 0 18px;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.history__head h2 span {
  color: var(--red);
}

.history__head p {
  margin: 0 auto;
  max-width: 680px;
  color: #666;
  font-size: 1.02rem;
  line-height: 1.8;
}

/* ---------- Timeline ---------- */

.timeline {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
}

.timeline::before {
  /* línea central */
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(211,14,51,.0), rgba(211,14,51,.55), rgba(211,14,51,.0));
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 100px;
}

.timeline__item:last-child {
  margin-bottom: 0;
}

/* nodo sobre la línea */
.timeline__item::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 30px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  transform: translateX(-50%);
  box-shadow: 0 0 0 6px rgba(211,14,51,.15);
  z-index: 2;
}

/* alternar lados */
.timeline__item:nth-child(even) .timeline__media { order: 2; }
.timeline__item:nth-child(even) .timeline__text { order: 1; text-align: right; }
.timeline__item:nth-child(even) .timeline__year { margin-left: auto; }

/* media */
.timeline__media {
  position: relative;
}

.timeline__media::before {
  content: "";
  position: absolute;
  inset: 18px auto auto 18px;
  width: 100%;
  height: 100%;
  background: var(--red);
  border-radius: 22px;
  z-index: 0;
  opacity: .10;
}

.timeline__media img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 22px;
  filter: contrast(1.1) saturate(1.08) brightness(1.02);
  box-shadow: 0 28px 65px rgba(0,0,0,.18);
}

/* texto */
.timeline__year {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 8px 18px;
  background: rgba(211,14,51,.08);
  color: var(--red);
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.timeline__text h3 {
  margin: 0 0 16px;
  color: #111;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.timeline__text p {
  margin: 0 0 16px;
  color: #555;
  font-size: 1rem;
  line-height: 1.9;
}

.timeline__text p:last-child {
  margin-bottom: 0;
}

/* Variante con dos imágenes lado a lado */
.timeline__media--duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 992px) {
  .history-hero {
    background-attachment: scroll; /* parallax fijo no rinde en táctil */
    height: auto;                  /* en móvil, altura según contenido */
    min-height: 70vh;
    padding: 170px 0 100px;
  }

  .history {
    padding: 90px 0;
  }

  .history__head {
    margin-bottom: 56px;
  }

  .timeline {
    max-width: 640px;
  }

  .timeline::before {
    left: 22px;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-left: 56px;
    margin-bottom: 64px;
  }

  .timeline__item::after {
    left: 22px;
    top: 8px;
  }

  /* en móvil todo en el mismo orden y alineado a la izquierda */
  .timeline__item:nth-child(even) .timeline__media { order: 0; }
  .timeline__item:nth-child(even) .timeline__text {
    order: 0;
    text-align: left;
  }

  .timeline__item:nth-child(even) .timeline__year {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .timeline__media--duo {
    grid-template-columns: 1fr;
  }

  .history-hero {
    min-height: 60vh;
    padding: 150px 0 80px;
  }

  .history-hero__desc {
    font-size: 1rem;
  }

  .timeline__item {
    padding-left: 44px;
  }

  .timeline::before {
    left: 14px;
  }

  .timeline__item::after {
    left: 14px;
  }

  .timeline__media::before {
    inset: 12px auto auto 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-hero {
    background-attachment: scroll;
  }

  .history-hero__cue i {
    animation: none;
  }
}
