/*
 * Lane A v2 — Episode lesson reading (Day 1+)
 * High-contrast scrollable curriculum text · full-width teach visuals
 * Phone + 120" TV legible
 */

:root {
  --lesson-bg: #ffffff;
  --lesson-panel: #f8fafc;
  --lesson-ink: #0a1525;
  --lesson-muted: #334155;
  --lesson-accent: #b45309;
  --lesson-line: #cbd5e1;
  --lesson-callout: #fffbeb;
  --lesson-callout-line: #d97706;
}

body.ep-lesson-mode {
  background: var(--lesson-bg);
  color: var(--lesson-ink);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.65;
}

body.ep-lesson-mode .ep-header {
  background: #ffffff;
  border-bottom: 2px solid var(--lesson-line);
}

body.ep-lesson-mode .ep-title { color: #1e3a5f; }
body.ep-lesson-mode .ep-subject-badge,
body.ep-lesson-mode .ep-back,
body.ep-lesson-mode .ep-nav-btn { color: var(--lesson-muted); }

body.ep-lesson-mode .ep-stage {
  max-width: 920px;
}

/* ── READING BLOCK ─────────────────────────────────────────────── */
.ep-reading {
  background: var(--lesson-panel);
  border: 2px solid var(--lesson-line);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ep-reading.ep-visible { opacity: 1; transform: none; }

.ep-reading-head {
  border-bottom: 2px solid var(--lesson-line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.ep-reading-chapter {
  font-family: Orbitron, Inter, sans-serif;
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.12em;
  color: var(--lesson-accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ep-reading-title {
  font-family: Orbitron, Inter, sans-serif;
  font-size: clamp(18px, 2.8vw, 26px);
  color: #1e3a5f;
  line-height: 1.3;
  margin: 0;
}
.ep-reading-location {
  margin-top: 8px;
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--lesson-muted);
}

.ep-reading-body {
  color: var(--lesson-ink);
}
.ep-reading-body p {
  margin: 0 0 1em;
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.7;
}
.ep-reading-body p:last-child { margin-bottom: 0; }
.ep-reading-body strong { color: #0f172a; font-weight: 700; }

.ep-reading-list {
  margin: 0 0 1em;
  padding-left: 1.4em;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.65;
}
.ep-reading-list li { margin-bottom: 0.45em; }

.ep-exam-callout {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--lesson-callout);
  border-left: 4px solid var(--lesson-callout-line);
  border-radius: 0 10px 10px 0;
  font-size: clamp(15px, 2vw, 19px);
  color: #78350f;
  line-height: 1.6;
}
.ep-exam-callout-label {
  font-family: Orbitron, sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--lesson-accent);
  margin-bottom: 6px;
}

/* ── VO SLOT (marked, not faked) ─────────────────────────────── */
.ep-vo-slot {
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: clamp(12px, 1.5vw, 14px);
  color: #64748b;
  background: #ffffff;
  letter-spacing: 0.04em;
}

/* ── TEACH VISUAL (full-width demonstration) ─────────────────── */
.ep-teach {
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ep-teach.ep-visible { opacity: 1; transform: none; }

.ep-teach-frame {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--lesson-line);
  background: #ffffff;
}
.ep-teach-frame img {
  display: block;
  width: 100%;
  max-height: min(52vh, 480px);
  object-fit: cover;
  object-position: center top;
}
.ep-teach-caption {
  padding: 16px 20px;
  background: #1e3a5f;
  color: #f8fafc;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}
.ep-teach-caption strong { color: #fef3c7; }

.ep-chain-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 20px;
  background: #eff6ff;
}
.ep-chain-link {
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ep-chain-link:hover,
.ep-chain-link:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 58, 95, 0.12);
  border-color: #1d4ed8;
  outline: none;
}
.ep-chain-link:active { transform: translateY(0); }
.ep-chain-tap {
  margin-top: 8px;
  font-size: clamp(11px, 1.4vw, 13px);
  color: #1d4ed8;
  font-weight: 600;
}
.ep-chain-num {
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  color: #1d4ed8;
  letter-spacing: 0.08em;
}
.ep-chain-name {
  font-size: clamp(14px, 1.8vw, 17px);
  font-weight: 700;
  color: #0a1525;
  margin-top: 4px;
}
.ep-chain-break {
  font-size: clamp(12px, 1.5vw, 14px);
  color: #334155;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── CHAIN DETAIL MODAL ─────────────────────────────────────── */
.ep-chain-detail {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ep-chain-detail.open { display: flex; }
.ep-chain-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 21, 37, 0.72);
}
.ep-chain-detail-panel {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 2px solid #1e3a5f;
  padding: 20px;
  color: #0a1525;
}
.ep-chain-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #e2e8f0;
  color: #0a1525;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}
.ep-chain-detail-img-wrap img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}
.ep-chain-detail-num {
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  color: #1d4ed8;
  letter-spacing: 0.1em;
}
.ep-chain-detail-title {
  font-family: Orbitron, sans-serif;
  font-size: clamp(20px, 3vw, 26px);
  color: #1e3a5f;
  margin: 8px 0;
}
.ep-chain-detail-def,
.ep-chain-detail-break {
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.65;
  margin: 0 0 12px;
}
.ep-chain-detail-break {
  padding: 12px;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

/* ── DISCUSSION CUE ─────────────────────────────────────────── */
.ep-discussion-anchor {
  min-height: 40px;
  margin: 0 0 8px;
}
.ep-discussion-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 21, 37, 0.88);
}
.ep-discussion-overlay.open { display: flex; }
.ep-discussion-panel {
  width: min(900px, 100%);
  background: #ffffff;
  border-radius: 18px;
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
  border: 3px solid #f59e0b;
}
.ep-discussion-label {
  font-family: Orbitron, sans-serif;
  font-size: clamp(12px, 1.6vw, 14px);
  letter-spacing: 0.14em;
  color: #b45309;
  margin-bottom: 16px;
}
.ep-discussion-prompt {
  font-size: clamp(22px, 3.5vw, 34px);
  line-height: 1.45;
  color: #0a1525;
  font-weight: 600;
  margin: 0 0 16px;
}
.ep-discussion-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: #475569;
  margin: 0 0 24px;
}
.ep-discussion-continue {
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  background: #1e3a5f;
  color: #ffffff;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  cursor: pointer;
}

/* ── AUTO-SPLIT ANCHOR ───────────────────────────────────────── */
.ep-split-anchor {
  margin: 24px 0;
}
.ep-split-signal {
  padding: 16px 18px;
  border-radius: 12px;
  border: 2px dashed #1e3a5f;
  background: #eff6ff;
}
.ep-split-label {
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #1e3a5f;
  margin-bottom: 6px;
}
.ep-split-copy {
  margin: 0;
  font-size: clamp(15px, 2vw, 18px);
  color: #334155;
  line-height: 1.5;
}

/* ── TOOL DUO TEACH PANELS ─────────────────────────────────── */
.ep-tool-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.ep-tool-panel img {
  display: block;
  width: 100%;
  height: min(42vh, 360px);
  object-fit: cover;
}
.ep-tool-label {
  padding: 12px 14px 4px;
  font-family: Orbitron, sans-serif;
  font-size: clamp(13px, 1.8vw, 16px);
  color: #1e3a5f;
  background: #ffffff;
}
.ep-tool-caption {
  padding: 0 14px 14px;
  font-size: clamp(14px, 1.8vw, 17px);
  color: #334155;
  line-height: 1.5;
  background: #ffffff;
}

@media (max-width: 700px) {
  .ep-tool-duo { grid-template-columns: 1fr; }
}

/* ── MILO (lesson mode — light panel) ────────────────────────── */
body.ep-lesson-mode .ep-milo {
  background: #fffbeb;
  border: 2px solid #f59e0b;
  color: var(--lesson-ink);
}
body.ep-lesson-mode .ep-milo-headline { color: #92400e; font-size: clamp(16px, 2.4vw, 22px); }
body.ep-lesson-mode .ep-milo-body,
body.ep-lesson-mode .ep-milo-detail {
  color: var(--lesson-ink);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.65;
}
body.ep-lesson-mode .ep-milo-detail {
  background: rgba(255, 255, 255, 0.7);
  color: #78350f;
}

/* ── DECISION + RECAP (lesson mode) ───────────────────────────── */
body.ep-lesson-mode .ep-decision {
  background: #ffffff;
  border: 2px solid var(--lesson-accent);
}
body.ep-lesson-mode .ep-decision-prompt {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--lesson-ink);
}
body.ep-lesson-mode .ep-choice-btn {
  background: #f8fafc;
  color: var(--lesson-ink);
  border: 2px solid var(--lesson-line);
  font-size: clamp(15px, 2vw, 18px);
}
body.ep-lesson-mode .ep-recap {
  background: #f0fdf4;
  border: 2px solid #86efac;
  text-align: left;
}
body.ep-lesson-mode .ep-recap-text {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--lesson-ink);
}

/* Hide legacy caption dialogue layout on lesson days */
body.ep-lesson-mode .ep-keisha-narration,
body.ep-lesson-mode .ep-dialogue { display: none !important; }

@media (max-width: 600px) {
  .ep-reading { padding: 16px; }
  .ep-chain-diagram { grid-template-columns: 1fr 1fr; }
}

/* ── TAP-TO-REVEAL STEP ROWS (skills exam prep) ──────────────── */
.ep-reveal-block {
  padding: clamp(16px, 2.5vw, 24px);
  background: #f8fafc;
}
.ep-reveal-title {
  font-family: Orbitron, Inter, sans-serif;
  font-size: clamp(15px, 2vw, 19px);
  color: #1e3a5f;
  margin: 0 0 14px;
  line-height: 1.35;
}
.ep-reveal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ep-step-reveal {
  margin: 0 0 10px;
}
.ep-step-reveal button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  background: #ffffff;
  color: #0a1525;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ep-step-reveal button:hover,
.ep-step-reveal button:focus {
  border-color: #1d4ed8;
  outline: none;
  box-shadow: 0 4px 14px rgba(30, 58, 95, 0.12);
}
.ep-step-reveal.revealed button {
  border-color: #10b981;
  background: #ecfdf5;
}
.ep-step-reveal p {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 10px 10px 0;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
  color: #0a1525;
}
.ep-step-reveal p.hidden {
  display: none;
}
