/*
 * ROW Academy lesson page — the lesson head ("Lesson N • <course>", name,
 * duration) above the body. The "Lesson N of M" pill sits in the right column
 * under the share buttons (Batch B's lesson-nav.css); from 991px down the
 * column drops below the quiz, as on live.
 * components/frontend/AcademyCourse.tsx (Lesson).
 *
 * Builds on Batch D's guide-content.css (two columns, contents card and
 * phone bar, share buttons, article text). Ported from live's lesson template
 * stylesheet (.guide-content_intro-*, .guide-content_text-wrap,
 * .hero-slider_elpse, .section_guide-content.is-no-padding); the lesson's
 * Finsweet TOC offset is 10rem (guides: 20rem).
 * Academy-only; scoped under .raven-academy.academy-lesson.
 */

.raven-academy.academy-lesson.section_guide-content.is-no-padding { padding-top: 0; }
/* Live's section rule keeps a 6.5rem bottom on lessons above 991px (Batch D now sets its guide padding by class, so it is restated here for lessons; below, D's narrower steps apply). */
@media screen and (min-width: 992px) {
  .raven-academy.academy-lesson.section_guide-content { padding-bottom: 6.5rem; }
}

.raven-academy.academy-lesson .guide-content_text-wrap {
  display: flex;
  flex-flow: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 42rem;
  margin-bottom: 3rem;
}

.raven-academy.academy-lesson .guide-content_intro-wrap {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.raven-academy.academy-lesson .hero-slider_elpse {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 0.25rem;
  background-color: #000;
}

.raven-academy.academy-lesson .fs-toc_richtext h1,
.raven-academy.academy-lesson .fs-toc_richtext h2,
.raven-academy.academy-lesson .fs-toc_richtext h3,
.raven-academy.academy-lesson .fs-toc_richtext h4,
.raven-academy.academy-lesson .fs-toc_richtext h5,
.raven-academy.academy-lesson .fs-toc_richtext h6 {
  /* Live: fs-toc-offsettop="10rem" on lessons. */
  scroll-margin-top: 10rem;
}

/*
 * A body that starts with a heading: live's Finsweet TOC wraps each section in
 * a div, so the first heading keeps its top margin (QA-E-7, 24px on an H2) inside
 * the rich text's own box;
 * Batch D's base rule zeroes the first child's margin.
 */
.raven-academy.academy-lesson .fs-toc_richtext > h2:first-child { margin-top: 1.5rem; }
/* Webflow's rich text opens with a table-display ::before, so that margin is not collapsed away. */
.raven-academy.academy-lesson .fs-toc_richtext::before { content: ""; display: table; }

/* A Webflow caption left inside a video figure ("Type image c"): live does not show it (QA-E-4). */
.raven-academy.academy-lesson .fs-toc_richtext figure.w-richtext-figure-type-video > figcaption { display: none; }

/*
 * Contents H3 links (QA-E-11), as live's Finsweet TOC: 14px (the 0.75rem indent is
 * Batch D's shared `.is-h3` rule), collapsed under their H2 until that H2's link is
 * current (then each shows as a row). Live nests the H3 wrappers in the H2's; the
 * shared card lists them flat, so the "under the current H2" rule is written with
 * sibling selectors. H3s before the first H2 have no H2 above them and always show
 * (QA-E-5). A collapsed link is also hidden from the keyboard and screen readers
 * (visibility), so Tab never lands on a link nobody can see.
 */
.raven-academy.academy-lesson .fs-toc_link-wrapper.is-h3 > .fs-toc_link,
body:has(.raven-academy.academy-lesson) .raven-academy.academy-guide-tocbar .fs-toc_link-wrapper.is-h3 > .fs-toc_link {
  font-size: 0.875rem;
  letter-spacing: 0.025rem;
}
.raven-academy.academy-lesson .fs-toc_link-wrapper.is-h2 ~ .fs-toc_link-wrapper.is-h3,
body:has(.raven-academy.academy-lesson) .raven-academy.academy-guide-tocbar .fs-toc_link-wrapper.is-h2 ~ .fs-toc_link-wrapper.is-h3 { height: 0; visibility: hidden; }
.raven-academy.academy-lesson .fs-toc_link-wrapper.is-h2:has(> .w--current) ~ .fs-toc_link-wrapper.is-h3,
body:has(.raven-academy.academy-lesson) .raven-academy.academy-guide-tocbar .fs-toc_link-wrapper.is-h2:has(> .w--current) ~ .fs-toc_link-wrapper.is-h3 { height: auto; visibility: visible; }
.raven-academy.academy-lesson .fs-toc_link-wrapper.is-h2:has(> .w--current) ~ .fs-toc_link-wrapper.is-h2 ~ .fs-toc_link-wrapper.is-h3,
body:has(.raven-academy.academy-lesson) .raven-academy.academy-guide-tocbar .fs-toc_link-wrapper.is-h2:has(> .w--current) ~ .fs-toc_link-wrapper.is-h2 ~ .fs-toc_link-wrapper.is-h3 { height: 0; visibility: hidden; }

@media screen and (max-width: 991px) {
  /* The open phone "Contents" list on lessons starts with an 18px spacer and ends with a 12px one (live's
     fs-toc_lmobile-spacer / fs-toc_mobile-spacer-bottom; guides have none). The bar is portalled to <body>. */
  body:has(.raven-academy.academy-lesson) .raven-academy.academy-guide-tocbar .fs-toc_link-content::before { content: ""; display: block; height: 1.125rem; }
  body:has(.raven-academy.academy-lesson) .raven-academy.academy-guide-tocbar .fs-toc_link-content::after { content: ""; display: block; height: 0.75rem; }
}

@media screen and (max-width: 479px) {
  /* Lessons' phone "Contents" bar label is 16px / 28px on live (guides 24px); the bar is portalled to <body> (QA-E-6). */
  body:has(.raven-academy.academy-lesson) .raven-academy.academy-guide-tocbar .guide-content_toc-heading-wrap .heading-style-h5 {
    font-size: 1rem;
    line-height: 1.75rem;
  }
}

