// ==========================================================================
// Timeline Block
// Chronological entries: CSS Grid (year | dot+line | content)
//
// Grid columns: [year] [marker] [content]
// The marker column stretches full row height so ::after (the line)
// connects each dot to the next, creating a continuous vertical line.
// ==========================================================================

.b-timeline {
  // Spacing handled by l-section utility classes
}

// ==========================================================================
// Item grid
// ==========================================================================

.b-timeline__item {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: $spacer * 1;
  row-gap: $spacer * 0.5;
  align-items: start;
  @media (min-width: 400px) {
    column-gap: 1.5rem;
  }
  @include media-breakpoint-up(sm) {
    grid-template-columns: 5rem 1.75rem 1fr;
    column-gap: 2rem;
    row-gap: 0;
  }

  @include media-breakpoint-up(md) {
    grid-template-columns: 6.5rem 2rem 1fr;
    column-gap: 2.5rem;
  }

  @include media-breakpoint-up(lg) {
    grid-template-columns: 8rem 2.5rem 1fr;
    column-gap: 3rem;
  }
}

// ==========================================================================
// Year label (left column)
// ==========================================================================

.b-timeline__year {
  font-size: $h1-font-size;
  font-weight: $font-weight-extrabold;
  color: $primary;
  line-height: 1;
  text-align: left;
  grid-column: 1 / -1;
  margin-bottom: 1.5rem;
  @include media-breakpoint-up(sm) {
    font-size: $h2-font-size;
    text-align: right;
    grid-column: auto;
    margin-top: -5px;
    margin-bottom: 1.5rem;
  }

  @include media-breakpoint-up(md) {
    font-size: $h1-font-size;
    margin-top: -8px;
  }

  @include media-breakpoint-up(lg) {
  }
}

// ==========================================================================
// Marker column: dot + connecting line segment
//
// align-self: stretch keeps the column as tall as the content cell.
// ::after fills remaining space below the dot with a 1px line,
// which visually connects to the next item's dot.
// ==========================================================================

.b-timeline__marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  margin-bottom: 1rem;
  grid-column: 1;
  grid-row: 2;

  @include media-breakpoint-up(sm) {
    grid-column: auto;
    grid-row: auto;
  }

  &::after {
    content: "";
    flex: 1;
    width: 1px;
    background: $primary-15;
    margin-top: 1rem;
  }
}

.b-timeline__item--last .b-timeline__marker::after {
  display: none;
}

.b-timeline__dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: $color-accent;
  flex-shrink: 0;
  margin-top: $spacer * 0.25;
  position: relative;
  z-index: 1;
}

// ==========================================================================
// Content column (right)
// ==========================================================================

.b-timeline__content {
  grid-column: 2;
  grid-row: 2;
  padding-bottom: 5rem;

  @include media-breakpoint-up(sm) {
    grid-column: auto;
    grid-row: auto;
  }
  @include media-breakpoint-up(xl) {
    padding-left: 1rem;
  }
  .b-timeline__item--last & {
    padding-bottom: 0;
  }
}

// Image
.b-timeline__image-wrap {
  position: relative;
  margin-bottom: 2rem;

  // Original: display at natural size, no stretching
  &--original {
    display: inline-block;
    max-width: 100%;
  }
}

.b-timeline__image {
  display: block;
  width: 100%;

  .b-timeline__image-wrap--original & {
    width: auto;
    max-width: 100%;
    min-width: 150px;
  }
}

// Entry title
.b-timeline__entry-title {
  margin-top: 0;
  font-size: 1.125rem;
  line-height: 1.4;
  @include media-breakpoint-up(sm) {
    font-size: 1.125rem;
  }
  @include media-breakpoint-up(md) {
    font-size: 1.25rem;
  }
}

// Body text
.b-timeline__text {
  p:last-child {
    margin-bottom: 0;
  }
}
