/*
    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%;
}

/* ResizableNav: the splitter fills the body and its bar is the nav/content separator. */
.gnt-portal-layout__body--split {
    grid-template-columns: minmax(0, 1fr);
}

.gnt-portal-layout__splitter.e-splitter {
    border: 0;
}

.gnt-portal-layout__splitter > .e-pane {
    min-height: 0;
    overflow: hidden;
}

.gnt-portal-layout__splitter .gnt-portal-layout__nav {
    border-right: 0;
    overflow: hidden;
}

/* GNTPortalNavMenu: search box pinned at the top, the command list scrolls under it. */
.gnt-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    height: 100%;
    min-height: 0;
    padding: 0.5rem;
    box-sizing: border-box;
}

.gnt-portal-nav__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0.15rem;
}

.gnt-portal-nav__search.e-input {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 0.35rem;
}

.gnt-portal-nav__list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.gnt-portal-nav__group {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gnt-text-tertiary);
    margin: 0.7rem 0 0.15rem 0.65rem;
}

.gnt-portal-nav__link {
    display: block;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gnt-portal-nav__link--home {
    font-weight: 600;
}

.gnt-portal-nav__link:hover {
    background: var(--gnt-surface-2);
    color: inherit;
}

.gnt-portal-nav__link.active {
    background: var(--gnt-primary-tint);
    color: var(--gnt-primary-strong);
    font-weight: 600;
}

.gnt-portal-nav__empty {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    color: var(--gnt-text-tertiary);
}

.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;
}
