/**
 * Interactive Timeline Styles - Julie & Tom
 * Optimized for compact, cozy mobile presentation & fast scanning.
 * Strict HVL Standard: < 400 lines.
 */

/* Hero Banner */
.hero-banner {
  background: var(--cream-card);
  border: 1px solid rgba(164, 32, 56, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) { .hero-banner { padding: 22px 26px; margin-bottom: 22px; } }
.hero-content-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
@media (min-width: 640px) {
  .hero-content-wrap {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 20px;
  }
}
.hero-img-box img {
  width: auto;
  height: auto;
  max-width: 110px;
  max-height: 155px;
  border-radius: 0;
  border: 2px solid var(--burgundy);
  background: #ffffff;
  padding: 3px;
  box-shadow: var(--shadow-md);
  object-fit: contain;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  display: block;
}
@media (min-width: 768px) {
  .hero-img-box img {
    max-width: 135px;
    max-height: 190px;
  }
}
.hero-img-box img:hover { transform: rotate(-1deg) scale(1.03); }
.hero-badge-row { margin-bottom: 4px; }
.hero-intro h2 {
  font-family: var(--font-serif-display);
  color: var(--burgundy);
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  margin-bottom: 4px;
  line-height: 1.2;
}
.hero-intro p {
  font-size: 0.90rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.45;
  max-width: 740px;
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
@media (min-width: 640px) { .hero-actions { justify-content: flex-start; } }

/* Timeline Sticky Controls */
.timeline-controls {
  background: rgba(255, 255, 240, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(164, 32, 56, 0.2);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 48px;
  z-index: 35;
}
.controls-top-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.search-box {
  flex: 1;
  min-width: 140px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 6px 12px 6px 30px;
  border: 1px solid #d8c3a8;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s ease;
}
.search-icon-svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 2px var(--burgundy-subtle);
}

/* Density Switcher */
.density-group {
  display: inline-flex;
  background: rgba(70, 19, 0, 0.08);
  padding: 2px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.density-btn {
  background: transparent;
  border: none;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.density-btn.active {
  background: #ffffff;
  color: var(--burgundy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Scrollable Horizontal Filter Tracks */
.scrollable-filter-track {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.scrollable-filter-track::-webkit-scrollbar { display: none; }
.year-btn {
  background: transparent;
  border: 1px solid rgba(164, 32, 56, 0.3);
  color: var(--burgundy);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.year-btn:hover { background: var(--burgundy-subtle); }
.year-btn.active {
  background: var(--burgundy);
  color: #ffffff;
  border-color: var(--burgundy);
}
.category-chip {
  background: transparent;
  border: 1px solid rgba(70, 19, 0, 0.15);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.category-chip:hover { background: rgba(70, 19, 0, 0.06); }
.category-chip.active {
  background: var(--burgundy);
  color: #ffffff;
  border-color: var(--burgundy);
}

/* 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; }
