/* =============================================================================
   BLACK SIGNAL — css/components/row.css
   ROW — the answer choice's shape, used for every list: a ruled row with a
   "letter cell" on the left (a mono id or a condensed letter), the title in the
   middle, quiet meta on the right. Rows share hairlines; the row is a sweep.

     .bs-rows            the ruled container
     .bs-row             one row (add .bs-sweep .bs-sweep--quiet in the template)
       .bs-row-key       the left cell (mono id / letter)
       .bs-row-title     condensed title
       .bs-row-meta      chips, counts
     answer states on .choice-btn: .selected (held), .correct, .incorrect, .dimmed

   Legacy names mapped: .linux-lab-list → .bs-rows, .linux-lab-row → .bs-row,
   .linux-lab-row-id → .bs-row-key, .linux-lab-row-title → .bs-row-title,
   .linux-lab-row-meta → .bs-row-meta; the quiz's .choice-btn / .choice-letter /
   .choice-text; the module list's .obj-entry; quiz-home's .qh-action cells.
   ============================================================================= */
@layer components {

/* ── Container ─────────────────────────────────────────────────────────── */
.bs-rows,
.linux-category-screen .linux-lab-list {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 1px solid var(--sig-rule);
  border-bottom: 0;
}

/* ── Lab row ───────────────────────────────────────────────────────────── */
.bs-row,
.linux-lab-row {
  display: grid;
  /* Let long lab IDs grow their key cell (up to a sensible limit) instead
     of painting over the adjacent title. Short IDs retain a 128px cell. */
  grid-template-columns: fit-content(228px) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
  min-height: 64px;
  margin: 0;
  padding: 0;
  border-width: 0 0 1px 0;
  border-style: solid;
  border-color: var(--sig-rule);
  clip-path: none;
  text-align: left;
  color: var(--sig-ink);
  font: inherit;
}
.bs-row-key,
.linux-lab-row-id {
  display: flex; align-items: center;
  box-sizing: border-box;
  min-width: 128px;
  max-width: 228px;
  min-height: 0;
  padding: 8px 18px;
  border-right: 1px solid var(--sig-rule);
  font-family: var(--sig-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--orange);
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.4;
}
.bs-row-title,
.linux-lab-row-title {
  display: flex; align-items: center;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sig-ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.bs-row-meta,
.linux-lab-row-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  min-width: 0;
  padding: 8px 20px;
}
.linux-lab-xp {
  font-family: var(--sig-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--sig-ink-dim);
  font-variant-numeric: tabular-nums;
}
.linux-lab-new,
.linux-lab-completions,
.linux-lab-live,
.linux-lab-row .bs-pro-badge {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 7px;
  font-family: var(--sig-mono); font-weight: 500;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--sig-rule-strong);
  color: var(--orange); background: transparent;
  clip-path: none;
}
/* LIVE badge: a solid accent chip so a real-terminal lab reads at a glance,
   distinct from the guided labs' NEW / completion-count chips. */
.linux-lab-live {
  background: var(--orange);
  color: var(--accent-on-accent);
  border-color: var(--orange);
  font-weight: 600;
}
/* Pro badge: a solid accent chip (black ink on the theme color) so it reads
   clearly against a locked lab row, matching the course/module tiles. */
.linux-lab-row .bs-pro-badge {
  background: var(--orange);
  color: var(--accent-on-accent);
  border-color: var(--orange);
}
.linux-lab-row::before, .linux-lab-row::after { content: none; }
.linux-lab-row.is-locked .linux-lab-row-title { color: var(--sig-ink-mute); }

/* ── Answer choice (the reference) ─────────────────────────────────────── */
.choice-btn {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  border-width: 0 0 1px 0;
  border-style: solid;
  border-color: var(--sig-rule);
  text-align: left;
  color: var(--sig-ink);
  font: inherit;
  overflow: hidden;
}
.choice-btn:last-child { border-bottom-width: 0; }
.choice-btn::before, .choice-btn::after { content: none; }
.choice-letter {
  display: flex; align-items: center; justify-content: center;
  min-width: 64px;
  border-right: 1px solid var(--sig-rule);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 0;
  color: var(--orange);
  background: transparent;
  flex-shrink: 0;
  align-self: stretch;
  user-select: none;
}
.choice-text {
  display: flex; align-items: center;
  flex: 1 1 auto;
  padding: 16px 22px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  color: var(--sig-ink);
}
/* Picked: the quiz sets aria-pressed="true" on the chosen row, and the sweep
   holds the fill (see sweep.css) — identical to hover, as the reference was. */

/* Answered: results, not interactions — no hatch, no sweep. */
.choice-btn.correct, .choice-btn.incorrect, .choice-btn.dimmed {
  background-image: none;
  cursor: default;
}
.choice-btn.correct { background-color: color-mix(in srgb, var(--orange) 14%, var(--sig-black)); border-color: var(--orange); }
.choice-btn.correct .choice-letter { background: var(--orange); color: var(--accent-on-accent); border-color: var(--orange); }
.choice-btn.correct .choice-text { color: var(--orange); }
.choice-btn.incorrect { background-color: var(--sig-alert-bg); border-color: var(--sig-alert-rule); }
.choice-btn.incorrect .choice-letter { color: var(--sig-alert-ink); border-color: var(--sig-alert-rule); }
.choice-btn.incorrect .choice-text { color: var(--sig-ink-dim); text-decoration: line-through; text-decoration-color: var(--sig-alert-ink); }
.choice-btn.dimmed { color: var(--sig-ink-mute); }
.choice-btn.dimmed .choice-letter, .choice-btn.dimmed .choice-text { color: var(--sig-ink-mute); }

/* ── Entry rows on a module list (objectives, live system lab) ─────────── */
.linux-category-screen .obj-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--sig-rule);
  border-top: none;
  justify-content: start;
}
.linux-category-screen .obj-entry + .linux-category-grid { margin-top: 28px; }
.obj-entry-note {
  font-family: var(--sig-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--sig-ink-dim);
  line-height: 1.5;
}

/* ── Tool cells on quiz-home: a ruled strip of three ───────────────────── */
.linux-category-screen .qh-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--sig-rule);
  border-left: 1px solid var(--sig-rule);
}
.qh-action {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  min-height: 92px;
  padding: 18px 20px;
  margin: 0;
  border-width: 0 1px 1px 0;
  border-style: solid;
  border-color: var(--sig-rule);
  clip-path: none;
  text-align: left;
  font: inherit;
}
.qh-action::before, .qh-action::after { content: none; }
.qh-action-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0; line-height: 1; text-transform: uppercase; color: var(--sig-ink); }
.qh-action-sub  { font-family: var(--sig-mono); font-size: 11.5px; letter-spacing: 0.01em; color: var(--sig-ink-dim); }
.qh-action--primary .qh-action-name { color: var(--orange); }   /* primary: accent label + accent border, still black at rest */
.qh-action--primary { border-color: var(--orange); }

/* ── Narrower screens ──────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .bs-row, .linux-lab-row { grid-template-columns: fit-content(180px) minmax(0, 1fr) auto; }
  .bs-row-key, .linux-lab-row-id { min-width: 96px; max-width: 180px; padding: 8px 12px; }
  .choice-letter { min-width: 56px; font-size: 20px; }
  .choice-text { font-size: 16px; padding: 14px 16px; }
}
@media (max-width: 599px) {
  /* The key cell takes only what its id needs (LAB1 ≈ 64px), up to 30%, so
     the title — the thing people read — gets the width. */
  .bs-row, .linux-lab-row { grid-template-columns: fit-content(30%) minmax(0, 1fr); grid-template-rows: auto auto; min-height: 0; }
  .bs-row-key, .linux-lab-row-id { grid-row: 1 / span 2; min-width: 64px; max-width: 100%; padding: 8px 12px; font-size: 10.5px; letter-spacing: 0.07em; justify-content: center; }
  .bs-row-title, .linux-lab-row-title { padding: 12px 14px 2px; font-size: 17px; }
  .bs-row-meta, .linux-lab-row-meta { padding: 0 14px 12px; gap: 8px 10px; justify-content: flex-start; }
  .linux-category-screen .obj-entry { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; }
  .linux-category-screen .qh-actions { grid-template-columns: 1fr; }
  .qh-action { min-height: 76px; }
}

}
