/*
 * layout.css — container utilities + the site-wide hero/main full-bleed pattern.
 *
 * Why this file fights `.site-main`:
 *
 * Hello-Elementor parent ships
 *     body:not([class*=elementor-page-]) .site-main { max-width: 1140px; }
 * which clamps every CHN page-template page that lacks the `elementor-page-<id>`
 * body class. Result: heroes and CTA bands render boxed at 1140px with white
 * margins instead of full-bleed. We unwind that here, then provide a clear
 * pattern: <main> is unbounded, hero `<section>` is unbounded, the inner
 * `.chn-container` carries the editorial column.
 */

/* Container utilities.
 * Phase B4 Stage 0.2: canonical `.chn-container` lives in base.css and consumes
 * `--chn-container-max` + `--chn-container-pad` from tokens.css. The legacy
 * `.chn-container` declaration that lived here was removed so we don't shadow
 * the SSOT rule with the older `--chn-container` + `--chn-space-5` pair. The
 * `--text` variant is kept here as a narrow-column modifier. */
.chn-container--text { max-width: var(--chn-container-text); }
.chn-grid { display: grid; gap: var(--chn-space-5); }
.chn-grid--cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.chn-grid--cards-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.chn-stack > * + * { margin-top: var(--chn-space-4); }

/* ---------------------------------------------------------------------------
 * Hero full-bleed lock — overrides hello-elementor `.site-main` clamp.
 *
 * CHN-rendered pages either carry `body.chn-page` (added in inc/setup.php on
 * select pages) OR carry the `.chn-marketing` / `.chn-marketing--blocks`
 * signature on the <main> element. On those surfaces we drop the parent-theme
 * width cap on `<main class="site-main">` so heroes, breadcrumb strips, CTA
 * bands, and surface-alt section backgrounds can extend to true 100vw. Inner
 * `.chn-container` continues to bind the editorial column to `--chn-container-max`.
 *
 * Phase B4 W1-B: added the `main.chn-marketing` selector branch so the legacy
 * PHP marketing templates (about / why-chn / how-it-works) unwind even when
 * the body lacks `chn-page` — required for full-bleed `chn-marketing__pillars`
 * and `chn-marketing__trust` section backgrounds when reviewed via the
 * template-preview facility.
 * ------------------------------------------------------------------------- */
body.chn-page main.site-main,
body.chn-page .site-main,
main.site-main.chn-marketing,
.site-main.chn-marketing,
main.site-main.chn-mkt,
.site-main.chn-mkt,
main.site-main.chn-custom-design,
.site-main.chn-custom-design,
main.site-main.chn-onboarding,
.site-main.chn-onboarding,
main.site-main.chn-bid-landing,
.site-main.chn-bid-landing,
main.site-main.chn-contact,
.site-main.chn-contact,
/* Phase B4 Wave 5: commerce flow (cart / checkout / order-received) — the
 * injected breadcrumb-strip and page-hero are full-bleed children of the
 * `.woocommerce` wrapper, so the parent `<main>` must also be full-width. */
body.chn-commerce main.site-main,
body.chn-commerce .site-main {
	max-width: none;
	width: 100%;
	margin-inline: 0;
	padding-inline: 0;
}

/* Hero is always 100% of the main column (which is 100% of viewport). The
   background fills the full element; the inner `.chn-container` constrains
   text and CTA. Scoped so Elementor-rendered surfaces are left alone.

   Phase B4 W2: .chn-mkt branch added so the second batch of marketing
   templates (want-a-custom-design, want-a-house-manual, how-much-cost,
   how-much-afford) hero render full-bleed in template-preview without
   needing the body.chn-page marker the legacy chn-marketing trio carries.

   .chn-onboarding branch added so the architect / customer / sp registration
   PHP templates also unwind under template-preview. */
body.chn-page .chn-page-hero,
.chn-marketing .chn-page-hero,
.chn-mkt .chn-page-hero,
.chn-custom-design .chn-page-hero,
.chn-onboarding .chn-page-hero {
	width: 100%;
	max-width: none;
	margin-inline: 0;
}

/* Plan-product (Elementor template 24691) is NOT touched here.
 *
 * The `pd_hero` section is rendered by Elementor with `layout: boxed`. The
 * outer `.elementor-section` already fills 100% of `<main>`; the inner
 * `.elementor-container` is what's capped at 1140px (Elementor's own kit
 * setting). Once `<main class="site-main">` is unbounded by the rules above,
 * the pd_hero background paints edge-to-edge automatically. The boxed inner
 * container is intentional and matches Kemar's approved plan-product layout.
 * Editing `_elementor_data` JSON is byte-length-sensitive and risky; the
 * unwind on `.site-main` is sufficient. */

