/* Hành trình 10 mùa: thông tin chính, ảnh tự chuyển, thanh năm, chú thích */

/* ---------- Ảnh chính: lớp bọc parallax + ảnh tự chuyển ---------- */
#hanh-trinh .season-stack-inner { position: absolute; inset: 0; display: block; transition: scale .6s var(--ease, cubic-bezier(.2, .7, .2, 1)); }
#hanh-trinh .season-stack img { transform: none; transition: none; } /* GSAP lo chuyển ảnh; tránh xung đột transition */
#hanh-trinh .season-stack:hover .season-stack-inner,
#hanh-trinh .season-stack:focus-visible .season-stack-inner { scale: 1.06; }

/* ---------- Danh sách thông tin ---------- */
.season-facts {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px;
  max-width: 520px; border-top: 1px solid var(--line);
}
.season-fact { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.season-fact--wide { grid-column: 1 / -1; }
.season-fact-icon {
  flex: none; width: 20px; height: 20px; margin-top: 2px;
  fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.season-fact-body { display: grid; gap: 2px; min-width: 0; }
.season-fact-body small { font: 500 12px/1.3 var(--sans); letter-spacing: .02em; color: var(--muted); }
.season-fact-value { font: 500 15px/1.45 var(--sans); color: var(--ink); overflow-wrap: break-word; text-wrap: pretty; }
.season-fact:not(.season-fact--wide) .season-fact-value {
  font-family: var(--display, Georgia, serif); font-weight: 600; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--green-deep);
}
/* Số đếm: bản “bóng” giữ đủ bề rộng để bố cục không nhảy */
.season-count-up { display: inline-grid; }
.season-count-up > span { grid-area: 1 / 1; }
.season-count-ghost { visibility: hidden; }

/* Số thứ tự ảnh: góc trái để không bị huy hiệu mùa che */
#hanh-trinh .season-count { right: auto; left: 12px; }
/* Huy hiệu mùa: khung vuông bo góc, ảnh lấp đầy khung */
#hanh-trinh .season-photo--c { border-radius: 18px; border-width: 5px; aspect-ratio: 1; overflow: hidden; }
#hanh-trinh .season-photo--c img { object-fit: cover; padding: 0; border-radius: 13px; }

/* Ranh giới mùa: chỉ dùng ở desktop ghim ngang */
.season-divider { display: none; }

/* ---------- Thanh năm: đường tiến độ neo theo tâm từng nhãn (journey.js đặt --rail-start/--rail-len) ---------- */
.journey-rail-progress { position: relative; overflow: visible; background: none; }
.journey-rail-progress::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: var(--rail-start, 0px); width: var(--rail-len, 100%);
  background: var(--line);
}
#journey-progress { position: absolute; top: 0; left: var(--rail-start, 0px); width: var(--rail-len, 100%); height: 100%; }
.rail-year { text-align: center; }

/* ---------- Chú thích dưới thanh năm ---------- */
.journey-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; font: 400 12px/1.45 var(--sans); color: var(--muted); }
.journey-note svg { flex: none; width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

/* Kéo ngang: không bôi đen chữ */
.journey-track.is-grab, .journey-track.is-grab * { user-select: none; -webkit-user-select: none; }

@media (max-width: 899px) {
  .season-facts { column-gap: 14px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .season-fact { gap: 10px; padding: 10px 0; }
  .season-fact:not(.season-fact--wide) .season-fact-value { font-size: 17px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  #hanh-trinh .season-stack-inner { transition: none; }
}

/* ==========================================================
   Desktop ghim ngang (>= 900px, có GSAP)
   Mỗi mùa = một khung 100vw; chữ + ảnh gom thành MỘT bố cục ở giữa khung,
   hai mùa cạnh nhau cách xa + có vạch ranh giới.
   ========================================================== */
@media (min-width: 900px) {
  .has-gsap #hanh-trinh {
    --col-text: clamp(360px, 33vw, 520px);
    --col-gap: clamp(36px, 4.2vw, 84px);
    --col-photo: clamp(400px, 43vw, 700px);
    --season-w: min(calc(var(--col-text) + var(--col-gap) + var(--col-photo)), calc(100vw - 2 * var(--gutter)));
    --season-x: max(var(--gutter), calc((100vw - var(--season-w)) / 2)); /* mép trái bố cục */
  }
  /* khung ghim mang nền riêng: khi đang ghim (position: fixed) không lộ phần phía sau */
  .has-gsap #journey-pin.is-pinned { background-color: var(--page-bg, var(--tint, #EEF6E3)); }
  .has-gsap #hanh-trinh .season {
    grid-template-columns: minmax(0, var(--col-text)) minmax(0, var(--col-photo));
    justify-content: center; align-items: center;
    column-gap: var(--col-gap);
    padding: calc(var(--header-h) + 4px) var(--gutter) 12px;
  }

  /* Cột chữ: một mép trái chung, nhịp dọc đều */
  .has-gsap #hanh-trinh .season-text {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    max-height: 100%; min-width: 0;
  }
  .has-gsap #hanh-trinh .season-text .season-numeral {
    font-size: clamp(64px, min(10.5vw, 16.5vh), 190px); line-height: .8;
    margin: 0 0 clamp(10px, 1.8vh, 18px) -.055em; /* bù khoảng trống trái của nét chữ: thẳng mép với dòng dưới */
  }
  .has-gsap #hanh-trinh .season-meta {
    margin: 0 0 clamp(6px, 1vh, 10px);
    font: 700 12px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--green-deep);
  }
  .has-gsap #hanh-trinh .season-title {
    margin: 0; max-width: 100%;
    font-size: clamp(24px, min(2.4vw, 4.2vh), 38px); line-height: 1.2; text-wrap: balance;
  }
  .has-gsap #hanh-trinh .season-slogan {
    margin: clamp(6px, 1.1vh, 12px) 0 0;
    font-size: clamp(18px, min(1.55vw, 2.9vh), 25px); line-height: 1.25; text-wrap: balance;
  }

  /* Bảng thông tin: luôn 2 cột bằng nhau, kẻ ngang + vạch dọc giữa hai cột */
  .has-gsap #hanh-trinh .season-facts {
    width: 100%; max-width: none; margin: clamp(14px, 2.6vh, 28px) 0 0;
    grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0;
    border-top: 1px solid var(--line);
  }
  .has-gsap #hanh-trinh .season-fact,
  .has-gsap #hanh-trinh .season-fact--wide {
    grid-column: auto; gap: 10px;
    padding: clamp(8px, 1.5vh, 14px) clamp(12px, 1.3vw, 20px) clamp(8px, 1.5vh, 14px) 0;
  }
  .has-gsap #hanh-trinh .season-fact:nth-child(even) {
    padding-left: clamp(12px, 1.3vw, 20px); padding-right: 0;
    border-left: 1px solid var(--line);
  }
  .has-gsap #hanh-trinh .season-fact-icon { width: 18px; height: 18px; margin-top: -1px; }
  .has-gsap #hanh-trinh .season-fact-body { gap: 4px; }
  .has-gsap #hanh-trinh .season-fact-body small {
    font: 600 11px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  }
  .has-gsap #hanh-trinh .season-fact-value { font: 500 14.5px/1.45 var(--sans); color: var(--ink); }
  .has-gsap #hanh-trinh .season-fact:not(.season-fact--wide) .season-fact-value {
    font-family: var(--display, Georgia, serif); font-weight: 600; line-height: 1.1;
    font-size: clamp(19px, min(1.6vw, 3vh), 25px); color: var(--green-deep);
  }

  /* Cột ảnh */
  .has-gsap #hanh-trinh .season-photos { width: 100%; height: min(60vh, 620px); }

  /* Vạch ranh giới giữa hai mùa (mép trái mỗi panel từ mùa II) + nhãn mùa đọc dọc */
  .has-gsap #hanh-trinh .season-divider {
    display: block; position: absolute; z-index: 2; left: 0; width: 0;
    top: calc(var(--header-h) + 2vh); bottom: 2vh; pointer-events: none;
  }
  .has-gsap #hanh-trinh .season:first-child .season-divider { display: none; }
  .has-gsap #hanh-trinh .season-divider::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -.5px; width: 1px;
    background: linear-gradient(to bottom, rgba(15, 92, 48, 0), rgba(15, 92, 48, .38) 14%, rgba(15, 92, 48, .38) 86%, rgba(15, 92, 48, 0));
  }
  .has-gsap #hanh-trinh .season-divider span {
    position: absolute; left: 0; top: 50%; translate: -50% -50%; rotate: 180deg;
    writing-mode: vertical-rl; white-space: nowrap;
    padding: 12px 5px; border-radius: 99px;
    background: var(--tint, #EEF6E3); box-shadow: inset 0 0 0 1px rgba(15, 92, 48, .22);
    font: 700 11px/1 var(--sans); letter-spacing: .18em; color: var(--green-deep);
  }

  /* Thanh năm: chấm trên đường kẻ, chấm đang xem nổi bật */
  /* thanh năm cùng bề ngang với bố cục mùa: I dưới mép chữ, X dưới mép ảnh; chừa chỗ nút nhạc bên phải */
  .has-gsap #hanh-trinh .journey-rail {
    padding: 4px max(var(--season-x), calc(var(--gutter) + 64px)) 14px var(--season-x);
  }
  .has-gsap #hanh-trinh .journey-rail-progress { margin-bottom: 0; }
  .has-gsap #hanh-trinh #journey-progress { transition: none; } /* bám từng khung hình của dải ngang */
  .has-gsap #hanh-trinh .journey-rail-years { display: flex; justify-content: space-between; gap: 0; }
  .has-gsap #hanh-trinh .rail-year {
    position: relative; display: grid; justify-items: center; gap: 1px; min-width: 48px;
    padding: 14px 4px 2px; font-size: 12px; color: var(--muted);
  }
  .has-gsap #hanh-trinh .rail-year::before {
    content: ""; position: absolute; top: -5px; left: 50%; width: 8px; height: 8px; margin-left: -4px;
    border-radius: 50%; background: var(--paper, #FAFCF7); box-shadow: inset 0 0 0 1.5px rgba(12, 46, 27, .3);
    transition: background-color .3s, box-shadow .3s, scale .3s;
  }
  .has-gsap #hanh-trinh .rail-year.is-passed::before { background: var(--green); box-shadow: none; }
  .has-gsap #hanh-trinh .rail-year.is-active::before {
    background: var(--green); scale: 1.5;
    box-shadow: 0 0 0 3px rgba(19, 158, 73, .2);
  }
  .has-gsap #hanh-trinh .rail-year b { font-size: 15px; line-height: 1.2; }
  .has-gsap #hanh-trinh .rail-year.is-passed b { opacity: .6; }
  .has-gsap #hanh-trinh .rail-year.is-active { color: var(--green-deep); font-weight: 700; }
  .has-gsap #hanh-trinh .rail-year.is-active b { opacity: 1; color: var(--green); }

  /* Chú thích: góc trái dưới (viên “mùa đang xem” đã ẩn khi đang ở phần ghim), không chạm giữa đáy màn hình */
  .has-gsap #hanh-trinh .journey-note {
    margin: 6px 0 0; padding-right: 0; max-width: min(36vw, 560px);
    justify-content: flex-start; text-align: left; font-size: 11.5px; line-height: 1.4; text-wrap: balance;
  }
}

/* Màn thấp: gọn chiều cao */
@media (min-width: 900px) and (max-height: 760px) {
  .has-gsap #hanh-trinh .season { padding-top: calc(var(--header-h) - 4px); padding-bottom: 6px; }
  .has-gsap #hanh-trinh .season-photos { height: min(58vh, 620px); }
  .has-gsap #hanh-trinh .season-text .season-numeral { font-size: clamp(56px, 14vh, 190px); }
  .has-gsap #hanh-trinh .season-fact-value { font-size: 13.5px; line-height: 1.35; }
  .has-gsap #hanh-trinh .rail-year { padding-top: 11px; }
  .has-gsap #hanh-trinh .journey-rail { padding-bottom: 8px; }
}
