/* Vertical "Luma-style" event timeline: a column of dots connected by a
   dotted line, with a date label next to each dot and a rounded bubble
   describing the event further to the right. */

:root {
  --timeline-dot-color: #6c5ce7;
  --timeline-line-color: #c9c3f0;
  --timeline-bubble-bg: #FDFCFF;
  --timeline-bubble-border: #f1eef8;
  --timeline-bubble-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --timeline-text-color: #222222;
  --timeline-muted-color: #767676;
  --special-date-color: #c0392b;
}

.timeline {
  max-width: 640px;
  margin: 2rem 0;
  padding: 0 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.timeline-empty {
  text-align: center;
  color: var(--timeline-muted-color);
  padding: 2rem 0;
}

.timeline-item {
  display: flex;
  align-items: stretch;
}

/* Year marker: shown above the first event/branch, and again every time
   the year changes going down the list. align-items: stretch (not a
   margin on the row) keeps the connecting line unbroken through it. */
.timeline-year-row {
  display: flex;
  align-items: stretch;
}

.timeline-year {
  flex-shrink: 0;
  width: 8rem;
  padding-right: 0.75rem;
  text-align: right;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.3rem 0;
  color: var(--timeline-text-color);
}

/* Date label, e.g. "JUL 14" */
.timeline-date {
  flex-shrink: 0;
  width: 8rem;
  text-align: right;
  padding-right: 0.75rem;
  padding-top: 0.1rem;
}

.timeline-date .timeline-weekday {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--timeline-muted-color);
  text-transform: uppercase;
}

.timeline-date .timeline-month {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #aaaaaa;
  text-transform: uppercase;
}

.timeline-date .timeline-day {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--timeline-text-color);
  line-height: 1.1;
}

/* Dot + dotted connector column */
.timeline-line-col {
  position: relative;
  flex-shrink: 0;
  width: 1.25rem;
}

.timeline-dot {
  position: absolute;
  top: 0.3rem;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--timeline-dot-color);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--timeline-dot-color);
  z-index: 1;
}

/* The line running from this event's own dot down to the bottom of its row
   (behind the bubble), so it reaches the gap/branch row(s) below and the
   line never breaks. Suppressed on the last event, which has nothing below it. */
.timeline-item:not(.timeline-item-last) .timeline-line-col::after {
  content: "";
  position: absolute;
  top: 1.1rem;
  bottom: 0;
  left: 50%;
  border-left: 2px dotted var(--timeline-line-color);
}

/* Vertical dotted line segment: fills the full height of whatever row it's
   in (a plain gap row, or a branch row), so stacking more rows between two
   events automatically makes the line longer. */
.timeline-line-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 2px dotted var(--timeline-line-color);
}

/* Plain gap row between two events with no special dates in between */
.timeline-gap {
  display: flex;
  height: 2rem;
}

.timeline-gap-spacer {
  flex: 1;
}

/* A special-date branch hanging off the main line, between two events */
.timeline-branch {
  display: flex;
  align-items: stretch;
}

.timeline-branch-lead {
  flex-shrink: 0;
  width: 8rem;
  padding-right: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
}

.timeline-branch-label {
  text-align: right;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--special-date-color);
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}

.timeline-branch-connector-row {
  display: flex;
  align-items: center;
}

.timeline-branch-date {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--timeline-muted-color);
  white-space: nowrap;
  margin-right: 0.4rem;
}

.timeline-branch-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--special-date-color);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--special-date-color);
}

.timeline-branch-connector {
  flex: 0 0 3rem;
  border-top: 2px dotted var(--special-date-color);
  margin-left: 0.4rem;
}

/* Bubble containing the event description */
.timeline-bubble {
  flex: 1;
  display: block;
  background: var(--timeline-bubble-bg);
  border: 1px solid var(--timeline-bubble-border);
  border-radius: 14px;
  box-shadow: var(--timeline-bubble-shadow);
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.timeline-bubble:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

.timeline-bubble-special {
  background: #f7bcbc;
}

.timeline-bubble-title {
  font-weight: 700;
  color: var(--timeline-text-color);
  margin-bottom: 0.2rem;
}

.timeline-bubble-time {
  font-size: 0.75rem;
  font-weight: 400;
  color: #aaaaaa;
  margin-left: 1.25rem;
}

.timeline-bubble-sub {
  font-size: 0.85rem;
  color: var(--timeline-muted-color);
}

.timeline-bubble-partiful {
  color: var(--timeline-dot-color);
  font-weight: 700;
  text-decoration: underline;
}

.timeline-bubble-partiful:hover {
  color: #fff;
  background: var(--timeline-dot-color);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  margin: -0.1rem -0.3rem;
}

.timeline-bubble-partiful-tba {
  color: #a89fe0;
  font-weight: 700;
}

/* Narrow screens: the 8rem date/branch column eats too much width from the
   bubble, so shrink it back down and tighten up the branch layout to match. */
@media (max-width: 600px) {
  .timeline-date,
  .timeline-branch-lead,
  .timeline-year {
    width: 4.25rem;
    padding-right: 0.5rem;
  }

  .timeline-branch-date {
    font-size: 0.65rem;
    margin-right: 0.25rem;
  }

  .timeline-branch-connector {
    flex-basis: 0.75rem;
    margin-left: 0.25rem;
  }

  .timeline-branch-label {
    font-size: 0.65rem;
  }

  .timeline-bubble {
    padding: 0.7rem 0.85rem;
  }
}
