/* =========================================================
   Shell
   The header and side navigation are Carbon's UI shell. This file places
   the page beside them and adds the console's own pieces: the
   organisation's logo, the role in the header, and the boot and lock
   screens.
========================================================= */

/* ---- Header ---------------------------------------------------------- */

.cds--header__name {
    gap: 0.5rem;
    min-width: 0;
}

.cds--header__name--prefix {
    overflow: hidden;
    font-weight: 500;
    padding-inline-end: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-logo {
    width: auto;
    max-width: 6rem;
    height: 1.5rem;
    object-fit: contain;
}

.header-product {
    color: var(--cds-text-secondary);
    font-weight: 400;
}

.header-role {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: var(--cds-text-secondary);
    white-space: nowrap;
}

/* ---- Side navigation ------------------------------------------------- */

.console-nav {
    border-inline-end: 1px solid var(--cds-border-subtle-01);
}

/* Carbon sets navigation links semibold; the console keeps them regular and marks the
   current page with Carbon's bar and highlight. */

.console-nav .cds--side-nav__link-text {
    font-weight: 400;
}

.console-nav .cds--side-nav__items {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Help sits on its own at the bottom. */

.console-nav .is-apart {
    margin-top: auto;
    margin-bottom: 1rem;
}

/* On wide screens the navigation is always open. */

@media (min-width: 66rem) {
    .console-nav {
        inline-size: var(--console-nav-width);
    }
}

/* ---- Page ------------------------------------------------------------ */

.console-content {
    min-height: 100vh;
    padding: calc(var(--console-header-height) + 2rem) 2rem 4rem;
}

@media (min-width: 66rem) {
    .console-content {
        margin-left: var(--console-nav-width);
    }
}

.content-inner,
.session-banner {
    max-width: var(--console-content-width);
}

.content-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.session-banner {
    margin-bottom: 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1,
.profile-header h1,
.lock-box h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--cds-text-primary);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 2.25rem;
    letter-spacing: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Boot and lock screens --------------------------------------------
   A lock covers the whole page: nothing behind it is readable until the
   session and the connection are confirmed again. */

.boot {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cds-background);
}

.boot .cds--inline-loading {
    width: auto;
}

/* The lock is a modal <dialog> so it also covers any open dialog. */

dialog.lock {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 1.5rem;
    border: 0;
    background: var(--cds-background);
    color: var(--cds-text-primary);
}

dialog.lock[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

dialog.lock::backdrop {
    background: var(--cds-background);
}

.lock-box {
    width: 100%;
    max-width: 30rem;
}

.lock-mark img {
    max-width: 2.5rem;
    height: 2rem;
    margin-bottom: 1.5rem;
    object-fit: contain;
}

.lock-box p {
    margin-top: 0.5rem;
    color: var(--cds-text-secondary);
}

.lock-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1px;
    flex-wrap: wrap;
}

.lock-note {
    margin-top: 1rem;
}

/* ---- Narrow screens -------------------------------------------------- */

@media (max-width: 42rem) {
    .console-content {
        padding: calc(var(--console-header-height) + 1rem) 1rem 3rem;
    }

    .header-role,
    .header-product {
        display: none;
    }
}

@media print {
    .cds--header,
    .cds--side-nav,
    .session-banner {
        display: none;
    }

    .console-content {
        margin: 0;
        padding: 0;
    }
}
