/* Timeline Frontend Styles */
.timeline-container {
  position: relative;
  max-width: 1600px;
  margin: 60px auto;
  padding: 40px 20px;
}

/* Linha vertical central */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #2957a4, #ed3237);
  transform: translateX(-50%);
  z-index: 1;
}

/* Item da timeline - grid layout with 3 columns for alternating layout */
.timeline-item {
  position: relative;
  margin-bottom: 80px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 50px;
  align-items: center;
  min-height: 350px;
}

/* Generic content container - no repeated tags for left/right */
.timeline-content {
  width: 100%;
}

/* Image content styling */
.timeline-content-image {
  max-width: 500px;
}

.timeline-item-left .timeline-content-image {
  justify-self: end;
}

.timeline-item-right .timeline-content-image {
  justify-self: start;
}

.timeline-content-image img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content-image img:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Text content styling */
.timeline-content-text {
  max-width: 550px;
}

.timeline-item-left .timeline-content-text {
  justify-self: start;
}

.timeline-item-right .timeline-content-text {
  justify-self: end;
}

/* Center column with timeline marker and year badge */
.timeline-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Marcador circular */
.timeline-marker {
  width: 20px;
  height: 20px;
  background: #ed3237;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(237, 50, 55, 0.2);
}

/* Year badge positioned above the marker */
.timeline-year {
  margin-bottom: 15px;
}

.year-badge {
  display: inline-block;
  background: #ed3237;
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(237, 50, 55, 0.3);
}

.timeline-description {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  text-align: justify;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.timeline-description p {
  margin: 0 0 10px 0;
}

.timeline-description p:last-child {
  margin-bottom: 0;
}

/* Improved responsive design for tablets */
@media (max-width: 1024px) {
  .timeline-container {
    padding: 30px 20px;
    max-width: 1200px;
  }

  .timeline-item {
    gap: 40px;
    min-height: 300px;
  }

  .timeline-content-image {
    max-width: 400px;
  }

  .timeline-content-image img {
    height: 280px;
  }

  .timeline-content-text {
    max-width: 450px;
  }

  .timeline-description {
    font-size: 15px;
  }
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .timeline-container {
    padding: 20px 15px;
    margin: 40px auto;
  }

  /* Move line to the left side on mobile */
  .timeline-line {
    left: 30px;
  }

  /* Stack layout vertically on mobile */
  .timeline-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 60px;
    min-height: auto;
    padding-left: 60px;
    gap: 20px;
  }

  /* Center column positioned absolutely on mobile */
  .timeline-center {
    position: absolute;
    left: 30px;
    top: 20px;
    transform: translateX(-50%);
  }

  .timeline-marker {
    width: 16px;
    height: 16px;
    border-width: 3px;
  }

  .timeline-year {
    margin-bottom: 10px;
  }

  .year-badge {
    font-size: 13px;
    padding: 6px 16px;
  }

  /* Full width image and text on mobile */
  .timeline-content-image,
  .timeline-content-text {
    max-width: 100%;
    width: 100%;
    justify-self: stretch !important;
  }

  .timeline-content-image img {
    height: auto;
    min-height: 180px;
    max-height: 250px;
  }

  .timeline-description {
    font-size: 15px;
    line-height: 1.5;
  }
}

/* Added extra small mobile devices support */
@media (max-width: 480px) {
  .timeline-container {
    margin: 30px auto;
    padding: 15px 10px;
  }

  .timeline-line {
    left: 20px;
    width: 3px;
  }

  .timeline-center {
    left: 20px;
  }

  .timeline-marker {
    width: 14px;
    height: 14px;
  }

  .timeline-item {
    margin-bottom: 50px;
    padding-left: 45px;
    gap: 15px;
  }

  .timeline-content-image img {
    min-height: 150px;
    max-height: 200px;
    border-radius: 6px;
  }

  .timeline-description {
    font-size: 14px;
    line-height: 1.5;
  }

  .timeline-description p {
    margin: 0 0 8px 0;
  }

  .year-badge {
    font-size: 12px;
    padding: 5px 14px;
  }
}

/* Added landscape orientation support for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .timeline-container {
    padding: 20px 15px;
  }

  .timeline-content-image img {
    max-height: 180px;
  }
}
