/* Timeline — company history (Wireframe 9-4845). Grid: year | rail | card.
   With a heading the section splits like Edith's steps block (Figma 269-582):
   heading sticky on the left half, the rail on the right half — a lone
   880px list left half the 1280 grid empty. The rail is one line behind all
   dots (::before on the list). */
.sun-tl { display: block; container-type: inline-size; --sun-tl-year: 72px; --sun-tl-rail: 40px; }
.sun-tl__inner {
  box-sizing: border-box;
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
  padding-block: clamp(48px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vw, 48px);
}
.sun-tl__head { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.sun-tl__heading {
  margin: 0;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.16px;
  color: var(--sun-secondary);
  text-wrap: balance;
}
.sun-tl__heading-muted { color: var(--sun-bluegrey); }
.sun-tl__subhead { margin: 0; font-size: 16px; line-height: 24px; color: var(--sun-bluegrey); }

.sun-tl__list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  overflow: clip;                                /* keeps the end masks inside the list */
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sun-tl:not(.sun-tl--split) .sun-tl__list { max-width: 880px; }
/* Rail: runs the full list; the first and last dot mask the overshoot with
   the page grey, so it starts and stops exactly at a dot however tall the
   first/last card wraps. */
.sun-tl__list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sun-tl-year) + var(--sun-tl-rail) / 2 - 1px);
  width: 2px;
  background: var(--sun-muted);
}
.sun-tl__item {
  position: relative;
  display: grid;
  grid-template-columns: var(--sun-tl-year) var(--sun-tl-rail) minmax(0, 1fr);
  align-items: center;
}
.sun-tl__year {
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: 24px;                               /* H5 24/32 — the steps "01" */
  line-height: 32px;
  color: var(--sun-primary);
  font-variant-numeric: tabular-nums;
}
.sun-tl__dot {
  position: relative;                            /* above the rail */
  justify-self: center;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 3px solid var(--sun-primary);
  border-radius: 50%;
  background: var(--sun-primary);                /* all milestones filled */
}
.sun-tl__card {
  box-sizing: border-box;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 8px;
  padding: 20px 24px;
  background: var(--sun-base);
  border-radius: 4px;
}
.sun-tl__title {
  margin: 0;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: 18px;                               /* H6 18/24 — steps card text */
  line-height: 24px;
  color: var(--sun-secondary);
}
.sun-tl__text { margin: 4px 0 0; font-size: 16px; line-height: 24px; color: var(--sun-bluegrey); }

.sun-tl__item:first-child .sun-tl__dot::before,
.sun-tl__item:last-child .sun-tl__dot::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  height: 200px;
  background: var(--sun-border);
}
.sun-tl__item:first-child .sun-tl__dot::before { bottom: calc(100% + 3px); }
.sun-tl__item:last-child .sun-tl__dot::after { top: calc(100% + 3px + 6px); }   /* below the glow ring, which hides the rail up to here */
.sun-tl__item:only-child .sun-tl__dot::before,
.sun-tl__item:only-child .sun-tl__dot::after { display: none; }
.sun-tl__list:has(> :only-child)::before { display: none; }

/* The glow marks the latest milestone (last entry). An outline, not a box-shadow:
   it paints above the dot's own ::after mask (which ends the rail below the dot),
   so the ring stays whole; opaque (18 % orange on page grey) so the rail does not
   show through it. */
.sun-tl__item:last-child .sun-tl__dot { outline: 6px solid color-mix(in srgb, var(--sun-primary) 18%, var(--sun-border)); }
/* Highlight card = the steps CTA card gradient (accent → navy, Figma 103°). */
.sun-tl__item--highlight .sun-tl__card { background: linear-gradient(103deg, var(--sun-accent) 21.07%, var(--sun-secondary) 100%); }
.sun-tl__item--highlight .sun-tl__title { color: var(--sun-base); }
.sun-tl__item--highlight .sun-tl__text { color: var(--sun-border); }

/* Split layout — steps geometry: two equal columns, 40 gap, sticky aside.
   Driven by the block's own width (container), so it also stays stacked when
   the block sits in a narrow content column. */
@container (min-width: 1025px) {
  .sun-tl--split .sun-tl__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
  .sun-tl--split .sun-tl__head {
    position: sticky;
    top: calc(var(--sun-header-h, 76px) + 32px);
    gap: 24px;
  }
  /* Aside heading = steps / FAQ aside: H2 Display 48/56, subhead 18/24. */
  .sun-tl--split .sun-tl__heading {
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.1667;
    letter-spacing: -0.48px;
  }
  .sun-tl--split .sun-tl__subhead { font-size: 18px; line-height: 24px; }
}

@container (max-width: 560px) {
  .sun-tl__inner { --sun-tl-year: 0px; --sun-tl-rail: 24px; }
  .sun-tl__item { grid-template-columns: var(--sun-tl-rail) minmax(0, 1fr); row-gap: 4px; }
  .sun-tl__year { grid-column: 2; margin-left: 12px; font-size: 18px; line-height: 24px; }
  .sun-tl__dot { grid-column: 1; grid-row: 1; }
  .sun-tl__card { grid-column: 2; min-height: 0; margin-left: 12px; padding: 16px 20px; }
  .sun-tl__title { font-size: 16px; }
}

/* Unfold animation (block.js adds .is-anim, then .is-in per entry, top to
   bottom): the dot pops in, year and card fade up, the rail grows down to the
   newest dot (--sun-tl-p from JS). Reduced motion / no JS: static. */
.sun-tl.is-anim .sun-tl__list::before {
  transform: scaleY(var(--sun-tl-p, 0));
  transform-origin: top;
  transition: transform .3s ease-out;
}
.sun-tl.is-anim .sun-tl__dot { transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.sun-tl.is-anim :is(.sun-tl__year, .sun-tl__card) {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1);
}
.sun-tl.is-anim .sun-tl__card { transition-delay: .1s; }
.sun-tl.is-anim .sun-tl__item.is-in .sun-tl__dot { transform: none; }
.sun-tl.is-anim .sun-tl__item.is-in :is(.sun-tl__year, .sun-tl__card) { opacity: 1; transform: none; }
