/* Student Commons 5.14.6 — cumulative layout shift / first-paint stability.
 *
 * The historical terminal CSS stack was printed after wp_footer(). On an
 * uncached/optimised request the browser could paint the older centred shell
 * first, then receive the final Workspace rail geometry at the end of the
 * document and visibly move the header, rail and main workspace. 5.14.6 makes
 * the final signed-in geometry part of the head/first paint and reserves the
 * remaining dimensions that can otherwise change as content becomes ready.
 */

html[data-nsc-commons="1"]{
  scrollbar-gutter:stable;
  min-height:100%;
}

body.nsc5-document{
  min-height:100vh;
}

/* Do not animate any property that participates in shell geometry. */
body.nsc5-document .nsc5-topbar,
body.nsc5-document .nsc5-topbar-inner,
body.nsc5-document .nsc5-layout,
body.nsc5-document .nsc5-sidebar,
body.nsc5-document .nsc5-main,
body.nsc5-document .nsc5-context,
body.nsc5-document .nsc5-brand{
  transition-property:background-color,color,border-color,box-shadow,opacity!important;
}

@media (min-width:901px){
  html body.nsc5-document.nsc590-member-document{
    --nsc5146-rail:252px;
    --nsc5146-gutter:30px;
    --nsc5146-right:26px;
  }

  /* Exact header height prevents a late line/image measurement from changing
   * the sticky offset used by the rail. */
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-topbar,
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-topbar-inner,
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-topbar .nsc5-brand{
    height:var(--nsc5-topbar)!important;
    min-height:var(--nsc5-topbar)!important;
    max-height:var(--nsc5-topbar)!important;
  }

  /* First-frame shell geometry: same values as the final 5.14.5 authority. */
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-topbar-inner{
    grid-template-columns:var(--nsc5146-rail) minmax(280px,680px) auto!important;
    gap:var(--nsc5146-gutter)!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0 var(--nsc5146-right) 0 0!important;
  }
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-topbar .nsc5-brand{
    width:var(--nsc5146-rail)!important;
    min-width:var(--nsc5146-rail)!important;
    max-width:var(--nsc5146-rail)!important;
    padding:0 18px!important;
    margin:0!important;
    border-radius:0!important;
  }
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-layout:not(.nsc5-layout-focus){
    grid-template-columns:var(--nsc5146-rail) minmax(0,790px) minmax(250px,310px)!important;
    gap:var(--nsc5146-gutter)!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:30px var(--nsc5146-right) 80px 0!important;
  }
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-layout.nsc5-layout-wide:not(.nsc5-layout-focus){
    grid-template-columns:var(--nsc5146-rail) minmax(0,1fr)!important;
  }
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5-sidebar.nsc5142-workspace-sidebar{
    width:var(--nsc5146-rail)!important;
    min-width:var(--nsc5146-rail)!important;
    max-width:var(--nsc5146-rail)!important;
    height:calc(100vh - var(--nsc5-topbar))!important;
    min-height:calc(100vh - var(--nsc5-topbar))!important;
    max-height:calc(100vh - var(--nsc5-topbar))!important;
    top:var(--nsc5-topbar)!important;
    margin:-30px 0 -80px!important;
    padding:20px 14px 22px!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }

  /* Reserve the identity block dimensions before the avatar finishes decode. */
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5142-sidebar-identity{
    min-height:70px!important;
  }
  html body.nsc5-document.nsc590-member-document .nsc590-member-app .nsc5142-sidebar-avatar{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    flex:0 0 42px!important;
  }
}

@media (max-width:900px){
  /* Mobile bottom navigation is present from first paint; reserve content
   * clearance so the page does not jump when browser chrome settles. */
  body.nsc5-document .nsc5-app{padding-bottom:env(safe-area-inset-bottom,0px)}
}
