/* /Components/Layout/MainLayout.razor.rz.scp.css */
.page[b-c26mvu0viy] {
    position: relative;
    display: flex;
    flex-direction: column;
}

main[b-c26mvu0viy] {
    flex: 1;
}

.sidebar[b-c26mvu0viy] {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row[b-c26mvu0viy] {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

    .top-row[b-c26mvu0viy]  a, .top-row[b-c26mvu0viy]  .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

    .top-row[b-c26mvu0viy]  a:hover, .top-row[b-c26mvu0viy]  .btn-link:hover {
        text-decoration: underline;
    }

    .top-row[b-c26mvu0viy]  a:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

@media (max-width: 640.98px) {
    .top-row[b-c26mvu0viy] {
        justify-content: space-between;
    }

    .top-row[b-c26mvu0viy]  a, .top-row[b-c26mvu0viy]  .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page[b-c26mvu0viy] {
        flex-direction: row;
    }

    .sidebar[b-c26mvu0viy] {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row[b-c26mvu0viy] {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth[b-c26mvu0viy]  a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row[b-c26mvu0viy], article[b-c26mvu0viy] {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* ==========================================================================
   Last-resort framework UI (issue #111): #blazor-error-ui and the .NET 9
   custom reconnect dialog (#components-reconnect-modal). Colours, padding and
   buttons come from the state template's .alert / .btn rules via PortalAlert;
   this only adds positioning, state visibility and the dialog frame, which the
   template has no pattern for. Both are d-print-none in the markup.
   ========================================================================== */

/* Hidden until blazor.web.js sets style.display = "block". Pinned to the bottom of the viewport over the
   page, in the content column. WCAG 1.4.10 (Reflow): at 320px / 400% zoom it may be taller than the viewport,
   so it scrolls instead of trapping content off-screen. */
#blazor-error-ui[b-c26mvu0viy] {
    display: none;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    max-height: 100vh;
    overflow-y: auto;
    padding-bottom: 1rem;
}

/* It floats over the page, so it needs more separation than PortalAlert's .shadow-sm. */
#blazor-error-ui[b-c26mvu0viy]  .blazor-error-alert {
    margin-bottom: 0;
    box-shadow: var(--bs-box-shadow-lg, 0 1rem 3rem rgba(0, 0, 0, 0.175)) !important;
}

/* error-ui.js focuses the alert when it appears; keep PortalAlert's focus ring (app.css) with the stronger shadow. */
#blazor-error-ui[b-c26mvu0viy]  .blazor-error-alert:focus-visible {
    box-shadow: var(--boe-focus-ring), var(--bs-box-shadow-lg, 0 1rem 3rem rgba(0, 0, 0, 0.175)) !important;
}

#blazor-error-ui .dismiss[b-c26mvu0viy] {
    margin-top: 0.75rem;
}

/* WCAG 2.4.7 (Focus Visible): the app's .btn focus ring is a box-shadow, which High Contrast mode drops, and
   Bootstrap sets outline: 0. A transparent outline is invisible normally and becomes a system-colour ring in
   forced-colors mode, as for .portal-alert in app.css. The dialog's buttons also receive focus from reconnect-modal.js. */
#blazor-error-ui .dismiss:focus-visible[b-c26mvu0viy],
.reconnect-dialog .btn:focus-visible[b-c26mvu0viy] {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.reconnect-dialog[b-c26mvu0viy] {
    width: fit-content;
    min-width: min(24rem, calc(100% - 2rem));
    max-width: min(36rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    padding: 2rem clamp(1.5rem, 6vw, 2.5rem);
    border: 0;
    border-radius: 0.375rem;
    box-shadow: var(--bs-box-shadow-lg, 0 1rem 3rem rgba(0, 0, 0, 0.175));
    overflow-wrap: anywhere;
}

    .reconnect-dialog[b-c26mvu0viy]::backdrop {
        background: rgba(0, 0, 0, 0.5);
    }

    /* While reconnecting, focus is on the dialog itself (there is no action yet), so it needs the app focus ring
       too (WCAG 2.4.7). The transparent outline shows in forced-colors mode, where the box-shadow is dropped. */
    .reconnect-dialog:focus-visible[b-c26mvu0viy] {
        outline: 2px solid transparent;
        outline-offset: 2px;
        box-shadow: var(--boe-focus-ring), var(--bs-box-shadow-lg, 0 1rem 3rem rgba(0, 0, 0, 0.175));
    }

/* Only the block for the state Blazor has set is shown. */
.reconnect-state[b-c26mvu0viy] {
    display: none;
}

.reconnect-dialog.components-reconnect-show .reconnect-state-show[b-c26mvu0viy],
.reconnect-dialog.components-reconnect-failed .reconnect-state-failed[b-c26mvu0viy],
.reconnect-dialog.components-reconnect-rejected .reconnect-state-rejected[b-c26mvu0viy] {
    display: block;
}

.reconnect-state h2[b-c26mvu0viy] {
    margin-top: 0;
    margin-bottom: 1rem;
}

.reconnect-state > :last-child[b-c26mvu0viy] {
    margin-bottom: 0;
}

/* The spinner sits on the first line of the text and the text wraps beside it. */
.reconnect-progress[b-c26mvu0viy] {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

    .reconnect-progress .spinner-border[b-c26mvu0viy] {
        flex: none;
        margin-top: 0.25em;
        color: #14507a;
    }

/* WCAG 1.4.11 (Non-text Contrast): High Contrast mode drops the shadow, so a system-colour border marks the dialog edge. */
@media (forced-colors: active) {
    .reconnect-dialog[b-c26mvu0viy] {
        border: 1px solid CanvasText;
    }
}
