/**
 * Learnomy — Single course stylesheet.
 *
 * Page-specific styles for /courses/{slug}/ (single-course.php).
 * Loaded only on that route via Template_Loader::enqueue_assets() so the
 * catalog, dashboards, blocks, and other surfaces don't pay for the
 * sidebar-card + curriculum CSS.
 *
 * Shared primitives consumed but not owned here:
 *   .lrn-course-card*, .lrn-wishlist-btn*, .lrn-empty-state*,
 *   .lrn-load-more, .lrn-grid, .lrn-breadcrumb, .lrn-hero*, .lrn-btn,
 *   .lrn-badge*, .lrn-card
 * Those live in learnomy.css because dashboards, catalog, instructor
 * profiles, and blocks all render them too.
 *
 * Responsive contract: exactly two @media queries at the bottom of the
 * file — 1024px (tablet ↔ desktop) and 640px (mobile). No intermediate
 * breakpoints. The previous mix of 480px / 767px / 768px stops folded
 * into the canonical pair.
 *
 * @package Learnomy
 */

/* ==========================================================================
   Course intro video — prominent trailer at top of main column for
   classic/focused/split layouts. Hero layout renders its own trailer
   inside the hero band, so body.php skips this block when active.
   ========================================================================== */

.lrn-course-intro-video {
	margin-block-end: var(--lrn-sp-6);
}

.lrn-course-intro-video__frame {
	aspect-ratio:    16 / 9;
	overflow:        hidden;
	border-radius:   var(--lrn-radius-lg);
	background:      var(--lrn-bg-tertiary);
	box-shadow:      var(--lrn-shadow-md);
}

.lrn-course-intro-video__frame iframe,
.lrn-course-intro-video__frame video {
	width:      100%;
	height:     100%;
	border:     0;
	display:    block;
	object-fit: cover;
}

/* ==========================================================================
   Sidebar card — purchase / enroll / membership panel
   ========================================================================== */

/*
 * The card's children own their own insets, so the card itself carries none.
 *
 * It is a .lrn-card, and .lrn-card pads itself by sp-6 - correct for a plain
 * content card, wrong for this one. Every child here already pays for its own
 * spacing: the preview is a media band meant to bleed to the edge, and each
 * body pads itself by sp-5. Inheriting the card padding on top of that inset
 * the image from the border and doubled the spacing at every body edge, so an
 * integration action rendered in the footer slot sat 40px below the enrol CTAs
 * with nothing in between.
 *
 * Zeroing it here fixes both at the cause. `overflow: hidden` is what going
 * flush requires - without it the preview's square corners overhang the card's
 * radius.
 */
.lrn-sidebar-card {
	padding:  0;
	overflow: hidden;
}

.lrn-sidebar-card__preview {
	aspect-ratio: 16 / 9;
	overflow:     hidden;
	background:   var(--lrn-bg-tertiary);
}

.lrn-sidebar-card__preview img,
.lrn-sidebar-card__preview iframe,
.lrn-sidebar-card__preview video {
	width:      100%;
	height:     100%;
	object-fit: cover;
	display:    block;
	border:     0;
}

.lrn-sidebar-card__body {
	padding: var(--lrn-sp-5);
}

/*
 * Stacked bodies must not stack their padding.
 *
 * The integration footer slot renders in a card body of its OWN, so an action
 * added there met the first body's bottom padding AND its own top padding -
 * two gaps where the design has one. Collapsing the shared edge holds for any
 * future slot rendered the same way, not just the one that exposed it.
 */
.lrn-sidebar-card__body + .lrn-sidebar-card__body {
	padding-block-start: 0;
}

.lrn-sidebar-card__price {
	display:       flex;
	align-items:   center;
	gap:           var(--lrn-sp-2);
	margin-bottom: var(--lrn-sp-4);
}

.lrn-sidebar-card__price-current {
	font-size:   var(--lrn-text-2xl);
	font-weight: var(--lrn-weight-semibold);
	color:       var(--lrn-text);
}

/* Recurring interval suffix ("/mo", "/yr") — smaller + muted next to the price. */
.lrn-sidebar-card__price-interval {
	font-size:   var(--lrn-text-base);
	font-weight: var(--lrn-weight-normal);
	color:       var(--lrn-text-secondary);
}

.lrn-sidebar-card__price-original {
	font-size:       var(--lrn-text-md);
	color:           var(--lrn-text-tertiary);
	text-decoration: line-through;
}

.lrn-sidebar-card__sale-timer {
	font-size: var(--lrn-text-sm);
	color:     var(--lrn-danger-fg, var(--lrn-danger));
	margin:    0 0 var(--lrn-sp-4);
}

/* Icon + sentence notes in the sidebar card.
 *
 * Both of these shipped with markup and no CSS, so the icon sat inline in a
 * <p> on the text baseline and the second line of a wrapping sentence ran back
 * underneath it — the note read as a hanging indent nobody asked for.
 *
 * `flex-start`, not the `center` the includes-list uses: that list holds
 * single-line items where centring is invisible, while these are sentences
 * that WILL wrap at a narrow sidebar or a longer translation. Centring a
 * badge against a two-line block floats it into the gap between the lines.
 * The icon belongs beside the first line, so it is nudged down by half the
 * difference between the line box and the icon to sit on that line's optical
 * centre rather than its top edge.
 */
.lrn-sidebar-card__owner-note,
.lrn-sidebar-card__external-note {
	display:     flex;
	align-items: flex-start;
	gap:         var(--lrn-sp-2);
	margin:      0 0 var(--lrn-sp-4);
	font-size:   var(--lrn-text-sm);
	line-height: var(--lrn-leading-normal);
	color:       var(--lrn-text-secondary);
}

.lrn-sidebar-card__owner-note svg,
/* "Your instructor marks this course complete": a quiet note under the
   button, not body text pressed against it. */
.lrn-sidebar-card__waiting-note {
	margin:      var(--lrn-sp-3) 0 0;
	font-size:   var(--lrn-text-sm);
	line-height: var(--lrn-leading-normal);
	color:       var(--lrn-text-secondary);
}

/* Buy to keep (owner decision 5): what gives them the course now, then a quiet
   link to own it. Never a second primary button under "Continue learning". */
.lrn-sidebar-card__keep {
	margin-block:  var(--lrn-sp-3) 0;
	font-size:     var(--lrn-text-sm);
	line-height:   var(--lrn-leading-normal);
	color:         var(--lrn-text-secondary);
	text-align:    center;
}

.lrn-sidebar-card__keep-link {
	display:          flex;
	align-items:      center;
	justify-content:  center;
	min-block-size:   44px;
	color:            var(--lrn-accent-text, var(--lrn-accent));
	font-weight:      var(--lrn-weight-medium, 500);
	text-decoration:  underline;
	text-underline-offset: 2px;
}

.lrn-sidebar-card__keep-link:hover {
	color: var(--lrn-accent-hover, var(--lrn-accent));
}

.lrn-sidebar-card__keep-link:focus-visible {
	outline:        2px solid var(--lrn-accent);
	outline-offset: 2px;
	border-radius:  var(--lrn-radius-sm);
}

.lrn-sidebar-card__external-note svg {
	width:       16px;
	height:      16px;
	flex-shrink: 0;
	margin-top:  0.125em;
	color:       var(--lrn-text-secondary);
}

.lrn-sidebar-card__includes {
	margin-top:  var(--lrn-sp-5);
	padding-top: var(--lrn-sp-5);
	border-top:  1px solid var(--lrn-divider);
}

.lrn-sidebar-card__includes-title {
	font-size:   var(--lrn-text-sm);
	font-weight: var(--lrn-weight-semibold);
	margin:      0 0 var(--lrn-sp-3);
}

.lrn-sidebar-card__includes-list {
	list-style: none;
	margin:     0;
	padding:    0;
}

.lrn-sidebar-card__includes-list li {
	display:        flex;
	align-items:    center;
	gap:            var(--lrn-sp-2);
	padding-bottom: var(--lrn-sp-2);
	font-size:      var(--lrn-text-sm);
	color:          var(--lrn-text-secondary);
}

/* Icons here are descriptive bullets ("8 lessons", "Certificate", "Lifetime
   access"), not actions. Tinting them with `--lrn-accent` (the same red as
   the primary Buy Now CTA right above) created a stack of five red bullets
   competing with the single primary action — five small CTAs in disguise.
   Using `--lrn-text-secondary` keeps them legible while letting the Buy Now
   button stay the only accent-colored element in the card. */
.lrn-sidebar-card__includes-list svg {
	width:       14px;
	height:      14px;
	color:       var(--lrn-text-secondary);
	flex-shrink: 0;
}

/* ==========================================================================
   Sidebar card — membership CTA, guarantee, feedback messages
   (coupon styles removed with the course-page coupon field, Basecamp 10229900813)
   ========================================================================== */

.lrn-sidebar-card__membership-cta {
	margin-top:  var(--lrn-sp-4);
	padding-top: var(--lrn-sp-4);
	border-top:  1px solid var(--lrn-divider);
	text-align:  center;
}

.lrn-sidebar-card__membership-text {
	font-size: var(--lrn-text-sm);
	color:     var(--lrn-text-secondary);
	margin:    0 0 var(--lrn-sp-3);
}

.lrn-sidebar-card__guarantee {
	display:     flex;
	align-items: center;
	gap:         var(--lrn-sp-2);
	font-size:   var(--lrn-text-sm);
	color:       var(--lrn-text-secondary);
	margin-top:  var(--lrn-sp-4);
}

.lrn-sidebar-card__guarantee svg {
	width:  16px;
	height: 16px;
}

/* ==========================================================================
   Single-course main column — section rhythm, layout, title, meta, progress
   ========================================================================== */

.lrn-single-course__section {
	margin-bottom: var(--lrn-sp-10);
}

/* The section's own heading only: a descendant selector also shrank the H2s an
   author writes in the description below their H3s (support card 10541770528). */
.lrn-single-course__section > h2 {
	font-size:   var(--lrn-text-lg);
	font-weight: var(--lrn-weight-semibold);
	margin:      0 0 var(--lrn-sp-5);
}

.lrn-single-course__progress {
	margin-bottom: var(--lrn-sp-6);
}

.lrn-single-course__progress-header {
	display:         flex;
	justify-content: space-between;
	margin-bottom:   var(--lrn-sp-2);
	font-size:       var(--lrn-text-sm);
}

.lrn-single-course__layout {
	display:               grid;
	grid-template-columns: 1fr 340px;
	gap:                   var(--lrn-sp-8);
	align-items:           start;
}

.lrn-single-course__title {
	font-size:   var(--lrn-text-2xl);
	font-weight: var(--lrn-weight-semibold);
	margin:      0 0 var(--lrn-sp-3);
}

.lrn-single-course__curriculum {
	margin-bottom: var(--lrn-sp-8);
}

.lrn-single-course__sidebar {
	position: sticky;
	/* Clear a theme's sticky/pinned header so the card doesn't slide up UNDER it
	   on scroll (Basecamp #9972595954 — Reign pins a 90px header at top:0).
	   sticky-offset.js measures the active sticky header and sets
	   --lrn-sticky-header-offset; it defaults to 0 on themes without one, so the
	   card keeps its plain sp-8 gap there (no regression). */
	top:      calc(var(--lrn-sticky-header-offset, 0px) + var(--lrn-sp-8));
}

/* In-page nav targets (About, Curriculum, Instructor, Reviews, Your review):
   a jump aligns the heading to the viewport top, which is where a theme's
   pinned header sits, so the heading landed hidden behind it
   (Basecamp 10331562152). Clear the same measured offset the sticky surfaces
   use, plus a small gap. */
.lrn-single-course h2[id] {
	scroll-margin-top: calc(var(--lrn-sticky-header-offset, 0px) + var(--lrn-sp-4));
}

/* Classic's sales view: title head and enroll card start on one line, and the
   light band runs edge to edge. A shadow paints the band past the column, so
   nothing can scroll sideways, and clip-path keeps it from spilling down. */
.lrn-single-course.lrn-single-course--head {
	padding-block-start: 0;
}

.lrn-single-course--head .lrn-single-course__layout {
	grid-template-columns: minmax(0, 1fr) 340px;
	column-gap:            var(--lrn-sp-10);
	row-gap:               0;
}

.lrn-single-course__head {
	grid-column: 1;
	grid-row:    1;
	position:    relative;
	background:  var(--lrn-bg-elevated);
	box-shadow:  0 0 0 100vmax var(--lrn-bg-elevated);
	clip-path:   inset(0 -100vmax);
}

.lrn-single-course__head .lrn-hero__inner {
	max-width:      none;
	padding-inline: 0;
	padding-block:  var(--lrn-sp-8);
}

.lrn-single-course--head .lrn-single-course__main {
	grid-column:   1;
	grid-row:      2;
	padding-block: var(--lrn-sp-8) var(--lrn-sp-12);
}

.lrn-single-course--head .lrn-single-course__sidebar {
	grid-column:        2;
	grid-row:           1 / 3;
	z-index:            1;
	/* A margin, so a theme's sticky header offset can't add to it. Lines the card
	   up with the trail on any theme, with or without a pinned header. */
	margin-block-start: var(--lrn-sp-8);
}

.lrn-single-course--head .lrn-sidebar-card,
.lrn-course-hero__cta {
	box-shadow: 0 10px 28px rgba(11, 24, 41, 0.12);
}

/* Classic's title sizes with the page, and the card's top lines up with the trail. */
.lrn-single-course__head .lrn-hero__title {
	max-width:   none;
	font-size:   clamp(26px, 3.5vw, 40px);
	font-weight: var(--lrn-weight-bold);
	line-height: 1.15;
	text-wrap:   balance;
}

.lrn-single-course--head .lrn-single-course__sidebar > :first-child {
	margin-block-start: 0;
}

.lrn-sidebar-card__login-alt {
	margin-block-start: var(--lrn-sp-3);
}

.lrn-hero-action__plans,
.lrn-sidebar-card__included {
	justify-self: start;
}

/* Anyone with the course: one band with where they stand and the next step. */
.lrn-single-course.lrn-single-course--owned {
	padding-block-start: 0;
}

.lrn-course-owned {
	display:         flex;
	align-items:     center;
	justify-content: space-between;
	gap:             var(--lrn-sp-6);
	margin-block-end: var(--lrn-sp-8);
	padding-block:   var(--lrn-sp-6);
	background:      var(--lrn-bg-elevated);
	box-shadow:      0 0 0 100vmax var(--lrn-bg-elevated), 0 1px 0 100vmax var(--lrn-border);
	clip-path:       inset(0 -100vmax -1px);
}

.lrn-course-owned__text {
	display:   grid;
	gap:       var(--lrn-sp-2);
	min-width: 0;
	flex:      1 1 auto;
}

.lrn-course-owned .lrn-single-course__title {
	margin:      0;
	font-size:   clamp(22px, 2.4vw, 28px);
	font-weight: var(--lrn-weight-bold);
}

.lrn-course-owned .lrn-single-course__progress {
	max-width: 420px;
	margin:    0;
	padding:   0;
	border:    0;
	background: none;
}

.lrn-course-owned .lrn-single-course__next {
	margin: 0 0 var(--lrn-sp-2);
}

.lrn-course-owned__action {
	flex: none;
}

.lrn-course-owned__state {
	background: var(--lrn-accent-bg);
	color:      var(--lrn-accent-text, var(--lrn-accent));
}

/* The main action is on the band, so the card only stays for what's left in it. */
.lrn-single-course--owned .lrn-sidebar-card:not(:has(.lrn-sidebar-card__body :is(a, button:not([hidden]), p:not([hidden])))) {
	display: none;
}

.lrn-single-course--owned .lrn-single-course__layout:not(:has(.lrn-single-course__sidebar :is(a, button:not([hidden]), p:not([hidden])))) {
	grid-template-columns: minmax(0, 1fr);
}

.lrn-course-owned__action {
	display: grid;
	gap:     var(--lrn-sp-2);
}

.lrn-course-owned .lrn-sidebar-card__waiting-note,
.lrn-course-owned .lrn-sidebar-card__keep {
	margin:     0;
	font-size:  var(--lrn-text-sm);
	/* On the band these sit under the progress line, so they line up with it. */
	text-align: start;
}

.lrn-course-owned .lrn-sidebar-card__keep-link {
	justify-content: flex-start;
}

.lrn-sidebar-card__included,
.lrn-course-owned__state,
.lrn-hero-action .lrn-badge {
	border-radius: var(--lrn-radius-full);
}

.lrn-sidebar-card__included {
	background: var(--lrn-accent-bg);
	color:      var(--lrn-accent-text, var(--lrn-accent));
}

.lrn-course-owned__action .lrn-sidebar-card__leave {
	justify-self: center;
}

/* Additions placed inside a course column follow its edges. */
.lrn-single-course__main > .lrn-container {
	max-width:      none;
	margin-inline:  0;
	padding-inline: 0;
}

/* The includes list on its own card, under a price and button that sit above it. */
.lrn-course-includes-card .lrn-sidebar-card__includes {
	margin:     0;
	padding:    var(--lrn-sp-5);
	border:     0;
}

/* Inside the enroll card the list follows the price and needs no heading. */
.lrn-single-course__sidebar .lrn-sidebar-card__includes-title,
.lrn-course-hero__cta .lrn-sidebar-card__includes-title {
	display: none;
}

/* The "Already have an account? Log in" line sits under the full-width sign-up
   button; centre it so it reads as balanced beneath the button (BC #9972620106). */
.lrn-sidebar-card__login-alt {
	font-size:  var(--lrn-text-sm);
	text-align: center;
}

/* Comments + Q&A sit inside __main and share the section rhythm. The card
   border/padding comes from the companion .lrn-card class; this just adds
   the bottom spacing. */
.lrn-single-course__comments {
	margin-bottom: var(--lrn-sp-10);
	padding:       var(--lrn-sp-6);
}

.lrn-single-course__qa {
	margin-bottom: var(--lrn-sp-10);
}

/* ==========================================================================
   Curriculum — accordion of sections, each holding a list of lessons,
   topics, and quizzes. Renders both in the sales view (locked) and the
   learning view (with completion checkmarks).
   ========================================================================== */

.lrn-curriculum {
	margin-bottom: var(--lrn-sp-6);
}

.lrn-curriculum__section {
	border:        1px solid var(--lrn-border);
	border-radius: var(--lrn-radius-lg);
	margin-bottom: var(--lrn-sp-3);
	overflow:      hidden;
}

.lrn-curriculum__section[open] {
	border-color: var(--lrn-border-heavy);
}

.lrn-curriculum__section-title {
	display:         flex;
	align-items:     center;
	justify-content: space-between;
	gap:             var(--lrn-sp-3);
	padding:         var(--lrn-sp-4);
	font-weight:     var(--lrn-weight-semibold);
	font-size:       var(--lrn-text-base);
	cursor:          pointer;
	background:      var(--lrn-bg-secondary);
	list-style:      none;
}

.lrn-curriculum__section-title::-webkit-details-marker {
	display: none;
}

/* The section name takes the width the count leaves and wraps itself. */
.lrn-curriculum__section-title > :first-child {
	min-width:     0;
	overflow-wrap: break-word;
}

/* "4 lessons" / "2/4" is one fact and stays on one line, at any width. */
.lrn-curriculum__section-count {
	flex-shrink: 0;
	white-space: nowrap;
	font-size:   var(--lrn-text-sm);
	font-weight: var(--lrn-weight-normal);
	color:       var(--lrn-text-tertiary);
}

.lrn-curriculum__lessons {
	list-style: none;
	margin:     0;
	padding:    0;
}

.lrn-curriculum__lesson {
	border-top: 1px solid var(--lrn-divider);
}

.lrn-curriculum__lesson-row {
	display:     flex;
	align-items: center;
	gap:         var(--lrn-sp-2);
	padding:     var(--lrn-sp-3) var(--lrn-sp-4);
}

.lrn-curriculum__lesson-row a {
	color:           var(--lrn-text);
	text-decoration: none;
	flex:            1;
}

/* Only the LINK used to take the free space, so a locked or unlinkable row
   bunched its meta against the title while its unlocked neighbours pushed the
   same meta to the row end. Barely visible with one type label; an obvious
   ragged column once every row carries a duration. The title takes the space
   whichever element it happens to be. */
.lrn-curriculum__lesson-row > .lrn-curriculum__title,
.lrn-curriculum__lesson-row > .lrn-curriculum__title--locked {
	flex: 1;
}

.lrn-curriculum__lesson-row a:hover {
	color: var(--lrn-accent-text, var(--lrn-accent));
}

.lrn-curriculum__lesson--done .lrn-curriculum__lesson-row a {
	color: var(--lrn-text-secondary);
}

.lrn-curriculum__icon {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	color:           var(--lrn-accent-text, var(--lrn-accent));
	flex-shrink:     0;
	width:           20px;
}

.lrn-curriculum__check {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	font-size:       var(--lrn-text-sm);
	color:           var(--lrn-success-fg, var(--lrn-success));
	flex-shrink:     0;
	width:           20px;
}

/* Lucide icons default to 24px and would overflow the icon column, crowding
   the title and swallowing the row gap. Constrain every curriculum glyph to a
   consistent size so the gap before the title reads correctly. */
.lrn-curriculum__icon svg,
.lrn-curriculum__quiz-icon svg,
.lrn-curriculum__section-label svg {
	width:  18px;
	height: 18px;
}

.lrn-curriculum__type-label {
	font-size: var(--lrn-text-xs);
	color:     var(--lrn-text-tertiary);
}

/* Runtime for one row. Sits last on the line, in the same quiet register as the
   type label — it is a fact about the lesson, not a call to action, and a column
   of these should be scannable without pulling the eye off the titles.
   tabular-nums keeps the digits on a grid so "9 min" and "12 min" line up.
   The title above takes flex:1, so this is pushed to the end of the row on its
   own; `white-space: nowrap` stops "1h 05m" breaking across the space. */
.lrn-curriculum__duration {
	font-size:             var(--lrn-text-xs);
	color:                 var(--lrn-text-tertiary);
	font-variant-numeric:  tabular-nums;
	white-space:           nowrap;
	flex-shrink:           0;
}

.lrn-curriculum__topics {
	list-style:          none;
	margin:              0;
	padding-block:       0;
	padding-inline-start: var(--lrn-sp-10);
	padding-inline-end:  0;
}

.lrn-curriculum__topic {
	display:     flex;
	align-items: center;
	gap:         var(--lrn-sp-2);
	padding:     var(--lrn-sp-2) var(--lrn-sp-4);
	font-size:   var(--lrn-text-sm);
}

.lrn-curriculum__topic-icon {
	color:       var(--lrn-text-tertiary);
	flex-shrink: 0;
}

.lrn-curriculum__topic a {
	color:           var(--lrn-text-secondary);
	text-decoration: none;
}

.lrn-curriculum__topic a:hover {
	color: var(--lrn-accent-text, var(--lrn-accent));
}

/* Quiz rows are list items in a bare list wherever they appear — under a lesson,
   at the end of a section, or in the final-assessment block. The list markers
   are suppressed here rather than per-list so a new placement cannot ship with
   stray bullets. */
.lrn-curriculum__lesson-quizzes,
.lrn-curriculum__section-quizzes {
	list-style: none;
	margin:     0;
	padding:    0;
}

.lrn-curriculum__quiz {
	display:     flex;
	align-items: center;
	gap:         var(--lrn-sp-2);
	padding:     var(--lrn-sp-3) var(--lrn-sp-4);
	border-top:  1px solid var(--lrn-divider);
	background:  var(--lrn-accent-bg);
}

/* A quiz that belongs to a lesson is indented to the same rail as that lesson's
   topics, so the outline reads as a hierarchy rather than a flat run of rows:
   the student can see at a glance which lesson the quiz closes out. Padding
   rather than margin keeps the tinted background running the full row width. */
.lrn-curriculum__quiz--in-lesson {
	padding-inline-start: var(--lrn-sp-10);
}

.lrn-curriculum__quiz-icon {
	display:     inline-flex;
	align-items: center;
	color:       var(--lrn-accent-text, var(--lrn-accent));
	flex-shrink: 0;
	width:       20px;
}

/* Icon + label group on the left of a section summary (e.g. the award icon
   beside "Final assessment"), so the count can sit flush-right via the
   parent's space-between. */
.lrn-curriculum__section-label {
	display:     inline-flex;
	align-items: center;
	gap:         var(--lrn-sp-2);
}

.lrn-curriculum__quiz a {
	color:           var(--lrn-text);
	text-decoration: none;
	font-weight:     var(--lrn-weight-medium);
	flex:            1;
}

.lrn-curriculum__quiz a:hover {
	color: var(--lrn-accent-text, var(--lrn-accent));
}

.lrn-curriculum__quiz-pass {
	font-size: var(--lrn-text-xs);
	color:     var(--lrn-text-tertiary);
}

/* The student's state on a quiz row ("Not passed · 66.67%"). When the row runs
   out of room (390px) the badges move to a second line instead of squeezing
   the title to a word per line; rows without a state are unchanged. */
.lrn-curriculum__quiz {
	flex-wrap: wrap;
}

.lrn-curriculum__quiz > a,
.lrn-curriculum__quiz > .lrn-curriculum__title--locked {
	min-width: 10rem;
}

/* On a phone the state takes its own line, indented past the 20px icon so it
   lines up under the quiz title instead of under the icon. */
@media (max-width: 640px) {
	.lrn-curriculum__quiz {
		row-gap: var(--lrn-sp-1);
	}

	.lrn-curriculum__quiz:has(.lrn-curriculum__quiz-state)::after {
		content:    "";
		flex-basis: 100%;
		order:      1;
	}

	.lrn-curriculum__quiz-state {
		order:               2;
		margin-inline-start: calc(20px + var(--lrn-sp-2));
	}
}

/* ==========================================================================
   Responsive — exactly two breakpoints

   Per ux-foundation responsive rules: 1024px (tablet ↔ desktop) and
   640px (mobile). The previous slice held three stops (480 / 767 / 768);
   they collapse into this pair.
   ========================================================================== */

@media (max-width: 1023.98px) {
	.lrn-single-course--head .lrn-single-course__layout {
		grid-template-columns: minmax(0, 1fr) 300px;
		column-gap:            var(--lrn-sp-6);
	}
}

@media (max-width: 640px) {
	/* Tap floor for the curriculum title links without changing the row: the
	   link takes the row's own block padding as its hit area (26px text, ~50px
	   target) and gives it back with a negative margin, so rows stay the same
	   height and the target never reaches into the next row. */
	.lrn-curriculum__lesson-row a,
	.lrn-curriculum__quiz a {
		padding-block: var(--lrn-sp-3);
		margin-block:  calc(-1 * var(--lrn-sp-3));
	}

	.lrn-course-owned {
		flex-direction: column;
		align-items:    stretch;
		gap:            var(--lrn-sp-4);
		padding-block:  var(--lrn-sp-5);
	}

	.lrn-course-owned__action .lrn-btn {
		width: 100%;
	}

	.lrn-single-course--head .lrn-single-course__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.lrn-single-course--head :is(.lrn-single-course__head, .lrn-single-course__main, .lrn-single-course__sidebar) {
		grid-column: 1;
		grid-row:    auto;
	}

	.lrn-single-course--head .lrn-single-course__main {
		grid-row: 3;
	}

	/* Mobile: the sidebar drops below the main column and the price chip
	   shrinks for readability. */
	.lrn-single-course__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.lrn-single-course__sidebar {
		position: static;
	}

	.lrn-sidebar-card__price {
		font-size: var(--lrn-text-xl);
	}
}

/* ─────────────────────────────────────────────────────────────────────
   Review form (J-01.20) — write-or-posted card shown to enrolled
   students. Stars use radio inputs styled as ★ glyphs with hover/focus
   highlighting through sibling/has selectors. Posted state shares the
   container class so the resting layout doesn't reflow on submit.
   ─────────────────────────────────────────────────────────────────── */
.lrn-review-form {
	padding: var(--lrn-sp-6);
	display: flex;
	flex-direction: column;
	gap: var(--lrn-sp-4);
}

.lrn-review-form__subtitle {
	margin: 0;
	color: var(--lrn-text-secondary);
	font-size: var(--lrn-text-sm);
}

.lrn-review-form__alert {
	padding: var(--lrn-sp-3) var(--lrn-sp-4);
	border-radius: var(--lrn-radius-md);
	background: var(--lrn-danger-soft, #fdecea);
	background: color-mix(in srgb, var(--lrn-danger, #d04040) 12%, transparent);
	color: var(--lrn-danger, #d04040);
	font-size: var(--lrn-text-sm);
}

.lrn-review-form__rating {
	border: 0;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--lrn-sp-2);
}

.lrn-review-form__rating legend {
	font-size: var(--lrn-text-sm);
	font-weight: 600;
	margin-bottom: var(--lrn-sp-1);
}

.lrn-review-form__stars {
	display: flex;
	gap: var(--lrn-sp-1);
}

.lrn-review-form__star-label {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.lrn-review-form__star-label input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.lrn-review-form__star {
	display: inline-block;
	font-size: var(--lrn-text-2xl);
	line-height: 1;
	/* Empty stars must be clearly visible on the white form card. The old
	   --lrn-bg-tertiary (#f6f6f6) was near-white, so the rating selector looked
	   blank / unrenderable and users could not see what to click
	   (Basecamp #9972752478). */
	color: var(--lrn-border-heavy);
	transition: color 120ms ease;
}

/* Selected: the checked star + every star before it. DOM order is 1→5, so a
   star is "before" the checked one when it has a LATER checked sibling. (The
   old rule relied on an `.is-before` class no JS ever set, so only the single
   clicked star ever filled.) */
.lrn-review-form__star-label:has(input:checked) .lrn-review-form__star,
.lrn-review-form__star-label:has(~ .lrn-review-form__star-label input:checked) .lrn-review-form__star {
	color: var(--lrn-gold);
}

/* Hover preview takes over from the selected state: reset the whole group, then
   gold the hovered star + every star before it. */
.lrn-review-form__stars:hover .lrn-review-form__star {
	color: var(--lrn-border-heavy);
}

.lrn-review-form__stars:hover .lrn-review-form__star-label:hover .lrn-review-form__star,
.lrn-review-form__stars:hover .lrn-review-form__star-label:has(~ .lrn-review-form__star-label:hover) .lrn-review-form__star {
	color: var(--lrn-gold);
}

.lrn-review-form__star-label input[type="radio"]:focus-visible + .lrn-review-form__star {
	outline: 3px solid var(--lrn-focus-ring);
	outline-offset: 0;
	border-radius: 2px;
}

/* The :has-based "highlight every star up to checked" requires sibling
   ordering, which the simpler :has selector above only resolves on the
   element with the checked input. Fall back to a JS-free progressive
   fill: every label before the checked one inherits the gold via the
   :has(~ ...) selector below. */
.lrn-review-form__stars:has(input[value="5"]:checked) .lrn-review-form__star-label .lrn-review-form__star { color: var(--lrn-gold); }
.lrn-review-form__stars:has(input[value="4"]:checked) .lrn-review-form__star-label:nth-of-type(-n+4) .lrn-review-form__star { color: var(--lrn-gold); }
.lrn-review-form__stars:has(input[value="3"]:checked) .lrn-review-form__star-label:nth-of-type(-n+3) .lrn-review-form__star { color: var(--lrn-gold); }
.lrn-review-form__stars:has(input[value="2"]:checked) .lrn-review-form__star-label:nth-of-type(-n+2) .lrn-review-form__star { color: var(--lrn-gold); }
.lrn-review-form__stars:has(input[value="1"]:checked) .lrn-review-form__star-label:nth-of-type(1)     .lrn-review-form__star { color: var(--lrn-gold); }

.lrn-review-form--posted {
	gap: var(--lrn-sp-2);
}

.lrn-review-form__posted-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--lrn-sp-4);
}

.lrn-review-form__posted-date {
	color: var(--lrn-text-secondary);
	font-size: var(--lrn-text-sm);
}

.lrn-review-form__posted-stars {
	display: flex;
	gap: var(--lrn-sp-1);
	font-size: var(--lrn-text-xl);
}

.lrn-review-form__posted-title {
	margin: var(--lrn-sp-2) 0 0;
	font-size: var(--lrn-text-base);
	font-weight: 600;
}

.lrn-review-form__posted-body {
	margin: 0;
	color: var(--lrn-text);
}

/* ── Mobile sticky buy bar ──────────────────────────────────────────────────
   On phones the purchase card is the last thing on the page (~4000px down), so
   a visitor has no visible price/CTA without scrolling to the end. This pins a
   compact price + primary action to the bottom of the viewport. Hidden on
   desktop, where the sidebar purchase card is always visible. */
.lrn-sticky-buy-bar {
	display: none;
}

@media (max-width: 640px) {
	.lrn-sticky-buy-bar {
		position:        fixed;
		inset-inline:    0;
		bottom:          0;
		z-index:         50;
		display:         flex;
		align-items:     center;
		gap:             var(--lrn-sp-3);
		padding:         var(--lrn-sp-3) var(--lrn-sp-4);
		background:      var(--lrn-bg);
		border-top:      1px solid var(--lrn-border);
		box-shadow:      0 -2px 12px color-mix(in srgb, var(--lrn-text) 12%, transparent);
		padding-bottom:  calc(var(--lrn-sp-3) + env(safe-area-inset-bottom, 0px));
	}

	/* Hidden while the page's own Enroll button is on screen, so there is one
	   Enroll action at a time (Basecamp 10463792536). */
	.lrn-sticky-buy-bar.is-redundant {
		visibility: hidden;
		transform:  translateY(100%);
	}

	/* Both sides may shrink and wrap, so a long price ("Included with your
	   membership", "CHF 1,299.00 /mo") or a long label never pushes the button
	   past the screen edge at 320px (Basecamp 10513148893). The price takes at
	   most a little over half the bar; the button takes the rest. */
	.lrn-sticky-buy-bar__price {
		flex:            0 1 auto;
		min-width:       0;
		max-inline-size: 55%;
		font-size:       var(--lrn-text-lg);
		font-weight:     700;
		line-height:     var(--lrn-leading-tight);
		color:           var(--lrn-text);
		overflow-wrap:   anywhere;
	}

	.lrn-sticky-buy-bar .lrn-sticky-buy-bar__cta {
		flex:            1 1 0;
		min-width:       0;
		text-align:      center;
		min-height:      var(--lrn-touch-min);
		display:         inline-flex;
		align-items:     center;
		justify-content: center;
		white-space:     normal;
		overflow-wrap:   anywhere;
	}

	/* Keep page content clear of the fixed bar so the footer/last card isn't
	   hidden behind it. */
	.lrn-single-course {
		padding-bottom: calc(var(--lrn-touch-min) + var(--lrn-sp-8));
	}

	/* Lift the notifications FAB clear of this bar.
	   The bell is `position: fixed` bottom-right at z-index 9999; this bar is
	   fixed at bottom: 0 with z-index 50. On a phone they occupy the same
	   corner, so the bell landed ON the primary CTA - measured at 390px, the
	   bar's top edge at y=775 and the bell spanning 772-820, i.e. sitting over
	   the right end of Buy Now / Enroll Now (Basecamp 10186166939). The button
	   still worked, but the control a buyer is meant to press was wearing
	   another control.
	   Offset = this bar's own box: the CTA's min-height plus its block padding
	   plus the safe-area inset, so the two stay separated if the bar's padding
	   is ever retuned. `:has()` because the bell lives outside .lrn-app - it is
	   appended near <body> - so it cannot be reached by descending from the
	   course markup, and it must only move on pages that actually show a bar. */
	body:has(.lrn-sticky-buy-bar) .lrn-notification-bell {
		inset-block-end: calc(
			var(--lrn-touch-min) + var(--lrn-sp-3) * 2 + var(--lrn-sp-4)
			+ env(safe-area-inset-bottom, 0px)
		);
	}
}

/* --- Leave this course -----------------------------------------------------
 *
 * A real option, not an invitation. It sits under the primary CTA as a quiet
 * text link, the way "cancel my plan" sits under a subscription rather than
 * beside it - a member looking for it finds it; a member reading the page is
 * not asked to consider quitting.
 *
 * Colour only arrives on hover/focus. A permanently red control in a sidebar
 * reads as a warning about the course rather than an action available on it.
 * Logical properties so RTL mirrors, and a 44px min tap target so it is
 * reachable on a phone without sitting close enough to the CTA to be hit by
 * accident.
 */
.lrn-sidebar-card__leave {
	display:          block;
	inline-size:      100%;
	min-block-size:   44px;
	margin-block-start: var(--lrn-sp-3);
	padding-block:    var(--lrn-sp-2);
	padding-inline:   0;
	border:           0;
	background:       none;
	color:            var(--lrn-text-muted, #6b7280);
	font-size:        var(--lrn-text-sm);
	text-align:       center;
	cursor:           pointer;
	transition:       color 0.15s ease;
}

.lrn-sidebar-card__leave:hover,
.lrn-sidebar-card__leave:focus-visible {
	color:           var(--lrn-danger, #c0392b);
	text-decoration: underline;
}

.lrn-sidebar-card__leave:disabled {
	opacity: 0.6;
	cursor:  default;
}

.lrn-sidebar-card__leave-error {
	margin-block-start: var(--lrn-sp-2);
	color:              var(--lrn-danger, #c0392b);
	font-size:          var(--lrn-text-sm);
	text-align:         center;
}
