/* ============================================================
   Maths Standard Y11 Module 2 — Component Styles
   Loaded after lesson.css + maths-standard-y11-theme.css
   ============================================================ */

/* ── Intentions Grid ── */
.intentions-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px;
}
.intention-card {
  background: var(--surface); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); border-top: 3px solid var(--primary);
}
.intention-card.understand { border-top-color: var(--accent); }
.intention-card.cando      { border-top-color: var(--secondary); }
.intention-card h3 {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px;
  color: var(--text); display: flex; align-items: center; gap: 6px;
}
.intention-card ul { list-style: none; }
.intention-card li {
  color: var(--text-muted); font-size: 13.5px; padding: 5px 0 5px 16px;
  position: relative; line-height: 1.45; border-bottom: 1px solid var(--border);
}
.intention-card li:last-child { border-bottom: none; }
.intention-card li::before { content: '›'; position: absolute; left: 0; font-weight: 700; color: var(--primary); }
.intention-card.understand li::before { color: var(--accent); }
.intention-card.cando li::before { color: var(--secondary); }

/* ── Hero extras ── */
.hero-desc { color: var(--text-muted); font-size: 15.5px; max-width: 540px; line-height: 1.6; }

/* ── Worked Example blocks ── */
.we-header {
  background: var(--surface-2); padding: 14px 24px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.we-label {
  font-family: var(--font-display); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted);
}
.pt-badge {
  padding: 4px 12px; border-radius: 100px;
  background: var(--accent-bg); color: var(--accent);
  font-family: var(--font-display); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.we-setup {
  background: var(--primary-light); padding: 18px 24px;
  border-bottom: 1px solid rgba(194,65,12,0.15);
}
.we-setup h4 {
  font-family: var(--font-display); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--primary);
  margin-bottom: 10px;
}
.we-setup p  { color: var(--text); font-size: 14px; margin-bottom: 6px; }
.we-setup ul { list-style: none; padding: 0; }
.we-setup li {
  font-size: 14px; color: var(--text-muted); padding: 3px 0 3px 14px; position: relative;
}
.we-setup li::before { content: '→'; position: absolute; left: 0; color: var(--primary); }
.we-solution {
  background: white; padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.we-solution h4 {
  font-family: var(--font-display); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted);
  margin-bottom: 14px;
}
.we-step {
  display: grid; grid-template-columns: 28px 1fr 1fr;
  gap: 12px; align-items: start; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px dashed var(--border);
}
.we-step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.we-step-num {
  width: 24px; height: 24px; background: var(--primary);
  border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: white; flex-shrink: 0;
  font-family: var(--font-display);
}
.we-step-eq {
  font-family: var(--font-mono); font-size: 13.5px; color: var(--text); line-height: 1.5;
}
.we-step-why {
  font-size: 13px; color: var(--text-muted); font-style: italic; line-height: 1.5;
}

/* Step-reveal */
.reveal-btn {
  display: inline-block; margin-top: 10px; padding: 7px 18px;
  background: var(--primary); color: #fff; border: none; border-radius: 6px;
  font-family: inherit; font-size: 0.93rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.reveal-btn:hover { background: var(--primary-dark); }
.we-step.revealed { animation: revealStep .35s ease both; }
@keyframes revealStep { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Conversion Table ── */
.conversion-table-wrap { margin: 20px 0; }
.conversion-table-label {
  font-family: var(--font-display); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--primary);
  margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.conversion-table-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.conversion-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px;
}
.conversion-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; text-align: center;
}
.conversion-card .from {
  font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--primary); display: block; margin-bottom: 4px;
}
.conversion-card .arrow { font-size: 16px; color: var(--text-light); }
.conversion-card .to {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-muted);
  display: block; margin-top: 4px;
}

/* ── Marks badge ── */
.marks {
  display: inline-flex; align-items: center;
  background: var(--secondary); color: white;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
  font-family: var(--font-display); float: right; margin-top: 2px;
}

/* ── Answers section ── */
.answers-trigger { border: 2px solid var(--secondary); }
.answers-trigger:hover { background: var(--secondary-light); }
.answers-trigger .arrow { color: var(--secondary); }
.answers-body { border: 2px solid var(--secondary); border-top: none; }
.answer-item { border-left: 3px solid var(--secondary); }
.answer-item h4 { color: var(--secondary); }

/* ── Completion ── */
.completion-checkbox.checked { background: var(--secondary); border-color: var(--secondary); }
.completion-wrap.done { border-color: var(--secondary); background: var(--secondary-light); }

/* ── MC Block ── */
.mc-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}
.mc-block .mc-question {
  padding: 16px 20px 8px; margin: 0;
  font-size: 14.5px; color: var(--text); font-weight: 500;
}
.mc-block .mc-options {
  padding: 0 20px 14px;
}
.mc-answer {
  display: none; padding: 12px 20px;
  background: var(--success-light); border-top: 1px solid var(--border);
  font-size: 13.5px; color: #14532d;
}
.mc-answer.show { display: block; }

/* ── SA Block ── */
.sa-block { padding: 20px 24px; }
.sa-block .question-text { font-size: 14.5px; color: var(--text); line-height: 1.6; }

/* ── Question numbering ── */
.q-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; background: var(--primary);
  border-radius: 50%; color: white; font-size: 11px; font-weight: 700;
  font-family: var(--font-display); flex-shrink: 0; margin-right: 6px;
  vertical-align: middle;
}
.question-text { font-size: 14.5px; color: var(--text); line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .intentions-grid { grid-template-columns: 1fr; }
  .we-step { grid-template-columns: 28px 1fr; }
  .we-step-why { grid-column: 2; }
  .conversion-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Interactive Explore Demo ── */
.interactive-demo {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 32px 0; box-shadow: var(--shadow-sm);
}
.interactive-demo-header {
  background: var(--primary-light); border-bottom: 1px solid rgba(194,65,12,0.15);
  padding: 12px 20px; display: flex; align-items: center; gap: 10px;
}
.interactive-demo-header h4 {
  font-family: var(--font-display); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--primary); margin: 0;
}
.interactive-demo-badge {
  font-family: var(--font-display); font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--primary); color: white; padding: 2px 8px; border-radius: 100px;
}
.interactive-demo-body {
  padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.demo-canvas-wrap { overflow-x: auto; width: 100%; }
.demo-canvas-wrap canvas {
  display: block; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff9f7;
}
.demo-controls {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: center;
}
.demo-control { display: flex; align-items: center; gap: 8px; }
.demo-control label {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); white-space: nowrap;
}
.demo-control input[type="range"] { width: 150px; accent-color: var(--primary); cursor: pointer; }
.demo-control .val {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--primary); min-width: 56px;
}
.demo-mode-btns { display: flex; gap: 6px; }
.demo-mode-btn {
  padding: 5px 14px; border-radius: 100px; border: 2px solid var(--border);
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; cursor: pointer; background: var(--surface-2); color: var(--text-muted);
  transition: all .2s;
}
.demo-mode-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* DST Formula Triangle */
.dst-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.dst-triangle-outer {
  width: 220px; border: 3px solid #ea580c; border-radius: var(--radius-sm); overflow: hidden;
}
.dst-top {
  background: #fed7aa; padding: 16px; text-align: center;
  font-family: var(--font-display); font-size: 32px; font-weight: 800;
  color: #c2410c; cursor: pointer; border-bottom: 2px solid #ea580c;
  transition: background .2s, color .2s; user-select: none;
}
.dst-top.covered, .dst-top:hover { background: #c2410c; color: white; }
.dst-bottom { display: grid; grid-template-columns: 1fr 26px 1fr; }
.dst-cell {
  background: #fef9f3; padding: 14px 10px; text-align: center;
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  color: #ea580c; cursor: pointer; transition: background .2s, color .2s; user-select: none;
}
.dst-cell:hover, .dst-cell.covered { background: #ea580c; color: white; }
.dst-sep {
  background: #fff9f7; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #a06040; font-weight: 700;
  border-left: 2px solid #f0d0bc; border-right: 2px solid #f0d0bc;
}
.dst-formula {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--primary-dark); text-align: center; padding: 12px 24px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--border); min-width: 240px;
}
.dst-hint { font-size: 12px; color: var(--text-light); text-align: center; font-family: var(--font-body); }

@media (max-width: 600px) {
  .demo-control input[type="range"] { width: 110px; }
}
