/* Base Styles */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: bold;
  color: white;
  background: linear-gradient(0deg, rgba(59,59,59,1) 0%, rgba(19,19,20,1) 35%, rgba(0,0,0,1) 100%);
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: scroll;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE 10+ */
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* HEADER */
header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 1rem;
  min-height: 60vh;
  box-sizing: border-box;
}

header h1 {
  font-size: clamp(2rem, 8vw, 4rem);
  margin: 0;
}

header h2 {
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 400;
  margin: 1rem 0 10rem;
}

.arrow-down {
  width: 2px;
  height: 48px;
  background: white;
  margin: 1rem auto 0 auto; 
  position: relative;
}
.arrow-down::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid white;
}

/* TIMELINE CONTAINER */
.timeline-container {
  /* 2) Make sure it's relative so absolutely positioned children align properly */
  position: relative;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}

#line-container {
  position: relative;
  width: 100%;
  min-height: 100%;
  margin: 0 auto;
  overflow: visible;
}

/* DOTS AND LINES */
.dot {
  position: absolute;
  width: 0.625rem;
  height: 0.625rem;
  background-color: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.line-segment {
  position: absolute;
  background-color: white;
}
.horizontal {
  height: 1px;
}
.vertical {
  width: 1px;
}

/* DATE LABELS */
.date-label {
  position: absolute;
  font-size: clamp(0.875rem, 3vw, 1.125rem);
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s ease;
  transform: translateY(-7.5rem);
}
.date-label:hover {
  color: #cccccc;
}
.date-label.right {
  text-align: right;
  transform: translate(-100%, -7.5rem);
}

/* SVG CONTAINER */
.svg-container {
  /* 3) Must be absolute to place with top/left inside .timeline-container */
  position: absolute;
  width: clamp(9.375rem, 30vw, 15.625rem);
  height: clamp(8.438rem, 27vw, 14.063rem);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.buildings {
  width: 100%;
  height: 100%;
}

/* POPUP */
.popup {
  position: absolute;
  background-color: rgba(37, 37, 37, 0.9);
  border-radius: 0.5rem;
  padding: 1rem;
  width: clamp(12.5rem, 50vw, 14.375rem);
  max-width: 90vw;
  box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translate(-50%, 0.625rem);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    width 0.3s ease,
    height 0.3s ease,
    top 0.3s ease;
  z-index: 100;
}
.popup.show {
  opacity: 1;
  transform: translate(-50%, -110%);
}
.popup.below-date {
  transform: translate(-50%, 0);
}
.popup.expanded {
  width: clamp(12.5rem, 50vw, 14.375rem);
}
.popup h3 {
  margin-top: 0;
  font-size: clamp(1rem, 3vw, 1.125rem);
}
.popup p {
  font-size: clamp(0.875rem, 2.5vw, 0.875rem);
  margin-bottom: 0.625rem;
}
.popup .read-more {
  background: none;
  border: none;
  color: #4a90e2;
  cursor: pointer;
  padding: 0;
  font-size: clamp(0.875rem, 2.5vw, 0.875rem);
}
.popup .event-image {
  max-width: 100%;
  height: auto;
  margin-top: 0.625rem;
}
.popup-close {
  position: absolute;
  top: 0.3125rem;
  right: 0.3125rem;
  background: none;
  border: none;
  color: white;
  font-size: 1.125rem;
  cursor: pointer;
}

/* RESPONSIVE */
@media (max-width: 64em) {
  .timeline-container {
    padding: 1rem;
  }
}
@media (max-width: 48em) {
  .timeline-container {
    padding: 0.625rem;
  }
  .date-label {
    transform: translateY(-5rem);
  }
  .date-label.right {
    transform: translate(-100%, -5rem);
  }
}
@media (max-width: 30em) {
  .timeline-container {
    padding: 0.5rem;
  }
  .date-label {
    transform: translateY(-3.75rem);
  }
  .date-label.right {
    transform: translate(-100%, -3.75rem);
  }
  .popup,
  .popup.expanded {
    width: 80vw;
    max-width: 17.5rem;
  }
}
