/*
 * The stages of a test page: which of the cover, the form and the result
 * screen is on show. Functional, and the same whatever the design.
 *
 * The cover, the items and the name step are dressed in css/test.css; the
 * certificate and the blocks under it in css/result.css.
 *
 * Class names: .quizstandard-* are the theme's own; .quiz-engine-* are the
 * plugin's and are styled but never renamed, because its JS selects on them.
 */

/* ---------- stages ----------
 *
 * Only ever applied to a scripted document. Without .quizstandard-js none of these
 * rules exist and the page is what the engine rendered: the cover, then every
 * question, then the submit button. That fallback is also what a crawler
 * indexes, so it is not a courtesy - it is the reason the questions are in the
 * HTML at all.
 */

html:not(.quizstandard-js) .quizstandard-start {
    display: none;
}

.quizstandard-js [data-stage="cover"] .quizstandard-quiz {
    display: none;
}

.quizstandard-js [data-stage="quiz"] .quizstandard-cover,
.quizstandard-js [data-stage="result"] .quizstandard-cover,
.quizstandard-js [data-stage="result"] .quizstandard-pre-about {
    display: none;
}

/*
 * Only the question form goes away once a result is out - NOT the wrapper
 * around it. The engine prints the result blocks as a sibling of the form
 * inside that same wrapper, so hiding the wrapper hid the result card itself:
 * everything below it rendered and the card measured zero. Fixed here rather
 * than by moving markup, because where the engine puts its results is its
 * business.
 */
.quizstandard-js [data-stage="result"] .quiz-engine-form {
    display: none;
}

/*
 * What the test is about stays put while the visitor answers - there is no
 * reason to take it away mid-test. Who prepared it, and the stars, are hidden
 * a different way, in css/test.css: they belong to a certificate that exists,
 * and they come back when the block moves into the foot of the result.
 */

.quizstandard-js [data-stage="quiz"] .quizstandard-progress-slot {
    display: flex;
}
