/* Shared across both hosts. Deliberately tiny: MudBlazor's theme owns the look, so anything
   added here is a rule that has to hold in the browser AND inside the MAUI WebView. */

html, body {
    margin: 0;
    padding: 0;
}

/* ── Printing ──────────────────────────────────────────────────────────────────────────────────
   Report cards and fee challans are printed from the browser rather than generated as PDFs on the
   server. That keeps the app dependency-free, works identically inside the MAUI WebView, and works
   with the network down — which the local-first deployment mode requires. "Save as PDF" comes free
   from the print dialog.

   Everything below is inside @media print, so none of it can affect the app on screen. */

.print-page {
    /* Screen preview only — print overrides the width to the paper's own. */
    max-width: 210mm;
    margin: 0 auto 1.5rem auto;
    background: #fff;
    color: #000;
    padding: 12mm;
    box-sizing: border-box;
}

.print-sheet + .print-sheet {
    /* One report card per sheet. Without this the second card starts halfway down the first page
       and every card after it drifts further, which is the classic bulk-print failure. */
    page-break-before: always;
    break-before: page;
}

.print-avoid-break {
    page-break-inside: avoid;
    break-inside: avoid;
}

@page {
    size: A4;
    margin: 12mm;
}

@media print {
    /* The app's chrome — nav drawer, app bar, buttons, snackbars — must not reach paper. */
    .mud-appbar,
    .mud-drawer,
    .mud-overlay,
    .mud-snackbar-provider,
    .no-print {
        display: none !important;
    }

    .mud-main-content,
    .mud-layout,
    .mud-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    html, body {
        background: #fff !important;
    }

    .print-page {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    /* Colour-printing is the exception in a school office, so the layout must read in black and
       white. Borders carry the structure; background fills are printed rather than dropped, because
       a table header that vanishes takes the column meanings with it. */
    .print-page * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a[href]::after {
        /* Browsers append the URL to links by default. On a report card that is noise. */
        content: none !important;
    }
}

/* Blazor's built-in error banner. Hidden until the framework sets display:block on it. */
#blazor-error-ui {
    color-scheme: light only;
    background: #ffd9d9;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1100;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* iOS notch / Android status bar. Only meaningful in the MAUI host, but lives here so the two
   hosts share one stylesheet rather than one-and-a-bit. */
.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: #1D4ED8;
        width: 100%;
        z-index: 1;
    }
}

/* The help panel's contents.

   Markdig produces plain h2/p/table/code, and MudBlazor styles none of it — without this the
   guide renders as a wall of browser-default text inside an otherwise designed app, which reads
   as a broken panel rather than as documentation. Scoped to .oneschool-guide so it cannot reach
   any other markup. */
.oneschool-guide {
    line-height: 1.6;
}

.oneschool-guide h1,
.oneschool-guide h2,
.oneschool-guide h3 {
    margin: 1.25rem 0 0.5rem;
    line-height: 1.3;
}

.oneschool-guide h1 { font-size: 1.35rem; }
.oneschool-guide h2 { font-size: 1.2rem; }
.oneschool-guide h3 { font-size: 1.05rem; }

/* The first heading is the section title, and the panel already says "Help" above it. */
.oneschool-guide > :first-child {
    margin-top: 0;
}

.oneschool-guide p,
.oneschool-guide ul,
.oneschool-guide ol {
    margin: 0 0 0.75rem;
}

.oneschool-guide ul,
.oneschool-guide ol {
    padding-left: 1.25rem;
}

.oneschool-guide li {
    margin-bottom: 0.25rem;
}

.oneschool-guide table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.oneschool-guide th,
.oneschool-guide td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.35rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

.oneschool-guide code {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    padding: 0.05rem 0.25rem;
    font-size: 0.85em;
}

/* Fenced blocks hold commands. They must not wrap: a wrapped command line is one somebody copies
   wrongly. */
.oneschool-guide pre {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    padding: 0.6rem;
    overflow-x: auto;
}

.oneschool-guide pre code {
    background: none;
    padding: 0;
}

.oneschool-guide blockquote {
    border-left: 3px solid rgba(0, 0, 0, 0.2);
    margin: 0 0 0.75rem;
    padding-left: 0.75rem;
    opacity: 0.9;
}
