/**
 * Interactive Timeline Vertical Tree & Event Cards - Julie & Tom
 * Strict HVL Standard: < 400 lines.
 */

/* Timeline Vertical Tree */
.timeline-tree {
  position: relative;
  margin: 10px 0;
  padding-left: 20px;
}

@media (min-width: 768px) {
  .timeline-tree {
    padding-left: 26px;
  }
}

.timeline-tree::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(to bottom, var(--burgundy) 0%, var(--light-blue-dark) 50%, var(--burgundy) 100%);
  border-radius: 1px;
}

@media (min-width: 768px) {
  .timeline-tree::before {
    left: 10px;
  }
}

/* Year Separator */
.year-separator {
  position: relative;
  margin: 18px 0 8px -20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (min-width: 768px) {
  .year-separator {
    margin-left: -26px;
  }
}

.year-badge {
  background: var(--burgundy);
  color: var(--cream);
  font-family: var(--font-serif-display);
  font-size: 0.94rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--cream);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.year-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--burgundy), transparent);
}

.year-count {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Event Item Card */
.event-item {
  position: relative;
  margin-bottom: 9px;
  cursor: pointer;
}

.event-dot {
  position: absolute;
  left: -18px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--burgundy);
  box-shadow: 0 0 0 2px var(--cream);
  z-index: 3;
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  .event-dot {
    left: -22px;
    width: 11px;
    height: 11px;
  }
}

.event-item:hover .event-dot {
  background: var(--burgundy);
  border-color: var(--light-blue);
  transform: scale(1.25);
}

.event-card {
  background: var(--cream-card);
  border: 1px solid rgba(164, 32, 56, 0.18);
  border-left: 3px solid var(--burgundy);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  box-shadow: 0 1px 3px rgba(70, 19, 0, 0.05);
  transition: all 0.2s ease;
}

.event-item:hover .event-card {
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--burgundy);
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.event-date {
  font-family: var(--font-serif-body);
  font-weight: 700;
  font-size: 0.90rem;
  color: var(--burgundy);
}

.event-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}

.badge-star {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 1px 4px;
  font-size: 0.70rem;
}

.event-desc {
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.42;
  margin-bottom: 3px;
  word-break: break-word;
}

/* Hyperlinks in cards & modal */
.event-desc a,
.modal-body a {
  color: var(--burgundy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.event-desc a:hover,
.modal-body a:hover {
  color: var(--light-blue-dark);
}

.event-photo-preview {
  margin-top: 5px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.event-photo-preview img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--burgundy);
}

.photo-click-hint {
  font-size: 0.74rem;
  color: var(--burgundy);
  font-weight: 600;
}

.google-photos-row {
  margin-top: 4px;
}

.google-photos-tag {
  color: #1a73e8;
  font-size: 0.75rem;
  font-weight: 600;
}

.event-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.tag-pill {
  font-size: 0.70rem;
  padding: 1px 5px;
}

/* Mode Compact: Ultra-condensed scan mode */
.timeline-tree.mode-compact .event-item {
  margin-bottom: 4px;
}

.timeline-tree.mode-compact .event-card {
  padding: 5px 9px;
  border-left-width: 2.5px;
}

.timeline-tree.mode-compact .event-desc {
  font-size: 0.84rem;
  line-height: 1.32;
  margin-bottom: 1px;
}

.timeline-tree.mode-compact .event-date {
  font-size: 0.84rem;
}

.timeline-tree.mode-compact .year-separator {
  margin: 12px 0 5px -20px;
}

.timeline-tree.mode-compact .event-photo-preview img {
  width: 30px;
  height: 30px;
}

.timeline-tree.mode-compact .event-tags {
  display: none;
}
