/**
 * Block Styles: Timeline
 *
 * BEM Notation: .timeline__element--modifier
 */

.timeline {
  position: relative;
  overflow: hidden;
}

.timeline__anchor {
  position: relative;
  top: -110px;
}

/* Intro */
.timeline__intro {
  margin-bottom: clamp(3rem, 6vw, 6rem);
}

.timeline__subline {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent-color);
}

.timeline__headline {
  color: var(--brand-header-text-color);
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.timeline__intro-text {
  margin-top: 1.5rem;
  max-width: 620px;
}

.timeline__intro-text p {
  color: var(--brand-primary-text-color);
  font-size: 1rem;
  line-height: 1.6;
}

.timeline__intro-text p:last-child {
  margin-bottom: 0;
}

.timeline__intro-media {
  position: relative;
  margin: 0;
  min-height: 360px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bs-light, #f8f9fa);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

.timeline__intro-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(239, 124, 0, 0.18), rgba(0, 0, 0, 0.05));
  pointer-events: none;
}

.timeline__intro-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  max-height: 400px;
  object-fit: cover;
}

/* Timeline list */
.timeline__list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0;
  margin: 0;
}

.timeline__list::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--brand-primary-color-dark, #e9ecef);
}

/* Desktop timeline item */
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
  align-items: center;
}

/* Card position */
.timeline__card {
  position: relative;
  z-index: 1;
  grid-column: 1;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

/* Marker column */
.timeline__marker {
  /* position: relative; */
  z-index: 3;
  grid-column: 2;
  width: 100%;
  /* height: 56px; */
}

/* Dot stays exactly on the center line */
.timeline__marker-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 5px solid #fff;
  border-radius: 999px;
  background: var(--brand-accent-color);
  box-shadow: 0 0 0 4px rgba(239, 124, 0, 0.16);
}

/* Year badge */
.timeline__marker-year {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--brand-accent-color);
  color: #fff;
  font-size: 0.92rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  transform: translateY(-50%);
}

/* Odd card left => year right */
.timeline__item:nth-child(odd) .timeline__marker-year {
  left: calc(50% + 25px);
}

/* Even card right => year left */
.timeline__item:nth-child(even) .timeline__marker-year {
  right: calc(50% + 25px);
}

.timeline__item:nth-child(even) .timeline__card {
  grid-column: 3;
}

.timeline__card:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 124, 0, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

/* .timeline__card::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 5px;
  border-radius: 999px;
  background: var(--brand-accent-color);
}

.timeline__item:nth-child(odd) .timeline__card::before {
  right: 0;
}

.timeline__item:nth-child(even) .timeline__card::before {
  left: 0;
} */

.timeline__item--has-image .timeline__card {
  grid-template-columns: 170px minmax(0, 1fr);
}

.timeline__item:nth-child(odd).timeline__item--has-image .timeline__card {
  grid-template-columns: minmax(0, 1fr) 170px;
}

.timeline__item:nth-child(odd).timeline__item--has-image .timeline__item-media {
  order: 2;
}

.timeline__item-media {
  margin: 0;
  min-height: 100%;
  background: var(--bs-light, #f8f9fa);
}

.timeline__item-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  max-height: 250px;
  object-fit: cover;
}

.timeline__item-content {
  padding: clamp(1.35rem, 2.5vw, 2rem);
}

.timeline__year-mobile {
  display: none;
  width: fit-content;
  margin-bottom: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--brand-accent-color);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  font-weight: 800;
}

.timeline__item-title {
  margin: 0 0 0.85rem;
  color: var(--brand-header-text-color);
  font-size: clamp(1.25rem, 1.7vw, 1.55rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.timeline__item-text {
  color: var(--brand-primary-text-color);
}

.timeline__item-text p {
  color: var(--brand-primary-text-color);
  font-size: 0.98rem;
  line-height: 1.6;
}

.timeline__item-text p:last-child {
  margin-bottom: 0;
}

/* Highlight item */
.timeline__item--highlight .timeline__card {
  background: var(--brand-accent-color);
  border-color: var(--brand-accent-color);
}

.timeline__item--highlight .timeline__card::before {
  background: #fff;
  opacity: 0.75;
}

.timeline__item--highlight .timeline__item-title,
.timeline__item--highlight .timeline__item-text,
.timeline__item--highlight .timeline__item-text p {
  color: #fff;
}

.timeline__item--highlight .timeline__year-mobile {
  background: #fff;
  color: var(--brand-accent-color);
}

/* Bottom card */
.timeline__bottom {
  margin-top: clamp(3rem, 6vw, 6rem);
}

.timeline__bottom-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 24px;
  background: var(--brand-primary-color-light, #f8f9fa);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.timeline__bottom-headline {
  margin: 0 0 1rem;
  color: var(--brand-header-text-color);
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.timeline__bottom-text p {
  color: var(--brand-primary-text-color);
  font-size: 1rem;
  line-height: 1.6;
}

.timeline__bottom-text p:last-child {
  margin-bottom: 0;
}

.timeline__bottom-action {
  display: flex;
  justify-content: flex-end;
}

/* Light text variant */
.light-text .timeline__headline,
.light-text .timeline__item-title,
.light-text .timeline__bottom-headline {
  color: #fff;
}

.light-text .timeline__intro-text,
.light-text .timeline__intro-text p,
.light-text .timeline__item-text,
.light-text .timeline__item-text p,
.light-text .timeline__bottom-text,
.light-text .timeline__bottom-text p {
  color: rgba(255, 255, 255, 0.85);
}

.light-text .timeline__card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.light-text .timeline__bottom-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.light-text .timeline__list::before {
  background: rgba(255, 255, 255, 0.22);
}

.light-text .timeline__marker-dot {
  border-color: rgba(255, 255, 255, 0.95);
}

/* Responsive */
@media (max-width: 991.98px) {
  .timeline__list {
    gap: 1.5rem;
  }

  .timeline__list::before {
    left: 18px;
    transform: none;
  }

  .timeline__item {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: flex-start;
  }

  .timeline__marker {
    grid-column: 1;
    width: 42px;
    height: auto;
    min-height: 56px;
    padding-top: 1.5rem;
  }

  .timeline__marker-dot {
    top: 1.5rem;
    left: 19px;
    transform: translate(-50%, 0);
  }

  .timeline__marker-year {
    display: none;
  }

  .timeline__card,
  .timeline__item:nth-child(even) .timeline__card {
    grid-column: 2;
  }

  .timeline__year-mobile {
    display: inline-flex;
  }

  .timeline__card::before,
  .timeline__item:nth-child(odd) .timeline__card::before,
  .timeline__item:nth-child(even) .timeline__card::before {
    left: 0;
    right: auto;
    top: 1.25rem;
    bottom: 1.25rem;
  }

  .timeline__bottom-card {
    grid-template-columns: 1fr;
  }

  .timeline__bottom-action {
    justify-content: flex-start;
  }
}

@media (max-width: 575.98px) {
  .timeline__headline {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
  }

  .timeline__intro-media,
  .timeline__intro-media img {
    min-height: 220px;
    border-radius: 18px;
  }

  .timeline__card,
  .timeline__bottom-card {
    border-radius: 18px;
  }

  .timeline__item-content {
    padding: 1.25rem;
  }

  .timeline__item-media img {
    min-height: 190px;
  }
}
