/**
 * historia.css — Nuestra Historia page
 * Estilos específicos de la página. Depende de styles.css (cargado primero).
 */

/* ── Layout principal ─────────────────────────────────────── */
.historia-main {
  overflow-x: hidden;
}

/* ── Hero intro — 100% ancho, fondo blanco ────────────────── */
.historia-hero {
  min-height: calc(100vh - var(--nav-h) - 8rem); /* 8rem del timeline visible */
  display: flex;
  align-items: center;
  padding: 2rem max(3rem, 8vw) 2rem;
  background: #fff;
  overflow: hidden;
}

.historia-intro {
  width: 100%;
  max-width: none;
  animation: slideFromRight 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(100vw); }
  to   { opacity: 1; transform: translateX(0);    }
}

.historia-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--wine-red);
  background: rgba(141, 20, 30, 0.10);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.historia-h1 {
  font-size: clamp(2.25rem, 4.5vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.historia-h1 em {
  font-style: normal;
  color: var(--wine-red);
}

.historia-lead {
  font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
  line-height: 1.65;
  color: var(--secondary);
  max-width: 38rem;
}

/* ── Sección timeline ─────────────────────────────────────── */
.tl-section {
  position: relative;
  overflow: hidden; /* evita que las fotos desborden hacia el scrubber */
}

.tl-axis-bg {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(20, 17, 67, 0.07);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
}

.tl-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid rgba(20, 17, 67, 0.12);
  border-radius: 999px;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tl-arrow:hover { background: var(--primary); color: white; }
.tl-arrow--prev { left: 1.5rem; }
.tl-arrow--next { right: 1.5rem; }

.tl-viewport {
  display: flex;
  align-items: flex-end; /* alineados abajo: imágenes cuelgan hacia arriba del eje */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 1rem max(10vw, 4rem) 3rem;
  position: relative;
  z-index: 10;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tl-viewport::-webkit-scrollbar { display: none; }

/* ── Cards del timeline ── */
.tl-item {
  flex-shrink: 0;
  scroll-snap-align: center;
  text-align: center;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.tl-item--minor {
  width: clamp(160px, 22vw, 240px);
  margin: 0 1.75rem;
  opacity: 0.4;
  transform: scale(0.9);
}

.tl-item--major {
  width: clamp(240px, 36vw, 380px);
  margin: 0 2.5rem;
}

.tl-item--hero {
  width: clamp(280px, 46vw, 460px);
  margin: 0 2.5rem;
  position: relative;
  z-index: 30;
}

.tl-era {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--wine-red);
  margin-bottom: 0.75rem;
}

/* Contenedor de imagen */
.tl-img-wrap {
  overflow: hidden;
  border-radius: 0.5rem;
  position: relative;
}
.tl-img-wrap--portrait { aspect-ratio: 4/4; }
.tl-img-wrap--square   { aspect-ratio: 1/1; }
.tl-img-wrap--video    { aspect-ratio: 16/9; }

/* Placeholder de color mientras no hay fotos reales */
.tl-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
}
.tl-placeholder--1984 { background: linear-gradient(135deg, #1a1842 0%, #2d2a5e 100%); }
.tl-placeholder--1994 { background: linear-gradient(135deg, #2d2a5e 0%, #414070 100%); }
.tl-placeholder--2004 { background: linear-gradient(135deg, #141143 0%, #8d141e 100%); }
.tl-placeholder--2014 { background: linear-gradient(135deg, #292759 0%, #3d3b72 100%); }
.tl-placeholder--2024 { background: linear-gradient(135deg, #8d141e 0%, #141143 100%); }

.tl-placeholder-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.35);
}

/* Badge sobre el card hero */
.tl-active-tag {
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--wine-red);
  color: white;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Texto debajo de la imagen */
.tl-year {
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--primary);
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}
.tl-year--minor {
  font-size: clamp(1.25rem, 2.2vw, 1.875rem);
  color: var(--secondary);
}

.tl-caption {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--secondary);
}

.tl-desc {
  font-size: clamp(0.8125rem, 1.1vw, 0.9rem);
  line-height: 1.6;
  color: var(--secondary);
  font-style: italic;
  margin-top: 0.5rem;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

.tl-item--hero .tl-img-wrap {
  box-shadow: 0 20px 56px rgba(20, 17, 67, 0.18);
}

/* ── Scrubber — pegado al timeline ────────────────────────── */
.scrubber-section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 5rem;
}

.scrubber-wrap {
  position: relative;
  height: 5.5rem;
  display: flex;
  align-items: center;
}

.scrubber-line {
  position: absolute;
  left: 2.5rem;
  right: 2.5rem;
  height: 1px;
  background: rgba(20, 17, 67, 0.10);
}

/* ── Anchor con preview flotante ── */
.scrubber-anchor {
  position: absolute;
  top: 50%;
  transform: translateY(-120%);
  z-index: 20;
}
.scrubber-anchor--left  { left: 0; }
.scrubber-anchor--right { right: 0; }

.scrubber-preview {
  position: absolute;
  bottom: calc(100% + 0.875rem);
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.92);
  width: 8rem;
  height: 10.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 48px rgba(20, 17, 67, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.875rem;
}
.scrubber-anchor:hover .scrubber-preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.scrubber-preview--1984 { background: linear-gradient(135deg, #1a1842 0%, #2d2a5e 100%); }
.scrubber-preview--2024 { background: linear-gradient(135deg, #8d141e 0%, #141143 100%); }

.scrubber-preview-era {
  font-size: 0.5625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.25rem;
}

.scrubber-preview-year {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: white;
  line-height: 1;
}

/* Miniatura siempre visible */
.scrubber-thumb {
  width: 2.75rem;
  height: 3.5rem;
  overflow: hidden;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  border: none;
  padding: 0;
  display: block;
}
.scrubber-thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(20, 17, 67, 0.18);
}

.scrubber-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0.25rem;
}
.scrubber-thumb-inner--1984 { background: linear-gradient(135deg, #1a1842 0%, #2d2a5e 100%); }
.scrubber-thumb-inner--2024 { background: linear-gradient(135deg, #8d141e 0%, #141143 100%); }

.scrubber-thumb-year {
  font-size: 0.45rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Dots ── */
.scrubber-dots {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
}

.scrubber-dot-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scrubber-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 999px;
  background: rgba(20, 17, 67, 0.14);
  border: none;
  cursor: pointer;
  transition: background 0.22s, transform 0.22s;
  padding: 0;
  display: block;
}
.scrubber-dot:hover,
.scrubber-dot.is-active {
  background: var(--wine-red);
  transform: scale(1.6);
}

/* Etiquetas posicionadas absolutamente — no afectan el layout de los dots */
.scrubber-dot-label {
  position: absolute;
  top: calc(0.4375rem + 0.45rem);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.5rem;
  font-weight: 700;
  color: rgba(20, 17, 67, 0.28);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}
.scrubber-dot-wrap.is-active .scrubber-dot-label {
  color: var(--wine-red);
  font-weight: 800;
}

/* ── Leyenda ── */
.historia-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0 2rem 4rem;
}
.historia-legend-line {
  width: 3rem;
  height: 1px;
  background: rgba(20, 17, 67, 0.12);
}
.historia-legend-text {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--secondary);
  opacity: 0.5;
}

/* ── Footer ── */
.historia-footer {
  padding: 2.5rem 3rem;
  background: var(--surface-container-low);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}
.historia-footer-logo img { height: 1.75rem; width: auto; }
.historia-footer-links { display: flex; gap: 2rem; flex-wrap: wrap; }
.historia-footer-links a {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--secondary);
  text-decoration: none;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.historia-footer-links a:hover { opacity: 1; }
.historia-footer-copy {
  font-size: 0.75rem;
  color: var(--secondary);
  opacity: 0.35;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .historia-hero {
    min-height: auto;
    padding: 3rem 1.5rem;
  }

  .tl-arrow { display: none; }

  .tl-viewport {
    padding: 3rem 1.5rem 2.5rem;
  }

  .tl-item--minor {
    width: clamp(140px, 48vw, 200px);
    margin: 0 1rem;
  }
  .tl-item--major,
  .tl-item--hero {
    width: clamp(220px, 78vw, 320px);
    margin: 0 1.25rem;
  }

  .scrubber-section { padding: 0 1.25rem; }
  .scrubber-dots    { padding: 0 0.75rem; }

  .historia-legend { padding-bottom: 2.5rem; }
  .historia-footer { flex-direction: column; text-align: center; }
  .historia-footer-links { justify-content: center; }
}

@media (max-width: 480px) {
  .historia-h1 { font-size: clamp(1.875rem, 8vw, 2.5rem); }
  .scrubber-section { padding: 0 0.75rem; }
  .scrubber-wrap { height: 4.5rem; }
  .scrubber-thumb { width: 2.25rem; height: 2.875rem; }
}

.tl-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}