/* ==========================================================================
   fse-page — page geometry primitive (front-end)
   Platform-level. Consumed by all five reference sites. No site-specific rules.

   It owns exactly two properties of the PAGE, as distinct from the blocks on
   it: how the top-level regions (header / main / footer) sit against each
   other, and how a page shorter than the viewport ends.

   --------------------------------------------------------------------------
   1. REGIONS BUTT TOGETHER — the page-ground strip
   --------------------------------------------------------------------------

   THE DEFECT. WordPress emits the root block gap as

       :where(.wp-site-blocks) > * { margin-block-start: var(--…--spacing--40) }

   which puts 16px of PAGE GROUND between every top-level region. Measured
   2026-09-16 on 155 page/viewport combinations — every page of all five sites
   at 1400, 1200, 900, 768 and 375 — `main`'s bottom edge and `footer`'s top
   edge were 16px apart on every single one. On Eldering-ICT that is a white
   strip between the blue closing CTA band and the near-black footer; on Zuidema
   and Flurt the closing band and the footer are the SAME colour and the strip
   cuts a visible line through them.

   WHY IT IS A PLATFORM DEFECT AND NOT CONTENT. This platform's page geometry is
   full-bleed bands that each own their vertical padding (see the `alignfull`
   contract in the L3 spacing suite). A margin applied at the REGION level
   therefore cannot be part of any band's rhythm — it can only ever expose the
   page ground between two bands that were composed to be adjacent. Two sites
   had already tried to fix it from their own `parts/footer.html`
   (`"margin":{"top":"0"}` in elderingict and vakantieparkinstyle) and neither
   worked, because the margin is on the `<footer>` TEMPLATE PART ELEMENT that
   WordPress generates, not on the group inside it.

   THE FIX. One rule. `.wp-site-blocks > *` is (0,1,0) and core's
   `:where(.wp-site-blocks) > *` is (0,0,0) — `:where()` zeroes specificity — so
   this wins on specificity alone, in either stylesheet order, with no
   `!important` and without touching the block gap anywhere else on the page.

   WHAT IT DOES NOT FIX, AND WHY THE PARTS WERE ALSO EDITED. A margin on the
   first/last child INSIDE a region collapses out through the region element,
   and no rule on the region can stop that (only a BFC can, which would keep the
   same strip and merely repaint it in the region's own colour). The three
   `parts/header.html` and `parts/footer.html` files that still carried
   `margin.bottom` / `margin.top` of `spacing|40` were set to `0`, which is what
   elderingict and vakantieparkinstyle had already done by hand. Region rhythm
   now has ONE source: none.

   --------------------------------------------------------------------------
   2. THE FOOTER ENDS THE PAGE — short-page ground
   --------------------------------------------------------------------------

   THE DEFECT. Measured 2026-09-16: Flurt's 404 ended its footer 479px above the
   bottom of a 1000px viewport, `/over-flurt/` 353px, `/contact/` 120px; VPI's
   404 256px and De Wissel's 183px. Below the footer sat bare page ground. This
   is a SEPARATE defect from (1) and the two were deliberately measured apart —
   (1) is present on every page, (2) only on pages shorter than the viewport.

   THE MECHANISM. `.wp-site-blocks` is a column flex container with a viewport
   floor, and `main` is the only region allowed to grow. Flex was chosen over
   `grid-template-rows: auto 1fr auto` because it does not assume the page has
   exactly three regions; a template with an extra region still works, and a
   template with no `main` simply does not stretch instead of breaking.

   `100svh` is the SMALL viewport height — the height with mobile browser chrome
   VISIBLE. `100dvh` would resize the page as the chrome retracts, and `100vh`
   is the LARGE height, which on a phone guarantees a scrollbar on a page that
   has nothing to scroll. `100vh` is kept as the preceding declaration purely as
   the fallback for engines without `svh`.

   Flex changes the formatting context of the regions, so margins no longer
   collapse THROUGH them. That is only safe because of (1): every region margin
   the platform or a part could contribute is now zero, so there is nothing left
   to collapse. The two halves of this file depend on each other.
   ========================================================================== */

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100svh;
}

/*
 * The logged-in admin bar is a fixed 32px band that WordPress pays for with
 * `html { margin-top: 32px }`. Without this the viewport floor above overshoots
 * by exactly that much and every short page gains a scrollbar for an
 * admin-only chrome element. `--wp-admin--admin-bar--height` is WordPress's own
 * variable; the fallback is its desktop value.
 */
.admin-bar .wp-site-blocks {
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
	min-height: calc(100svh - var(--wp-admin--admin-bar--height, 32px));
}

/*
 * Only `main` absorbs the slack. `flex-grow` on the region — not a `min-height`
 * on it — because the header and footer heights are content-dependent and
 * differ per site, so there is no number to subtract.
 */
.wp-site-blocks > main {
	flex-grow: 1;
}

/*
 * Region rhythm is zero. See section 1 above. Declared on the child rather than
 * as `gap` on the flex container so that it also holds if `.wp-site-blocks`
 * ever stops being a flex container.
 */
.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}
