/* ============================================================
   Renovise — layout / structure for the plugin's own sections.
   Header and footer are owned by the theme (renovise/assets/css/main.css).
   ============================================================ */

/* Every Renovise block root is border-box.
   Several of these blocks set an explicit width, or inherit the constrained
   layout's max-width, AND carry their own padding or border. Under the default
   content-box that padding is added OUTSIDE the limit, so the block sticks out
   past every other block in the column — the TOC was 52px wider than its
   neighbours (100% + 24px + 24px + a 4px left border). Root elements only:
   descendants keep whatever box model their own rules expect. */
[class*="wp-block-renovise-"] {
	box-sizing: border-box;
}

:root { --rnv-gutter: clamp(1.25rem, 5vw, 2rem); }

/* Content width is owned by the THEME (theme.json settings.layout). The bands
   below read --wp--style--global--content-size, so they follow whatever the theme
   sets without this plugin overriding it. */

/* Full-bleed coloured bands: break out full-width, and align their content to the
   shared container edge via padding ON THE BAND (same mechanism as the hero). */
.renovise-hero,
.renovise-banner,
.renovise-brands,
.renovise-steps,
.renovise-highlight,
.renovise-teasers {
	box-sizing: border-box !important;   /* padding stays INSIDE the 100vw — no 2440px overflow */
	width: 100vw;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
	padding-inline: max(var(--rnv-gutter), calc((100vw - var(--wp--style--global--content-size)) / 2)) !important;
}

/* Neutralize the band inner wrappers so they DON'T add a second indent. */
.renovise-steps__inner,
.renovise-highlight__inner,
.renovise-teasers__inner {
	max-width: none !important;
	margin-inline: 0 !important;
	padding-inline: 0 !important;
}

/* White content sections align with the content column — same left and right
   edges as every other block on the page.

   They must state that width themselves rather than inherit it. WordPress's
   constrained layout caps a block via `.wp-container-N > * { max-width: … }`,
   which only produces the content column when the PARENT container is itself
   capped — true inside page.html's post-content, false in the two places these
   blocks actually live: front-page.html (post-content is alignfull, so it spans
   the viewport) and straight inside <main> on index.html. There the old
   `max-width: none` let them span the full viewport while their neighbours
   stayed at 1280px.

   Pinning content-size here is correct in BOTH cases: in an uncapped parent it
   restores the column, and in an already-capped one it matches the cap exactly,
   so nothing moves. padding-inline stays 0 so the text starts on the same
   vertical line as the other blocks, not one gutter further in. */
.renovise-bloglist,
.renovise-projects {
	max-width: var(--wp--style--global--content-size, 1280px) !important;
	margin-inline: auto !important;
	padding-inline: 0 !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}
@media (max-width: 782px) {
	.renovise-bloglist,
	.renovise-projects { padding-inline: var(--rnv-gutter) !important; }
}

/* Blog Hero opens the article, so it starts at the very top of the page and sits
   BEHIND the sticky header (no gap below the header, header overlays the image)
   instead of leaving a blank strip and starting after the header. --rnv-header-h
   is measured live and published by the THEME (assets/js/header-height.js); the
   px fallback covers the instant before that script runs, and the case where a
   different theme is active. */
.renovise-bloghero {
	margin-top: calc(-1 * var(--rnv-header-h, 84px)) !important;
}
