/**
 * Sensei LMS in the theme colours, readable in light and dark.
 *
 * Sensei reads its colours from custom properties on body, with the "-global" ones first; several
 * others are fixed light-theme values. Mapping them all to the theme tokens makes course pages,
 * learning mode and the course list follow the palette (and a style variation) in both schemes.
 * Loaded only when Sensei is active (inc/Assets.php). Looks only; a full design round comes later.
 *
 * @package DeWittePrins\Theme
 * @since   0.2.0
 */

/* `:root body` outranks Sensei's own `body` rule, whatever the load order. */
:root body {
	--sensei-background-color-global: var(--wp--preset--color--base);
	--sensei-text-color-global: var(--wp--preset--color--contrast);
	--sensei-primary-color-global: var(--wp--preset--color--accent);
	--sensei-primary-contrast-color: var(--wp--custom--color--on-accent);
	--sensei-secondary-color: var(--wp--preset--color--accent);
	--sensei-button-text-color: var(--wp--custom--color--on-accent);
	--sensei-button-fill-hover-color: var(--wp--preset--color--surface);
	--sensei-button-outline-hover-color: var(--wp--preset--color--soft);
	--sensei-course-progress-bar-color: var(--wp--custom--color--line);
	--sensei-course-progress-bar-inner-color: var(--wp--preset--color--accent);
	--sensei-lesson-meta-color: var(--wp--preset--color--muted);
	--sensei-locked-lesson-color: var(--wp--preset--color--muted);
	--sensei-module-lesson-color: var(--wp--preset--color--contrast);
	--sensei-pagination-color: var(--wp--preset--color--contrast);
	--border-color: var(--wp--custom--color--line);
}

/* Sensei notices (such as "no access to this lesson"): a theme card instead of a fixed light box. */
:root .sensei-course-theme .sensei-lms-notice,
:root .sensei-lms-notice {
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--large);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

/* "Back to: <course>" under a lesson: Sensei gives it a fixed near-white bar, unreadable in dark. */
:root .sensei-breadcrumb {
	border-radius: var(--wp--preset--border-radius--medium);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	font-style: normal;
}

.sensei-course-theme-locked-lesson-notice__title,
.sensei-course-theme-locked-lesson-notice__text {
	color: inherit;
}

/*
 * Course list (the [sensei_courses] shortcode and the course archive). Sensei gives author, meta and
 * prices fixed greys (#888, #555, #222) that nearly vanish in dark, and a light line between the
 * courses. The extra class outweighs Sensei's own selectors without !important.
 */
.course-container > .course.course {
	border-bottom-color: var(--wp--custom--color--line);
}

:root .course-container .course-author.course-author,
:root .course-container .sensei-course-meta.sensei-course-meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

:root .course-container .course-author.course-author a,
:root .course-container .sensei-course-meta.sensei-course-meta a {
	color: var(--wp--preset--color--contrast);
}

/* Under the summary: the price (or "from" the lowest one) and a button to the course page (inc/SenseiCourseList.php). */
.course-price-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	clear: both;
	margin-block: var(--wp--preset--spacing--30) 0;
}

.course-price-summary .course-price-summary__price {
	margin: 0;
	color: var(--wp--preset--color--contrast);
	font-weight: 700;
}

.course-price-summary__price del {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.course-price-summary__price ins {
	color: inherit;
	text-decoration: none;
}

/*
 * The products of a course on its own page, when there are several: Sensei Pro sets white cards on a
 * light grey band, which in dark leaves light text on white.
 */
:root .course-meta .course-products {
	border-radius: var(--wp--preset--border-radius--medium);
	background-color: var(--wp--preset--color--soft);
}

:root .course-meta .course-product {
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--medium);
	background-color: var(--wp--preset--color--base);
	box-shadow: none;
	color: var(--wp--preset--color--contrast);
}

:root .course-meta .course-product-price {
	color: var(--wp--preset--color--contrast);
}
