/* The course/lesson loop — courses, lessons and their modules, quizzes and reflections.
   Everything these pages share with the rest of the app is already on the redesign: the
   `.page-frame` gutter (main owns 16, the frame tops up to the design's 20), `.page-title`
   and `.page-heading`, the `.btn-*` pills, `.empty-state`, `.flash` and the global field.
   This file is only what those blocks cannot reach — the ink and hairline rows that
   replace the white cards, the ochre progress line, and the reading type of a lesson.
   Values are the design's atoms in `redesign.css`; no per-page figures. */

/* These pages are not `.rd`-rooted (they predate the redesign and are rendered inside the
   app's own frame), so the atoms whose font comes from the `.rd` root would inherit the
   app's Encode Sans. Set the design's sans for them once, here. */
.rd-courseloop .rd-label,
.rd-courseloop .rd-link,
.rd-courseloop .btn-icon {
  font-family: var(--rd-sans);
}
/* `.btn-icon` is the reflection screen's "What is a reflection" (its only caller); the
   design's quiet link is the accent, not the old teal. */
.rd-courseloop .btn-icon {
  color: var(--rd-accent);
}

/* ---------- type ----------
   A content headline (module title, next lesson, reflection question) and the reading
   voice. `padding-block` zeroes the `py-3` the base layer puts on an `h1`. */
.rd-courseloop__title {
  padding-block: 0;
  font-family: var(--rd-serif);
  font-weight: 500;
  font-size: 23px;
  line-height: 1.15;
  color: var(--rd-ink);
  text-wrap: balance;
}

/* The course's own head: title and the lessons/time label under the photograph. */
.rd-courseloop__head {
  margin-top: var(--rd-space-m);
}
.rd-courseloop__head .rd-label {
  margin-top: var(--rd-space-2xs);
}

.rd-courseloop__copy {
  font-family: var(--rd-serif);
  font-size: 17.5px;
  line-height: 1.3;
  color: var(--rd-ink-reading);
  text-wrap: pretty;
}

/* Cormorant draws its default figures old-style, where a 1 reads as a small capital I —
   "1. Eros and OM" and a lesson's "1" look like roman numerals. The serif headings and
   numbers in this loop use lining figures (the walkthrough's counters do the same). */
.rd-courseloop__title,
.rd-courseloop__row-num,
.rd-courseloop__tile-name,
.rd-courseloop__question {
  font-variant-numeric: lining-nums;
}

/* A course's section header ("WELCOME"): the design's letterspaced serif, on the page
   field rather than in the old white plate. */
.rd-courseloop__section {
  margin-top: var(--rd-space-l);
  padding-bottom: var(--rd-space-2xs);
  font-family: var(--rd-serif);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rd-ink);
}
.rd-courseloop__section:first-child {
  margin-top: 0;
}

/* ---------- lists ----------
   Hairline rows in place of white cards, as the FAQ, Badges and profile-course lists do.
   A row is a `button_to`, so the hairline belongs between the forms, not on each button. */
.rd-courseloop__rows {
  margin-top: var(--rd-space-s);
}
.rd-courseloop__rows > * + * .rd-courseloop__row {
  border-top: 1px solid rgba(51, 45, 43, 0.16);
}
.rd-courseloop__row {
  border-radius: 0;
  color: inherit;
  text-decoration: none;
}
.rd-courseloop__row:disabled {
  cursor: auto;
}
.rd-courseloop__row-num {
  font-family: var(--rd-serif);
  font-weight: 400;
  font-size: 27px;
  line-height: 1;
  color: var(--rd-accent);
}
.rd-courseloop__row-title {
  font-family: var(--rd-serif);
  font-weight: 500;
  font-size: 19.5px;
  line-height: 1.1;
  color: var(--rd-ink);
  text-wrap: balance;
}
.rd-courseloop__row-meta {
  font-family: var(--rd-sans);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.35;
  color: var(--rd-ink-muted);
}
.rd-courseloop__row-icon {
  color: var(--rd-ink-muted);
}
.rd-courseloop__row--locked .rd-courseloop__row-num,
.rd-courseloop__row--locked .rd-courseloop__row-title {
  color: var(--rd-ink-muted);
}
/* the module count inside a started lesson, and the completed check: the old teal */
.rd-courseloop__ring {
  color: var(--rd-accent);
}
.rd-courseloop__check {
  background: var(--rd-ochre);
  color: var(--rd-bone);
}

/* courses#index: the photograph, then the course's name in serif (screen 14's grid) */
.rd-courseloop__list {
  display: grid;
  gap: var(--rd-space-xl);
}
.rd-courseloop__tile {
  display: block;
  color: inherit;
  text-decoration: none;
}
.rd-courseloop__tile:focus-visible {
  outline: 2px solid var(--rd-accent);
  outline-offset: 4px;
}
.rd-courseloop__tile :where(img) {
  border-radius: 2px;
}
.rd-courseloop__tile-name {
  display: block;
  margin-top: var(--rd-space-s);
  font-family: var(--rd-serif);
  font-weight: 500;
  font-size: 23px;
  line-height: 1.1;
  text-wrap: balance;
}

/* ---------- progress ----------
   The design's shape (.rd-profile__course-line): one hairline, filled in ochre. The width
   is the app's own percentage, written inline exactly as the profile row writes it. */
.rd-courseloop__progress {
  display: block;
  height: 1px;
  background: rgba(51, 45, 43, 0.16);
}
.rd-courseloop__progress > span {
  display: block;
  height: 1px;
  background: var(--rd-accent);
}
.rd-courseloop__progress--short {
  width: 62%;
  margin-inline: auto;
}

/* ---------- completion ----------
   The mark is a stamp in the palette (the old disc was teal, which the design has nowhere). */
.rd-courseloop__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--rd-ochre);
  color: var(--rd-bone);
}

/* ---------- quiz ----------
   The answer plate is `.question-option`, shared with the eudaimonia questions (another
   lane), so the loop's treatment is scoped to this root — a hairline box on the page
   field, ink when chosen. */
.rd-courseloop .question-option {
  border: 1px solid var(--rd-hairline);
  border-radius: 2px;
  background: transparent;
  color: var(--rd-ink);
  font-family: var(--rd-sans);
  font-size: 16.5px;
  font-weight: 300;
  line-height: 1.35;
}
.rd-courseloop .question-option:has([type='radio']:checked) {
  border-color: var(--rd-ink);
  background: var(--rd-ink);
  color: var(--rd-bone);
}
/* the native control keeps the design's accent rather than the old teal. The shared rule is
   `#frontend .question-option [type='radio']:checked` — id + attribute — so this has to match
   that specificity, as the base refresh's field rules do. */
#frontend .rd-courseloop .question-option [type='radio']:checked,
#frontend .rd-courseloop .question-option [type='radio']:checked:hover,
#frontend .rd-courseloop .question-option [type='radio']:checked:focus {
  border-color: var(--rd-accent);
  background-color: var(--rd-accent);
}
.rd-courseloop__error {
  color: var(--rd-rust);
}
/* the wrong-answer screen keeps the old panel's shape (it is the page's only plate), in
   the design's surface: a hairline box on the page field, no white card, no radius */
.rd-courseloop__failed {
  padding: var(--rd-space-l);
  border: 1px solid var(--rd-hairline);
  border-radius: 2px;
}

/* ---------- reflections ----------
   The list is rendered straight into the layout (no page component), so it brings its own
   frame: the same 20px gutter, and the design's rows. */
.rd-courseloop__reflection,
.rd-courseloop__reflection:last-child {
  padding: var(--rd-space-l) 0;
  border-top: 1px solid rgba(51, 45, 43, 0.16);
}
.rd-courseloop__reflection:first-child {
  padding-top: var(--rd-space-s);
  border-top: 0;
}
.rd-courseloop__course {
  display: block;
  margin-top: var(--rd-space-2xs);
}
.rd-courseloop__question {
  margin-top: var(--rd-space-s);
  font-family: var(--rd-serif);
  font-style: italic;
  font-size: 19.5px;
  line-height: 1.22;
  color: var(--rd-ink);
  text-wrap: pretty;
}
.rd-courseloop__answer {
  margin-top: var(--rd-space-xs);
}
