/* ============================================
   TIMELINE COMPONENT STYLES
   ProPublica-inspired horizontal timeline
   ============================================ */

/* ============================================
   HOME LOGO
   ============================================ */
.home-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.home-link:hover {
  opacity: 1;
}

.home-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   CATEGORY COLORS
   ============================================ */
:root {
  --color-political: #f59e0b;    /* Amber - political changes */
  --color-conflict: #ef4444;      /* Red - conflict/violence */
  --color-international: #3b82f6; /* Blue - international relations */
  --color-economic: #10b981;      /* Green - economic events */

  /* SCMP-inspired palette */
  --color-bg-primary: #0a0a0a;        /* Deep black - primary background */
  --color-bg-secondary: #1a1a1a;      /* Slightly lighter black */
  --color-nav-bg: #1e293b;            /* Dark navy for timeline nav */
  --color-accent-gold: #FCDD09;       /* Ethiopian flag gold */
  --color-accent-burnt: #E64A19;      /* Burnt orange alternative */
  --color-text-primary: #f5f5f5;      /* Off-white text */
  --color-text-secondary: #a3a3a3;    /* Muted gray text */
}

/* ============================================
   HERO MODIFICATIONS
   ============================================ */
.timeline-hero {
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
}

.ethiopia-bg {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.9) 100%),
    url('https://images.unsplash.com/photo-1523805009345-7448845a9e53?w=1920') center/cover;
}

.hero-kicker {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-political);
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(20px);
}

.hero-source {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(20px);
}

/* ============================================
   TIMELINE NAVIGATION BAR
   ============================================ */
.timeline-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1.5rem 0.75rem 4.5rem; /* Extra left padding for logo */
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.timeline-nav.visible {
  transform: translateY(0);
}

.timeline-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================================
   CATEGORY FILTERS
   ============================================ */
.timeline-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

.filter-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--color-text);
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.filter-dot.political { background: var(--color-political); }
.filter-dot.conflict { background: var(--color-conflict); }
.filter-dot.international { background: var(--color-international); }
.filter-dot.economic { background: var(--color-economic); }

/* ============================================
   TIMELINE SCRUBBER
   ============================================ */
.timeline-scrubber {
  position: relative;
  padding: 0.5rem 0;
}

.timeline-track {
  position: relative;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  cursor: pointer;
}

.timeline-years {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  padding: 0 10px;
}

.year-label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.625rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  pointer-events: none;
}

/* Event Markers */
.timeline-markers {
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 100%;
}

.timeline-marker {
  position: absolute;
  top: 15%;
  width: 2px;
  height: 70%;
  border-radius: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.timeline-marker:hover {
  opacity: 1;
  transform: scaleY(1.2);
}

/* All markers use same neutral color for cleaner look */
.timeline-marker.political,
.timeline-marker.conflict,
.timeline-marker.international,
.timeline-marker.economic {
  background: rgba(255, 255, 255, 0.5);
}

.timeline-marker:hover {
  background: rgba(255, 255, 255, 0.9);
}

.timeline-marker.hidden {
  opacity: 0.15;
  pointer-events: none;
}

/* Playhead */
.timeline-playhead {
  position: absolute;
  top: 0;
  left: 10px;
  width: 2px;
  height: 100%;
  background: var(--color-text);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  pointer-events: auto;
  cursor: grab;
  z-index: 10;
}

.timeline-playhead::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--color-text);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timeline-playhead:hover::before {
  transform: translateX(-50%) scale(1.2);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.timeline-playhead:active {
  cursor: grabbing;
}

.timeline-playhead:active::before {
  transform: translateX(-50%) scale(1.3);
}

/* ============================================
   TIMELINE CONTENT
   ============================================ */
.timeline-content {
  padding-top: 120px; /* Space for fixed nav */
  min-height: 100vh;
}

/* Event Card */
.event-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 1;
  transform: translateY(0);
}

.event-card.active {
  opacity: 1;
  transform: translateY(0);
}

.event-card.filtered-out {
  display: none;
}

/* Event Header */
.event-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.event-date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.event-category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-category.political {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-political);
}
.event-category.conflict {
  background: rgba(239, 68, 68, 0.2);
  color: var(--color-conflict);
}
.event-category.international {
  background: rgba(59, 130, 246, 0.2);
  color: var(--color-international);
}
.event-category.economic {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-economic);
}

/* Event Title */
.event-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: #ffffff;
}

/* Event Description */
.event-description {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 700px;
}

.event-description p {
  margin-bottom: 1rem;
}

.event-description p:last-child {
  margin-bottom: 0;
}

/* Event Media - Full Bleed */
.event-media {
  margin-top: 2rem;
  margin-bottom: 0;
  /* Break out of container for full-bleed */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  /* Required for absolute positioned caption */
}

.event-media img {
  width: 100%;
  max-height: 85vh;
  object-fit: cover;
  object-position: center top;
  display: block;
  /* Grayscale documentary style */
  filter: grayscale(100%);
  transition: filter 0.4s ease;
}

.event-media:hover img {
  filter: grayscale(50%);
}

/* Caption overlaid on bottom of image - SCMP style */
.event-media-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  max-width: 50%;
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.8);
  line-height: 1.4;
  text-align: left;
}

.caption-source {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

/* ============================================
   FEATURED SECTIONS (Chapter Markers)
   Use .featured class for intentional gold sections
   - Story arc beginnings
   - Major turning points
   - Information-dense moments
   ============================================ */
.event-card.featured {
  /* Break out for full-bleed accent background */
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  padding-left: calc(50vw - 450px + 2rem);
  padding-right: calc(50vw - 450px + 2rem);
  padding-top: 4rem;
  padding-bottom: 0;
  max-width: none;
  background: var(--color-accent-gold);
  border-bottom: none;
}

.event-card.featured .event-date,
.event-card.featured .event-description,
.event-card.featured .event-description p {
  color: rgba(0, 0, 0, 0.75);
}

.event-card.featured .event-title {
  color: #000;
  font-weight: 700;
}

.event-card.featured .event-category {
  background: rgba(0, 0, 0, 0.15);
  color: #000;
}

.event-card.featured .event-category .filter-dot {
  background: #000;
}

.event-card.featured .event-source {
  /* Hide separate source - now inline with caption */
  display: none;
}

.event-card.featured .event-media {
  /* Reset to full-bleed within featured section */
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}

.event-card.featured .event-media-caption {
  background: rgba(0, 0, 0, 0.7);
  color: rgba(255, 255, 255, 0.8);
}

/* Add bottom padding to featured cards without images */
.event-card.featured .event-description:last-child {
  padding-bottom: 2rem;
}

/* Responsive adjustments for featured cards */
@media (max-width: 968px) {
  .event-card.featured {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .event-card.featured .event-media {
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-right: 0;
  }
}

/* Event Source */
.event-source {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.event-source a {
  color: var(--color-accent);
  text-decoration: none;
}

.event-source a:hover {
  text-decoration: underline;
}

/* ============================================
   YEAR DIVIDERS
   ============================================ */
.year-divider {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
  text-align: center;
}

.year-divider-label {
  display: inline-block;
  font-size: 3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .timeline-nav {
    padding: 0.5rem 1rem;
  }

  .timeline-filters {
    gap: 0.25rem;
  }

  .filter-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
  }

  .filter-btn span:not(.filter-dot) {
    display: none;
  }

  .filter-btn[data-category="all"] span {
    display: inline;
  }

  .year-label {
    font-size: 0.5rem;
  }

  .event-card {
    padding: 2rem 1rem;
  }

  .event-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .timeline-nav {
    display: none;
  }

  .event-card {
    opacity: 1;
    transform: none;
    page-break-inside: avoid;
  }
}
