/* corrige.css — extracted from _source/ templates */
/* 11 files share this stylesheet */

.corrige-wrapper { max-width: 920px; margin: 0 auto; padding: 0 1rem 3rem; }
.corrige-wrapper h1 { font-size: 1.6rem; margin: 2rem 0 0.5rem; }
.corrige-intro {
  font-size: 0.92rem; color: #6b7280; margin-bottom: 1.5rem;
  line-height: 1.6;
}
.corrige-intro strong { color: #374151; }
.corrige-back {
  display: inline-block; font-size: 0.85rem; margin-bottom: 1.5rem;
  color: var(--color-primary, #0991E0); text-decoration: none;
  font-weight: 600;
}
.corrige-back:hover { text-decoration: underline; }

/* ── Part Section ────────────────────────────────────── */
.corrige-part {
  margin-bottom: 2rem;
}
.corrige-part-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  background: var(--color-primary, #0991E0); color: #fff;
  margin-bottom: 0.5rem;
}

/* ── Grid of answers ─────────────────────────────────── */
.corrige-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 0.35rem;
}
.corrige-cell {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.6rem;
  background: #fff; border: 2px solid #e5e7eb;
  cursor: pointer; transition: all 0.15s;
  font-size: 0.85rem;
  user-select: none;
}
.corrige-cell:hover {
  border-color: var(--color-primary, #0991E0);
  background: #eff6ff;
}
.corrige-cell.open {
  border-color: var(--color-primary, #0991E0);
  background: #f0f7ff;
}
.corrige-qnum {
  font-weight: 700; color: #374151;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.8rem;
  min-width: 2.2rem;
}
.corrige-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem;
  font-weight: 700; font-size: 0.82rem;
  background: #e2e8f0; color: #334155;
  flex-shrink: 0;
}

/* ── Expanded answer panel ────────────────────────────── */
.corrige-detail {
  display: none;
  margin: 0.35rem 0 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--color-primary, #0991E0);
  font-size: 0.9rem; line-height: 1.6;
  animation: fadeIn 0.2s ease;
}
.corrige-detail.open { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.corrige-detail .detail-qnum {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 700; font-size: 0.82rem;
  color: var(--color-primary, #0991E0);
  margin-bottom: 0.3rem;
}
.corrige-detail .detail-question {
  font-weight: 600; color: #1f2937;
  margin-bottom: 0.75rem;
}
.corrige-detail .detail-options {
  list-style: none; padding: 0; margin: 0;
}
.corrige-detail .detail-options li {
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.88rem;
}
.corrige-detail .detail-options li.correct-option {
  background: #ecfdf5;
  font-weight: 600;
  border-left: 3px solid #6ee7b7;
  padding-left: 0.75rem;
}
.corrige-detail .detail-options li .opt-letter {
  font-weight: 700; margin-right: 0.4rem;
  color: #6b7280;
}
.corrige-detail .detail-options li.correct-option .opt-letter {
  color: #059669;
}
.corrige-detail .image-note {
  font-size: 0.8rem; color: #9ca3af;
  font-style: italic; margin-top: 0.5rem;
}
.corrige-detail .detail-explanation {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 189, 10, 0.08);
  border-left: 3px solid var(--color-accent-warm);
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--color-text);
}
.corrige-detail .detail-explanation strong {
  color: var(--color-primary);
}
.corrige-detail .detail-image {
  margin-top: 0.75rem;
  text-align: center;
}
.corrige-detail .detail-image img {
  display: block;
  margin: 0 auto;
  max-width: 600px;
  width: auto;
  height: auto;
  border: 1px solid var(--color-border-light);
}

/* ── Legend ───────────────────────────────────────────── */
.corrige-legend {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  font-size: 0.82rem; color: #6b7280;
  margin-bottom: 1rem; padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.corrige-legend span {
  display: flex; align-items: center; gap: 0.3rem;
}
.legend-swatch {
  width: 1.2rem; height: 1.2rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.7rem;
  background: #e2e8f0; color: #334155;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .corrige-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 0.25rem;
  }
  .corrige-cell { padding: 0.45rem; font-size: 0.8rem; }
  .corrige-letter { width: 1.5rem; height: 1.5rem; font-size: 0.75rem; }
}

/* ══════════════════════════════════════════════════════════════
   Dark mode
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .corrige-intro {
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-intro strong {
  color: var(--dm-text-heading);
}
html[data-theme="dark"] .corrige-intro a {
  color: var(--dm-link);
}
html[data-theme="dark"] .corrige-grid-cell {
  background: var(--dm-surface);
  border-color: var(--dm-border);
}
html[data-theme="dark"] .corrige-grid-cell:hover {
  border-color: var(--dm-link);
}
html[data-theme="dark"] .corrige-grid-cell.active {
  background: rgba(9, 145, 224, 0.12);
}
html[data-theme="dark"] .corrige-grid-cell.correct {
  background: rgba(9, 145, 224, 0.08);
}
html[data-theme="dark"] .corrige-cell-q {
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-cell-answer {
  background: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-detail {
  background: var(--dm-bg);
  border-color: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-detail .detail-qnum {
  color: var(--dm-link);
}
html[data-theme="dark"] .corrige-detail .detail-question {
  color: var(--dm-text-heading);
}
html[data-theme="dark"] .corrige-detail-correct {
  background: rgba(5, 150, 105, 0.1);
}
html[data-theme="dark"] .corrige-detail-correct .check {
  color: #34d399;
}
html[data-theme="dark"] .corrige-nav-pill {
  background: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-qnum {
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-letter {
  background: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-cell {
  background: var(--dm-surface);
  border-color: var(--dm-border);
}
html[data-theme="dark"] .corrige-cell:hover {
  border-color: var(--dm-link);
  background: var(--dm-surface-hi);
}
html[data-theme="dark"] .corrige-cell.open {
  border-color: var(--dm-link);
  background: rgba(9, 145, 224, 0.12);
}
html[data-theme="dark"] .corrige-detail .detail-options li .opt-letter {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .corrige-detail .detail-options li.correct-option {
  background: rgba(5, 150, 105, 0.1);
}
html[data-theme="dark"] .corrige-detail .detail-options li.correct-option .opt-letter {
  color: #34d399;
}
html[data-theme="dark"] .corrige-detail .image-note {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .corrige-detail .detail-image img {
  border-color: var(--dm-border);
}
html[data-theme="dark"] .corrige-detail .detail-explanation {
  background: var(--dm-warm-8);
  border-left-color: var(--color-accent-warm);
  color: var(--dm-text);
}
html[data-theme="dark"] .corrige-detail .detail-explanation strong {
  color: var(--dm-text-heading);
}
html[data-theme="dark"] .corrige-legend {
  color: var(--dm-text-muted);
  border-bottom-color: var(--dm-border);
}
html[data-theme="dark"] .legend-swatch {
  background: var(--dm-border);
  color: var(--dm-text);
}
