/* =========================================================
   Timeline "Lịch sử phát triển" — trang chủ
   Khớp bảng màu theme (xanh rêu đậm + kem + giấy be)
   ========================================================= */
.nw-timeline { padding: 64px 0; }

/* Đường thời gian dọc + các ô năm */
.tl-track {
  position: relative;
  padding-left: 42px;
}
.tl-track::before {
  content: "";
  position: absolute;
  left: 13px; top: 6px; bottom: 6px;
  width: 3px;
  background: linear-gradient(180deg, var(--green-deep), var(--green-moss) 60%, rgba(82,107,79,.25));
  border-radius: 3px;
}

/* Ô LỚN = 1 năm */
.tl-year {
  position: relative;
  background: var(--cream-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(18,51,40,.07);
  padding: 22px 24px 24px;
  margin-bottom: 22px;
}
/* Nút tròn trên đường thời gian */
.tl-year::before {
  content: "";
  position: absolute;
  left: -34px; top: 26px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--green-deep);
  border: 3px solid var(--cream-light);
  box-shadow: 0 0 0 3px rgba(18,51,40,.12);
}
.tl-year-num {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 900;
  line-height: 1;
  color: var(--green-deep);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

/* Ô NHỎ = sự kiện (bấm được) */
.tl-events {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.tl-event {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--white-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font: inherit;
  color: var(--charcoal);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.tl-event-ic {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
}
.tl-event-ic svg { width: 21px; height: 21px; }
.tl-event:hover,
.tl-event:focus-visible {
  transform: translateY(-3px);
  border-color: var(--green-moss);
  background: #fff;
  box-shadow: 0 16px 34px rgba(18,51,40,.12);
  outline: none;
}
.tl-event-t { font-size: 15.5px; font-weight: 750; line-height: 1.35; }
.tl-event-more {
  font-size: 12.5px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--earth);
}

/* Hai nút: Tóm tắt (mở popup) và Chi tiết (sang trang dự án) */
.tl-event-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.tl-act {
  font: inherit;
  font-size: 12.5px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.tl-act-sum {
  background: var(--green-deep);
  border: 1px solid var(--green-deep);
  color: var(--cream);
}
.tl-act-sum:hover { background: var(--green-moss); border-color: var(--green-moss); }
.tl-act-detail {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--earth);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.tl-act-detail:hover { border-color: var(--earth); background: var(--paper); }
.tl-act:focus-visible { outline: 2px solid var(--earth); outline-offset: 2px; }

/* Năm "đỉnh cao" nhấn nhẹ (72 tỷ) — tùy chọn thẩm mỹ, không bắt buộc */
.tl-event:has(.tl-event-t) { }

/* =========================================================
   Modal chi tiết
   ========================================================= */
.tl-modal[hidden] { display: none; }
.tl-modal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.tl-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(18,51,40,.55);
  backdrop-filter: blur(3px);
  animation: tlFade .2s ease;
}
.tl-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--cream-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px 30px 32px;
  animation: tlPop .22s ease;
}
.tl-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white-soft);
  color: var(--green-deep);
  font-size: 16px; cursor: pointer;
  transition: background .15s, transform .15s;
}
.tl-modal-close:hover { background: #fff; transform: rotate(90deg); }

.tl-illus {
  height: 128px;
  border-radius: var(--radius-md);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.tl-illus svg { width: 54px; height: 54px; }
.tl-illus-img {
  width: 100%; height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.tl-illus-cap {
  font-size: 12.5px; color: var(--muted);
  text-align: center; margin-bottom: 14px;
}
.tl-detail-year {
  display: inline-block;
  font-size: 13px; font-weight: 850; letter-spacing: .1em;
  color: var(--earth); text-transform: uppercase;
  margin-bottom: 6px;
}
.tl-detail h3 {
  font-size: clamp(21px, 3vw, 26px);
  color: var(--green-deep);
  line-height: 1.25;
  margin: 0 0 14px;
}
.tl-detail-img {
  width: 100%; height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.tl-detail-body { color: #4c534a; font-size: 16px; line-height: 1.7; }
.tl-detail-body p { margin: 0 0 12px; }
.tl-placeholder {
  background: var(--paper);
  border: 1px dashed var(--green-moss);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: #5c6357;
}

@keyframes tlFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes tlPop { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }

@media (max-width: 640px) {
  .nw-timeline { padding: 44px 0; }
  .tl-track { padding-left: 34px; }
  .tl-track::before { left: 9px; }
  .tl-year::before { left: -30px; }
  .tl-events { grid-template-columns: 1fr; }
  .tl-modal-card { padding: 26px 20px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-event, .tl-modal-close, .tl-modal-backdrop, .tl-modal-card { transition: none; animation: none; }
}

/* Khối "Kết quả" trong modal — thành tựu tóm tắt, đứng trước câu chuyện */
.tl-ket-qua {
  margin: 4px 0 16px;
  padding: 14px 16px;
  background: var(--cream-light, #fbf8f0);
  border: 1px solid var(--line, rgba(18,51,40,.16));
  border-radius: 12px;
}
.tl-ket-qua-nhan {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--green-moss, #526b4f); margin-bottom: 8px; font-weight: 600;
}
.tl-ket-qua ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.tl-ket-qua li { font-size: 14px; line-height: 1.5; color: var(--green-deep, #123328); }
