/*
    Shell for every portal (GNTPortalLayout, Sabre.Shared.Web/Components/Portal).
    These rules were previously copied into each of the seven portal layouts as
    .{portal}-layout-* blocks. A portal layout now keeps only rules that are genuinely its own
    (page fill for its page classes, a nav or content tint) — never the grid or chrome.
*/

.gnt-portal-layout {
    display: grid;
    grid-template-rows: 50px minmax(0, 1fr);
    grid-template-areas:
        "header"
        "body";
    height: 100%;
    width: 100%;
    min-width: 0;
    align-items: stretch;
    justify-items: stretch;
    position: relative;
    box-sizing: border-box;
}

.gnt-portal-layout--with-footer {
    grid-template-rows: 50px minmax(0, 1fr) auto;
    grid-template-areas:
        "header"
        "body"
        "footer";
}

/* The shell is the document root (Platform), so it sizes to the viewport itself. */
.gnt-portal-layout--viewport {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.gnt-portal-layout__hosts {
    grid-area: header;
    min-height: 0;
}

.gnt-portal-layout__header {
    grid-area: header;
    background: var(--sabre-chrome-bg);
    color: var(--sabre-chrome-fg);
    border-bottom: 1px solid var(--sabre-chrome-border);
    min-height: 0;
}

.gnt-portal-layout__body {
    grid-area: body;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: stretch;
    align-content: stretch;
    min-height: 0;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.gnt-portal-layout__body--wide {
    grid-template-columns: minmax(0, 1fr);
}

.gnt-portal-layout__nav {
    border-right: 1px solid var(--gnt-border-color);
    overflow: auto;
    min-height: 0;
    height: 100%;
}

.gnt-portal-layout__content {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
    min-width: 0;
    height: 100%;
    overflow: auto;
    padding: 0.75rem;
    box-sizing: border-box;
}

/* The tab workspace owns its own scrolling and gives each tab its padding (main-tabs.css);
   a padded, scrolling pane around it double-scrolls the grid. */
.gnt-portal-layout__content--tabbed {
    padding: 0;
    overflow: hidden;
}

.gnt-portal-layout__content--tabbed > .main-data-root {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

/* Descendant, not direct child: in a tabbed pane the grid sits inside the tab host. */
.gnt-portal-layout__content .gnt-grid-selector-root {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

.gnt-portal-layout__content-footer {
    flex: 0 0 auto;
}

.gnt-portal-layout__content--tabbed > .gnt-portal-layout__content-footer {
    padding: 0 0.75rem;
}

.gnt-portal-layout__footer {
    grid-area: footer;
    /* The build watermark and the environment badge pin themselves to the footer's two ends. */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px 12px;
    font-size: 0.8rem;
    background: var(--sabre-chrome-bg);
    color: var(--sabre-chrome-fg-muted);
    border-top: 1px solid var(--sabre-chrome-border);
}

/* Centres a portal's not-authorized message; the message itself stays portal-specific. */
.gnt-portal-denied {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
}
