/* =============================================================================
   GS TIMELINE
   Vertical alternating timeline. Bar drawn per-node from pill center to pill
   center, so it starts/ends exactly at the first and last markers.
   ============================================================================= */

/* --- Geometry constants ---
   --pill-half  : half the pill height, anchors the bar at each pill center.
                  Pill height = pad-top(0.55) + line-height(1.05×1.5) + pad-bot(0.55) ≈ 2.675rem
   --node-gap   : margin-bottom between nodes.
   --bar-width  : thickness of the vertical bar.

   Bar segment math (::after on each node):
     top    =  --pill-half                  → starts at THIS pill center
     bottom = -(--node-gap + --pill-half)   → ends at NEXT pill center
              (bottom is measured from node's bottom edge;
               next node top is node-gap below, its pill center is pill-half further)
   --------------------------------------------------------------------------- */

.gs-timeline {
  --pill-half: 1.35rem;
  --node-gap:  3rem;
  --bar-color:  var(--bs-primary, #0d6efd);
  --done-color: /*#525252;*/ #299800;
  --bar-width: 6px;

  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}


/* --- Node row --- */

.gs-timeline__node {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin-bottom: var(--node-gap);
  position: relative;
}

.gs-timeline__node:last-child {
  margin-bottom: 0;
}

.gs-timeline__node:nth-child(even) {
  flex-direction: row-reverse;
}


/* --- Bar segment: this pill center → next pill center ---
   The gradient body is solid for the first ~88%, then transitions into a
   decreasing-dash trail over the final ~12%:
     large dash → medium dash → small dash → two single dots → fade out.
   The last node draws nothing.
   ---------------------------------------------------------------- */

.gs-timeline__node::after {
  content: '';
  position: absolute;
  left: calc(50% - var(--bar-width) / 2);
  top: var(--pill-half);
  bottom: calc(-1 * (var(--node-gap) + var(--pill-half)));
  width: var(--bar-width);
  border-radius: calc(var(--bar-width) / 2);
  z-index: 0;

  background: linear-gradient(to bottom,
    /* Solid body */
    var(--bar-color) 0%,
    var(--bar-color) 50%,

    /* Break — gap before trail begins */
    transparent      80%,
    transparent      100%
  );
}

.gs-timeline__node:last-child::after {
  display: none;
}


/* --- Content and spacer (left/right halves) --- */

.gs-timeline__content,
.gs-timeline__spacer {
  flex: 1;
}

.gs-timeline__content {
  padding: 0 2rem;
}

/* Postponed badge — red pill below the main marker */
.gs-timeline__postponed {
  padding: 0.35rem 0.75rem;
  background: #dc3545;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 2rem;
  text-align: center;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

/* Done nodes use the secondary colour throughout */
.gs-timeline__node--done {
  --bar-color: var(--done-color);
}

/* Odd (left-side) nodes: right-align text so it reads toward the bar */
.gs-timeline__node:nth-child(odd) .gs-timeline__content {
  text-align: right;
}


/* --- Center marker — pill button overlapping the bar --- */

/* Marker: transparent column container, pills stack inside it */
.gs-timeline__marker {
  flex: 0 0 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

/* Time pill — carries the visual pill styling */
.gs-timeline__time {
  min-width: 140px;
  background: var(--bar-color);
  border-radius: 2rem;
  padding: 0.55rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.02em;
}


/* --- Card — no background, title-forward --- */

.gs-timeline__card {
  padding: 0.25rem 0;
}

.gs-timeline__card-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  /* color: var(--bs-heading-color, inherit); */
}

.gs-timeline__card-body {
  font-size: 1.15rem;
  /* color: var(--bs-body-color, inherit); */
  line-height: 1.65;
}

.gs-timeline__card-body a{
  font-weight: 600;
  color: #084196;
}

.gs-timeline__card-body > *:last-child {
  margin-bottom: 0;
}


/* --- Medium screens: bar moves to the right, all cards left-aligned to it --- */

@media (min-width: 641px) and (max-width: 1200px) {
  /* Cancel alternating — all nodes flow left-to-right */
  .gs-timeline__node:nth-child(even) {
    flex-direction: row;
  }

  /* Hide spacer so content fills the left, marker sits on the right */
  .gs-timeline__spacer {
    display: none;
  }

  /* Bar re-anchored to marker center on the right side.
     Marker is flex: 0 0 140px, so its center is 70px from the node's right edge. */
  .gs-timeline__node::after {
    left: calc(100% - 70px - var(--bar-width) / 2);
  }

  /* All text left-aligned toward the bar */
  .gs-timeline__node:nth-child(odd) .gs-timeline__content {
    text-align: left;
  }
}


/* --- Small screens: single column --- */

@media (max-width: 640px) {
  .gs-timeline__node,
  .gs-timeline__node:nth-child(even) {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2.5rem;
  }

  .gs-timeline__node::after {
    display: none;
  }

  .gs-timeline__spacer {
    display: none;
  }

  .gs-timeline__content {
    padding: 0;
  }

  .gs-timeline__marker {
    flex: none;           /* prevent flex-basis 140px becoming the height */
    order: -1;            /* render above the card */
    align-self: flex-start;
    margin-bottom: 0.75rem;
  }

  .gs-timeline__card-title {
    font-size: 1.35rem;
  }

  .gs-timeline__node:nth-child(odd) .gs-timeline__content {
    text-align: left;
  }
}
