/* =============================================
   CHRONOLOGIE — deux colonnes
   ============================================= */

/* ---- En-têtes colonnes ---- */
.tl-header {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  gap: 0;
  margin-bottom: 0;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding-bottom: 0;
}

.tl-col-header {
  padding: 12px 16px;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-col-header.tl-left  { border-radius: var(--radius-md) 0 0 0; text-align: right; justify-content: flex-end; }
.tl-col-header.tl-right { border-radius: 0 var(--radius-md) 0 0; border-left: none; }
.tl-axis-header { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---- Corps ---- */
.tl-body {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

/* ── Rangée année ── */
.tl-row {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  min-height: 40px;
  border-bottom: 1px solid rgba(0,0,0,.03);
}
.tl-row:last-child { border-bottom: none; }

.tl-row-future { opacity: .65; }
.tl-row-future:hover { opacity: 1; transition: opacity .2s; }

/* ── Colonnes ── */
.tl-col {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tl-col-vie  { background: rgba(0,0,0,.012); align-items: flex-end; }
.tl-col-patri{ background: rgba(26,122,101,.04); align-items: flex-start; }

/* ── Axe central ── */
.tl-axis {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 14px;
  position: relative;
  background: var(--surface-alt);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Ligne verticale continue */
.tl-axis::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, transparent 0%, var(--border-hover) 8%, var(--border-hover) 92%, transparent 100%);
  transform: translateX(-50%);
}

.tl-year {
  font-family: var(--font-serif);
  font-size: .82rem;
  color: var(--text-soft);
  background: var(--surface-alt);
  padding: 2px 0;
  position: relative;
  z-index: 1;
  text-align: center;
  white-space: nowrap;
}
.tl-year-future { color: var(--text-muted); font-style: italic; }

/* ── Marqueur AUJOURD'HUI ── */
.tl-now-row {
  min-height: 0;
  border-bottom: none;
}

.tl-now-row .tl-col { padding: 0; min-height: 20px; background: transparent; }

.tl-now-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  position: relative;
  z-index: 2;
}

.tl-now-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(232,112,90,.2), 0 0 12px rgba(232,112,90,.4);
  animation: now-pulse 2s ease-in-out infinite;
}

@keyframes now-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232,112,90,.2), 0 0 12px rgba(232,112,90,.3); }
  50%       { box-shadow: 0 0 0 6px rgba(232,112,90,.1), 0 0 20px rgba(232,112,90,.5); }
}

.tl-now-row .tl-axis::before {
  background: none;
}
.tl-now-row .tl-axis {
  border-color: transparent;
  background: transparent;
}

.tl-now-label {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--coral);
  white-space: nowrap;
}

/* Ligne de séparation présent */
.tl-now-separator {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(232,112,90,.3), transparent);
  pointer-events: none;
}

/* ── Événements ── */
.tl-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  max-width: 340px;
  transition: border-color .2s, transform .15s;
  position: relative;
}
.tl-event:hover { border-color: var(--border-hover); transform: translateY(-1px); }

/* Inversé côté gauche */
.tl-col-vie .tl-event { flex-direction: row-reverse; text-align: right; }
.tl-col-vie .ev-meta  { text-align: right; }

/* Connecteur vers l'axe */
.tl-col-vie .tl-event::after {
  content: '';
  position: absolute;
  right: -14px; top: 50%;
  width: 12px; height: 1px;
  background: var(--border-hover);
  transform: translateY(-50%);
}
.tl-col-patri .tl-event::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%;
  width: 12px; height: 1px;
  background: var(--border-hover);
  transform: translateY(-50%);
}

/* Couleurs par type */
.ev-green  { border-left: 3px solid var(--green);  }
.ev-gold   { border-left: 3px solid var(--gold);   }
.ev-blue   { border-left: 3px solid var(--blue);   }
.ev-teal   { border-left: 3px solid var(--teal);   }
.ev-coral  { border-left: 3px solid var(--coral);  }
.ev-purple { border-left: 3px solid var(--purple); }
.ev-muted  { border-left: 3px solid var(--border-hover); opacity: .7; }

/* Côté gauche : border-right au lieu de border-left */
.tl-col-vie .ev-green  { border-left: none; border-right: 3px solid var(--green); }
.tl-col-vie .ev-gold   { border-left: none; border-right: 3px solid var(--gold); }
.tl-col-vie .ev-blue   { border-left: none; border-right: 3px solid var(--blue); }
.tl-col-vie .ev-teal   { border-left: none; border-right: 3px solid var(--teal); }
.tl-col-vie .ev-coral  { border-left: none; border-right: 3px solid var(--coral); }
.tl-col-vie .ev-purple { border-left: none; border-right: 3px solid var(--purple); }
.tl-col-vie .ev-muted  { border-left: none; border-right: 3px solid var(--border-hover); }

.ev-future { opacity: .6; border-style: dashed !important; }

/* Icône */
.ev-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  color: var(--text-soft);
  flex-shrink: 0;
}
.ev-green  .ev-icon { background: rgba(93,217,140,.1);  color: var(--green); }
.ev-gold   .ev-icon { background: var(--gold-dim);   color: var(--gold); }
.ev-blue   .ev-icon { background: var(--blue-dim);   color: var(--blue); }
.ev-teal   .ev-icon { background: var(--teal-dim);   color: var(--teal); }
.ev-coral  .ev-icon { background: var(--coral-dim);  color: var(--coral); }
.ev-purple .ev-icon { background: var(--purple-dim); color: var(--purple); }

/* Textes */
.ev-body { flex: 1; min-width: 0; }
.ev-title {
  font-size: .85rem; font-weight: 500;
  color: var(--text); line-height: 1.3;
  margin-bottom: 3px;
}
.ev-detail { font-size: .78rem; color: var(--text-soft); }
.ev-sub    { font-size: .73rem; color: var(--text-muted); margin-top: 2px; }
.ev-meta   {
  display: inline-block;
  font-size: .68rem; letter-spacing: .04em;
  background: rgba(255,255,255,.07);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text-soft);
  margin-top: 4px;
  text-transform: capitalize;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .tl-header, .tl-row { grid-template-columns: 0 32px 1fr; }
  .tl-col-vie { display: none; }
  .tl-col-header.tl-left { display: none; }
}
