/* Página Historia — hero «Andén editorial» y espina de recorrido */

/* ===== Hero «Andén editorial» ===== */
.anden {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-bone) 0%, var(--color-bone) 72%, var(--color-white) 100%);
  padding-block: calc(var(--header-offset) + clamp(2.2rem, 6vh, 4rem)) clamp(2.4rem, 6vh, 4.2rem);
}

.anden__grid {
  display: grid;
  gap: clamp(1.8rem, 4.5vw, 4rem);
  align-items: center;
}

@media (min-width: 768px) {
  .anden__grid {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

.anden__content {
  min-width: 0;
}

.anden__title {
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: var(--space-3);
}

.anden__route {
  max-width: 420px;
  margin-top: var(--space-5);
}

.anden__media {
  position: relative;
  min-width: 0;
  justify-self: end;
  width: min(100%, 320px);
}

/* Marco de arco: ventana de andén */
.anden__frame {
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  border: var(--border-subtle);
  box-shadow: var(--shadow-lg);
  background: var(--color-white);
  padding: 10px;
}

.anden__frame img {
  border-radius: 989px 989px calc(var(--radius-lg) - 6px) calc(var(--radius-lg) - 6px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
}

@media (max-width: 767px) {
  .anden__media {
    justify-self: start;
    width: min(100%, 250px);
  }
}

/* ===== Orígenes: pila de fotos con passe-partout ===== */
.hist-stack img {
  padding: 10px;
  background: var(--color-white);
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.hist-stack img:first-child {
  transform: rotate(-1.1deg);
}

.hist-stack img:last-child {
  transform: rotate(1.2deg);
}

.hist-stack img:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ===== Fotos editoriales enmarcadas ===== */
.hist-foto {
  padding: 10px;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.hist-foto:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-sky);
}

.hist-foto img {
  border-radius: calc(var(--radius-lg) - 6px);
}

.hist-foto figcaption {
  font-style: italic;
  color: var(--text-muted);
}

/* ===== Espina de recorrido (Evolución) ===== */
.hist-ruta-head {
  max-width: 60ch;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.2rem, 5vw, 3.4rem);
}

.hist-ruta-head .eyebrow {
  justify-content: center;
}

.hist-ruta-head .titulo-trazo {
  margin-inline: auto;
}

.hist-ruta {
  position: relative;
  max-width: 55rem;
  margin-inline: auto;
}

.hist-ruta__line {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--color-pearl);
  border-radius: 2px;
}

/* Sin JS el progreso queda completo; GSAP lo arranca en 0 y lo completa con el scroll */
.hist-ruta__progress {
  position: absolute;
  inset: 0;
  background: var(--color-sky);
  border-radius: 2px;
  transform-origin: top;
}

.hist-parada {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-block: var(--space-4);
}

.hist-parada__dot {
  position: absolute;
  left: 50%;
  top: 2.15rem;
  transform: translate(-50%, 0);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-white);
  border: 3px solid var(--color-sky);
  box-shadow: 0 0 0 5px var(--color-bone);
  z-index: 1;
}

.hist-parada:last-child .hist-parada__dot {
  background: var(--color-sky);
}

.hist-parada__card {
  padding: var(--space-5) var(--space-5) calc(var(--space-5) + 0.1rem);
}

.hist-parada:nth-child(odd) .hist-parada__card {
  grid-column: 1;
  margin-right: clamp(1.8rem, 4vw, 3rem);
}

.hist-parada:nth-child(even) .hist-parada__card {
  grid-column: 2;
  margin-left: clamp(1.8rem, 4vw, 3rem);
}

.hist-parada__year {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  color: var(--color-sky-deep);
  margin-bottom: var(--space-2);
}

.hist-parada__text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.hist-parada__text strong {
  color: var(--text-primary);
}

@media (max-width: 719px) {
  .hist-ruta__line {
    left: 9px;
    transform: none;
  }

  .hist-parada {
    grid-template-columns: 1fr;
  }

  .hist-parada__dot {
    left: 9px;
    transform: translate(-50%, 0) scale(0.85);
    box-shadow: 0 0 0 4px var(--color-bone);
  }

  .hist-parada:nth-child(odd) .hist-parada__card,
  .hist-parada:nth-child(even) .hist-parada__card {
    grid-column: 1;
    margin: 0 0 0 2.2rem;
  }
}

/* ===== Un desafío permanente ===== */
.hist-desafio {
  max-width: 70ch;
  margin-inline: auto;
}

.hist-desafio p + p {
  margin-top: var(--space-4);
}

.hist-desafio > p:nth-of-type(1) {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.1vw, 1.3rem);
  line-height: 1.55;
  color: var(--text-primary);
}

/* ===== Notebooks de poca altura: el hero entra completo ===== */
@media (min-width: 900px) and (max-height: 760px) {
  .anden {
    padding-block: calc(var(--header-offset) + 1.4rem) 1.8rem;
  }

  .anden__title {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
  }

  .anden__media {
    width: min(100%, 250px);
  }

  .anden__frame img {
    aspect-ratio: 1 / 1;
  }
}

/* ===== Fondos «Degradés puente» (ronda 7): sin costuras entre bandas ===== */
.section-warm {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--color-bone) 14%, var(--color-bone) 86%, #FFFFFF 100%);
}

/* El cierre celeste desemboca sin corte en el footer tinta; el tramo
   oscuro vive en el padding inferior extra, nunca bajo el contenido. */
.section-accent {
  /* Rampa celeste→tinta ruteada por tonos fríos intermedios (ronda 11) */
  background: linear-gradient(180deg, #FFFFFF 0%, var(--color-sky-soft) 180px, var(--color-sky-soft) calc(100% - 260px), #C4D8E4 calc(100% - 253px), #BCD3E1 calc(100% - 233px), #A9C5D7 calc(100% - 204px), #93AEBE calc(100% - 168px), #879FAD calc(100% - 130px), #7E96A4 calc(100% - 92px), #657A87 calc(100% - 56px), #4E5F6A calc(100% - 27px), #3B4C58 calc(100% - 7px), #2B3942 100%);
  padding-bottom: clamp(140px, 16vh, 190px);
}

.site-footer {
  background: linear-gradient(180deg, #2B3942 0%, var(--color-dark) 120px);
}

/* ===== Ronda 29.4b (refuerzo): borde diseñado hacia el footer tinta =====
   Mismo criterio que la Home: meseta del color propio + ola en el color
   exacto del footer; el degradé largo se retira. */
.section-accent {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--color-sky-soft) 180px, var(--color-sky-soft) 100%);
  padding-bottom: clamp(150px, 16vh, 200px);
}

.section-accent::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 64px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0 34C240 56 480 14 720 34S1200 58 1440 36L1440 64 0 64Z' fill='%232B3942'/%3E%3C/svg%3E") bottom center / 100% 64px no-repeat;
}

/* ===== Ronda 34 (Historia) ===== */
/* 34.9 Hero en alturas cortas: compacto y con la línea de recorrido
   extendida hacia la foto para conectar la composición */
.anden__route {
  max-width: none;
}

@media (min-width: 900px) and (max-height: 820px) {
  .anden {
    padding-block: calc(var(--header-offset) + 0.6rem) 1.2rem;
  }
}

/* 34.11 Espina del timeline al punteado-de-ramal (firma del sitio);
   el progreso celeste del scrub corre por encima como recorrido hecho */
.hist-ruta__line {
  background: repeating-linear-gradient(180deg, var(--color-pearl) 0 6px, transparent 6px 14px);
}
