.timeline {
  position: relative;
  background: var(--Linear, linear-gradient(273deg, #034DA7 4.3%, #011E41 82.97%));
  color: #fff;
  padding: 11.625rem 1rem 7rem;
  overflow: hidden;
}

.timeline > * {
  position: relative;
  z-index: 1;
}

.timeline .timeline-item--third {
  isolation: isolate;
}

.timeline .timeline-item--third::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  top: 45%;
  z-index: -1;
  background-image: url('../images/gradient-ribbon-start.svg');  
  background-size: cover;
  background-position: center;
  background-repeat: repeat-x;
}

.timeline .timeline-item--third:nth-child(odd)::after {
  background-image: url('../images/gradient-ribbon.svg');
  top:50%;
}

.timeline h2 {
  text-align: center;
  color: #F7C171;
}

.aah-timeline.timeline h2.contentHeading span.heading {
  margin-bottom: 122px;
}

.aah-timeline.timeline a {
  color: #B87D28;
  text-decoration: underline;
}

.aah-timeline.timeline a:hover {
  color: #F7C171;
}

/* Timeline list */
.timeline-list {
  position: relative;
  max-width: 1046px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

/* Vertical line */
.timeline-list::before {
  content: "";
  position: absolute;
  top: -55px;
  bottom: 0;
  left: 50%;
  width: 3px;
  height: calc(100% + 10.438rem);
  background-color: #F7C171;
  transform: translateX(-50%);
  z-index: 1;
}

/* Timeline item */
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 103px;
  align-items: start;
  transition: margin 0.5s ease-in-out;
  margin-bottom: 5rem;
}

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

/* Year badge container */
.timeline-marker {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 18px 40px 18px 30px;
  background-color: transparent;
  border: 3px solid #F7C171;
  border-radius: 50px;
  color: #fff;
  font-size: 20px;
  line-height: 26px;
  font-weight: 400;
  white-space: nowrap;
  position: absolute;
  top: 160px;
  font-family: 'Fjalla One';
}

.timeline-item:first-child .timeline-marker {
  top: -20px !important;
}


/* Icon comes from Elementor Icons control (see .timeline-marker__icon) */
.timeline-marker__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  line-height: 0;
  color: inherit;
}

.timeline-marker__icon :is(i, svg) {
  display: block;
  width: 1em;
  height: 1em;
}

.timeline-marker__icon svg,
.timeline-marker__icon svg path {
  fill: #F7C171;
}

/* Content card */
.timeline-content {
  width: 100%;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 120px;
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;

}

.timeline-content .img-wrapper {
  width: 100%;
  margin-bottom: 26px;
}

.timeline-content .img-wrapper:not(:has(img)) {
  display: none;
}

.timeline-content .img-wrapper img {
  width: 100%;
  height: 100%;
  max-height: 236px;
  object-fit: cover;
}

.timeline-content .text-content {
  transition: transform 0.3s ease-in-out;
}

.timeline-content .img-wrapper:not(:has(img)) + .text-content {
  padding: 0 20px;
}

.timeline-content h3 {
  margin: 0;
  font-size: 1.3125rem;
  line-height: 1.4;
  color: #F7C171;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: capitalize;
}

.timeline-content p {
  font-size: 17px;
  line-height: 26px;
  color: #F3F3F3;
}

/* Multi-section timeline item */
.timeline-content--multi {
  padding: 0;
}

.multi-section__item {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
}

.multi-section__item h3 {
  margin-bottom: 0.75rem;
}

.multi-section__item .img-wrapper {
  margin-bottom: 1.5rem;
}

.multi-section__item .timeline-year {
  display: inline;
}

.multi-section__item:first-child {
    padding-bottom: 40px;
}

/* Alternating sides - odd items: badge left, content right */
.timeline-item:nth-child(odd) .timeline-marker {
  right: 676px;
  top: 40%;
}

.timeline-item:nth-child(odd) .timeline-marker::after {
  content: "";
  position: absolute;
  right: -13rem;
  top: 50%;
  width: 206px;
  height: 3px;
  background-color: #F7C171;
  transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content {
  grid-column: 2;
  text-align: left;
}

.timeline-item:nth-child(even) .timeline-marker {
  left: 676px;
  top: 40%;
}


.timeline-content.noTimelineImage .timeline-marker {
  top: -15%;
}

.timeline-item:nth-child(odd) .timeline-content.noTimelineImage .text-content {
  padding-left: 20px;
}

.timeline-item:nth-child(even) .timeline-marker::after {
  content: "";
  position: absolute;
  left: -13rem;
  top: 50%;
  width: 206px;
  height: 3px;
  background-color: #F7C171;
  transform: translateY(-50%);
}

@media (max-width: 1024px) {
  .timeline {
    padding: 10% 5%;
  }
}

/* Tablet and Mobile layout - Stacked cards */
@media (max-width: 1240px) {
  .timeline-list {
    margin-top: 40px;
  }

  /* Hide timeline line */
  .timeline-list::before {
    display: none;
  }

  /* Stack cards */
  .timeline-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
    direction: ltr;
  }

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

  .timeline-marker {
    display: inline-flex;
    align-self: flex-start;
    margin: 0;
    padding: 12px 20px;
    position: relative;
    top: unset !important;
    left: unset !important;
    right: unset !important;
  }

  .timeline-marker::after {
    display: none;
  }

  .timeline-item:nth-child(even) {
    direction: ltr;
  }

  .timeline-content,
  .multi-section__item {
    gap: 20px;
    flex-direction: column;
  }

  .timeline-content h3 {
    font-size: 1.125rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .timeline-content .img-wrapper {
    margin-bottom: 0;
  }

  .timeline-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
  }
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:first-child .timeline-marker {
    top: unset;
  }
  .timeline-item:nth-child(even) .timeline-marker {
    margin-left: 0;
  }
  .timeline-item:first-child {
    margin-bottom: 3rem;
  }
  .timeline-content .img-wrapper:not(:has(img)) + .text-content {
    padding: 0;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .timeline-marker {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
  }

  .timeline-marker__icon {
    font-size: 20px;
  }

  .timeline-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .timeline-content p {
    font-size: 0.9375rem;
    line-height: 1.6;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .timeline-content {
    border: 2px solid currentColor;
  }

  .timeline-content:focus {
    outline-width: 4px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}


@media screen and (min-width: 1300px) {
  .multi-section .multi-section__item:first-child:before {
      content: "";
      position: absolute;
      left: -3rem;
      background: #F7C171;
      height: calc(100% - 200px);
      width: 3px;
      top: 200px;
  }

  .multi-section__item:after {
      content: "";
      position: absolute;
      left: -3rem;
      width: 3rem;
      height: 3px;
      background: #F7C171;
      top: 200px;
  }

  .multi-section__item:nth-child(2):before {
      content: "";
      position: absolute;
      left: -3rem;
      background: #F7C171;
      height: 9%;
      width: 3px;
      top: 0%;
  }

  .multi-section__item:nth-child(2):after {
      content: "";
      position: absolute;
      left: -3rem;
      width: 3rem;
      height: 3px;
      background: #F7C171;
      top: 35px;
  }
}