/**
 * LearnDash course / lesson / topic / quiz, on the same system as /register/
 * and /checkout/.
 *
 * ⚠ SELECTORS UNVERIFIED AGAINST THIS INSTALL.
 * /courses/boundary-town/ 302-redirects anyone who is not enrolled to
 * /checkout/?add-to-cart=3175, and /lessons/ is a 404 (there is no archive).
 * Reaching these pages needs an enrolled, logged-in account, and completing an
 * order to get one was out of scope. The rules below target LearnDash's stock
 * LD30 classes, taken from the plugin's own templates rather than from this
 * site's rendered DOM.
 *
 * Everything here is additive — spacing, type, colour, focus, radius. No layout
 * is inverted and nothing is hidden, so a selector that misses simply does
 * nothing. Compare with register.css and checkout.css, where every rule was
 * measured against the live cascade.
 *
 * THE SHARED SYSTEM
 *   #005daa PCAU blue · #0a2540 navy · #dd9933 gold
 *   Montserrat headings / Lato body — both already enqueued site-wide
 *   card: 20px radius, hairline border, NO elevation
 *   CTA: blue gradient, fully rounded (999px), NO shadow
 */

:root {
	--pcau-blue: #005daa;
	--pcau-blue-dark: #0d5aa3;
	--pcau-navy: #0a2540;
	--pcau-gold: #dd9933;

	--pcau-ink: #17202c;
	--pcau-muted: #5b6675;
	--pcau-line: #dbe1e8;

	--pcau-radius: 20px;
	--pcau-radius-sm: 10px;
}

/* ── page surface ───────────────────────────────────────────────────────── */

/* The Themeco theme paints `body { background: #f3f3f3 }` site-wide; clearing a
   wrapper to `transparent` only reveals it, so the section paints white over. */
body.single-sfwd-courses,
body.single-sfwd-lessons,
body.single-sfwd-topic,
body.single-sfwd-quiz,
body.single-sfwd-courses .x-section,
body.single-sfwd-lessons .x-section,
body.single-sfwd-topic .x-section,
body.single-sfwd-quiz .x-section {
	background: #fff;
}

.learndash-wrapper {
	font-family: "Lato", sans-serif;
	color: var(--pcau-ink);
}

.learndash-wrapper h1,
.learndash-wrapper h2,
.learndash-wrapper h3,
.learndash-wrapper .ld-course-title,
.learndash-wrapper .ld-item-title {
	font-family: "Montserrat", sans-serif;
	letter-spacing: -0.01em;
	color: var(--pcau-ink);
}

/* ── the card ───────────────────────────────────────────────────────────── */

.learndash-wrapper .ld-item-list,
.learndash-wrapper .ld-tabs-content,
.learndash-wrapper .ld-focus-content {
	max-width: 1080px;
	margin-inline: auto;
	background: #fff;
	border: 1px solid var(--pcau-line);
	border-radius: var(--pcau-radius);
	padding: clamp(1.5rem, 3vw, 2.75rem);
	box-shadow: none;
}

/* ── progress ───────────────────────────────────────────────────────────── */

.learndash-wrapper .ld-progress-bar {
	height: 10px;
	background: #e8edf3;
	border-radius: 999px;
	overflow: hidden;
}

.learndash-wrapper .ld-progress-bar .ld-progress-bar-percentage {
	background: linear-gradient(90deg, var(--pcau-blue) 0%, #2a86d8 100%);
	border-radius: 999px;
}

.learndash-wrapper .ld-progress-heading,
.learndash-wrapper .ld-progress-stats {
	color: var(--pcau-muted);
	font-size: 0.85rem;
}

/* ── lesson rows ────────────────────────────────────────────────────────── */

.learndash-wrapper .ld-item-list-item {
	margin-bottom: 0.6rem;
	background: #fff;
	border: 1px solid var(--pcau-line);
	border-radius: var(--pcau-radius-sm);
	transition: border-color 140ms ease, transform 120ms ease;
}

.learndash-wrapper .ld-item-list-item:hover {
	border-color: var(--pcau-blue);
	transform: translateY(-1px);
}

.learndash-wrapper .ld-item-list-item.ld-is-complete .ld-status-icon.ld-status-complete {
	background-color: #027a48;
}

.learndash-wrapper .ld-item-title {
	font-weight: 600;
}

/* ── CTAs ───────────────────────────────────────────────────────────────── */

.learndash-wrapper .ld-button,
.learndash-wrapper #btn-join,
.learndash-wrapper .ld-primary-background {
	padding: 0.85rem 1.75rem;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(180deg, var(--pcau-blue) 0%, var(--pcau-blue-dark) 100%);
	color: #fff;
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	letter-spacing: 0.02em;
	box-shadow: none;
	transition: transform 120ms ease, filter 120ms ease;
}

.learndash-wrapper .ld-button:hover:not(:disabled),
.learndash-wrapper #btn-join:hover {
	transform: translateY(-1px);
	filter: brightness(1.04);
}

.learndash-wrapper .ld-button.ld-button-transparent {
	background: transparent;
	color: var(--pcau-blue);
	border: 1px solid var(--pcau-line);
	box-shadow: none;
}

/* ── focus mode ─────────────────────────────────────────────────────────── */

.learndash-wrapper .ld-focus-sidebar {
	background: transparent;
	border-right: 1px solid var(--pcau-line);
}

.learndash-wrapper .ld-focus-header {
	background: var(--pcau-navy);
	color: #fff;
}

/* The header logo is the dark-on-light asset; render it solid white on navy
   without swapping the src, as /register/ does in its brand panel. */
.learndash-wrapper .ld-focus-header .ld-brand-logo img {
	filter: brightness(0) invert(1);
}

/* ── quizzes ────────────────────────────────────────────────────────────── */

.learndash-wrapper .wpProQuiz_content .wpProQuiz_button,
.learndash-wrapper .wpProQuiz_content input[type="button"] {
	padding: 0.7rem 1.75rem;
	border: 0;
	border-radius: 999px;
	background: var(--pcau-blue);
	color: #fff;
	font-family: "Montserrat", sans-serif;
	font-weight: 600;
	box-shadow: none;
}

.learndash-wrapper .wpProQuiz_content .wpProQuiz_questionListItem {
	margin-bottom: 0.5rem;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--pcau-line);
	border-radius: var(--pcau-radius-sm);
}

.learndash-wrapper .wpProQuiz_content .wpProQuiz_questionListItem:hover {
	border-color: var(--pcau-blue);
	background: #f7fafd;
}

/* Required markers wear the brand gold, as on /register/. */
.learndash-wrapper .required,
.learndash-wrapper abbr.required {
	color: var(--pcau-gold);
	border: 0;
	text-decoration: none;
}

/* ── accessibility ──────────────────────────────────────────────────────── */

.learndash-wrapper a:focus-visible,
.learndash-wrapper button:focus-visible,
.learndash-wrapper input:focus-visible {
	outline: 2px solid var(--pcau-blue);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.learndash-wrapper .ld-item-list-item,
	.learndash-wrapper .ld-button,
	.learndash-wrapper #btn-join {
		transition: none;
	}

	.learndash-wrapper .ld-item-list-item:hover,
	.learndash-wrapper .ld-button:hover:not(:disabled) {
		transform: none;
	}
}

@media (max-width: 640px) {
	.learndash-wrapper .ld-item-list,
	.learndash-wrapper .ld-tabs-content,
	.learndash-wrapper .ld-focus-content {
		border-radius: 0;
		border-inline: 0;
		box-shadow: none;
		padding-inline: 1rem;
	}
}

/* ------------------------------------------------------- flat, rounded -----

   The LMS reads as paper, not as floating cards: hairlines separate, nothing
   is elevated. LearnDash and WpProQuiz both ship their own shadows on
   containers this file does not otherwise touch (ld-alert, ld-course-status,
   ld-content-actions, the quiz wrapper), so the reset is scoped to every
   ld-prefixed element and to the quiz content, rather than listed one by one.

   `outline` is untouched, so :focus-visible rings survive the reset — they are
   an outline, not a shadow. */

.learndash-wrapper [class^="ld-"],
.learndash-wrapper [class*=" ld-"],
.learndash-wrapper .wpProQuiz_content,
.learndash-wrapper .wpProQuiz_quiz,
.learndash-wrapper .wpProQuiz_questionList,
.learndash-wrapper .wpProQuiz_questionListItem {
	box-shadow: none;
}

/* Every button in the LMS is a pill, flat.
 *
 * The buttons on /lessons/pre-course-knowledge-assessment/ are NOT .ld-button —
 * that page is a quiz, so its controls come from WpProQuiz (.wpProQuiz_button,
 * and plain input[type="button"]), plus LearnDash's own Mark Complete submit
 * and the post-quiz continue link. All four are covered here. */
.learndash-wrapper .ld-button,
.learndash-wrapper .ld-expand-button,
.learndash-wrapper #btn-join,
.learndash-wrapper #quiz_continue_link,
.learndash-wrapper .learndash_mark_complete_button,
.learndash-wrapper input[type="submit"].learndash_mark_complete_button,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button2,
.learndash-wrapper .wpProQuiz_content input[type="button"],
.learndash-wrapper .wpProQuiz_content input[type="submit"] {
	border-radius: 999px;
	box-shadow: none;
}

/* A pill needs horizontal room the square version did not. */
.learndash-wrapper #quiz_continue_link,
.learndash-wrapper .learndash_mark_complete_button,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button2,
.learndash-wrapper .wpProQuiz_content input[type="button"],
.learndash-wrapper .wpProQuiz_content input[type="submit"] {
	padding-inline: 1.75rem;
}

.learndash-wrapper .ld-button:hover,
.learndash-wrapper #quiz_continue_link:hover,
.learndash-wrapper .learndash_mark_complete_button:hover,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button:hover {
	box-shadow: none;
}

/* ------------------------------------------------ empty course-description tab ---

   LearnDash always prints the tabs wrapper on a course page, even when the only
   tab is empty:

     <div class="ld-tabs ld-tab-count-1">
       <div class="ld-tabs-content">
         <div class="ld-tab-content ld-visible" id="ld-tab-content-289"></div>
       </div>
     </div>

   That used to be an invisible zero-content div. Giving .ld-tabs-content a
   border, radius and padding above turned it into a visible empty card between
   the progress bar and Course Content.

   SCOPED TO COURSE PAGES ON PURPOSE.
   `ld-tab-count-1` only means "this wrapper has one tab". That is also true on
   lesson and topic pages, where the single tab is the one holding the lesson
   body — hiding it unscoped would blank the lesson content. On a course page the
   single tab is the course description, which this course does not have.

   Consequence: if a course description is ever added, this rule hides it. Delete
   this block at that point, or gate it on the description being empty. */

body.single-sfwd-courses .ld-tabs.ld-tab-count-1 {
	display: none;
}
