/* ============================================
   JOURNEY TIMELINE · مسیر آرمان
   Horizontal scroll storyline · vanilla GSAP + ScrollTrigger
   Palette: white + navy + cyan · RTL text · LTR track
   ============================================ */

.jt {
  --jt-bg: #ffffff;
  --jt-ink: #0a2a4a;
  --jt-muted: #5b7a99;
  --jt-active: #42c0f8;
  --jt-track: #e8f5fc;
  position: relative;
  height: 260vh;
  background: var(--jt-bg);
  color: var(--jt-ink);
  overflow: clip;
  direction: rtl;
}

.jt-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.jt-viewport {
  direction: ltr;
  width: 100%;
  overflow: hidden;
  padding: 0 0 0 0;
}

.jt-slider {
  display: flex;
  align-items: stretch;
  gap: 4vw;
  width: max-content;
  padding: 0 5vw;
  will-change: transform;
}

/* ---------- image card : always 1:1 square ---------- */
.jt-media {
  width: clamp(320px, 30vw, 520px);
  aspect-ratio: 1 / 1;
  border-radius: 1vw;
  overflow: hidden;
  flex-shrink: 0;
  align-self: center;
  box-shadow: 0 24px 60px -24px rgba(10, 42, 74, 0.35);
}

.jt-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- track area ---------- */
.jt-track-zone {
  position: relative;
  flex-shrink: 0;
}

.jt-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.jt-rail .jt-cap {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--jt-active);
  flex-shrink: 0;
}

.jt-rail .jt-line-bg {
  height: 2px;
  flex: 1;
  background: var(--jt-track);
  border-radius: 999px;
  overflow: hidden;
}

.jt-rail .jt-line-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--jt-active);
  border-radius: 999px;
}

.jt-cols {
  display: flex;
  flex-direction: column;
  height: 30vw;
  min-height: 320px;
  max-height: 520px;
}

.jt-row {
  display: flex;
  align-items: stretch;
  height: 50%;
}

.jt-row--top {
  align-items: flex-end;
  padding-bottom: 26px;
}

.jt-row--bottom {
  align-items: flex-start;
  padding-top: 26px;
}

.jt-intro {
  flex-shrink: 0;
  direction: rtl;
  text-align: right;
}

.jt-row--top .jt-intro {
  width: 20vw;
  min-width: 220px;
  padding-top: 8px;
}

.jt-row--bottom .jt-intro {
  width: 16vw;
  min-width: 160px;
  padding-top: 8px;
}

.jt-title {
  font-family: "Vazirmatn", "Dana", sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3vw, 52px);
  line-height: 1.1;
  margin: 0;
  color: var(--jt-ink);
}

.jt-period {
  font-family: "Vazirmatn", "Dana", sans-serif;
  font-size: clamp(15px, 1.6vw, 24px);
  color: var(--jt-muted);
  margin: 0;
  font-weight: 500;
}

.jt-items {
  display: flex;
  gap: 0;
  height: 100%;
}

.jt-item {
  position: relative;
  width: 26vw;
  min-width: 260px;
  max-width: 440px;
  padding: 0 2.2vw;
  direction: rtl;
  text-align: right;
  display: flex;
}

.jt-row--top .jt-item {
  align-items: flex-start;
}

.jt-row--bottom .jt-item {
  align-items: flex-end;
}

.jt-row--top .jt-items .jt-item + .jt-item {
  margin-left: 6vw;
}

.jt-row--bottom .jt-items .jt-item + .jt-item {
  margin-left: 9vw;
}

.jt-stem-wrap {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: auto;
  width: 0;
}

.jt-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--jt-active);
  right: -7px;
}

.jt-row--top .jt-dot {
  bottom: -33px;
}

.jt-row--bottom .jt-dot {
  top: -33px;
}

.jt-stem {
  position: absolute;
  width: 2px;
  background: var(--jt-active);
  border-radius: 999px;
  right: -1px;
}

.jt-row--top .jt-stem {
  top: 0;
  bottom: -26px;
  transform-origin: bottom;
}

.jt-row--bottom .jt-stem {
  top: -26px;
  bottom: 0;
  transform-origin: top;
}

.jt-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 4px;
}

.jt-row--bottom .jt-body {
  justify-content: flex-end;
  padding-bottom: 0;
}

.jt-year {
  font-family: "Vazirmatn", "Dana", sans-serif;
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 38px);
  line-height: 1.15;
  margin: 0;
  color: var(--jt-ink);
}

.jt-desc {
  font-family: "Vazirmatn", "Dana", sans-serif;
  font-size: clamp(14px, 1.35vw, 21px);
  line-height: 1.7;
  color: var(--jt-muted);
  margin: 0;
  max-width: 90%;
}

/* word-mask reveal (vanilla replacement for SplitText) */
.jt-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.jt-wi {
  display: inline-block;
  will-change: transform;
}

/* ---------- mobile ---------- */
@media (max-width: 600px) {
  .jt {
    height: 420vh;
  }

  /* svh = stable against mobile URL bar; top-anchored so there is
     no dead gap between the previous section and this one */
  .jt-sticky {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    align-items: flex-start;
  }

  .jt-viewport {
    padding-top: calc(64px + 2svh);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .jt-slider {
    gap: 7vw;
    padding: 0 7vw;
  }

  /* square on mobile too — capped by viewport height so it always fits */
  .jt-media {
    width: min(76vw, 320px, 32svh);
    aspect-ratio: 1 / 1;
    border-radius: 5vw;
  }

  .jt-cols {
    height: 76svh;
    min-height: 0;
    max-height: none;
  }

  .jt-row--top .jt-intro {
    width: 52vw;
    min-width: 0;
  }

  .jt-row--bottom .jt-intro {
    width: 34vw;
    min-width: 0;
  }

  .jt-item {
    width: 68vw;
    min-width: 0;
    max-width: none;
    padding: 0 7vw;
  }

  .jt-row--top .jt-items .jt-item + .jt-item {
    margin-left: 30vw;
  }

  .jt-row--bottom .jt-items .jt-item + .jt-item {
    margin-left: 30vw;
  }

  .jt-rail .jt-cap {
    width: 10px;
    height: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jt-slider,
  .jt-line-fill,
  .jt-stem,
  .jt-dot,
  .jt-wi {
    transform: none !important;
  }
}
