/* ==========================================================================
   Lesson drills (docs/DRILLS-DESIGN.md) — styles for the .lesson-drill widget
   hydrated by /javascripts/drill.js. Built on the editorial tokens.
   ========================================================================== */

.lesson-drill { margin: 28px 0; }

.ld-card {
  background: var(--surface, #fffdf9);
  border: 1px solid var(--border-strong, #d8d0bf);
  border-radius: 12px;
  overflow: hidden;
}

.ld-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface-2, #f3efe7);
  border-bottom: 1px solid var(--border, #e7e1d4);
}

.ld-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body, sans-serif);
  font-weight: 600;
  color: var(--text, #1a1712);
  letter-spacing: 0.01em;
}

.ld-badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand, #0f766e);
  color: var(--text-on-brand, #fffdf9);
  font-size: 0.8rem;
}

.ld-score {
  font-size: 0.8rem;
  color: var(--text-muted, #5e574a);
  font-variant-numeric: tabular-nums;
}

.ld-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.ld-q {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, #e7e1d4);
}
.ld-q:last-child { border-bottom: none; }

.ld-prompt {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 12px;
}

.ld-qnum {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft, #d7ede9);
  color: var(--brand-strong, #115e59);
  font-size: 0.75rem;
  font-weight: 700;
}

.ld-qtext { font-weight: 600; color: var(--text, #1a1712); }

/* ---- inputs -------------------------------------------------------------- */

.ld-options { display: flex; flex-direction: column; gap: 8px; }

.ld-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border, #e7e1d4);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.ld-option:hover { border-color: var(--brand, #0f766e); }
.ld-option input { accent-color: var(--brand, #0f766e); }

.ld-choice {
  align-self: flex-start;
  padding: 8px 18px;
  border: 1px solid var(--border-strong, #d8d0bf);
  border-radius: 999px;
  background: var(--surface, #fffdf9);
  color: var(--text, #1a1712);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.ld-choice:hover:not(:disabled) { border-color: var(--brand, #0f766e); color: var(--brand, #0f766e); }
.ld-choice.is-picked {
  background: var(--brand, #0f766e);
  border-color: var(--brand, #0f766e);
  color: var(--text-on-brand, #fffdf9);
}
.ld-choice:disabled { opacity: 0.6; cursor: default; }
.ld-options .ld-choice { align-self: auto; }
.ld-options--row { flex-direction: row; flex-wrap: wrap; }

.ld-text {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong, #d8d0bf);
  border-radius: 8px;
  background: var(--bg-elev, #fffdf9);
  color: var(--text, #1a1712);
  font: inherit;
  font-size: 0.95rem;
}
.ld-text:focus { outline: 2px solid var(--brand-soft, #d7ede9); border-color: var(--brand, #0f766e); }
.ld-textarea { resize: vertical; min-height: 96px; }

.ld-words { margin-top: 4px; font-size: 0.75rem; color: var(--text-faint, #8c8475); text-align: right; }
.ld-words.is-over { color: var(--warn, #b45309); }

/* ---- check + feedback ---------------------------------------------------- */

.ld-check {
  margin-top: 12px;
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  background: var(--text, #1a1712);
  color: var(--bg-elev, #fffdf9);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.ld-check:hover:not(:disabled) { background: var(--brand, #0f766e); }
.ld-check:disabled { opacity: 0.35; cursor: default; }

.ld-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border, #e7e1d4);
  background: var(--surface-2, #f3efe7);
}
.ld-feedback.ld-right { border-color: color-mix(in srgb, var(--good, #15803d) 40%, transparent); }
.ld-feedback.ld-wrong { border-color: color-mix(in srgb, var(--danger, #b91c1c) 35%, transparent); }

.ld-verdict { font-weight: 700; margin-bottom: 4px; }
.ld-right .ld-verdict { color: var(--good, #15803d); }
.ld-wrong .ld-verdict { color: var(--danger, #b91c1c); }
.ld-neutral .ld-verdict { color: var(--text-muted, #5e574a); }

.ld-answer { font-size: 0.9rem; margin-bottom: 4px; color: var(--text, #1a1712); }
.ld-explain { font-size: 0.9rem; color: var(--text-muted, #5e574a); line-height: 1.55; }

/* ---- long-form reveal ---------------------------------------------------- */

.ld-reveal {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border, #e7e1d4);
  background: var(--surface-2, #f3efe7);
}

.ld-reveal-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint, #8c8475);
  margin: 10px 0 6px;
}
.ld-reveal-title:first-child { margin-top: 0; }

.ld-model { font-size: 0.92rem; line-height: 1.6; color: var(--text, #1a1712); }

.ld-rubric { margin: 0 0 4px; padding-left: 20px; }
.ld-rubric li { font-size: 0.9rem; color: var(--text-muted, #5e574a); margin-bottom: 3px; }

.ld-rate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e7e1d4);
}
.ld-rate-label { font-size: 0.85rem; color: var(--text-muted, #5e574a); margin-right: 4px; }
.ld-rate-good.is-picked { background: var(--good, #15803d); border-color: var(--good, #15803d); }
.ld-rate-mid.is-picked { background: var(--warn, #b45309); border-color: var(--warn, #b45309); }
.ld-rate-bad.is-picked { background: var(--danger, #b91c1c); border-color: var(--danger, #b91c1c); }

/* Completed question: quiet the inputs */
.ld-q.ld-done .ld-option { opacity: 0.75; cursor: default; }

@media (max-width: 640px) {
  .ld-q { padding: 14px 12px; }
  .ld-head { padding: 10px 12px; }
}
