/* ===================================================
   SOTAI — history.css
   Timeline styles for History of Transplantation.
   Uses vars from main.css. Extends info_pages.css.
   =================================================== */

:root {
  --hist-accent-l: #eef4ff;
  --hist-accent-b: #c8ddf7;
  --hist-milestone-l: #fefce8;
  --hist-milestone-b: #fde68a;
  --hist-milestone-c: #92400e;
  --hist-dot: #1e4fa3;
  --hist-line: #c8ddf7;
}

[data-theme="dark"] {
  --hist-accent-l: #1c2e58;
  --hist-accent-b: #2a4478;
  --hist-milestone-l: #1c1a06;
  --hist-milestone-b: #78340f;
  --hist-milestone-c: #fcd34d;
  --hist-dot: #4d88e0;
  --hist-line: #2a4478;
}

/* ===== TAB SWITCHER ===== */
.hist-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow);
  transition: background .3s, border-color .3s;
}

.hist-tab {
  flex: 1;
  padding: 9px 20px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.hist-tab:hover {
  background: var(--bg-toolbar);
  color: var(--text-primary);
}

.hist-tab--active {
  background: var(--accent) !important;
  color: #ffffff !important;
}

/* ===== TIMELINE ===== */
.hist-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ===== SINGLE EVENT ===== */
.hist-event {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 16px;
  min-height: 80px;
}

/* Left marker column */
.hist-event__marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
}

.hist-event__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--hist-dot);
  border: 2.5px solid var(--bg-surface);
  box-shadow: 0 0 0 2px var(--hist-dot);
  flex-shrink: 0;
  z-index: 1;
  transition: background .3s, box-shadow .3s, border-color .3s;
}

.hist-event__dot--milestone {
  width: 18px;
  height: 18px;
  background: #f59e0b;
  box-shadow: 0 0 0 2.5px #f59e0b;
}

.hist-event__line {
  flex: 1;
  width: 2px;
  background: var(--hist-line);
  margin-top: 4px;
  transition: background .3s;
}

/* Right card */
.hist-event__card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  position: relative;
  transition: background .3s, border-color .3s, box-shadow .3s;
}

.hist-event__card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateX(2px);
}

/* Milestone card */
.hist-event__card--milestone {
  background: var(--hist-milestone-l);
  border-color: var(--hist-milestone-b);
}

.hist-event__milestone-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Year badge */
.hist-event__year {
  display: inline-flex;
  align-items: center;
  background: var(--hist-accent-l);
  border: 1px solid var(--hist-accent-b);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  transition: all .3s;
}

.hist-event__card--milestone .hist-event__year {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}

[data-theme="dark"] .hist-event__card--milestone .hist-event__year {
  color: #fcd34d;
}

/* Title */
.hist-event__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
  transition: color .3s;
}

/* Text */
.hist-event__text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
  transition: color .3s;
}

/* Last event — no line */
.hist-event:last-child .hist-event__line {
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 560px) {
  .hist-event {
    grid-template-columns: 28px 1fr;
    gap: 0 10px;
  }

  .hist-event__dot { width: 12px; height: 12px; }
  .hist-event__dot--milestone { width: 16px; height: 16px; }
  .hist-event__card { padding: 13px 14px; }
  .hist-tab { padding: 8px 12px; font-size: 12px; }
}
