/* Fidelidad visual del bloque "Fechas clave del proceso electoral". */
.timeline-ref-section {
  background: #fff;
  padding: 46px 0 34px;
  box-shadow: 0 0 0 100vmax #fff;
  clip-path: inset(0 -100vmax);
}

.timeline-ref-section .section-heading {
  align-items: flex-end;
  margin-bottom: 24px;
}

.timeline-ref-section .section-heading > div {
  max-width: 860px;
}

.timeline-ref-section .section-heading h2 {
  margin: 0 0 8px;
  color: #234b9f;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.03;
  letter-spacing: -.025em;
  font-weight: 700;
}

.timeline-ref-section .section-heading p {
  margin: 0;
  color: #27374f;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 500;
}

.timeline-ref-link {
  color: #234b9f;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.timeline-ref-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 8px;
  scrollbar-width: thin;
}

.timeline-ref-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, minmax(118px, 1fr));
  min-width: 1080px;
  gap: 0;
  align-items: stretch;
  padding: 0 2px;
}

.timeline-ref-track::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 5.5%;
  right: 5.5%;
  height: 2px;
  background: #8caf31;
  z-index: 0;
}

.timeline-ref-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 4px 10px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #234b9f;
  text-align: center;
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}

.timeline-ref-item:not(:first-child)::after {
  content: '';
  position: absolute;
  left: 0;
  top: 70px;
  bottom: 0;
  width: 1px;
  background: #9bacc9;
  opacity: .8;
}

.timeline-ref-item:hover,
.timeline-ref-item:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.timeline-ref-item:focus-visible .timeline-ref-icon {
  box-shadow: 0 0 0 4px rgba(51, 81, 149, .18);
}

.timeline-ref-icon {
  width: 54px;
  height: 54px;
  min-width: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .4);
}

.timeline-ref-item.is-green .timeline-ref-icon { background: #8caf31; }
.timeline-ref-item.is-blue .timeline-ref-icon { background: #234b9f; }
.timeline-ref-icon svg { width: 31px; height: 31px; }

.timeline-ref-date {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  color: #234b9f;
  font-size: 13px;
  line-height: 1.12;
  font-weight: 700;
}

.timeline-ref-title {
  margin-top: 8px;
  color: #334057;
  font-size: 12.5px;
  line-height: 1.24;
  font-weight: 500;
}

.timeline-ref-item.is-past {
  filter: grayscale(1);
}

/* Las tarjetas de fecha ya no tienen una acción de detalle asociada. */
#contenido .date-card[data-event-static="true"] > .small {
  display: none !important;
}

.timeline-ref-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 11px 16px;
  border-radius: 7px;
  background: #f1f4f9;
  color: #335195;
}

.timeline-ref-note-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: grid;
  place-items: center;
  color: #234b9f;
}

.timeline-ref-note-icon svg {
  width: 27px;
  height: 27px;
}

.timeline-ref-note p {
  margin: 0;
  color: #335195;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}

.timeline-ref-note strong { font-weight: 700; }

/* En escritorio, tanto el subtítulo de portada como la descripción de la página de Fechas
   permanecen en una sola línea. El enlace al cronograma ocupa la fila del título para no
   reducir el ancho disponible del subtítulo. */
@media (min-width: 901px) {
  .timeline-ref-section .section-heading {
    position: relative;
    display: block;
  }

  .timeline-ref-section .section-heading > div {
    max-width: none;
  }

  .timeline-ref-section .section-heading p {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(13px, 1.15vw, 16px);
    letter-spacing: -.012em;
  }

  .timeline-ref-section .timeline-ref-link {
    position: absolute;
    top: 10px;
    right: 0;
  }

  body:has(#main-nav a[aria-current="page"][href$="/fechas"]) .page-head p {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(14px, 1.35vw, 16px);
    letter-spacing: -.01em;
  }
}

@media (max-width: 900px) {
  .timeline-ref-section { padding-top: 36px; }
  .timeline-ref-section .section-heading {
    position: static;
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }
  .timeline-ref-section .section-heading h2 { font-size: 30px; }
  .timeline-ref-section .section-heading p {
    white-space: normal;
    font-size: 15px;
  }
  .timeline-ref-link {
    position: static;
    align-self: flex-start;
  }
}
