/*
 * Hubka Theme
 *
 * Phase: 11B.6 — Responsive Refinement & Page Composition
 * Purpose: Vertical rhythm between root-level template sections and raw
 * (non-block) content areas — the Page Rhythm & Composition pass
 * promised at the end of 11B.5.
 *
 * Content width (contentSize/wideSize) is already set in theme.json via
 * settings.layout and is not duplicated here. This file covers only what
 * theme.json cannot express: vertical rhythm between root-level template
 * sections (Hero, Featured Collection, Genre Grid, etc. stacked directly
 * in a template), since theme.json's blockGap only governs spacing
 * *within* a single group, not between top-level template blocks.
 *
 * Revision note: the fixed spacing--70 gap between sections has been
 * made fluid (clamp), so the page reads as one continuous, proportionally
 * scaling composition across breakpoints rather than a fixed jump that
 * feels too large on mobile or static on desktop — the same fluid
 * philosophy theme.json already applies to typography.
 *
 * No fixed heights. No absolute positioning. Logical properties only.
 *
 * Targets .wp-block-post-content only (not .entry-content): confirmed by
 * direct render that core/post-content always outputs both classes on the
 * same element in this block-theme architecture, and Hubka has no classic
 * PHP templates where .entry-content could appear alone — so the single
 * class already covers every case.
 */

/* Vertical rhythm between major page sections. `.wp-site-blocks` is
 * WordPress core's own wrapper for root-level template content in block
 * themes — a real, stable selector, not an invented one. */
.wp-site-blocks > * {
	margin-block: clamp(var(--wp--preset--spacing--60), 6vw, var(--wp--preset--spacing--80)) 0;
}

.wp-site-blocks > *:first-child {
	margin-block-start: 0;
}

/* Generic content container spacing for raw rendered content areas
 * (e.g. WooCommerce account/checkout wrappers) that aren't themselves
 * gap-aware block groups. */
.wp-block-post-content > * {
	margin-block: 0 var(--wp--preset--spacing--40);
}

.wp-block-post-content > *:last-child {
	margin-block-end: 0;
}

/* Root padding-aware alignment (theme.json's useRootPaddingAwareAlignments)
 * sets --wp--style--root--padding-left/right from theme.json's
 * styles.spacing.padding (2rem, see theme.json). That reads comfortably
 * on desktop/tablet but eats a disproportionate share of a phone screen.
 * Overriding the custom properties directly here — not .has-global-padding
 * itself — is the single point of control core's own padding-aware
 * alignment system already reads from everywhere.
 *
 * Targets `body`, not `:root`: confirmed live that WordPress core's own
 * generated stylesheet sets this custom property directly on `body`
 * (unconditionally, as part of its base body{} rule), which is a closer
 * ancestor than `:root`/`html` for inheritance purposes — a `:root`-only
 * override here was silently shadowed and never took effect. */
@media (max-width: 782px) {
	body {
		--wp--style--root--padding-right: 1rem;
		--wp--style--root--padding-left: 1rem;
	}
}
