// Road-tree for the RSI datasets chapter.
//
// Pure CSS asset plugin: the tree itself is raw HTML written inline in
// content/genai/rsi/datasets/README.md (div.rsd-roadmap). This plugin
// only ships the stylesheet, so the CSS is served as a proper <link> instead
// of an inline <style> block (which HonKit would wrap in <p>).
//
// Structure (same shape as odt-roadmap, but 6 lanes):
//   .rsd-roadmap
//     .rsd-root-wrap > .rsd-root          root node
//     .rsd-branches                       horizontal trunk line (::before)
//       .rsd-lanes
//         .rsd-lane [.rsd-lane-demo|-real|-debug|-verify|-robot|-personal]
//           .rsd-lane-head                lane title + subtitle
//           .rsd-card                     one dataset per card
//             .rsd-card-head > .rsd-name + .rsd-year
//             .rsd-tags > .rsd-tag .rsd-t-*         feature tags
//             .rsd-note                   one-line takeaway

.rsd-roadmap {
  margin: 1.4em 0 1.8em;
  font-size: 13px;
}

.rsd-root-wrap {
  text-align: center;
  position: relative;
  margin-bottom: 18px;
}

.rsd-root {
  display: inline-block;
  background: #1e293b;
  color: #fff;
  font-weight: 600;
  padding: 6px 24px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.rsd-root small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.75;
}

.rsd-root-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 1px;
  height: 18px;
  background: #94a3b8;
  transform: translateX(-50%);
}

.rsd-branches {
  position: relative;
}

.rsd-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8.33%;
  right: 8.33%;
  border-top: 1px solid #94a3b8;
}

.rsd-lanes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.rsd-lane {
  min-width: 0;
  position: relative;
  padding-top: 16px;
}

.rsd-lane::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 16px;
  background: #94a3b8;
  transform: translateX(-50%);
}

.rsd-lane-head {
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 13.5px;
}

.rsd-lane-head span {
  display: block;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

.rsd-lane-demo     .rsd-lane-head { background: #dbeafe; color: #1e40af; }
.rsd-lane-real     .rsd-lane-head { background: #d1fae5; color: #065f46; }
.rsd-lane-debug    .rsd-lane-head { background: #fee2e2; color: #991b1b; }
.rsd-lane-verify   .rsd-lane-head { background: #fef3c7; color: #92400e; }
.rsd-lane-robot    .rsd-lane-head { background: #ede9fe; color: #5b21b6; }
.rsd-lane-personal .rsd-lane-head { background: #fce7f3; color: #9d174d; }

.rsd-card {
  position: relative;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #64748b;
  border-radius: 10px;
  padding: 8px 10px 9px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.rsd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* whole card clickable -> official paper/dataset page (stretched link) */
a.rsd-stretch {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  border-radius: 10px;
}

a.rsd-stretch:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* keep the [n] reference superscripts clickable above the stretched link */
.rsd-card sup.cite {
  position: relative;
  z-index: 2;
}

.rsd-name {
  font-weight: 700;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.rsd-year {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  transition: color 0.15s;
  margin-left: auto;
}

.rsd-card:hover .rsd-year {
  color: #3b82f6;
}

.rsd-lane-demo     .rsd-card { border-left-color: #3b82f6; }
.rsd-lane-real     .rsd-card { border-left-color: #10b981; }
.rsd-lane-debug    .rsd-card { border-left-color: #ef4444; }
.rsd-lane-verify   .rsd-card { border-left-color: #f59e0b; }
.rsd-lane-robot    .rsd-card { border-left-color: #8b5cf6; }
.rsd-lane-personal .rsd-card { border-left-color: #ec4899; }

.rsd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  row-gap: 2px;
}

.rsd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}

.rsd-tag {
  font-size: 10.5px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 9px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rsd-note {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.rsd-t-blue   { background: #dbeafe; color: #1d4ed8; }
.rsd-t-amber  { background: #fef3c7; color: #92400e; }
.rsd-t-green  { background: #dcfce7; color: #15803d; }
.rsd-t-purple { background: #ede9fe; color: #6d28d9; }
.rsd-t-red    { background: #fee2e2; color: #b91c1c; }
.rsd-t-teal   { background: #ccfbf1; color: #0f766e; }
.rsd-t-pink   { background: #fce7f3; color: #be185d; }
.rsd-t-gray   { background: #f1f5f9; color: #334155; }

/* 6-column layout keeps the org-chart trunk; narrower widths reflow the
   lanes into a 3x2 grid and then a single column, without connectors */
@media (max-width: 1280px) {
  .rsd-branches::before,
  .rsd-lane::before,
  .rsd-root-wrap::after { display: none; }
  .rsd-lanes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .rsd-lanes { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
  .rsd-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: none;
  }
  .rsd-note { color: #cbd5e1; }
  .rsd-year { color: #94a3b8; }
  .rsd-branches::before,
  .rsd-lane::before,
  .rsd-root-wrap::after { background: #475569; }
  .rsd-t-gray { background: #334155; color: #e2e8f0; }
}
