/* ================================
   BASE - LINEA DE TIEMPO
   ================================ */

/* --- Variables globales --- */
:root {
  /* colores base */
  --bg-a: #0c0c0c;
  --bg-b: #0e0d0d;
  --bg-c: #000;

  --year-on: #ffc116;
  --year-off: #afafaf;
  --line-on: #fff;
  --line-off: rgba(255, 255, 255, .35);

  --dash: 14px;
  --gap: 5px;
  --line-w: 3px;
  --dot-d: 25px;

  --fs-year: 28px;
  --fs-date: 22px;

  /* Panel derecho */
  --tl-width: 320px;
  --tl-pad: 16px;
  --tl-accent: #ffc116;
}

#pie-credito {
    color: white;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 2px solid white;
    z-index: 90000;
    position: relative;
    width:100%;
        transform: translate(0, 20px);
}

#historia-scroll-linea-tiempo {
  max-width: 100%;
      scroll-snap-type: y mandatory;
      background-color: black;
}

/* --- Estructura general --- */
#historia-scroll-linea-tiempo {
  background: linear-gradient(to right, var(--bg-a), var(--bg-b), var(--bg-c));
  font-family: 'Heebo', 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  overflow: hidden;
}

body.has-tl-visible #historia-scroll-linea-tiempo,
body.has-tl-visible #portada-historia-scroll-linea-tiempo,
body.has-tl-visible #intro {
  padding-right: calc(var(--tl-width) + 10px);
}

/* EXCEPCIÓN → el pie NUNCA debe desplazarse */
body.has-tl-visible #pie-credito {
  padding-right: 0 !important;
}

#intro {
  background-color: #000;
}

#portada-historia-scroll-linea-tiempo {
  height: 100vh;
  background-color: #000;
  width: 100%;
}


.ano .texto-flotante.snap-stop,
.ano .galeria-fotos.snap-stop,
#portada-historia-scroll-linea-tiempo.snap-stop {
  display: block;
}

/* ================================
   BLOQUE: Año y eventos (estructura base)
   ================================ */
.ano {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  width: 100%;
  border-radius: 10px;
  transition: background-color .25s ease, box-shadow .25s ease;
}

/* Título del año (se mantiene para lógica; visual lo apagamos más abajo) */
.ano-titulo {
  font-weight: 800;
  font-size: var(--fs-year);
  color: var(--year-off);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
  border: 2px solid rgba(255, 255, 255, .35);
  padding: 5px;
}

.ano.has-events .ano-titulo {
  color: #fff;
  border: 2px solid #fff;
}

/* Transiciones */
.ano-evento .ponto,
.ano-titulo {
  transition: all .3s ease;
}

/* Estado activo (en vista) */
.ano.has-events.in-view .ano-titulo {
  color: var(--year-on) !important;
  border-color: var(--year-on) !important;
}

.ano.has-events.in-view .ano-evento .ponto {
  background-color: var(--year-on) !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 8px #ffc11688;
}

/* Línea vertical */
.ano-linha {
  width: var(--line-w);
  background-image: repeating-linear-gradient(to bottom,
      var(--line-off) 0 var(--dash),
      transparent var(--dash) calc(var(--dash) + var(--gap)));
}

.ano.has-events .ano-linha {
  background-image: repeating-linear-gradient(to bottom,
      var(--line-on) 0 var(--dash),
      transparent var(--dash) calc(var(--dash) + var(--gap)));
}

/* Evento individual */
.ano-evento {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  overflow: hidden;
}

.ano-evento .ponto {
  width: var(--dot-d);
  height: var(--dot-d);
  border-radius: 50%;
  background: #949494;
  border: 2px solid #fff;
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, .4);
  margin-bottom: 6px;
}

.ano-evento .ponto:hover {
  background: var(--year-on);
}

.ano-evento .data {
  font-size: var(--fs-date);
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, .8);
}

.site-footer {
  background: #0a0a0a;
  color: #ddd;
  padding: 40px 20px;
  border-top: 1px solid #222;
  font-family: "Heebo", "Open Sans", sans-serif;
}

.site-footer__inner {
  padding-top: 42px;
  padding-bottom:32px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  text-align: center;
  flex-direction: column;
}

/* Bloques */
.site-footer__block {
  flex: 1 1 280px;
  min-width: 260px;
}

/* Títulos */
.site-footer__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #f2f2f2;
}

/* Listado de créditos */
.site-footer__credits {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__credits li {
  margin-bottom: 6px;
  font-size: 1.2rem;
  line-height: 1.4;
}

.site-footer__credits strong {
  color: #fff;
  font-weight: 600;
}

/* Branding derecha */
.site-footer__brand {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.site-footer__org {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.site-footer__year {
  opacity: .7;
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Móvil */
@media (max-width: 600px) {
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .site-footer__brand {
    text-align: center;
  }
}

/* ================================
   APAGAR ELEMENTOS DE LA LÍNEA CENTRAL ORIGINAL
   (seguimos usando su DOM para sincronizar,
   pero no se muestran en la columna principal)
   ================================ */
#historia-scroll-linea-tiempo .ano .ano-linha,
#historia-scroll-linea-tiempo .ano .ano-evento .ponto,
#historia-scroll-linea-tiempo .ano .ano-evento .data,
#historia-scroll-linea-tiempo .ano .ano-titulo {
  display: none !important;
}

/* ================================
   PANEL LATERAL DERECHA
   ================================ */


#tl-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 38vh;
  height: 65vh;
  background: #111;
  color: var(--year-off);
  overflow: hidden;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  border-left: 2px solid var(--tl-accent);
  padding-top: 77px;
  background-color: black;
  padding-bottom: 15%;
  right: 2rem;

  /* ⬇⬇⬇ OCULTO POR DEFECTO */
  opacity: 0;
  pointer-events: none;
}

#tl-panel {
  transition: opacity .45s ease, transform .45s ease;
  transition-delay: 0s;
}

/* SOLO cuando entra (show-timeline) aplicamos delay */
body.show-timeline #tl-panel {
  transition-delay: 1s;
}

/* Estado visible (cuando ya salimos de portada/intro) */
body.show-timeline #tl-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* (Opcional) si quieres mantener hide-timeline */
body.hide-timeline #tl-panel {
  opacity: 0;
  pointer-events: none;
}
/* Scrollbar más ancho dentro del panel derecho */
#tl-panel .tl-scroll {
  scrollbar-width: thin;
  /* Firefox base */
  scrollbar-color: var(--tl-accent) #000;
}

/* Webkit (Chrome, Edge, Safari) */
#tl-panel .tl-scroll::-webkit-scrollbar {
  width: 14px;
  /* << AUMENTA EL GROSOR */
}

#tl-panel .tl-scroll::-webkit-scrollbar-track {
  background: #000;
}

#tl-panel .tl-scroll::-webkit-scrollbar-thumb {
  background: var(--tl-accent);
  border-radius: 10px;
  border: 3px solid #000;
  /* para que no quede pegado al borde */
}

#tl-toggle {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  background: #111;
  color: var(--year-on);
  border: 2px solid var(--year-on);
  border-radius: 6px 0 0 6px;
  font-size: 20px;
  width: 28px;
  height: 60px;
  cursor: pointer;
}

#tl-panel .tl-scroll {
  overflow-y: auto;
  padding: 20px 10px 40px;
  scrollbar-width: thin;
}

/* Aparición suave de la línea de tiempo (panel + columna) */
#tl-panel {
  transition: opacity .45s ease, transform .45s ease;
  transition-delay: 0s;
  /* reset */
}

/* SOLO cuando entra (show-timeline) aplicamos delay */
body.show-timeline #tl-panel {
  transition-delay: 1s;
}

/* Estado oculto (cuando portada/intro están visibles) */
body.hide-timeline #tl-panel,
body.hide-timeline #historia-scroll-linea-tiempo {
  opacity: 0;
  pointer-events: none;
}

/* Estado visible (cuando ya salimos de portada/intro) */
body.show-timeline #tl-panel,
body.show-timeline #historia-scroll-linea-tiempo {
  opacity: 1;
  transform: translateX(0);
}

/* Si el panel está colapsado, mantenemos la transición sólo de opacidad
   (el propio translateX de colapso lo gestiona tu clase .is-collapsed) */
#tl-panel.is-collapsed {
  transition: opacity .35s ease;
}


/* ================================
   AÑOS Y FECHAS
   ================================ */

.tl-year {
  margin-bottom: 20px;
  padding-left: 10px;
  cursor: pointer;
  transition: color 0.2s ease;
  opacity: .9;
background: linear-gradient(to right, #111111 0%, #000000 100%);
}

.tl-year .y {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--year-off);
  margin-bottom: 6px;
  transition: color 0.2s ease;
  padding: 5px;
}

.tl-year.is-active .y {
  color: #000;
  color: var(--tl-accent);
  border-color: var(--tl-accent);
}

.tl-year ul {
  list-style: none;
  padding-left: 22px;
  padding-bottom: 10px;
  margin: 0;
}

.tl-year li {
  position: relative;
  padding-left: 16px;
  margin: 6px 0;
  font-size: 1.1rem;
  color: var(--year-off);
  transition: color 0.25s ease;
  cursor: pointer;
}

.tl-year li .tl-dot {
  position: absolute;
  left: -9px;
  top: 6px;
  width: 8px;
  height: 8px;
  background: var(--year-off);
  border-radius: 50%;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.tl-year li.is-active,
.tl-year li.is-visible {
  color: var(--year-on);
}

.tl-year li.is-active .tl-dot,
.tl-year li.is-visible .tl-dot {
  background: var(--year-on);
  box-shadow: 0 0 6px var(--year-on);
}

/* Vídeos de fondo en la INTRO */
#intro .tlf-video-overlay {
  position: absolute;
  /* ya sueles tenerlo así */
  inset: 0;
  z-index: 1;
}

#intro .tlf-video-overlay video,
#intro .tlf-photo-hero>video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  /* <-- lo que pides */
  object-position: center;
  /* centra el encuadre */
}

#intro .tlf-photo-hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 768px) {
  #tl-panel {
    display: none;
  }

  #historia-scroll-linea-tiempo {
    width: 100%;
    overflow-x: hidden;
  }
}

/* ================================
   RESPONSIVE: ajustes adicionales
   ================================ */

/* Tablet grande / Desktop pequeño */
@media (max-width: 1200px) {
  :root {
    --tl-width: 280px;
    --fs-year: 24px;
    --fs-date: 20px;
    --dot-d: 22px;
    --line-w: 2.5px;
  }

}

/* Tablet / small laptop */
@media (max-width: 992px) {
  :root {
    --tl-width: 240px;
    --fs-year: 22px;
    --fs-date: 18px;
    --dot-d: 20px;
    --line-w: 2px;
  }

  #tl-panel {
    width: var(--tl-width);
    padding-left: 12px;
  }

  #tl-toggle {
    left: -26px;
    width: 26px;
    height: 56px;
    font-size: 18px;
  }

  .tl-year .y {
    font-size: 1.1rem;
  }

  .tl-year li {
    font-size: 0.95rem;
    padding-left: 14px;
  }
}

/* Mobile: ocultamos panel lateral y adaptamos columna principal */
@media (max-width: 768px) {


  :root {
    --tl-width: 0px;
    --fs-year: 20px;
    --fs-date: 16px;
    --dot-d: 18px;
    --line-w: 1.8px;
    --dash: 10px;
    --tl-pad: 12px;
  }



  #tl-panel {
    display: none !important;
  }

  body.has-tl-visible #historia-scroll-linea-tiempo,
  body.has-tl-visible #portada-historia-scroll-linea-tiempo,
  body.has-tl-visible #intro,
  body.has-tl-visible #pie-credito {
    padding: 0 !important;
    margin: 0 !important;
  }

  #historia-scroll-linea-tiempo {
      background: black;
    padding: 20px 0 40px !important;
    margin: 0 !important;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    align-items: stretch;
    box-sizing: border-box;
  }

  #portada-historia-scroll-linea-tiempo,
  #intro,
  #pie-credito {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2;
  }

  .snap-stop {
    min-height: 70vh;
    width: 100vw;
    box-sizing: border-box;
  }

  .ano {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .ano-evento .ponto {
    width: var(--dot-d);
    height: var(--dot-d);
    margin-bottom: 8px;
  }

  .ano-evento .data {
    font-size: var(--fs-date);
  }

  .tl-year ul {
    padding-left: 8px;
  }

  .tl-year li {
    padding-left: 10px;
    margin: 10px 0;
    font-size: 0.95rem;
  }

  .tl-year li .tl-dot {
    left: -8px;
    top: 5px;
    width: 9px;
    height: 9px;
  }

  #intro .tlf-video-overlay video,
  #intro .tlf-photo-hero>video {
    object-fit: cover;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    overflow: auto !important;
  }
}

/* Pequeños móviles */
@media (max-width: 480px) {
  :root {
    --fs-year: 18px;
    --fs-date: 15px;
    --dot-d: 16px;
    --tl-pad: 10px;
    --dash: 8px;
  }

  #historia-scroll-linea-tiempo {
    padding: 16px 0 36px !important;
    margin: 0 !important;
    width: 100vw;
    box-sizing: border-box;
  }

  #portada-historia-scroll-linea-tiempo,
  #intro,
  #pie-credito {
    position: relative;
    width: 100vw;
    box-sizing: border-box;
    padding: 0 !important;
    margin: 0 !important;
  }

  .ano {
    padding: 10px 12px;
    margin: 0;
    border-radius: 6px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .ano-titulo {
    font-size: calc(var(--fs-year) - 2px);
  }

  .ano-evento .data {
    font-size: calc(var(--fs-date) - 1px);
  }

  #tl-toggle {
    display: none;
  }
}

/* Small improvement: mejora scroll en dispositivos táctiles con contenido largo */
@media (pointer: coarse) {
  #historia-scroll-linea-tiempo {
    -webkit-overflow-scrolling: touch;
  }

  #tl-panel .tl-scroll {
    -webkit-overflow-scrolling: touch;
  }
}