/* THE WINDOW MENU'S FIVE SECTIONS.

   Simon: "Add a window menu item at the top... you can click to select any of
   the main sections within the interface, and that will hide any of those
   sections or reveal any of those sections." He picked two to start with, the
   gallery pane and the timeline. Then, later: "each one of the panels' tabs
   also has a close button. When you do this, remove the tab from visibility.
   With this, make it so the window menu at the top left allows you to select
   to activate or deactivate them, so you're not stuck."

   So it is all five panels now, and the state lives in
   js/panel/58-window-sections.js and arrives here as one class per hidden
   section on <html>.

   ==================================================================
   THIS FILE NO LONGER WRITES GRID TEMPLATES, AND THAT IS THE POINT

   It used to. Hiding a section takes its TRACK away as well as the element —
   a gallery hidden without collapsing its row leaves the viewer with 260px of
   nothing beneath it — and a grid template cannot be edited a row at a time,
   so each rule restated the whole thing. Two sections needed three of those:
   no-gallery, no-timeline, and both-at-once, because whichever rule was read
   last simply won and the other section's row came back.

   Five sections is THIRTY-ONE combinations. Thirty-one hand-written copies of
   the most load-bearing layout in the app is thirty-one chances for one of
   them to be quietly wrong, found one at a time, by whoever is using it.

   So the template is computed instead, in js/panelarrange.js — see
   gridTemplate() there. It asks one question of each panel (are you in this
   grid and not hidden) and writes the answer to <body> as an inline style,
   which beats every rule in 01-grid.css without anybody having to reason
   about file order. Every combination is covered because none of them is
   written down.

   What is left here is the part that genuinely is one rule per panel: taking
   the element off the screen. That is what these are, and they are all this
   file does now.

   Not scoped to .nle-on, deliberately: `display: none` on a hidden panel is
   right in any layout, and the gallery in particular is adopted by other
   rooms that move the element without moving it out of this file's reach. */

html.sec-no-project #nle-bin { display: none !important; }

/* The make column is #app — the panel's own root. Hiding it hides the
   generate form in the Edit layout and the node graph's host in the node
   space, which is what closing "Make / Nodes" means in both. */
html.sec-no-make #app { display: none !important; }

html.sec-no-viewer #nle-viewer { display: none !important; }

/* Two elements, not one: the resizer is its own bar and would otherwise be
   left behind as a 5px stripe against nothing. */
html.sec-no-gallery #gallery-pane,
html.sec-no-gallery #gallery-resizer { display: none !important; }

html.sec-no-timeline #nle-timeline { display: none !important; }

/* ---- AND THE SEAMS THAT SIZE THEM ----

   A resize handle for a panel that is not there is a 7px strip of window that
   drags something invisible. js/nle.js's placeGrips already hides a grip
   whose region has no box, so this is belt and braces for the moment between
   the class landing and the next placeGrips — but that moment is a repaint
   long and the grip is drawn on top of everything, so it is a moment you can
   see and click in. */
html.sec-no-gallery #nle-grip-gal,
html.sec-no-project #nle-grip-bin,
html.sec-no-timeline #nle-grip-tl { display: none !important; }

/* THE COLUMN SEAM IS NOT THE VIEWER'S, AND THAT LINE COST A PANEL.

   Simon: "when I have just the gallery view and I've got rid of the
   viewer, I can't click and drag on the left- or right-hand side... the
   edge of the gallery panel that is butting up to the make panel."

   #nle-grip-view is named after the picture and sizes the COLUMN - the
   make column in the Edit layout, the right-hand one in the node space -
   and the gallery has lived in that column since it moved under the
   picture. Hiding the handle because the picture was closed left the
   gallery as the one panel in the app with no live edge anywhere on it,
   which is precisely what "it's not acting as an independent panel"
   means. So it goes when the COLUMN goes - both of them closed - and
   js/nle.js's seamDead says the same thing from the other side, for the
   repaint between the class landing and the next placeGrips. */
html.sec-no-viewer.sec-no-gallery #nle-grip-view { display: none !important; }
