/* Photos-over-the-years timeline. --year-width (set by the timeline
   controller as you zoom) is how wide one year is. */
.timeline-track {
  --year-width: 56px;
  /* Exactly as wide as its years (no min-width), so the graph, which fills
     the track, lines up with the year columns at every zoom. */
}

.timeline-kind-births { --kind: #059669; }
.timeline-kind-deaths { --kind: #57534e; }
.timeline-kind-marriages { --kind: #db2777; }
.timeline-kind-events { --kind: #2563eb; }

.timeline-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: var(--kind, #a8a29e);
}

.timeline-event {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 1.5rem;
  padding: 0 0.4rem 0 0.1rem;
  margin-left: -0.35rem; /* put the dot on the date */
  border-radius: 9999px;
  font-size: 0.75rem;
  white-space: nowrap;
  color: #1c1917;
  background: color-mix(in srgb, var(--kind) 9%, white);
  border: 1px solid color-mix(in srgb, var(--kind) 35%, white);
}

.timeline-event:hover {
  border-color: var(--kind);
}

.timeline-area {
  fill: color-mix(in srgb, #b45309 18%, transparent);
}

.timeline-line {
  fill: none;
  stroke: #b45309;
  stroke-width: 1.5;
}

.timeline-axis .timeline-year,
.timeline-counts .timeline-year-count {
  flex: 0 0 var(--year-width);
  width: var(--year-width);
}

.timeline-year-count {
  text-align: center;
  min-height: 1.1rem;
}

.timeline-year {
  padding: 0.15rem 0 0.15rem 0.2rem;
  font-size: 0.7rem;
  color: #78716c;
  border-left: 1px solid #e7e5e4;
  overflow: hidden;
}

.timeline-year.decade {
  color: #1c1917;
  font-weight: 600;
  border-left-color: #a8a29e;
}

.timeline-thumb {
  position: absolute;
  margin-left: -1.65rem; /* centered on its year */
}

.timeline-thumb img {
  display: block;
  width: 3.3rem;
  height: 3.3rem;
  object-fit: cover;
  border-radius: 0.25rem;
  box-shadow: 0 0 0 2px white, 0 1px 3px rgba(0, 0, 0, 0.25);
}

.timeline-more {
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
}

/* Zoomed far out: only decade labels. */
.timeline-track.compact .timeline-year:not(.decade) { color: transparent; }
.timeline-track.compact .timeline-year.decade { overflow: visible; }
.timeline-track.compact .timeline-more { font-size: 0.65rem; }
