/* Timeline wrapper */
.timeline-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  font-family: 'homespun';
}

/* Center vertical line */
.center-line {
  position: absolute;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(#e664653d, #9198e58c);
  top: 0;
  bottom: 0;
  z-index: 1;
}

/* Timeline container */
.timeline-container {
  width: 100%;
}

/* Timeline row */
.timeline-row {
  display: flex;
  width: 100%;
  /* margin-bottom: 20px; */
}

/* Timeline item wrapper */
.timeline-item-wrapper {
  width: 50%;
  display: flex;
  justify-content: center;
  position: relative;
  /* margin-top: 30px; */
}

.timeline-item-wrapper.left {
  /* justify-content: flex-end; */ /* Align left items to the right side of their container */
}

.timeline-item-wrapper.right {
  justify-content: flex-start; /* Align right items to the left side of their container */
  margin-top: 10px;
}

/* Spacer for empty right item */
.timeline-item-wrapper.spacer {
  width: 50%;
}

/* Timeline items */
.timeline-item {
  width: calc(100% - 40px); /* Adjusted width */
  padding: 4px 20px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid #ca3070;
  border-image: linear-gradient(to right, #ca30707a 0%, #b3bf4a80 100%);
  border-image-slice: 1;
  background-color: #413f3f;
  position: relative; /* Ensure arrows position correctly */
  margin: 10px;
  height: fit-content;
  margin-bottom: 0;
  margin-top: 25px;
}

/* Left and Right item styles */
.timeline-item.left {
  /* Additional styles for left items if needed */
  text-align: end;
  /* width: fit-content; */
}

.timeline-item.right {
  /* Additional styles for right items if needed */
  margin-left: 20px;
}

/* Header with date and title */
.timeline-item-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.timeline-item.left .timeline-item-header {
  align-items: flex-end;
}

/* Styling for date and title */
.timeline-date {
  font-size: 25px;
  color: #ba4c4c;
  /* text-align: right; */
  /* align-items: end; */
  text-shadow: 4px 3px 0px rgb(35 88 160 / 14%), 6px 4px 7px rgba(14, 208, 225, 0.21);
}

.timeline-title {
  font-size: 22px;
  font-family: 'homespun';
  text-shadow: 4px 3px 0px rgb(160 35 160 / 47%), 6px 5px 4px rgba(14, 208, 225, 0.21);
  max-width: fit-content;
}

/* Content area hidden by default */
.timeline-content {
  margin-top: 10px;
  max-height: 0;
  /* display: none; */
  font-size: 16px;
  color: #1a9fbd;
  /* width: fit-content; */
  /* overflow-wrap: break-word; */
  overflow: hidden;
  transition: max-height 0.5s ease;
}

/* Show content when expanded */
.expanded .timeline-content {
  display: block;
}

/* Arrows */
.timeline-item.left::before {
  content: '';
  position: absolute;
  right: -15px;
  top: 20px;
  border-width: 10px 0 10px 15px;
  border-style: solid;
  border-color: transparent transparent transparent #b3bf4a85;
}

.timeline-item.right::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 20px;
  border-width: 10px 15px 10px 0; 
  border-style: solid; 
  border-color: transparent #ca30707a transparent transparent; 
}

/* Year box wrapper */
.year-box-wrapper {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.year-box {
  width: calc(50% - 40px);
  text-align: right;
  font-size: calc(1em + 1vh);
  font-weight: bold;
  padding: 40px 20px 10px 20px;
  /* margin-bottom: 20px; */
  text-shadow: 4px 3px 0px rgba(9, 1, 9, 0.53),
    9px 8px 0px rgba(14, 208, 225, 0.25);
  animation: color-change 2s infinite;
  font-family: 'homespun';
  transform: rotate(358deg);
}

/* Responsive styles */
@media screen and (max-width: 767px) {
  .timeline-row {
    flex-direction: column;
    /* flex-wrap: wrap; */
    /* justify-content: center; */
    /* align-items: stretch; */
    /* justify-content: space-between; */
  }

  .timeline-item-wrapper {
    width: 100%;
    justify-content: flex-start;
    /* margin-top: 0px; */
  }

 .timeline-item-wrapper.right {
    /* width: fit-content; */
    /* justify-content: flex-end; */
    margin-top: 0px;
    /* margin-left: 0px; */
  }
  
  .timeline-item {
 /*    width: fit-content; */
 margin-left: 0;
 width: 100%;
 margin-right: 25px;
 text-align: right;
 }

 .timeline-item.right{
  margin-left: 0px;
 }

  .year-box-wrapper {
    justify-content: flex-start;
  }

  .year-box {
    width: 100%;
    text-align: right;
    transform: none;
  }

  .timeline-item-header {
    align-items: flex-end;
    text-align: end;
    /* width: fit-content; */
  }

  .center-line {
     display: block;
     left: auto;
     right: 0;
     height: 100%;
  }

  /* Adjust arrows on small screens */
  .timeline-item.left::before,
  .timeline-item.right::before {
    right: -15px; /* Align arrow to the left */
    left: auto;
    border-width: 10px 0 10px 15px;
    border-style: solid;
    border-color: transparent transparent transparent #b3bf4a85;
    /* border-width: 10px 15px 10px 10px; */
    /* border-style: solid; */
    /* border-color: #d2181800 #b3bf4a #e9090900 #c3000000; */
  }
}

/* Optional: Keyframes for the color-change animation */
@keyframes color-change {
  0% {
    color: #ca3070;
  }
  50% {
    color: #b3bf4a;
  }
  100% {
    color: #ca3070;
  }
}
