/*
 * A question that does not apply is not on the screen.
 *
 * The script sets the `hidden` attribute, which is enough on its own almost
 * everywhere. Two places set `display` instead, and a display rule beats the
 * hidden attribute's default:
 *
 *   - Moodle's own form stylesheet, on .fitem;
 *   - this plugin's dialog, which flattens core's grid with
 *     `.nh-authpane__slot .fitem { display: block !important }`.
 *
 * The second is why the selectors below are written out rather than left as one
 * class. That rule is two classes deep and marked important, so a single
 * `.nzeru-conditional-hidden` -- even important -- loses to it on specificity,
 * and the row stayed on screen with the attribute correctly set. Each selector
 * here is at least as specific as the rule it has to beat.
 */
.nzeru-conditional-hidden,
.nh-authpane__slot .nzeru-conditional-hidden,
.nh-authpane__slot .fitem.nzeru-conditional-hidden,
.nh-authpane__slot .felement.nzeru-conditional-hidden,
form .fitem.nzeru-conditional-hidden,
form .form-group.nzeru-conditional-hidden {
    display: none !important;
}

/*
 * THE WHOLE WIDTH, NOT HALF.
 *
 * The dialog lays custom profile fields out two to a line -- matched on an id
 * prefix, because a stylesheet cannot know which shortnames an administrator
 * chose -- and that is right for Sex, which is one word beside a username. It
 * is wrong for these three: a country name, "Civil Society / Community
 * Organisation" and "Malawi University of Business and Applied Sciences" are
 * not half-a-dialog answers, and they read as a sequence of questions rather
 * than as pairs. So each takes its own line, like Email and Password above them.
 *
 * The extra element in the selector is deliberate. The rule this has to beat is
 * `.nh-authpane__slot [id^="fitem_id_profile_field_"]`, which is two classes'
 * worth of specificity and marked important; `form` makes this one heavier, so
 * it wins wherever the two stylesheets happen to load in.
 */
@media (min-width: 420px) {
    .nh-authpane__slot form [data-nzeru-conditional-row] {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: none !important;
    }
}
