/* Project pages: the images grow with the scroll (js/project-expand.js)
 * Above 991px the nav is fixed at the top, and the grid spans the page from
 * the start, over the panel's column, on four tracks: the first image (and
 * any more rows beside longer text) sits in the column's spot
 * (tracks 2-4), the rest span the page (1-4). The
 * script scales those down to look column-sized until the scroll grows
 * them, and moves the nav's items and the pill back over the panel until
 * then. The layout never changes. Once the first growing row gets to the
 * top of the window, the page holds still until they're done. The script
 * sets the measurements (--nav-*, --t1 to --t4, --hold, --hold-top).
 */
@media screen and (min-width: 992px) {
  html.has-fixed-nav .project-panel {
    padding-top: var(--nav-h);
  }
  html.has-fixed-nav .project-nav {
    position: fixed;
    top: 0;
    left: var(--nav-left);
    width: var(--nav-width);
    z-index: 6;
    padding-top: 1.25rem;
    margin: 0;
    pointer-events: none; /* it's as wide as the page, over the images */
  }
  html.has-fixed-nav .project-nav .is-navbar > * {
    pointer-events: auto;
  }
  /* `clip` cuts the page off the same way `hidden` does (css/styles.css),
     without breaking sticky */
  .page-wrapper {
    overflow: clip;
  }
  /* Held (--hold px of scrolling) once the first growing row gets to the
     top: the room it's held for is the empty box under it */
  html.has-grow .project-layout {
    position: sticky;
    top: var(--hold-top);
    overflow-anchor: none; /* the browser never moves the page as they grow */
  }
  html.has-grow .section_project > .padding-global::after {
    content: "";
    display: block;
    height: var(--hold);
  }
  html.has-grow .project-layout > .project-panel {
    grid-column: 1;
    grid-row: 1;
  }
  html.has-grow .project-layout > .project-images {
    grid-column: 1 / -1;
    grid-row: 1;
    pointer-events: none; /* its empty side lies over the panel */
  }
  html.has-grow .project-images > .project-grid {
    grid-template-columns: var(--t1) var(--t2) var(--t3) var(--t4);
  }
  html.has-grow .project-grid_cell {
    pointer-events: auto;
    transform-origin: 0 0;
  }
  /* The next project, added under this one (js/next-project.js): the nav
     is this page's own, fixed at the top, so the added one goes (at 991px
     and below it's at the top of the panel, and stays) */
  html.has-fixed-nav .is-stitched .project-nav {
    display: none;
  }
  /* That fixed nav is inside the first project's layout, which is sticky
     (the hold), so it's drawn on the layout's layer. The added projects
     come later on the page and would be drawn over it; this one's layer
     goes on top. (They never overlap: a sticky layout stays inside its
     own section.) */
  html.has-grow .section_project:not(.is-stitched) .project-layout {
    z-index: 1;
  }
  /* The pill's real spot is the middle, like the homepage's; the
     script moves it under the panel until the images grow */
  html.has-grow .dir-pill.is-floating.is-left {
    left: 0;
    right: 0;
    margin-inline: auto;
  }
}
