/* ==========================================================================
   Creation Wizard — Shared Picker Primitives
   --------------------------------------------------------------------------
   Per active-workstreams.md § "Wizard CSS shared-primitives refactor"
   (queued 2026-05-24, surfaced during OSE Slice 7 dev cutover).

   Today the per-system wizard CSS (cairn-wizard.css, mausritter-wizard.css,
   ose-wizard.css) each carries the same generic pickable-card /
   pickable-row / split-pane / attribute-grid primitives, just renamed
   per system (`.cairn-bg-card` ≈ `.mausritter-bg-grid-cell` ≈
   `.ose-race-card`). This file lifts the Layer-1 primitives out.

   Usage pattern (additive):
     <div class="wizard-pick-card ose-race-card selected">
                 ^^^^^^^^^^^^^^^^ shared primitive — defaults from here
                                  ^^^^^^^^^^^^^^^ per-system override hook
                                                  ^^^^^^^^ shared state class

   Views opt into the primitive by adding the `wizard-pick-card` class
   alongside their existing per-system class. Per-system styles continue
   to layer on top via higher-specificity selectors when needed (e.g.
   `.creation-wizard.cairn .cairn-bg-card { … }` still wins over
   `.wizard-pick-card { … }`).

   Trimming the per-system files to remove redundant rules is a separate
   follow-up (see active-workstreams.md § CSS-4).
   ========================================================================== */

/* ---------------------------------------------------------------------------
   .wizard-pick-grid — auto-fill grid for pickable cards. Used for race
   choices, class choices, template choices. Cards inside fill the grid.
   --------------------------------------------------------------------------- */

.wizard-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.5rem;
}

/* Wider tiles for grids with longer card content (Cairn backgrounds) */
.wizard-pick-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

/* ---------------------------------------------------------------------------
   .wizard-pick-card — a clickable card in a picker grid. Selected + hover
   states match the project's accent-red treatment. Blocked items use the
   .blocked modifier (lower opacity + not-allowed cursor).
   --------------------------------------------------------------------------- */

.wizard-pick-card {
  padding: 0.6rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wizard-pick-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.wizard-pick-card.selected {
  border-color: var(--accent-red);
  background: rgba(230, 57, 70, 0.08);
}

.wizard-pick-card.blocked {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--bg-secondary);
}

.wizard-pick-card.blocked:hover {
  border-color: var(--border-primary);
  background: var(--bg-secondary);
}

/* Card header — primary label + optional secondary chip (e.g. roll number) */
.wizard-pick-card__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.wizard-pick-card__desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin: 0;
}

/* ---------------------------------------------------------------------------
   .wizard-pick-row — a clickable row in a picker list. Same selected /
   hover / blocked states as .wizard-pick-card but laid out horizontally
   (name on the left, accessory on the right, optional reason text below).
   Used by OSE/BFRPG's Race & Class step for the class list under the
   race grid.
   --------------------------------------------------------------------------- */

.wizard-pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wizard-pick-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wizard-pick-row:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.wizard-pick-row.selected {
  border-color: var(--accent-red);
  background: rgba(230, 57, 70, 0.08);
}

.wizard-pick-row.blocked {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--bg-secondary);
}

.wizard-pick-row.blocked:hover {
  border-color: var(--border-primary);
  background: var(--bg-secondary);
}

.wizard-pick-row__name {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.wizard-pick-row__accessory {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-monospace, monospace);
}

.wizard-pick-row__reason {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------------------------------------------------------------------------
   .wizard-split-pane — two-pane layout for steps that have a picker on
   one side + detail panel on the other. Stacks to single column at
   <800px. Used by OSE/BFRPG Race & Class step.
   --------------------------------------------------------------------------- */

.wizard-split-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

@media (max-width: 800px) {
  .wizard-split-pane {
    grid-template-columns: 1fr;
  }
}

.wizard-split-pane > * {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---------------------------------------------------------------------------
   .wizard-row-pair — two-pane horizontal layout for steps that have two
   visually-similar sub-sections (e.g. OSE's HP & Starting Gold). Stacks
   to single column at <720px.
   --------------------------------------------------------------------------- */

.wizard-row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 720px) {
  .wizard-row-pair {
    grid-template-columns: 1fr;
  }
}
