/*
GPRO CSS: Scroll Snap
Description: Pure CSS scroll-snap. Any page containing a section tagged .gpro-snap__section auto-activates scroll-snap on the page — when the user stops scrolling, the page snaps to the nearest tagged section. Sections without the class scroll past normally.
Classes: .gpro-snap__section
Apply: Add .gpro-snap__section as a CSS Class on each Divi section that should be a snap target (Section Settings → Advanced → CSS Class). No body class needed — :has() activates the snap container automatically. Sections without the class scroll past normally; useful for footers or short interstitials.
Tokens: --gpro-snap-mode = "proximity" (default — snaps only near a snap point, long sections stay scrollable) or "mandatory" (strict, every scroll lands on a snap point — only safe when every snap section is 100vh); --gpro-snap-margin-top = px offset for fixed/sticky headers, so the top of each section isn't hidden behind the header (default 0); --gpro-snap-align = where the section aligns in the viewport on snap: start (default), center, end; --gpro-snap-min-height = per-section minimum height (default 100vh)
Version: 2.1
Order: 22
*/

/* Activate snap on the html element only on pages that use it.
   :has() is dynamic — matches per-page based on rendered DOM.

   --gpro-snap-mode defaults to "proximity" (snaps only when the user stops
   near a snap point; long sections remain readable). Set to "mandatory" in
   the child theme for strict snapping (only sensible if every snap section
   is exactly viewport-height).

   --gpro-snap-margin-top accounts for fixed/sticky headers — set to the
   header height (e.g. 80px) so the top of each snap section is visible
   rather than hidden behind a Crystal Header. */
html:has(.gpro-snap__section) {
    scroll-snap-type:   y var(--gpro-snap-mode, proximity);
    scroll-behavior:    smooth;
    scroll-padding-top: var(--gpro-snap-margin-top, 0);
}

/* Snap target — applied per-section. */
.gpro-snap__section {
    scroll-snap-align: var(--gpro-snap-align, start);
    scroll-margin-top: var(--gpro-snap-margin-top, 0);
    min-height:        var(--gpro-snap-min-height, 100vh);
}
