/* ===========================================================================
 * passage-item.css — canonical visual for PassageItem.
 * ===========================================================================
 * Single source of truth for .pi-* classes — .pi-eyebrow / .pi-stem /
 * .pi-choices / .pi-choice / .pi-letter / .pi-choice-main / .pi-choice-text
 * / .pi-elim / .pi-why / .pi-why-label / .pi-why-body / state classes.
 *
 * Replaces the per-surface scoped duplicates that previously lived in
 * subjects/reading/styles.css (.reading-screen .pi-*). The diagnostic-ui.css
 * .diag-passage-region .pi-* block stays as a surface-specific override
 * (the diagnostic genuinely uses a different visual treatment per the
 * passage-item-spec).
 *
 * Uses global tokens directly (--ink-*, --accent-*, --surface, --radius)
 * rather than the .reading-screen scoped --rd-* aliases — the canonical
 * applies anywhere PassageItem is mounted, not just under .reading-screen.
 * Loaded BEFORE surface stylesheets in index.html so per-surface overrides
 * (where they exist) win on specificity.
 * ========================================================================= */

.pi-item {
  font-family: var(--font-ui, var(--font-display));
  color: var(--ink);
}

/* --- Eyebrow chip above each question stem (q.type) ------------------- */
.pi-eyebrow {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-coral-tint);
  color: var(--accent-coral);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* --- Question stem ----------------------------------------------------- */
.pi-stem {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 14px;
  text-wrap: pretty;
}

/* --- Choice list + rows ------------------------------------------------ */
.pi-choices {
  display: grid;
  gap: 8px;
}

.pi-choice {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: var(--surface);
  border: 2px solid var(--ink-10);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
}
.pi-choice:hover:not(:disabled) { border-color: var(--ink-30); }
.pi-choice:disabled { cursor: default; }

.pi-choice.is-selected:not(.is-correct):not(.is-wrong) {
  background: var(--accent-coral-tint);
  border-color: var(--accent-coral);
}
.pi-choice.is-correct {
  background: var(--accent-sage-tint);
  border-color: var(--accent-sage);
  color: var(--accent-sage-ink);
}
.pi-choice.is-wrong {
  background: var(--accent-coral-tint);
  border-color: var(--accent-coral);
  color: var(--accent-coral-ink);
}
.pi-choice.is-eliminated {
  opacity: 0.5;
  cursor: default;
}
.pi-choice.is-eliminated .pi-choice-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--ink-30);
}
.pi-choice.is-dimmed { opacity: 0.75; }

/* --- Letter chip ------------------------------------------------------- */
.pi-letter {
  align-self: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--ink-10);
  color: var(--ink-70);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono, var(--font-ui));
}
.pi-choice.is-selected:not(.is-correct):not(.is-wrong) .pi-letter {
  background: var(--accent-coral);
  color: #fff;
}
.pi-choice.is-correct .pi-letter {
  background: var(--accent-sage);
  color: #fff;
}
.pi-choice.is-wrong .pi-letter {
  background: var(--accent-coral);
  color: #fff;
}

/* --- Choice text container -------------------------------------------- */
.pi-choice-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-family: var(--font-body, var(--font-display));
  font-size: 14px;
  line-height: 1.4;
  color: inherit;
  text-wrap: pretty;
}
.pi-choice-text { display: block; }

/* --- Eliminate button -------------------------------------------------- */
.pi-elim {
  align-self: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--ink-10);
  color: var(--ink-30);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pi-elim:hover {
  border-color: var(--ink-30);
  color: var(--ink-soft);
}
.pi-elim.is-on {
  background: var(--accent-coral-tint);
  border-color: var(--accent-coral);
  color: var(--accent-coral);
}

/* --- Inline why panel after reveal ------------------------------------ */
.pi-why {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--ink-30);
  background: var(--ink-5);
}
.pi-why.is-correct {
  background: var(--accent-sage-tint);
  border-color: var(--accent-sage);
}
.pi-why-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--ink-soft);
}
.pi-why.is-correct .pi-why-label {
  color: var(--accent-sage);
}
.pi-why-body {
  font-family: var(--font-body, var(--font-display));
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}
