/* =============================================================================
   Milestones: the year as a vertical timeline, one section per month.
   Each entry is a date, a short title, a line or two, and a strip of
   photographs; extra photographs from the same day sit in a toggle. The strip
   keeps every photograph's own shape: each image's flex-grow is its aspect
   ratio (set inline), so a row comes out at one height without cropping.
   The lightbox from page.js opens the large file (milestones.js).
   ========================================================================== */

/* ---- highlights: the gold sheet under the banner ---------------------------
   The sheet is the highlights alone: one line per month on a horizontal track,
   and no abstract under it. Below 900px the track turns vertical. */
.abstract--sheet.abstract--timeline .abstract__inner { grid-template-columns: minmax(0, 1fr); }

.hl__track {
  --dot: 13px;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  column-gap: 1rem;
}
/* the rail through every dot */
.hl__track::before {
  content: "";
  position: absolute;
  left: calc(var(--dot) / 2); right: 0;
  top: calc(2.3rem + .8rem + var(--dot) / 2 - 1px);
  height: 2px;
  background: linear-gradient(90deg, var(--bh-deep), color-mix(in srgb, var(--bh-deep) 35%, transparent));
}
.hl__item { min-width: 0; margin: 0; }
.hl__item a {
  display: grid;
  grid-template-rows: 2.3rem var(--dot) auto;
  row-gap: .8rem;
  color: inherit;
  text-decoration: none;
}
.hl__mon {
  align-self: end;
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .04em;
  color: var(--bh-label);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hl__yr { display: block; font-size: .6875rem; font-weight: 500; letter-spacing: .08em; opacity: .7; }
.hl__dot {
  position: relative;
  width: var(--dot); height: var(--dot);
  border-radius: 50%;
  background: var(--bh-deep);
  box-shadow: 0 0 0 4px var(--paper);
  transition: transform .2s ease;
}
.hl__text {
  font-size: .875rem;
  line-height: 1.45;
  color: var(--ink-1);
  text-wrap: pretty;
}
.hl__item a:hover .hl__dot,
.hl__item a:focus-visible .hl__dot { transform: scale(1.35); }
.hl__item a:hover .hl__text { text-decoration: underline; text-decoration-color: var(--bh-deep); text-underline-offset: 3px; }

@media (max-width: 899px) {
  .hl__track { grid-template-columns: minmax(0, 1fr); row-gap: 1.1rem; }
  .hl__track::before {
    left: calc(4.75rem + .9rem + var(--dot) / 2 - 1px); right: auto;
    top: .4rem; bottom: .4rem;
    width: 2px; height: auto;
    background: color-mix(in srgb, var(--bh-deep) 55%, transparent);
  }
  .hl__item a {
    grid-template-columns: 4.75rem var(--dot) minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: .9rem;
    align-items: start;
  }
  .hl__mon { align-self: start; padding-top: .05rem; }

  .hl__dot { margin-top: .3rem; }
}

/* ---- the timeline ------------------------------------------------------------ */
.milestones { --tl-date: 6.75rem; --tl-gap: 2.25rem; --tl-h: 10.5rem; }

.sec ol.tl {
  position: relative;
  list-style: none;
  margin: var(--sp-5) 0 0;
  padding: 0;
}
/* the rail: one continuous line down the date column's right edge */
.sec ol.tl::before {
  content: "";
  position: absolute;
  top: .55rem; bottom: .55rem;
  left: calc(var(--tl-date) + var(--tl-gap) / 2 - 1px);
  width: 2px;
  background: var(--leaf-200);
}
.sec ol.tl > li.tl__item {
  position: relative;
  display: grid;
  grid-template-columns: var(--tl-date) minmax(0, 1fr);
  column-gap: var(--tl-gap);
  margin: 0;
  padding-bottom: var(--sp-7);
}
.sec ol.tl > li.tl__item:last-child { padding-bottom: 0; }
.sec ol.tl > li.tl__item::before {
  content: "";
  position: absolute;
  top: .42rem;
  left: calc(var(--tl-date) + var(--tl-gap) / 2 - 7px);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--leaf-700);
  box-shadow: 0 0 0 4px var(--white);
}
.sec ol.tl--ahead > li.tl__item::before { background: var(--white); border: 2px solid var(--leaf-500); }

.sec .tl__date {
  margin: 0;
  padding-top: .12rem;
  text-align: right;
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.35;
  color: var(--leaf-700);
  font-variant-numeric: tabular-nums;
}
.tl__body { min-width: 0; }
.sec .tl__title {
  margin: 0 0 var(--sp-2);
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--leaf-900);
}
.sec .tl__body > p { margin: 0; max-width: var(--measure); }

/* ---- photo strip ------------------------------------------------------------- */
.fig.tl__fig { margin: var(--sp-4) 0 0; }
.tl__strip {
  display: flex;
  gap: var(--sp-2);
  max-width: calc(var(--ar) * var(--tl-h) + (var(--n) - 1) * var(--sp-2));
}
.tl__strip img {
  flex-shrink: 1;
  flex-basis: 0;
  width: 0;
  min-width: 0;
  height: auto;
}
.tl__fig figcaption { max-width: var(--measure); }
.tl__more { margin: var(--sp-4) 0 0; max-width: var(--measure); }
.tl__more .fig.tl__fig { margin-top: 0; }
.tl__more .tl__strip { max-width: calc(var(--ar) * 8.5rem + (var(--n) - 1) * var(--sp-2)); }

/* ---- phone: dates move above the titles, the rail moves to the edge --------- */
@media (max-width: 720px) {
  .milestones { --tl-h: 8rem; }
  .sec ol.tl::before { left: .4rem; }
  .sec ol.tl > li.tl__item {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 1.75rem;
    padding-bottom: var(--sp-6);
  }
  .sec ol.tl > li.tl__item::before { left: calc(.4rem - 6px); width: 12px; height: 12px; top: .3rem; }
  .sec .tl__date { text-align: left; padding: 0; margin-bottom: var(--sp-1); }
}

/* a lone photograph or a diagram gets more height than a row of three */
.tl__strip--one { --tl-h: 15rem; }
@media (max-width: 720px) { .tl__strip--one { --tl-h: 13rem; } }
.tl__more .tl__strip--one { max-width: calc(var(--ar) * 12rem); }
