/*
 * The classroom: the course page and the lesson page.
 * No hex values: colours come from tokens.css.
 */

/*
 * This site's typeface, back where MemberPress took it away.
 *
 * MemberPress Courses' own stylesheet sets `body { font-family: -apple-system... }`
 * and loads after the theme, so every classroom page rendered its menu and
 * buttons in the system font while the wordmark beside them stayed in Zilla
 * Slab. Two typefaces with different cap heights sitting side by side in one
 * bar do not read as "different font" -- they read as crooked, which is exactly
 * how it was reported.
 *
 * A class on body beats their bare `body` on specificity, so this wins wherever
 * the stylesheets happen to land in the order.
 */
body.single-mpcs-course,
body.single-mpcs-lesson { font-family: var(--bp-body); }

body.single-mpcs-course h1, body.single-mpcs-course h2, body.single-mpcs-course h3,
body.single-mpcs-lesson h1, body.single-mpcs-lesson h2, body.single-mpcs-lesson h3 {
  font-family: var(--bp-display);
}

/* ── Course page ───────────────────────────────────────────────────────── */

.bp-course { padding: 56px 0 96px; }

.bp-course-head {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  margin: 0 0 28px;
}

.bp-course-cover {
  width: 190px;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--bp-radius);
  border: 1px solid var(--bp-hair);
  flex: none;
}

.bp-course-head-body { flex: 1 1 280px; }

.bp-course-title {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  color: var(--bp-ink);
  margin: 0;
}

.bp-course-meta {
  font-size: 14px;
  color: var(--bp-muted);
  margin: 8px 0 0;
}

.bp-course-progress,
.bp-aside-progress { margin: 16px 0 0; }

/* Shared by both screens, and by the account page's course cards. */
.bp-progress {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: var(--bp-hair);
  overflow: hidden;
}

.bp-progress-bar {
  display: block;
  height: 100%;
  background: var(--bp-gold-deep);
  transition: width 0.3s ease;
}
.bp-progress-bar.is-complete { background: var(--bp-success-fg); }

.bp-progress-text {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  color: var(--bp-muted);
}

.bp-course-continue {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 24px;
  margin: 0 0 40px;
  background: var(--bp-band);
  border: 1px solid var(--bp-hair);
  border-radius: var(--bp-radius);
}

.bp-course-continue-title {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--bp-ink);
}

.bp-course-empty,
.bp-cs-empty {
  font-size: 15px;
  color: var(--bp-muted);
}

/* ── Sections and lesson rows ──────────────────────────────────────────── */

/*
 * bp-cs, not bp-section. The theme already owns .bp-section as a page section,
 * complete with 96px of air above and below, which this box inherited: a
 * curriculum block with two hundred empty pixels inside it and no explanation
 * on the page for where they came from.
 */

.bp-cs {
  border: 1px solid var(--bp-hair);
  border-radius: var(--bp-radius);
  overflow: hidden;
  margin: 0 0 20px;
}

.bp-cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 15px 22px;
  background: var(--bp-band);
  border-bottom: 1px solid var(--bp-hair);
}

.bp-cs-title {
  font-family: var(--bp-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bp-ink);
}

.bp-cs-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bp-muted);
  background: var(--bp-page);
  border: 1px solid var(--bp-hair);
  border-radius: 999px;
  padding: 3px 10px;
}

.bp-cs-empty { margin: 0; padding: 18px 22px; }

.bp-lesson-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bp-lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--bp-hair);
}
.bp-lesson-row:last-child { border-bottom: 0; }

/* An open circle that fills in when the lesson is done. Drawn in CSS so it
   needs no icon font to be understood. */
.bp-lesson-mark {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bp-hair);
  position: relative;
}

.is-done > .bp-lesson-mark,
.is-done > a > .bp-lesson-mark {
  background: var(--bp-success-fg);
  border-color: var(--bp-success-fg);
}

.is-done > .bp-lesson-mark::after,
.is-done > a > .bp-lesson-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--bp-page);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.bp-lesson-number {
  flex: none;
  width: 20px;
  font-size: 13px;
  color: var(--bp-muted);
  text-align: right;
}

.bp-lesson-link {
  flex: 1;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--bp-ink);
  text-decoration: none;
}
.bp-lesson-link:hover { color: var(--bp-gold-deep); }

.bp-lesson-state {
  font-size: 12.5px;
  color: var(--bp-muted);
  white-space: nowrap;
}

.bp-lesson-go {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 15px;
  border: 1px solid var(--bp-hair);
  border-radius: var(--bp-radius-btn);
  color: var(--bp-ink);
  text-decoration: none;
  white-space: nowrap;
}
.bp-lesson-go:hover { border-color: var(--bp-gold-deep); color: var(--bp-gold-deep); }

/* ── Lesson page ───────────────────────────────────────────────────────── */

/*
 * The header spans the window here, instead of sitting in the same centred
 * 1080px column as the rest of the site.
 *
 * On a lesson the content is not in that column: the curriculum takes the left
 * 320px and the lesson fills what is left. The header therefore ended 244px
 * short of the content underneath it -- the logo and the buttons lining up with
 * nothing. The sister site does the same thing on its lesson pages, and for the
 * same reason.
 *
 * Only the lesson page. The course page has no sidebar and does sit in the
 * centred column, where the header already lines up exactly.
 */
body.single-mpcs-lesson .bp-header-inner {
  max-width: none;
  /*
   * Left matches the curriculum's own padding, so the wordmark sits directly
   * above the course name in the column below it. A plain full-width header put
   * it hard against the window edge, lining up with nothing.
   *
   * Right is just the usual gutter. It cannot line up with the lesson: that
   * content is capped and centred in what is left beside the curriculum, so its
   * right edge moves with the window and no fixed padding follows it.
   */
  padding-left: 20px;
  padding-right: var(--bp-gutter);
}

.bp-lesson-layout {
  display: grid;
  /* 320 and 1200 are the sister site's own measurements, read off its lesson
     page rather than picked: a 940 cap squeezed the score into two thirds of
     the room it has there. */
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  min-height: 60vh;
}

.bp-lesson-aside {
  background: var(--bp-dark);
  color: var(--bp-dark-fg);
  align-self: stretch;
  padding: 0 0 30px;
  /* Follows the reader down a long lesson instead of scrolling away. */
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.bp-aside-course {
  display: block;
  text-decoration: none;
  color: inherit;
}

.bp-aside-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.bp-aside-title {
  display: block;
  padding: 16px 20px 0;
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--bp-dark-fg);
}

.bp-aside-progress { padding: 0 20px; margin: 14px 0 0; }
.bp-aside-progress .bp-progress { background: var(--bp-dark-hair); }
.bp-aside-progress .bp-progress-bar { background: var(--bp-gold); }
.bp-aside-progress .bp-progress-text { color: var(--bp-dark-dim); }

.bp-aside-nav { margin: 24px 0 0; }

.bp-aside-section {
  margin: 20px 0 6px;
  padding: 0 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bp-dark-dim);
}

.bp-aside-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bp-aside-lesson a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--bp-dark-dim);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.bp-aside-lesson a:hover { color: var(--bp-dark-fg); }

.bp-aside-lesson .bp-lesson-mark { border-color: var(--bp-dark-hair); }

.bp-aside-lesson.is-current a {
  color: var(--bp-dark-fg);
  font-weight: 600;
  border-left-color: var(--bp-gold);
  background: var(--bp-dark-nav);
}

/*
 * The column fills the space beside the curriculum; what is capped and centred
 * is the content inside it.
 *
 * Capping and centring this element instead looks like the same thing and is
 * not: it is a grid item, and an auto margin on a grid item turns off its
 * stretch, so it shrinks to fit its content. The lesson came out 408px wide
 * with the score squeezed into a third of the page.
 */
.bp-lesson-main { padding: 44px 40px 80px; }

.bp-lesson-heading,
.bp-lesson-content,
.bp-lesson-foot {
  max-width: 1200px;
  margin-inline: auto;
}

.bp-lesson-heading {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
  color: var(--bp-ink);
  margin-bottom: 26px;
}

.bp-lesson-content { font-size: 16.5px; line-height: 1.7; color: var(--bp-ink); }
.bp-lesson-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: var(--bp-radius);
}
.bp-lesson-content p { margin: 0 0 1.2em; }
.bp-lesson-content a { color: var(--bp-gold-deep); }

.bp-lesson-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding: 24px 0 0;
  border-top: 1px solid var(--bp-hair);
}

.bp-complete {
  font-family: var(--bp-body);
  font-size: 14px;
  font-weight: 700;
  padding: 11px 20px;
  border: 1px solid var(--bp-hair);
  border-radius: var(--bp-radius-btn);
  background: var(--bp-page);
  color: var(--bp-ink);
  cursor: pointer;
}
.bp-complete:hover { border-color: var(--bp-gold-deep); color: var(--bp-gold-deep); }

.bp-complete.is-done,
.bp-complete:disabled {
  background: var(--bp-success-bg);
  border-color: var(--bp-success-border);
  color: var(--bp-success-fg);
  cursor: default;
}
.bp-complete.is-busy { opacity: 0.6; }

.bp-lesson-move {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  margin-left: auto;
}

.bp-lesson-prev {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--bp-muted);
  text-decoration: none;
}
.bp-lesson-prev:hover { color: var(--bp-ink); }

/* ── Below 900px ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  /* The curriculum stops being a column and becomes a block above the lesson.
     A 300px sidebar on a phone leaves nothing for the lesson itself. */
  .bp-lesson-layout { grid-template-columns: minmax(0, 1fr); }

  .bp-lesson-aside {
    position: static;
    max-height: none;
  }

  .bp-aside-cover { max-height: 200px; }

  .bp-lesson-main { padding: 32px var(--bp-gutter) 64px; }

  .bp-course-cover { width: 130px; }
  .bp-course-title { font-size: 26px; }

  .bp-lesson-row { flex-wrap: wrap; }
  .bp-lesson-state { display: none; }
}
