:root {
    --timeline-width: 80vw;
    --year-width: 14vw;
    --event-max-width: 70vw; /* 400px; */
}

body {
    font-family: 'Helvetica Neue', sans-serif;
}

h1 {
    font-size: 15vw;
}   

.timeline-wrapper {
    width: var(--timeline-width);
    margin: 0 auto;
    overflow: visible;
    position: relative;
}

.timeline-buffer.top, .timeline-buffer.bottom {
    height: 80vh;
}

.timeline-wrapper section article.event img {
    display: none !important;
}

.year {
    display: grid;
    grid-template-columns: var(--year-width) 1fr;
    gap: 2rem;

    position: relative;
    margin-bottom: 3vh;
}

.year-marker {
    position: sticky;
    top: 0rem;
    height: fit-content;
    font-size: 7rem;
    font-weight: bold;
    color: #F00;
    /* cursor: pointer; */
    /* transition: color 0.2s ease; */
    
    /* Make year numbers clickable */
    display: block;
    text-decoration: none;
}

/* Hover effect for clickable years */
.year-marker:hover {
    /* color: #0066cc; */
}

.events {
    display: flex;
    flex-direction: column;
    gap: 50vh;
    align-items: flex-start;
}

.event {
    max-width: var(--event-max-width);
    padding: 0;
    /* border-radius: 8px; */
    /* background: #fff; */
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    
    transform-origin: left center;
    transition: all 0.3s ease;
    margin-bottom: 20vh;
    /* opacity: 0.8; */
    /* transform: scale(0.95); */

  h3 {
    font-size: 7vw;
    font-weight: 800;
  }

  p {
    font-size: 3.5rem;
  }
}



.event.web_tech * {
  font-family: "Courier New", monospace;
  font-weight: 400;
  unicode-bidi: embed;
  font-family: monospace;
  line-height: 1.5;   
  background-color: black;
  color: white;
  padding: 5rem;
  margin: 0;
  width: 100%;

  &:before {
    content: "<";
  }
  &::after {
    content: ">";
  }

  p {

  }
}

.event img {
    /* max-width: 100%;
    height: auto; */
}



/* Add scroll padding to ensure years are visible when scrolled to */
html {
    scroll-padding-top: 2rem;
    scroll-behavior: smooth;
}

/* Hover state */
.event:hover {
    /* opacity: 1; */
    /* transform: scale(1); */
    /* z-index: 1; */
    /* box-shadow: 0 4px 8px rgba(0,0,0,0.15); */
}

/* Active year events */
.year.active .event {
    opacity: 1;
    transform: scale(1);
}

/* Hide future events */
.year.future {
    display: none;
}

/* Navigation List Styling */
.timeline-nav {
  position: fixed;
  right: 2rem;
  top: 2rem;
  width: 300px;
  max-height: 80vh;
  /* background: #fff; */
  /* border-radius: 8px; */
  
  overflow-y: auto;
  cursor: move;
  display: flex;
  flex-direction: column;
  border: 1px solid black;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.timeline-nav-header {
  padding: 0.25rem;
  background: #ffeb3b;
  /* border-radius: 8px 8px 0 0; */
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.timeline-nav-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.timeline-nav-close {
  width: 12px;
  height: 12px;
  /* border-radius: 50%; */
  /* background: #ff5f57; */
  border: none;
  cursor: pointer;
}

.timeline-nav-content {
  overflow-y: auto;
  flex-grow: 1;
  padding: 0.5rem;
  background-color: #FFF499FF;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: #f5f5f5;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}

.nav-item.active .nav-dot {
  background: #ff0000;
}

.nav-title {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Adjust lexicon position to make room */
.lexicon-wrapper {

    position: fixed;
    right: 0;
    top: 0;
    width: 300px;
    padding: 0;
    overflow-y: auto;
    cursor: move;     /* Only when dragging */
    user-select: none; /* Prevent text selection while dragging */
    border: 1px solid black;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.lexicon-header {
  padding: 0.25rem;
  background: #ffeb3b;
  /* border-radius: 8px 8px 0 0; */
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  margin: 0;

  .lexicon-close {
    width: 12px;
    height: 12px;
    border: 1px solid #AA9804FF;
    background-color: #FFF499FF;
    border: none;
    cursor: pointer;
  }
}



.lexicon-content {
  background-color: #FFF499FF;
  max-height: 50vh;
overflow: auto;
}

.lexicon-content:not(.displayed) {
  display: none !important;
}

.lexicon-content.displayed {
  display: block !important;
}

.timeline-nav-content:not(.displayed) {
    display: none !important;
}

.timeline-nav-content.displayed {
    display: block !important;
}

main div#background-img-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.9;
}

main div#background-img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1;
}

span.lexicon-title,
span.timeline-nav-title {
  font-weight: 400;
  letter-spacing: 0.05rem;
  font-size: 0.9rem;
  color: black;
}

.requested-terms-wrapper {
  position: fixed;
  left: 20px;
  top: 20px;
  width: 250px;
  background: #f5f5f5;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.requested-terms-header {
  padding: 0.5rem;
  background: #e0e0e0;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.requested-terms-content {
  padding: 1rem;
}

.requested-terms-content:not(.displayed) {
  display: none;
}

.requested-terms-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.requested-terms-content li {
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
  cursor: text;
  user-select: all;
}

/* Highlight animation for lexicon terms */
.lexicon-content dt.highlight {
  background: yellow;
  transition: background-color 2s;
}