/*
 * Shifumi: Design Upgrade for LearnDash with the BuddyX theme (loaded only when BuddyX is the active theme).
 *
 * BuddyX (5.2.0 and later) takes the radio / checkbox of a single or multiple choice answer out of the flow and places it in the
 * start padding of the row (position absolute), then reserves that padding: calc(1em + 64px). Design Upgrade gives these rows
 * « padding: .875em » with a stronger selector, which cancelled the padding of the theme: the text ran under the input, the
 * input showed after short answers (« Vrai ○ »). Design Upgrade is no longer maintained: it follows the theme here. Only the
 * start padding of these rows changes; the rest of the look of Design Upgrade (background, radius, hover, correct / incorrect
 * colours) is kept.
 * Selectors: « .ldx-plugin.ldx-plugin » outweighs Design Upgrade without requiring its « .wpProQuiz_quiz » wrapper, which is
 * missing in some quiz displays (the input was then placed by BuddyX but the padding stayed the one of Design Upgrade).
 */
.ldx-plugin.ldx-plugin .learndash .wpProQuiz_content .wpProQuiz_questionList:is([data-type="single"], [data-type="multiple"]) .wpProQuiz_questionListItem label:has(> input:is([type="radio"], [type="checkbox"])) {
	padding-inline-start: calc(1em + 64px);
}

/*
 * Input (and status icon in check mode) level with the first line of the answer. BuddyX places them at « 16px + 0.8rem » from
 * the top, computed for its own row padding; Design Upgrade rows have « padding .875em » and « line-height 1.5 »: the middle of
 * the first line is .875em + .75em. The input takes the font size of the row so that « em » is the one of the text.
 */
.ldx-plugin.ldx-plugin .learndash .wpProQuiz_content .wpProQuiz_questionList:is([data-type="single"], [data-type="multiple"]) .wpProQuiz_questionListItem label > input:is([type="radio"], [type="checkbox"]) {
	font-size: inherit;
	top: calc(.875em + .75em);
}

.ldx-plugin.ldx-plugin .learndash .wpProQuiz_content .wpProQuiz_questionList:is([data-type="single"], [data-type="multiple"]) .wpProQuiz_questionListItem:is(.wpProQuiz_answerCorrect, .wpProQuiz_answerIncorrect) label:has(> input:is([type="radio"], [type="checkbox"]))::before {
	top: calc(.875em + .75em);
}

/*
 * Assessment scale (« ne me plaît pas ○1 ○2 … me plaît énormément »): BuddyX removes the start padding of these inline options
 * (« padding-inline: 0 16px ») with a selector that beats the one of Design Upgrade, so the radio touched the left border of its
 * box. The boxes are those of Design Upgrade: they get their padding back (.5em 1em, .875em 1em on small screens).
 */
.ldx-plugin.ldx-plugin .learndash .wpProQuiz_content .wpProQuiz_questionList[data-type="assessment_answer"] .wpProQuiz_questionListItem label {
	padding: .5em 1em;
}

@media (max-width: 800px) {
	.ldx-plugin.ldx-plugin .learndash .wpProQuiz_content .wpProQuiz_questionList[data-type="assessment_answer"] .wpProQuiz_questionListItem label {
		padding: .875em 1em;
	}
}
