@import url('/public/css/fonts.css');

:root {
  /* EXISTENTES… */
  --tl-pad-top: clamp(36px, 8vw, 160px);
  --tl-pad-inline: clamp(20px, 3vw, 48px);
  --tl-pad-bottom: clamp(10px, 2.5vw, 24px);
  --tl-gap-content: clamp(16px, 4vw, 32px);

  /* NUEVAS (controlan altura de la vigueta) */
  --vig-scale: 1.28;
  /* desktop: vigueta 28% más alta que fierros */
  --vig-min: 120px;
  --vig-max: 9999px;
}


#nuestros-reconocimientos {
  padding: 2rem;
  text-align: center;
}

#nuestros-reconocimientos .titulo {
  font-family: 'Ghino', sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 3vw, 40px);
  margin-bottom: 3rem;
  color: #0d315e;
}

/* Contenedor */
.timeline-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

/* Barra */
.timeline-bar {
  position: relative;
  overflow: visible;
  /* permite que sobresalga si hace falta */
  isolation: isolate;
  /* z-index predecible dentro */
  padding: var(--tl-pad-top) var(--tl-pad-inline) var(--tl-pad-bottom);
}

/* Fierros (fondo) */
.timeline-bar .timeline-bg {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  user-select: none;
  pointer-events: none;
}

/* Vigueta SIEMPRE por encima y cubriendo los fierros */
.timeline-bar .vigueta {
  position: absolute;
  left: 0;
  width: 140px;
  /* visible antes de que cargue el JS */
  height: 140px;
  /* el JS la recalcula para cubrir los fierros */
  object-fit: cover;
  transition: width .8s ease;
  z-index: 2;
  /* encima de fierros */
  pointer-events: none;
  /* no bloquea el click en los años */
}

/* Marcadores (años) */
.timeline-bar .marker {
  position: absolute;
  top: 0;
  /* apoyado en el padding-top */
  transform: translate(-50%, -120%);
  z-index: 3;
  cursor: pointer;
  font-weight: 800;
  color: #375a8f;
  background: transparent;
  border: none;
  padding: .25rem .35rem;
  font-size: clamp(12px, 1.6vw, 16px);
  transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
  border-radius: 999px;
}

.timeline-bar .marker.active {
  color: #fff;
  background-color: #0d315e;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(13, 49, 94, .25);
}

/* Contenido */
.reconocimientos-content {
  position: relative;
  margin-top: var(--tl-gap-content);
}

/* Ítems */
.recon-item {
  display: none;
  margin-top: 1rem;
}

.recon-item.active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

/* Imágenes del reconocimiento (tamaño uniforme) */
.recon-item img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Texto */
.recon-item p {
  font-size: 1.1rem;
  max-width: 520px;
  line-height: 1.5;
}


/* Animaciones */
@keyframes slideInFromBottom {
  0% {
    opacity: 0;
    transform: translateY(40px)
  }

  100% {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-40px)
  }

  100% {
    opacity: 1;
    transform: translateX(0)
  }
}

.recon-item.active img {
  animation: slideInFromLeft .6s ease-out both
}

.recon-item.active p {
  animation: slideInFromBottom .6s ease-out both
}

/* <= 900px */
@media (max-width: 900px) {
  :root {
    --vig-scale: 1.18;
    --vig-min: 100px;
  }
}

/* ===================== SOLO CELULARES (<=600px) ===================== */
@media (max-width: 600px) {
  :root {
    --tl-pad-top: 70px;
    --tl-pad-inline: 14px;
    /* colchón para que 2012/2025 no se corten */
    --tl-pad-bottom: 16px;

    --vig-scale: 1.20;
    /* vigueta visiblemente más alta que fierros */
    --vig-min: 100px;
    /* altura mínima de la vigueta en móvil */
    --vig-max: 160px;
  }

  #nuestros-reconocimientos {
    padding-left: 0;
    padding-right: 0;
    margin-top: 80px;
  }

  .timeline-bar {
    padding-left: var(--tl-pad-inline);
    padding-right: var(--tl-pad-inline);
    overflow: visible;
    isolation: isolate;
  }

  /* Fierros más gruesos y estables en móvil */
  .timeline-bar .timeline-bg {
    display: block;
    width: 100%;
    height: 70px;
    /* alto fijo: evita que se “aplasten” */
    object-fit: cover;
  }


  .timeline-bar  .vigueta {
    width: 140px;
    height: 110px;
    z-index: 2;
    pointer-events: none;
    margin-top: -10px;
  }

  /* Marcadores */
  .timeline-bar .marker {
    top: 0;
    transform: translate(-50%, -92%);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    /* nunca se parten */
    padding: .2rem .35rem;
    z-index: 3;
  }

  /* Ancla los extremos dentro del contenedor */
  .timeline-bar .marker:first-of-type {
    left: 0% !important;
    transform: translate(0, -92%);
    text-align: left;
  }

  .timeline-bar .marker:last-of-type {
    left: 100% !important;
    transform: translate(-100%, -92%);
    text-align: right;
  }

  /* Contenido debajo en columna */
  .recon-item.active {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .recon-item img {
    width: 150px;
    height: 150px;
  }
}

/* ===================== CELULARES PEQUEÑOS (<=400px) ===================== */
@media (max-width: 400px) {
  :root {
    --tl-pad-top: 85px;
    --vig-scale: 1.20;
    --vig-min: 98px;
    --vig-max: 150px;
  }

  .timeline-bar .marker {
    font-size: 12px;
    transform: translate(-50%, -90%);
  }

  .timeline-bar .marker:first-of-type {
    transform: translate(0, -90%);
  }

  .timeline-bar .marker:last-of-type {
    transform: translate(-100%, -90%);
  }
}
