/* ==========================================================================
   Timeline — events in order, joined by a line (order history, activity logs).

   <ol class="timeline">
     <li>
       <span class="timeline-marker theme-green"><i class="mi mi-check"></i></span>   (optional; a dot otherwise)
       <div class="timeline-content">
         <div class="timeline-title">Payment received</div>
         <div class="timeline-text">$129.00 via Visa</div>
         <time class="timeline-time">Nov 21, 10:24</time>
       </div>
     </li>
   </ol>

   theme-* on an <li> colors its dot / marker · .timeline-sm
   ========================================================================== */

.timeline {
  --mo-timeline-marker: 1.75rem;
  --mo-timeline-gap: 1.25rem;
  padding: 0;
  margin: 0;
  font-size: .875rem;
  list-style: none;
}
.timeline > li {
  position: relative;
  display: flex;
  gap: .875rem;
  padding-bottom: var(--mo-timeline-gap);
}
.timeline > li:last-child { padding-bottom: 0; }
/* The line from this marker down to the next */
.timeline > li:not(:last-child)::after {
  position: absolute;
  top: calc(var(--mo-timeline-marker) + .25rem);
  bottom: .25rem;
  inset-inline-start: calc(var(--mo-timeline-marker) / 2 - 1px);
  width: 2px;
  content: "";
  background: color-mix(in oklab, var(--mo-fg-body) 10%, transparent);
  border-radius: 2px;
}
/* Marker: an icon circle, or a dot when there's none */
.timeline-marker,
.timeline > li:not(:has(> .timeline-marker))::before {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--mo-timeline-marker);
  height: var(--mo-timeline-marker);
  font-size: .875rem;
  color: var(--mo-fg-3);
  background: color-mix(in oklab, var(--mo-fg-body) 7%, transparent);
  border-radius: 50%;
}
.timeline > li:not(:has(> .timeline-marker))::before {
  content: "";
  background: radial-gradient(circle, var(--mo-timeline-dot, var(--mo-fg-3)) 0 .25rem, transparent .3rem), color-mix(in oklab, var(--mo-fg-body) 7%, transparent);
}
.timeline > li[class*="theme-"] { --mo-timeline-dot: var(--mo-theme-base); }
.timeline-marker[class*="theme-"],
.timeline > li[class*="theme-"] > .timeline-marker { color: var(--mo-theme-fg); background: var(--mo-theme-bg-subtle); }
.timeline > li[class*="theme-"]:not(:has(> .timeline-marker))::before {
  background: radial-gradient(circle, var(--mo-theme-base) 0 .25rem, transparent .3rem), var(--mo-theme-bg-subtle);
}
.timeline-marker > .avatar { --mo-avatar-size: var(--mo-timeline-marker); }

.timeline-content {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .125rem 1rem;
  align-content: start;
  min-width: 0;
  padding-top: calc((var(--mo-timeline-marker) - 1.35em) / 2);
}
.timeline-title { font-weight: var(--mo-font-weight-medium); color: var(--mo-fg-body); }
.timeline-text { grid-column: 1; color: var(--mo-fg-3); }
.timeline-time { grid-row: 1; grid-column: 2; font-size: .8125rem; color: var(--mo-fg-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline-content > :not(.timeline-title, .timeline-text, .timeline-time) { grid-column: 1 / -1; margin-top: .375rem; }   /* cards, quotes… */

.timeline-sm { --mo-timeline-marker: 1.375rem; --mo-timeline-gap: .875rem; font-size: .8125rem; }
.timeline-sm .timeline-marker { font-size: .75rem; }

@media (width < 576px) {
  .timeline-time { grid-row: auto; grid-column: 1; }
}
