/* Only for arrows that point from one item to the next; neither RTL bundle mirrors Font Awesome glyphs. */
[dir="rtl"] .sis-flip-rtl { transform: scaleX(-1); }

/*
    Metronic lays out a button's <i> as inline-flex, and Font Awesome 7 gives every icon a fixed
    1.25em box with the glyph centred by text-align, which a flex container ignores. A glyph
    narrower than its box (the header's bell) sat at the start of the box, off the button's centre.
*/
.btn i { justify-content: center; }

/*
    CultureHelper.FontVariables puts a language's stacks on <html> as --bs-body-font-family,
    --bs-font-monospace and --sis-font-heading. Bootstrap's reboot reads the first two, but
    style.bundle.css later sets a literal font-family on html and body that hides the body variable,
    so the body rule here restores the reboot's own. A language with no stack keeps the theme default.
*/
body { font-family: var(--bs-body-font-family); }
h1, h2, h3, h4, h5, h6, .card-title { font-family: var(--sis-font-heading, inherit); }

/* Text that keeps the line breaks it was written with: announcement bodies and warning letters. */
.sis-pre-wrap { white-space: pre-wrap; }
.sis-pre-line { white-space: pre-line; }

/* The course picker's results list, laid over the form rather than pushing it down. */
.sis-picker-results { z-index: 1055; max-block-size: 18rem; }

/* The time column of a weekly grid. */
.sis-col-time { inline-size: 6rem; }

/* A small input held at one width beside its Save button. */
.sis-input-fixed { inline-size: 6rem; }

/* Inputs capped below a form-control's full width. The suffix is the cap in rem; the bare class is 6rem. */
.sis-input-narrow { max-inline-size: 6rem; }
.sis-input-narrow-8 { max-inline-size: 8rem; }
.sis-input-narrow-9 { max-inline-size: 9rem; }
.sis-input-narrow-10 { max-inline-size: 10rem; }
.sis-input-narrow-12 { max-inline-size: 12rem; }
.sis-input-narrow-16 { max-inline-size: 16rem; }

/*
    The recovery-codes screen. See recovery-codes.js for why the print sheet is lifted to <body>
    before any of the print rules below can work.
*/

.sis-recovery-code {
    font-family: var(--bs-font-monospace);
    letter-spacing: 0.08em;
    white-space: nowrap;
    user-select: all;
}

.sis-recovery-print {
    display: none;
}

/*
    Every page loads this file, so each print rule that reaches past the sheet waits until the sheet is a
    child of <body>, and the page margin belongs to a named page that only the sheet uses.
*/
@media print {
    @page sis-recovery {
        margin: 20mm;
    }

    body:has(> .sis-recovery-print) > :not(.sis-recovery-print) {
        display: none !important;
    }

    html:has(> body > .sis-recovery-print),
    body:has(> .sis-recovery-print) {
        background: #fff !important;
    }

    body:has(> .sis-recovery-print) {
        display: block !important;
    }

    .sis-recovery-print {
        display: block;
        page: sis-recovery;
        color: #000;
        font-size: 12pt;
        line-height: 1.5;
    }

    .sis-recovery-print h1 {
        margin-block: 0 2pt;
        margin-inline: 0;
        font-size: 18pt;
        color: #000;
    }

    .sis-recovery-print h2 {
        margin-block: 0 14pt;
        margin-inline: 0;
        font-size: 13pt;
        font-weight: 600;
        color: #000;
    }

    .sis-recovery-print dl {
        display: grid;
        grid-template-columns: max-content auto;
        gap: 2pt 12pt;
        margin-block: 0 16pt;
        margin-inline: 0;
    }

    .sis-recovery-print dd {
        margin: 0;
    }

    .sis-recovery-print-codes {
        display: grid;
        grid-template-columns: repeat(2, max-content);
        gap: 12pt 56pt;
        margin-block: 0 18pt;
        margin-inline: 0;
        padding-block: 14pt;
        padding-inline: 18pt;
        border: 1pt dashed #000;
        list-style: none;
    }

    .sis-recovery-print-codes .sis-recovery-code {
        font-size: 16pt;
        font-weight: 700;
    }
}
