/* ============================================================
   TIMELINE SECTION
   ============================================================ */

.timeline-section {
  padding: 120px 0 160px;
  position: relative;
  overflow: visible; /* allow wide popups to extend past section edge after JS nudging */
}
.timeline-section::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--border-a));
}

.timeline-section__header {
  text-align: center; margin-bottom: 80px; padding: 0 48px;
}
.timeline-section__label { margin-bottom: 18px; }
.timeline-section__title {
  font-family: var(--ff-s); font-size: clamp(28px,4vw,46px);
  font-weight: 400; line-height: 1.2; margin-bottom: 16px;
}
.timeline-section__subtitle { font-size: 15px; color: var(--text-2); max-width: 520px; margin: 0 auto; line-height: 1.75; }

/* -------- Track wrapper -------- */
.timeline {
  position: relative;
  padding: 60px 80px 300px;
}

.timeline__track {
  position: relative;
  display: flex; align-items: flex-start; padding: 0;
}

/* Horizontal rule — sits on the dot centre-line */
.timeline__line {
  position: absolute; top: 7px; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--border-a) 6%, var(--border-a) 94%, transparent);
}

/* Points row — spread across full page width, no scrollbar */
.timeline__points {
  display: flex; justify-content: space-between;
  position: relative; z-index: 1;
  width: 100%; flex-wrap: nowrap;
}

/* -------- Individual Point -------- */
.t-point {
  position: relative; display: flex; flex-direction: column;
  align-items: center; cursor: pointer;
  flex: 1; min-width: 0;
}

.t-point__dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid rgba(184,131,74,.4);
  background: var(--bg);
  transition: all .35s var(--ease);
  position: relative; z-index: 2;
  margin-bottom: 22px; flex-shrink: 0;
}
.t-point__dot::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid rgba(184,131,74,0); transition: border-color .35s;
}
.t-point:hover .t-point__dot,
.t-point.active .t-point__dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(184,131,74,.12);
}
.t-point:hover .t-point__dot::after,
.t-point.active .t-point__dot::after {
  border-color: rgba(184,131,74,.22);
}

.t-point__year {
  font-family: var(--ff-s); font-size: clamp(14px, 1.35vw, 20px); color: var(--text-2);
  transition: color .35s; margin-bottom: 6px; text-align: center;
}
.t-point__name {
  font-size: 10px; letter-spacing: .03em; color: var(--text-3);
  transition: color .35s; text-align: center;
  max-width: min(110px, 100%); line-height: 1.35;
  hyphens: auto;
}
.t-point:hover .t-point__year,
.t-point.active  .t-point__year { color: var(--accent); }
.t-point:hover .t-point__name,
.t-point.active  .t-point__name { color: var(--text-2); }

/* -------- Popup Card — opens downward below the dot labels -------- */
.t-popup {
  position: absolute;
  top: calc(100% + 18px); left: 50%;
  /* --popup-nudge-x shifts the card horizontally so edge points stay on-screen */
  transform: translateX(calc(-50% + var(--popup-nudge-x, 0px))) translateY(-10px);
  width: 460px;
  max-width: min(460px, calc(100vw - 40px));
  background: var(--surface);
  border: 1px solid var(--border-a);
  display: flex;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  z-index: 200;
}
/* Upward-pointing arrow connecting popup to its dot */
.t-popup::after {
  content: ''; position: absolute;
  top: -8px;
  left: calc(50% - var(--popup-nudge-x, 0px));
  transform: translateX(-50%) rotate(45deg);
  width: 14px; height: 14px;
  background: var(--surface);
  border-left: 1px solid var(--border-a);
  border-top: 1px solid var(--border-a);
}
.t-point.active .t-popup {
  opacity: 1; pointer-events: auto;
  transform: translateX(calc(-50% + var(--popup-nudge-x, 0px))) translateY(0);
}

/* Image column */
.t-popup__img {
  width: 140px; flex-shrink: 0;
  background-size: cover; background-position: center;
  min-height: 180px;
}

/* Text column */
.t-popup__content {
  flex: 1; padding: 22px 22px 20px; position: relative;
}

.t-popup__year { font-size: 9px; letter-spacing: .25em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.t-popup__title { font-family: var(--ff-s); font-size: 16px; font-weight: 400; color: var(--text); margin-bottom: 10px; line-height: 1.3; }
.t-popup__text { font-size: 12.5px; color: var(--text-2); line-height: 1.8; }
.t-popup__close {
  position: absolute; top: 10px; right: 12px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); font-size: 18px; line-height: 1;
  background: none; border: none; transition: color .3s;
}
.t-popup__close:hover { color: var(--accent); }

/* -------- Mobile: vertical stack -------- */
@media (max-width: 800px) {
  .timeline { padding: 32px 24px 60px; overflow-x: visible; }

  .timeline__track {
    flex-direction: column; min-width: unset;
    padding-left: 36px;
  }
  .timeline__line {
    top: 0; bottom: 0; left: 6px; right: auto;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--border-a) 6%, var(--border-a) 94%, transparent);
  }
  .timeline__points {
    flex-direction: column; gap: 48px; width: 100%;
  }
  .t-point {
    flex-direction: column; align-items: flex-start;
    width: 100%; cursor: pointer;
  }
  .t-point__dot {
    position: absolute; left: -43px; top: 3px; margin-bottom: 0;
  }
  .t-point__year { text-align: left; font-size: 18px; }
  .t-point__name { text-align: left; max-width: none; }
  .t-popup {
    position: relative; bottom: auto; left: auto;
    transform: none; width: 100%;
    margin-top: 14px; opacity: 1; pointer-events: auto;
    max-height: 0; overflow: hidden;
    border: none;
    transition: max-height .45s var(--ease), border-color .45s;
  }
  .t-popup::after { display: none; }
  .t-point.active .t-popup {
    max-height: 500px;
    border: 1px solid var(--border-a);
  }
  .t-popup__img { width: 110px; min-height: 160px; }
  .t-popup__content { padding: 18px 16px 16px; }
  .t-popup__close { top: 10px; right: 12px; }
}
