/* One page container (see inc/layout.php). Pages are full width; plain
   editor content sits in the same column MaxiBlocks sections use for
   their content: 90% of the window, at most 1170px. MaxiBlocks sections
   keep their own full-width backgrounds. The header uses the same
   column (style.css). */

.rhsa-page-container {
	--rhsa-container: 1170px;
	--rhsa-column: min(var(--rhsa-container), 90%);
	--rhsa-space: 64px;
}

.rhsa-page-container .entry-content {
	margin: 0;
	padding-bottom: 0 !important;
}

/* Astra's Customizer pads every article by 15% on each side; on pages
   the column below does that job instead. Posts keep the padding. */
.rhsa-page-container .site .site-content #primary .ast-article-single {
	padding-left: 0;
	padding-right: 0;
}

/* Every block placed directly on a page goes in the column, except
   MaxiBlocks sections (container blocks), which run full width and set
   their own inner width, and sections that manage their own column.
   Margins are set outright (not "auto") and win over per-block margins
   (MaxiBlocks gives some blocks their own), and the width is capped
   rather than set, so fixed-width embeds keep their size and line up
   with the column's left edge. */
.rhsa-page-container .entry-content > :not(.wp-block-maxi-blocks-container-maxi):not(.rec):not(.rec-programs):not(.alignfull):not(style):not(script) {
	box-sizing: border-box;
	margin-left: max(5%, (100% - var(--rhsa-container)) / 2) !important;
	margin-right: max(5%, (100% - var(--rhsa-container)) / 2) !important;
}
.rhsa-page-container .entry-content > :not(.wp-block-maxi-blocks-container-maxi):not(.rec):not(.rec-programs):not(.alignfull):not(style):not(script):not(iframe):not(img):not(video) {
	max-width: var(--rhsa-column) !important;
}
/* Astra (and sometimes the block's own settings) pad top-level Group and
   Columns blocks as if they were boxes. Without a background that just
   pushes the content in from the column, so it is removed. */
.rhsa-page-container .entry-content > :is(.wp-block-group, .wp-block-columns):not(.has-background) {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Embeds placed straight on a page keep their own size. */
.rhsa-page-container .entry-content > iframe,
.rhsa-page-container .entry-content > img,
.rhsa-page-container .entry-content > video { display: block; }

/* Breathing room when a page starts or ends with plain content rather
   than a MaxiBlocks section (which brings its own padding). */
.rhsa-page-container .entry-content > :first-child:not(.wp-block-maxi-blocks-container-maxi):not(.rec):not(.rec-programs) { margin-top: var(--rhsa-space); }
.rhsa-page-container .entry-content > :last-child:not(.wp-block-maxi-blocks-container-maxi):not(.rec):not(.rec-programs) { margin-bottom: var(--rhsa-space); }

/* News: the post grid sits in the same column. */
.blog.rhsa-page-container .site-content > .ast-container {
	box-sizing: border-box;
	width: var(--rhsa-column);
	max-width: none;
	margin: 0 auto;
	padding: var(--rhsa-space) 0;
}

@media (max-width: 600px) {
	.rhsa-page-container { --rhsa-space: 40px; }
}
