/**
 * Frontend tweaks for the parent Creator LMS plugin.
 * Added in the companion plugin so the parent stays at pristine.
 */

/*
 * Course card title fixes — two issues stacked.
 *
 * 1. Parent's `style.css:2869` sets `word-break: break-word`, a
 *    deprecated non-standard value that behaves like `break-all` in
 *    Chrome/Edge — chops titles mid-character. Reset to `normal` and
 *    keep `overflow-wrap` for unusually long single tokens.
 *
 * 2. The active theme's heading typography (e.g. narihealth's
 *    `narihealth_h2_typo`) sets `letter-spacing: -3px` on every H2.
 *    That's calibrated for display-size headings; on a 16px course-
 *    title H2 the negative spacing is a third of a character width per
 *    gap — letters overlap, narrow letters (i, l) become invisible,
 *    and word-spaces collapse to zero. ("MANDT TRAINING" rendered as
 *    "MANDTTRANING" with one I missing.) Reset letter-spacing to
 *    `normal` so the font's natural metrics apply.
 *
 * The selector matches the parent's specificity so we win at equal
 * specificity by load order (companion enqueue runs after parent).
 */
.creator-lms-page .creator-lms-course-cards .course-card .course-info .creator-lms-loop-course-title {
	word-break: normal;
	overflow-wrap: break-word;
	-ms-word-break: normal;
	letter-spacing: normal;
	word-spacing: normal;
}

/*
 * My Courses → Completed tab — green-check overlap fix.
 *
 * Parent's `dashboard.scss` (compiled into style.css) attaches an
 * absolute-positioned green ✓ via `::before` to EVERY `.creator-lms-button`
 * inside `.creator-lms-course-completed`. With the buttons gap'd 10px in a
 * flex row and the icon offset at `left:-40px`, the ::before on the second
 * button (e.g. "Join the Discussion") drifts back ~30px — which lands on
 * top of the first button ("Download Certificate"). The check is meant as
 * a single course-level "done" indicator, not per-button decoration, so
 * limit it to the first button in the action area.
 */
.creator-lms-dashboard-courses .creator-lms-dashboard-single-course.creator-lms-course-completed .creator-lms-button:not(:first-child)::before,
.creator-lms-page .creator-lms-dashboard-single-course.creator-lms-course-completed .creator-lms-button:not(:first-child)::before {
	content: none;
}

/*
 * Quiz lesson page — completion-action buttons (Download Certificate /
 * Join the Discussion) rendered under the attempts table by the
 * companion's content-quiz.php override.
 */
.creator-lms-quiz-completion-actions {
	display: flex;
	flex-flow: row wrap;
	gap: 12px;
	margin-top: 20px;
}

.creator-lms-quiz-completion-actions .creator-lms-button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
