/**
 * Course detail page (single pgs_course) — Phase 10.4–10.6: hero, anchor tabs, sections,
 * enrollment card + mobile bar, demo playlist. Loaded only on course pages (inc/assets.php).
 */

/* ---- Hero (10.4.1): pills, facts, instructors on the navy page hero ---- */
.pgs-course-hero__inner {
	gap: 14px;
}

.pgs-course-hero__title {
	max-width: 22ch;
}

@media (min-width: 1024px) {
	/* Room on the right for the enrollment card (10.5). */
	.pgs-course-hero__inner > :not(.pgs-breadcrumb) {
		max-width: min(720px, 62%);
	}
}

.pgs-course-hero__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pgs-course-hero__pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--pgs-border-strong);
	background: var(--pgs-fill);
	color: var(--pgs-text);
	text-decoration: none;
}

a.pgs-course-hero__pill:hover,
a.pgs-course-hero__pill:focus-visible {
	border-color: var(--pgs-lime);
}

.pgs-course-hero__pill .pgs-icon {
	width: 14px;
	height: 14px;
	color: var(--pgs-lime);
}

.pgs-course-hero__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
	margin: 4px 0 0;
}

.pgs-course-hero__fact {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
	font-weight: 500;
}

.pgs-course-hero__fact dt {
	display: inline-flex;
	color: var(--pgs-lime);
}

.pgs-course-hero__fact dt .pgs-icon {
	width: 18px;
	height: 18px;
}

.pgs-course-hero__fact dd {
	margin: 0;
}

.pgs-course-hero__people {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-top: 6px;
}

.pgs-course-hero__avatars {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgs-course-hero__avatars li {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0 0 0 -6px; /* small overlap: the initials stay readable */
	overflow: hidden;
	border: 2px solid var(--pgs-navy-deep);
	border-radius: 50%;
	background: linear-gradient(135deg, var(--pgs-green), var(--pgs-lime));
	color: var(--pgs-navy-deep);
	font-size: 13px;
	font-weight: 800;
}

.pgs-course-hero__avatars li:first-child {
	margin-left: 0;
}

.pgs-course-hero__avatars img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pgs-course-hero__avatars .pgs-course-hero__more {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.pgs-course-hero__taught {
	margin: 0;
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
}

/* ---- Layout (10.4.2): content left, enrollment card right from 1024px (pulled up into the
   hero, sticky under the header); one column below, the card right after the hero. ---- */
.pgs-course-body {
	padding-top: clamp(24px, 5vw, 48px);
}

.pgs-course-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(32px, 5vw, 56px);
}

@media (min-width: 1024px) {
	.pgs-course-layout {
		grid-template-columns: minmax(0, 1fr) clamp(320px, 30%, 400px);
		align-items: start;
	}

	.pgs-course-layout__aside {
		grid-column: 2;
		grid-row: 1; /* same single row as the content (spanning more rows added empty row gaps under it) */
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 77px + 24px);
		z-index: 5;
		margin-top: -240px; /* overlaps the hero's lower part, next to its text */
	}

	/* Sticky only with JavaScript: course-detail.js turns it off while the card is taller than
	   the window (10.5.2); without it a long card (every group listed) could hide its buttons. */
	.pgs-js .pgs-course-layout__aside {
		position: sticky;
	}

	.pgs-course-layout__main {
		grid-column: 1;
		grid-row: 1;
	}
}

.pgs-course-section + .pgs-course-section {
	margin-top: clamp(40px, 6vw, 64px);
}

.pgs-course-section__title {
	margin: 0 0 16px;
	font-size: var(--pgs-fs-h2);
}

/* ---- Enrollment card shell (10.4.2; filled in 10.5) ---- */
.pgs-enroll-card {
	box-shadow: var(--pgs-shadow-lg);
}

.pgs-enroll-card__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--pgs-surface-2);
}

.pgs-enroll-card__media > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pgs-enroll-card__body {
	display: grid;
	gap: 16px;
	padding: 20px;
}

/* ---- Anchor tabs (10.4.3, decision C3): links to the sections, sticky under the header (65px
   below 1024px, 77px from 1024px; under the WP admin bar except ≤ 600px, as the class pills);
   course-detail.js marks the section in view. Sections stop below the bar when jumped to. ---- */
.pgs-course-layout__main {
	--pgs-course-tabs-top: calc(var(--wp-admin--admin-bar--height, 0px) + 65px);
	--pgs-course-tabs-h: 49px;
}

@media (max-width: 600px) {
	.pgs-course-layout__main {
		--pgs-course-tabs-top: 65px;
	}
}

@media (min-width: 1024px) {
	.pgs-course-layout__main {
		--pgs-course-tabs-top: calc(var(--wp-admin--admin-bar--height, 0px) + 77px);
	}
}

.pgs-course-tabs {
	position: sticky;
	top: var(--pgs-course-tabs-top);
	z-index: 4;
	margin-bottom: clamp(24px, 4vw, 40px);
	border-bottom: 1px solid var(--pgs-border);
	background: rgba(255, 255, 255, .94);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

/* Phones / tablets: the bar runs to the screen edges. */
@media (max-width: 767px) {
	.pgs-course-tabs {
		margin-inline: -16px;
	}
}

@media (min-width: 768px) and (max-width: 1023px) {
	.pgs-course-tabs {
		margin-inline: calc(-1 * var(--pgs-gutter));
	}
}

.pgs-course-tabs__list {
	position: relative; /* offsetLeft of the links, to scroll the current one into view */
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

@media (max-width: 1023px) {
	.pgs-course-tabs__list {
		padding-inline: 8px;
	}
}

.pgs-course-tabs__list::-webkit-scrollbar {
	display: none;
}

.pgs-course-tabs__list li {
	flex: 0 0 auto;
}

.pgs-course-tabs__link {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0 14px;
	color: var(--pgs-text-muted);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--pgs-duration) var(--pgs-ease), box-shadow var(--pgs-duration) var(--pgs-ease);
}

.pgs-course-tabs__link:hover {
	color: var(--pgs-navy);
}

.pgs-course-tabs__link[aria-current="true"] {
	color: var(--pgs-navy);
	box-shadow: inset 0 -3px 0 var(--pgs-green);
}

/* Jumped-to headings stop 16px under the bar; the page already keeps 96px clear for the header
   (scroll-padding-top in base.css), and the two add up. */
.pgs-course-section {
	scroll-margin-top: calc(var(--pgs-course-tabs-top) + var(--pgs-course-tabs-h) + 16px - 96px);
}

/* ---- Overview (10.4.4): description, "What you'll learn" box, promo video ---- */
.pgs-course-overview {
	display: grid;
	gap: clamp(24px, 4vw, 32px);
}

.pgs-course-section__sub {
	margin: 0 0 16px;
	font-size: var(--pgs-fs-h3);
}

.pgs-course-learn {
	padding: clamp(20px, 3vw, 28px);
	border: 1px solid var(--pgs-border);
	border-radius: var(--pgs-radius);
	background: var(--pgs-tint-green);
}

/* ---- Subjects included (10.4.5): core chips, then each elective group in a dashed box ---- */
.pgs-course-subjects {
	display: grid;
	gap: 16px;
}

.pgs-course-subjects .pgs-course-section__sub {
	margin: 0;
}

.pgs-course-electives {
	display: grid;
	gap: 12px;
	padding: 16px;
	border: 1.5px dashed var(--pgs-border-strong);
	border-radius: var(--pgs-radius);
}

.pgs-course-electives__label {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	margin: 0;
}

.pgs-course-electives__hint {
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
}

.pgs-course-electives__or {
	color: var(--pgs-text-muted);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
	font-style: italic;
}

/* ---- Instructors (10.4.6): small cards, 1 → 2 columns ---- */
.pgs-course-instructors {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---- Related courses + closing CTA (10.4.8): white sections in a row share one gap (their
   paddings would add up to ~200px). ---- */
.pgs-course-body + .pgs-section,
.pgs-course-related + .pgs-section {
	padding-top: 0;
}

/* ---- Price summary in the card (10.5.1): bigger price, "You save …" under it ---- */
.pgs-enroll-card .pgs-price__current {
	font-size: clamp(1.75rem, 1.5rem + .6vw, 2rem);
}

.pgs-price__save {
	width: 100%;
	color: var(--pgs-accent);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
}

/* A card taller than the space under the header must not stick (its buttons would be out of
   reach) — it scrolls with the page instead: short laptop windows (CSS), or a long option list
   (course-detail.js adds .is-tall). */
@media (min-width: 1024px) and (max-height: 699px) {
	.pgs-course-layout__aside {
		position: static;
	}
}

.pgs-course-layout__aside.is-tall {
	position: static;
}

/* ---- Ways to enroll (10.5.2): full-width tabs in the card, then the options with prices ---- */
.pgs-enroll-card .pgs-tabs__list {
	display: none;
}

.pgs-js .pgs-enroll-card .pgs-tabs__list {
	display: flex;
	width: 100%;
	padding: 4px;
}

.pgs-enroll-card .pgs-tabs__tab {
	flex: 1 0 auto;
	padding-inline: .9em;
	font-size: var(--pgs-fs-small);
}

.pgs-enroll-card .pgs-tabs__panel {
	margin-top: 16px;
}

.pgs-enroll-card__group-title {
	margin: 0 0 10px;
	color: var(--pgs-text-muted);
	font-family: var(--pgs-font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .5px;
	text-transform: uppercase;
}

/* With tabs (JS) the tab already names the group. */
.pgs-js .pgs-enroll-card__tabs .pgs-enroll-card__group-title {
	display: none;
}

.pgs-enroll-options {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgs-enroll-option__row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 12px 14px;
	border: 1px solid var(--pgs-border);
	border-radius: var(--pgs-radius-sm);
	font-size: var(--pgs-fs-small);
}

/* Choices (10.5.3): the whole row is the radio's label; the chosen row is green. */
.pgs-enroll-options__set {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.pgs-enroll-options__legend {
	margin: 0 0 10px;
	padding: 0;
	color: var(--pgs-text);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
}

label.pgs-enroll-option__row {
	position: relative;
	align-items: center;
	padding-left: 44px;
	cursor: pointer;
	transition: border-color var(--pgs-duration) var(--pgs-ease), background-color var(--pgs-duration) var(--pgs-ease);
}

label.pgs-enroll-option__row:hover {
	border-color: var(--pgs-green);
}

.pgs-enroll-option__input {
	position: absolute;
	top: 50%;
	left: 14px;
	width: 20px;
	height: 20px;
	margin: -10px 0 0;
	accent-color: var(--pgs-green);
	cursor: pointer;
}

.pgs-enroll-option__row:has(.pgs-enroll-option__input:checked) {
	border-color: var(--pgs-green);
	background: var(--pgs-tint-green);
	box-shadow: inset 0 0 0 1px var(--pgs-green);
}

.pgs-enroll-option__row:has(.pgs-enroll-option__input:focus-visible) {
	outline: 3px solid var(--pgs-green);
	outline-offset: 2px;
}

.pgs-enroll-option__name {
	color: var(--pgs-text);
	font-weight: 600;
}

.pgs-enroll-option__price {
	display: inline-flex;
	gap: 8px;
	align-items: baseline;
	white-space: nowrap;
}

.pgs-enroll-option__price strong {
	color: var(--pgs-text);
}

.pgs-enroll-option__price del {
	color: var(--pgs-text-muted);
	font-size: 12px;
}

/* One group with a choice: the legend ("Choose your elective subject") already says it, so the
   group title is kept for screen readers only. */
.pgs-enroll-card__group-title:has(+ [data-enroll-choice]) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---- Subject-wise (10.5.4): checkbox rows like the radios, a running total under them, and a
   tip when the Full Package would cost the same or less. ---- */
.pgs-enroll-total {
	margin: 12px 0 0;
	color: var(--pgs-text);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
}

.pgs-enroll-tip {
	margin: 8px 0 0;
	padding: 10px 12px;
	border-radius: var(--pgs-radius-sm);
	background: var(--pgs-tint-green);
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
}

.pgs-enroll-total[hidden],
.pgs-enroll-tip[hidden] {
	display: none;
}

/* ---- Enroll buttons (10.5.5): full width, app first ---- */
.pgs-enroll-card__actions {
	display: grid;
	gap: 10px;
}

/* ---- Without JavaScript (10.5.6): choosing changes nothing, so the options are a plain price
   list — no radio / checkbox shown, rows not clickable. ---- */
html:not(.pgs-js) .pgs-enroll-option__input {
	display: none;
}

html:not(.pgs-js) label.pgs-enroll-option__row {
	padding-left: 14px;
	cursor: default;
}

html:not(.pgs-js) .pgs-enroll-option__row:has(.pgs-enroll-option__input:checked) {
	border-color: var(--pgs-border);
	background: none;
	box-shadow: none;
}

html:not(.pgs-js) .pgs-enroll-options__legend {
	display: none;
}

/* ---- Mobile enroll bar (10.5.7): fixed at the bottom below 1024px, under the WhatsApp button
   (which course-detail.js lifts above it via --pgs-float-offset). ---- */
.pgs-enroll-bar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 80;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--pgs-border);
	background: var(--pgs-surface);
	box-shadow: 0 -8px 24px rgba(0, 19, 56, .12);
}

.pgs-enroll-bar[hidden] {
	display: none;
}

@media (min-width: 1024px) {
	.pgs-enroll-bar {
		display: none;
	}
}

.pgs-enroll-bar__price {
	display: grid;
	min-width: 0;
	margin: 0;
	line-height: 1.25;
}

.pgs-enroll-bar__label {
	overflow: hidden;
	color: var(--pgs-text-muted);
	font-size: 12px;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pgs-enroll-bar__amount {
	color: var(--pgs-text);
	font-family: var(--pgs-font-head);
	font-size: 1.25rem;
	font-weight: 800;
	white-space: nowrap;
}

.pgs-enroll-bar__button {
	flex: 0 0 auto;
}

/* ---- Demo playlist (10.6.1, lessons page since 10.6A): subjects → sections → lessons ---- */
.pgs-playlist__subjects,
.pgs-playlist__sections,
.pgs-playlist__lessons {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgs-playlist__subjects {
	display: grid;
	gap: 12px;
}

.pgs-playlist__subject {
	overflow: hidden;
	border: 1px solid var(--pgs-border);
	border-radius: var(--pgs-radius);
	background: var(--pgs-surface);
}

.pgs-playlist__subject[open] {
	border-color: var(--pgs-accent-border, var(--pgs-green));
}

.pgs-playlist__subject-head,
.pgs-playlist__section-head {
	display: flex;
	align-items: center;
	gap: 12px;
	list-style: none;
	cursor: pointer;
}

/* Title + counts wrap together; the chevron always stays on the right. */
.pgs-playlist__head-text {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 12px;
	min-width: 0;
}

.pgs-playlist__subject-head::-webkit-details-marker,
.pgs-playlist__section-head::-webkit-details-marker {
	display: none;
}

.pgs-playlist__subject-head {
	padding: 16px 20px;
}

.pgs-playlist__subject-head:focus-visible,
.pgs-playlist__section-head:focus-visible {
	outline: 3px solid var(--pgs-green);
	outline-offset: -3px;
}

.pgs-playlist__subject-title {
	display: inline-flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	color: var(--pgs-text);
	font-family: var(--pgs-font-head);
	font-size: 1.0625rem;
	font-weight: 700;
}

.pgs-playlist__meta {
	color: var(--pgs-text-muted);
	font-size: var(--pgs-fs-small);
}

.pgs-playlist__chevron {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--pgs-green);
	transition: transform var(--pgs-duration) var(--pgs-ease);
}

details[open] > summary > .pgs-playlist__chevron {
	transform: rotate(180deg);
}

.pgs-playlist__sections {
	border-top: 1px solid var(--pgs-border);
}

.pgs-playlist__sections > li + li {
	border-top: 1px solid var(--pgs-border);
}

.pgs-playlist__section-head {
	padding: 12px 20px;
	background: var(--pgs-bg-alt);
}

.pgs-playlist__section-title {
	flex: 1 1 auto;
	color: var(--pgs-text);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
}

.pgs-playlist__lesson {
	border-top: 1px solid var(--pgs-border);
	font-size: var(--pgs-fs-small);
}

.pgs-playlist__row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 48px;
	padding: 10px 20px;
	border: 0;
	border-left: 3px solid transparent;
	background: none;
	font: inherit;
	text-align: left;
}

/* Free lessons play on click (10.6.4); the current one: green left bar, green text. */
button.pgs-playlist__row {
	cursor: pointer;
	transition: background-color var(--pgs-duration) var(--pgs-ease);
}

button.pgs-playlist__row:hover {
	background: var(--pgs-tint-green);
}

button.pgs-playlist__row:focus-visible {
	outline: 3px solid var(--pgs-green);
	outline-offset: -3px;
}

.pgs-playlist__lesson.is-current .pgs-playlist__row {
	border-left-color: var(--pgs-green);
	background: var(--pgs-tint-green);
}

.pgs-playlist__lesson.is-current .pgs-playlist__lesson-title {
	color: var(--pgs-accent);
}

.pgs-playlist__lesson-icon {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--pgs-fill);
	color: var(--pgs-text-muted);
}

.pgs-playlist__lesson-icon .pgs-icon {
	width: 14px;
	height: 14px;
}

.is-preview .pgs-playlist__lesson-icon {
	background: var(--pgs-tint-green);
	color: var(--pgs-accent);
}

.is-preview .pgs-playlist__lesson-icon .pgs-icon {
	margin-left: 2px;
	fill: currentColor;
}

.pgs-playlist__lesson-title {
	flex: 1 1 auto;
	min-width: 0;
	color: var(--pgs-text-body);
	line-height: 1.45;
}

.is-preview .pgs-playlist__lesson-title {
	color: var(--pgs-text);
	font-weight: 600;
}

.pgs-playlist__tag {
	flex: 0 0 auto;
	padding: 2px 8px;
	border-radius: var(--pgs-radius-pill);
	background: var(--pgs-tint-green);
	color: var(--pgs-accent);
	font-size: 12px;
	font-weight: 600;
}

.pgs-playlist__duration {
	flex: 0 0 auto;
	color: var(--pgs-text-muted);
	font-variant-numeric: tabular-nums;
}

/* ---- Playlist player stage + list (10.6.2; the lessons page layout is further down, 10.6A.3). */
.pgs-playlist {
	container-type: inline-size;
}

.pgs-playlist__body {
	display: grid;
	gap: 16px;
}

/* ---- Previous / Next under the player (10.6.4); they need JavaScript. ---- */
.pgs-player__nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
}

.pgs-player__nav .pgs-btn:disabled {
	opacity: .45;
	cursor: not-allowed;
}

html:not(.pgs-js) .pgs-player__nav {
	display: none;
}

/* Scrolled back to on phones when a lesson is chosen: stop below the header + section tabs
   (the page already keeps 96px clear — scroll-padding-top in base.css). */
.pgs-playlist__stage {
	scroll-margin-top: calc(var(--pgs-course-tabs-top) + var(--pgs-course-tabs-h) + 16px - 96px);
}

/* ---- Locked lessons (10.6.5): the row opens a small popover under it ---- */
.is-locked button.pgs-playlist__row:hover,
.is-locked button.pgs-playlist__row[aria-expanded="true"] {
	background: var(--pgs-fill);
}

.pgs-lock-pop {
	position: relative;
	margin: 0 12px 12px;
	padding: 16px 44px 16px 16px;
	border: 1px solid var(--pgs-border);
	border-radius: var(--pgs-radius-sm);
	background: var(--pgs-surface);
	box-shadow: var(--pgs-shadow);
}

.pgs-lock-pop[hidden] {
	display: none;
}

.pgs-lock-pop__close {
	position: absolute;
	top: 6px;
	right: 6px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pgs-text-muted);
	cursor: pointer;
}

.pgs-lock-pop__close:hover {
	background: var(--pgs-fill);
	color: var(--pgs-text);
}

.pgs-lock-pop__close:focus-visible {
	outline: 3px solid var(--pgs-green);
	outline-offset: 0;
}

.pgs-lock-pop__close .pgs-icon {
	width: 18px;
	height: 18px;
}

.pgs-lock-pop__title {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 0 0 6px;
	color: var(--pgs-text);
	font-weight: 700;
}

.pgs-lock-pop__title .pgs-icon {
	width: 16px;
	height: 16px;
	color: var(--pgs-accent);
}

.pgs-lock-pop__text {
	margin: 0 0 12px;
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
}

.pgs-lock-pop__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
}

.pgs-lock-pop__prices {
	color: var(--pgs-text);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
}

/* ---- Lessons page header (10.6A.2): slim navy band, no curves — text left, price + buttons
   right from 900px; stacked below. ---- */
.pgs-lessons-head {
	padding-block: clamp(24px, 4vw, 40px);
}

.pgs-lessons-head__inner {
	position: relative;
	display: grid;
	gap: 20px;
}

@media (min-width: 900px) {
	.pgs-lessons-head__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: end;
		gap: 32px;
	}
}

.pgs-lessons-head__main {
	display: grid;
	justify-items: start;
	gap: 10px;
	min-width: 0;
}

.pgs-lessons-head__back {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	min-height: 32px;
	color: var(--pgs-lime);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
	text-decoration: none;
}

.pgs-lessons-head__back:hover {
	text-decoration: underline;
}

.pgs-lessons-head__back .pgs-icon {
	width: 16px;
	height: 16px;
}

.pgs-lessons-head__title {
	margin: 0;
	color: var(--pgs-text);
	font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
	line-height: 1.2;
}

.pgs-lessons-head__counts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0;
	color: var(--pgs-text-body);
	font-size: var(--pgs-fs-small);
}

.pgs-lessons-head__counts > span {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.pgs-lessons-head__counts .pgs-icon {
	width: 16px;
	height: 16px;
	color: var(--pgs-lime);
}

.pgs-lessons-head__free .pgs-icon {
	fill: currentColor;
}

.pgs-lessons-head__enroll {
	display: grid;
	gap: 10px;
	justify-items: start;
}

@media (min-width: 900px) {
	.pgs-lessons-head__enroll {
		justify-items: end;
	}
}

.pgs-lessons-head__price {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
	align-items: baseline;
	margin: 0;
}

.pgs-lessons-head__price-label {
	width: 100%;
	color: var(--pgs-text-muted);
	font-size: 12px;
	letter-spacing: .5px;
	text-transform: uppercase;
}

@media (min-width: 900px) {
	.pgs-lessons-head__price {
		justify-content: flex-end;
	}

	.pgs-lessons-head__price-label {
		text-align: right;
	}
}

.pgs-lessons-head__price strong {
	color: var(--pgs-text);
	font-family: var(--pgs-font-head);
	font-size: 1.5rem;
	font-weight: 800;
}

.pgs-lessons-head__price del {
	color: var(--pgs-text-muted);
	font-size: var(--pgs-fs-small);
}

.pgs-lessons-head__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* ---- Lessons page layout (10.6A.3): full container width — big player left, the lesson list
   right in its own box about the window's height (scrolls inside); from 1100px of playlist
   width (1366px laptops and up). Narrower: player on top, the whole list below. ---- */
.pgs-course-lessons {
	--pgs-lessons-top: calc(var(--wp-admin--admin-bar--height, 0px) + 65px);
	padding-block: clamp(20px, 3vw, 36px) var(--pgs-section-y);
}

@media (max-width: 600px) {
	.pgs-course-lessons {
		--pgs-lessons-top: 65px;
	}
}

@media (min-width: 1024px) {
	.pgs-course-lessons {
		--pgs-lessons-top: calc(var(--wp-admin--admin-bar--height, 0px) + 77px);
	}
}

.pgs-playlist--page {
	margin-top: 0;
}

/* Jumping back to the player (phones) stops just under the header. */
.pgs-playlist--page .pgs-playlist__stage {
	scroll-margin-top: calc(var(--pgs-lessons-top) + 16px - 96px);
}

@container (min-width: 1100px) {
	.pgs-playlist--page.has-player .pgs-playlist__body {
		grid-template-columns: minmax(0, 1fr) clamp(300px, 28%, 420px);
		gap: 24px;
		align-items: start;
	}

	.pgs-playlist--page.has-player .pgs-playlist__stage {
		position: sticky;
		top: calc(var(--pgs-lessons-top) + 16px);
	}

	.pgs-playlist--page.has-player .pgs-playlist__list {
		position: sticky;
		top: calc(var(--pgs-lessons-top) + 16px);
		max-height: max(420px, calc(100vh - var(--pgs-lessons-top) - 32px));
		padding-right: 4px;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}
}

/* ---- Compact curriculum on the course page (10.6A.5): counts + "Watch free previews", then per
   subject a collapsible list of chapters and a link to its lessons on the lessons page. ---- */
.pgs-curriculum {
	margin-top: clamp(32px, 5vw, 48px);
}

.pgs-curriculum__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 16px;
}

.pgs-curriculum__head .pgs-course-section__sub {
	margin: 0 0 4px;
}

.pgs-curriculum__summary {
	margin: 0;
	color: var(--pgs-text-muted);
	font-size: var(--pgs-fs-small);
}

.pgs-curriculum__free {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	color: var(--pgs-accent);
	font-weight: 600;
}

.pgs-curriculum__free .pgs-icon,
.pgs-curriculum__head .pgs-btn .pgs-icon {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

.pgs-curriculum__subjects,
.pgs-curriculum__chapters {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgs-curriculum__subjects {
	display: grid;
	gap: 10px;
}

.pgs-curriculum__subject {
	border: 1px solid var(--pgs-border);
	border-radius: var(--pgs-radius-sm);
	background: var(--pgs-surface);
}

.pgs-curriculum__subject[open] {
	border-color: var(--pgs-accent-border);
}

.pgs-curriculum__subject-head {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 14px 18px;
	list-style: none;
	cursor: pointer;
}

.pgs-curriculum__subject-head::-webkit-details-marker {
	display: none;
}

.pgs-curriculum__subject-head:focus-visible {
	outline: 3px solid var(--pgs-green);
	outline-offset: -3px;
	border-radius: var(--pgs-radius-sm);
}

.pgs-curriculum__subject-title {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	color: var(--pgs-text);
	font-weight: 700;
}

.pgs-curriculum__meta {
	color: var(--pgs-text-muted);
	font-size: var(--pgs-fs-small);
	white-space: nowrap;
}

.pgs-curriculum__chapters {
	border-top: 1px solid var(--pgs-border);
}

.pgs-curriculum__chapters li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 10px 18px;
	font-size: var(--pgs-fs-small);
}

.pgs-curriculum__chapters li + li {
	border-top: 1px solid var(--pgs-border);
}

.pgs-curriculum__chapter {
	color: var(--pgs-text-body);
}

.pgs-curriculum__link {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	min-height: 44px;
	margin: 0 18px 8px;
	color: var(--pgs-accent);
	font-size: var(--pgs-fs-small);
	font-weight: 600;
	text-decoration: none;
}

.pgs-curriculum__link:hover {
	text-decoration: underline;
}

.pgs-curriculum__link .pgs-icon {
	width: 16px;
	height: 16px;
}
