/* RiskStock Academy — lesson video block (lesson-video.js).
   Loaded only on lessons that have a video. Colours come from the theme
   variables in styles.css, so dark/light both work. */

.lesson-video {
  margin: 30px 0 10px;
}

.lv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.lv-eyebrow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.lv-eyebrow span { color: var(--text-muted); letter-spacing: 0.06em; }

.lv-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f0f0d;
  border: 1px solid var(--slate);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lv-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f0f0d;
}

.lv-hint {
  margin: 10px 2px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lv-hint strong { color: var(--text-secondary); }

/* "Part of: …" line on lessons that share one video with a neighbour. */
.lv-partof {
  margin: 10px 2px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lv-partof strong { color: var(--text-secondary); }

.lv-partof button {
  padding: 0;
  font: inherit;
  color: var(--green);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---------- chapters ---------- */

.lv-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.lv-chapters button {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--navy-light);
  border: 1px solid var(--slate);
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.lv-chapters button b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.lv-chapters button:hover { border-color: var(--green); color: var(--text-primary); }
.lv-chapters button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.lv-chapters button.is-active {
  border-color: var(--green);
  background: var(--green-glow);
  color: var(--text-primary);
}

.lv-chapters button.is-active b { color: var(--green); }

/* ---------- notes panel ---------- */

.lv-notes {
  display: flex;
  flex-direction: column;
  padding: 20px 20px 16px;
  background: var(--navy-light);
  border: 1px solid var(--slate);
  border-radius: var(--radius);
}

.lv-notes h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.lv-notes-intro {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.lv-notes label {
  display: block;
  margin: 12px 0 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.lv-notes label:first-of-type { margin-top: 0; }

.lv-notes textarea {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  resize: vertical;
}

/* One free-form pad: ruled lines, grows to roughly the video's height. */
.lv-notes textarea.lv-notepad {
  flex: 1;
  min-height: 260px;
  padding: 4px 12px;
  font-size: 0.92rem;
  line-height: 28px;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 27px, var(--slate) 27px, var(--slate) 28px);
  background-attachment: local;
  background-position: 0 4px;
}

.lv-notes textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.lv-notes-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--slate);
}

.lv-notes-status {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.lv-notes-foot button {
  padding: 7px 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 999px;
  cursor: pointer;
}

.lv-notes-foot button:hover { background: var(--green-glow); }

/* ---------- takeaways + "Go deeper" ---------- */

.lesson-takeaways {
  margin: 26px 0 8px;
  padding: 22px 24px;
  background: var(--green-glow);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
}

.lesson-takeaways h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.lesson-takeaways ul {
  margin: 0;
  padding-left: 20px;
}

.lesson-takeaways li {
  margin: 6px 0;
  line-height: 1.55;
  color: var(--text-secondary);
}

.lesson-takeaways li strong { color: var(--text-primary); }

.lesson-deeper-head {
  margin: 40px 0 6px;
  font-size: 1.5rem;
}

.lesson-deeper-sub {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Desktop: the block breaks out of the 780px reading column so the notes
   can sit beside the video instead of below it. */
@media (min-width: 1140px) {
  .lesson-video {
    width: 1080px;
    margin-left: calc(50% - 540px);
  }
  .lv-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: stretch; }
  .lv-main { align-self: start; }
}

/* Master Your Money and How to Price a Stock lessons keep their own sticky
   "My notes" sidebar, so the video stays inside the reading column instead
   of breaking out. */
.mym-main .lesson-video,
.pas-main .lesson-video {
  width: auto;
  margin: 22px 0 8px;
}

.lv-hint a { color: var(--green); }

@media (max-width: 640px) {
  .lv-chapters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .lv-chapters button { flex: 0 0 auto; }
  .lesson-takeaways { padding: 18px 18px; }
  /* lesson titles carry an inline 2.4rem; scale them down on phones */
  .article-page h1 { font-size: 1.85rem !important; line-height: 1.15; }
}

/* ---------- Print my notes ---------- */

.lv-print-sheet { display: none; }

@media print {
  html.lv-printing body > * { display: none !important; }
  html.lv-printing body > .lv-print-sheet {
    display: block !important;
    color: #000;
    font: 12pt/1.5 Georgia, serif;
  }
  .lv-print-sheet h1 { font-size: 18pt; margin: 0 0 18pt; }
  .lv-print-sheet h2 { font-size: 12pt; margin: 16pt 0 4pt; }
  .lv-print-sheet p { margin: 0; min-height: 48pt; border-bottom: 1px solid #bbb; white-space: pre-wrap; }
  .lv-print-sheet .lv-print-foot { min-height: 0; border: 0; margin-top: 24pt; font-size: 9pt; color: #555; }
}
