* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background-color: #f7f7f7;
  overflow-x: hidden;
}

h1 {
  text-align: center;
  margin: 40px 0;
  color: #50694f;
}

/* === Timeline general === */
.timeline {
  position: relative;
  width: 90%;
  max-width: 1000px;
  margin: auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  background-color: #d3d3d3;
  transform: translateX(-50%);
}

.scroll-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  background-color: #6b8f71;
  height: 0;
  transform: translateX(-50%);
  transition: height 0.25s ease-out;
  z-index: 1;
}

.timeline-item {
  position: relative;
  margin: 60px 0;
  display: flex;
  justify-content: flex-start;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.icon {
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translate(-50%, 0);
  background-color: #fff;
  border: 3px solid #6b8f71;
  color: #6b8f71;
  font-size: 20px;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.3s ease;
}

.icon.active {
  background-color: #6b8f71;
  color: #fff;
  transform: translate(-50%, 0) scale(1.15);
  box-shadow: 0 0 10px rgba(107,143,113,0.5);
}

/* === Contenedor de cada ítem === */
.timeline-content {
  background-color: #fff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 45%;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-left: auto;
  margin-right: 30px;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-right: auto;
  margin-left: 30px;
}

.timeline-content img {
  width: 40%;
  border-radius: 10px;
  height: 160px;
  object-fit: cover;
}

.text-content {
  flex: 1;
}

/* === Descripción breve y expandible === */
.timeline-content p {
  color: #555;
  margin-bottom: 12px;
  line-height: 1.4em;
  max-height: 2.8em; /* ≈ 2 líneas */
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}

/* Degradado al final del texto */
.timeline-content p::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.2em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
}

/* Mostrar texto completo cuando está expandido */
.timeline-content p.expanded {
  max-height: 1000px;
  overflow: visible;
}

.timeline-content p.expanded::after {
  display: none;
}

/* === Botón "Ver más" / "Ver menos" === */
.desc-btn {
  display: inline-block;
  background-color: #6b8f71;
  color: white;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.3s ease;
}

.desc-btn:hover {
  background-color: #50694f;
}

/* === Botones de enlaces === */
.buttons a {
  text-decoration: none;
  color: white;
  background-color: #6b8f71;
  padding: 8px 12px;
  border-radius: 6px;
  margin-right: 8px;
  font-size: 14px;
  transition: background 0.3s ease;
}

.buttons a:hover {
  background-color: #50694f;
}

/* === Modal (por si lo usas luego) === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-content {
  background-color: #fff;
  border-radius: 12px;
  padding: 25px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: pop 0.3s ease;
}

.modal-content h3 {
  color: #6b4f4f;
  margin-bottom: 10px;
}

.modal-content p {
  color: #555;
  font-size: 15px;
}

.close-btn {
  margin-top: 15px;
  background-color: #6b8f71;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.close-btn:hover {
  background-color: #50694f;
}

@keyframes pop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* === Responsive para tablets y móviles === */
@media (max-width: 1024px) {
  .timeline::before, .scroll-line {
    left: 20px;
    transform: none;
  }

  .icon {
    left: 20px;
    top: 30px;
  }

  .timeline-item {
    flex-direction: column !important;
    align-items: flex-start;
  }

  .timeline-content {
    flex-direction: column;
    width: calc(100% - 40px);
    margin-left: 50px !important;
    margin-right: 10px !important;
  }

  .timeline-content img {
    width: 100%;
    height: 200px;
  }
}
