/* cuda-extras.css — CUDA-specific reusable components.
   Layers on top of the shared ../assets/style.css. Reused across all CUDA lessons.
   Components: .terminal (SSH/compile blocks), .hier (grid→block→thread diagram),
   .keyfact (cited fact badge), .twocol, .step-list. */

/* ---- terminal / shell command block ---- */
.terminal {
  background: #1e1e1e;
  color: #e8e8e8;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0;
  overflow-x: auto;
  border-left: 3px solid var(--accent);
}
.terminal .prompt { color: #6ab04c; user-select: none; }
.terminal .prompt::after { content: " "; }
.terminal .comment { color: #888; }
.terminal .out { color: #b8b8b8; }

/* ---- thread hierarchy diagram (grid → blocks → threads) ---- */
.hier {
  margin: 1.6rem 0;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.hier-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.grid-box {
  border: 2px dashed var(--accent);
  border-radius: 8px;
  padding: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: var(--accent-light);
}
.block-box {
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 0.5rem;
  background: #fff;
}
.block-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
  text-align: center;
}
.thread-row { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.thread {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--sidebar);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.thread.warp0 { background: #f3e5d8; border-color: var(--accent); }
.thread.hl { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- key fact badge (cite-backed) ---- */
.keyfact {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin: 1rem 0;
  background: #fff;
}
.keyfact .k {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-size: 0.9rem;
}
.keyfact .v { font-size: 0.97rem; }
.keyfact .v sup a { font-size: 0.7em; }

/* ---- two column layout ---- */
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.2rem 0; }
@media (max-width: 680px) { .twocol { grid-template-columns: 1fr; } }

/* ---- numbered step list for hands-on ---- */
.step-list { counter-reset: step; list-style: none; padding-left: 0; }
.step-list > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin: 1rem 0;
}
.step-list > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---- citation superscript ---- */
sup.cite a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ---- "try it" call-to-action ---- */
.tryit {
  background: linear-gradient(0deg, var(--accent-light), #fff);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1.6rem 0;
}
.tryit .tryit-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
