/* ========================================
   Timeline — Events, Dots, Photos
   ======================================== */

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--cream-dark);
  border-radius: 1px;
}

/* Dynamic timeline line: set by JS to span first dot to last dot */
.timeline.has-events::before {
  top: var(--timeline-top, 14px);
  bottom: var(--timeline-bottom, 14px);
}

.timeline-event {
  position: relative;
  padding: 0 0 20px 28px;
  animation: slideIn 0.3s ease;
  animation-fill-mode: backwards;
}

.timeline-event:last-child {
  padding-bottom: 0;
}

.timeline-event .timeline-dot {
  position: absolute;
  left: -8px;
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--gold);
  z-index: 2;
}

.timeline-event.type-plassen-buiten .timeline-dot,
.timeline-event.type-poepen-buiten .timeline-dot {
  border-color: var(--green);
  background: var(--green-light);
}

.timeline-event.type-plassen-binnen .timeline-dot,
.timeline-event.type-poepen-binnen .timeline-dot {
  border-color: var(--red);
  background: var(--red-light);
}

.timeline-event.type-eten .timeline-dot,
.timeline-event.type-drinken .timeline-dot {
  border-color: var(--orange);
  background: var(--orange-light);
}

.timeline-event.type-slapen .timeline-dot,
.timeline-event.type-ontwaken .timeline-dot {
  border-color: var(--blue);
  background: var(--blue-light);
}

.timeline-event.type-training .timeline-dot {
  border-color: var(--purple);
  background: var(--purple-light);
}

.timeline-event.type-uitlaten .timeline-dot,
.timeline-event.type-tuin .timeline-dot {
  border-color: var(--teal);
  background: var(--teal-light);
}

.timeline-event.type-milestone .timeline-dot {
  border-color: #FFD700;
  background: #FFF9C4;
}

.timeline-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.timeline-card:active {
  box-shadow: var(--shadow-md);
}

.timeline-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.event-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
}

.event-emoji {
  font-size: 20px;
  flex-shrink: 0;
}

.event-type {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
}

.event-note {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.45;
  margin-left: 52px;
}

.event-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 52px;
  margin-top: 2px;
}

/* Indoor accident highlight */
.timeline-event.type-plassen-binnen .timeline-card,
.timeline-event.type-poepen-binnen .timeline-card {
  border-left: 3px solid var(--red);
  background: var(--red-light);
}

.timeline-event.type-milestone .timeline-card {
  border-left: 3px solid #FFD700;
  background: #FFFDE7;
}

/* ---- Timeline Photo/Video ---- */
.event-photo {
  margin-top: 8px;
  margin-left: 52px;
}

.event-photo img,
.event-photo video {
  max-width: 200px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(164, 123, 91, 0.25);
  border: 2px solid var(--gold-light);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}

.event-photo video {
  cursor: default;
}

.event-photo img:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-md);
}

@media (min-width: 600px) {
  .event-photo img,
  .event-photo video {
    max-width: 300px;
  }
}
