/* v38-timeline-standard.css — Limery 공통 타임라인 표준 디자인
 *
 * ★ RULE #50 (2026-04-23 확정) — 모든 타임라인 뷰의 표준
 *
 * 클래스 네이밍: .lm-tl-*
 * 레퍼런스: activity-log 타임라인 (활동 로그 뷰)
 *
 * 사용법:
 *   1. index.html 에 <link rel="stylesheet" href="assets/css/v38-timeline-standard.css">
 *   2. HTML 에 .lm-tl-wrap > .lm-tl-row 구조 사용
 *   3. .lm-tl-row 에 style="--tl-color: #88c714" 로 컬러 지정
 *
 * ── 구조 ──────────────────────────────────────────────────────────
 * .lm-tl-wrap
 *   └ .lm-tl-date-label     (날짜 구분선, 선택)
 *   └ .lm-tl-row            (3컬럼 그리드 행, --tl-color 인라인)
 *       ├ .lm-tl-left       (좌측: 시간+날짜)
 *       │   ├ .lm-tl-time   (굵고 큰 시간)
 *       │   └ .lm-tl-date   (작고 그레이 날짜)
 *       ├ .lm-tl-node       (중앙: 수직선+점)
 *       │   └ .lm-tl-dot   (홀로우 컬러 원)
 *       └ .lm-tl-card       (우측: 콘텐츠 카드)
 *           ├ .lm-tl-title-row
 *           │   ├ .lm-tl-title
 *           │   └ .lm-tl-badges
 *           │       ├ .lm-tl-cat-chip  (카테고리, 아웃라인)
 *           │       └ (소유자 배지 = personBadge() 사용)
 *           └ .lm-tl-body   (추가 내용, 선택)
 */

/* ── 컨테이너 ──────────────────────────────────────────────────── */
.lm-tl-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── 날짜 구분선 ────────────────────────────────────────────────── */
.lm-tl-date-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px 108px; /* 86px(시간) + 22px(점) = 108px */
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-mute, #aaa);
  letter-spacing: 0.2px;
}

.lm-tl-date-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-primary, #88c714);
  flex-shrink: 0;
}

/* ── 행: 3컬럼 그리드 ──────────────────────────────────────────── */
.lm-tl-row {
  display: grid;
  grid-template-columns: 86px 26px 1fr;
  column-gap: 0;
  align-items: start;
  padding-bottom: 12px; /* 행 간격 — node::before가 이 구간 브리지 */
}

/* ── 좌측: 시간 + 날짜 ──────────────────────────────────────────── */
.lm-tl-left {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 14px;
  padding-top: 3px; /* 점·카드 상단과 수평 정렬 */
  gap: 2px;
}

/* 시간 — Pretendard, 볼드, 크게 */
.lm-tl-time {
  font-size: 13px;
  font-weight: 700;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  color: var(--c-text, #111);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: -0.3px;
  text-align: right;
}

/* 날짜 — 작고 그레이 */
.lm-tl-date {
  font-size: 10px;
  font-weight: 400;
  color: var(--c-text-mute, #bbb);
  white-space: nowrap;
  text-align: right;
  line-height: 1.3;
}

/* ── 중앙: 수직선 + 홀로우 점 ───────────────────────────────────── */
.lm-tl-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch; /* 카드 높이만큼 신장 */
}

/* 수직선 — 행 padding-bottom까지 연장하여 끊김 없음 */
.lm-tl-node::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: -12px; /* padding-bottom 브리지 → 다음 점까지 연결 */
  width: 2px;
  transform: translateX(-50%);
  background: var(--c-line, #dde0d8);
  z-index: 0;
}

/* 마지막 항목 — 선 연장 없음 */
.lm-tl-row:last-child .lm-tl-node::before {
  bottom: 0;
}

/* 홀로우 컬러 원형 점 — 선 위에 올라탐 */
.lm-tl-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2.5px solid var(--tl-color, #9ca3af);
  background: var(--c-bg, #f7f8f4); /* 페이지 배경으로 선을 가려 링처럼 보임 */
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-top: 4px; /* 시간·카드 상단과 수평 정렬 */
  box-shadow: 0 0 0 3px var(--c-bg, #f7f8f4);
  transition: transform 0.15s;
}

.lm-tl-row:hover .lm-tl-dot {
  transform: scale(1.18);
}

/* ── 우측: 콘텐츠 카드 ──────────────────────────────────────────── */
.lm-tl-card {
  margin: 4px 0 0 12px;
  padding: 10px 12px;
  border: none !important;
  border-left: none !important;
  border-radius: 8px !important; /* 좌측 막대 없으므로 전체 라운드 */
  box-shadow: none;
  transition: border 0.15s;
  /* 배경: 뷰에서 style="background: var(--tl-color)08" 로 인라인 지정 */
}

.lm-tl-card:hover {
  transform: none !important;
  box-shadow: none !important;
  /* 카드 컬러의 연한 버전을 테두리로 — 드롭쉐도우 없음 */
  border: 1px solid color-mix(in srgb, var(--tl-color, #9ca3af) 45%, transparent) !important;
}

/* ── 제목 행 ────────────────────────────────────────────────────── */
.lm-tl-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 2px;
}

.lm-tl-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ── 배지 그룹 ─────────────────────────────────────────────────── */
.lm-tl-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: auto;
}

/* 카테고리 배지 — 아웃라인 스타일 (흰 배경 + 컬러 테두리+글자) */
/* color: ${color}; border-color: 은 inline으로 지정 */
.lm-tl-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  background: #fff !important;
  border: 1px solid currentColor !important;
  border-radius: var(--r-pill, 999px);
  line-height: 1.4;
  white-space: nowrap;
}

/* CTA 버튼 ("상세", "보기" 등) — 아웃라인 라임 스타일 */
.lm-tl-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-primary, #88c714);
  background: #fff;
  border: 1px solid var(--c-primary, #88c714);
  border-radius: var(--r-pill, 999px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.lm-tl-action-btn:hover {
  background: var(--c-primary, #88c714);
  color: #fff;
}

/* ── 카드 본문 (선택) ───────────────────────────────────────────── */
.lm-tl-body {
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-text-soft, #555);
  line-height: 1.5;
}

.lm-tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.lm-tl-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--c-text-mute, #888);
}

/* ── 아이콘 래퍼 (선택) ─────────────────────────────────────────── */
.lm-tl-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* background: var(--tl-color)28; color: var(--tl-color) — inline 지정 */
}

/* ════════════════════════════════════════════════════════════════
   다크모드
   ════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .lm-tl-node::before {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .lm-tl-dot {
  background: var(--c-bg, #111612);
  box-shadow: 0 0 0 3px var(--c-bg, #111612);
}

[data-theme="dark"] .lm-tl-time {
  color: var(--c-text, #e0e0e0);
}

[data-theme="dark"] .lm-tl-date {
  color: var(--c-text-mute, #555);
}

[data-theme="dark"] .lm-tl-cat-chip {
  background: var(--c-surface-1, #1e1e1e) !important;
}

[data-theme="dark"] .lm-tl-card:hover {
  border: 1px solid color-mix(in srgb, var(--tl-color, #9ca3af) 55%, transparent) !important;
}

[data-theme="dark"] .lm-tl-action-btn {
  background: transparent;
  color: var(--c-primary, #88c714);
  border-color: var(--c-primary, #88c714);
}

[data-theme="dark"] .lm-tl-action-btn:hover {
  background: var(--c-primary, #88c714);
  color: #fff;
}

[data-theme="dark"] .lm-tl-title {
  color: var(--c-text, #ddd);
}

/* ════════════════════════════════════════════════════════════════
   모바일 반응형 (≤599px)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 599px) {
  .lm-tl-row {
    grid-template-columns: 66px 22px 1fr;
    padding-bottom: 10px;
  }

  .lm-tl-node::before {
    bottom: -10px;
  }

  .lm-tl-row:last-child .lm-tl-node::before {
    bottom: 0;
  }

  .lm-tl-left {
    padding-right: 10px;
    padding-top: 2px;
  }

  .lm-tl-time {
    font-size: 11px;
    letter-spacing: 0;
  }

  .lm-tl-date {
    font-size: 9px;
  }

  .lm-tl-dot {
    width: 11px;
    height: 11px;
    margin-top: 3px;
    border-width: 2px;
  }

  .lm-tl-card {
    margin-left: 10px;
    padding: 8px 10px;
  }

  .lm-tl-badges {
    gap: 4px;
  }

  /* 모바일에서 CTA 버튼 텍스트 숨기고 아이콘만 */
  .lm-tl-action-btn span {
    display: none;
  }

  .lm-tl-date-label {
    padding-left: 84px; /* 66 + 18 */
    font-size: 10px;
  }
}
