/*
	Section layout (MH) - Classes set from the "Section layout (MH)" panel
	(assets/js/section-controls.js) on Kadence Section (kadence/column) and Group blocks.

	  mh-width-reading | content | wide      Centred with a max width
	  mh-bg-surface | peach | navy           Background tint (navy = white text)
	  mh-pt-0 | sm | md | lg                 Padding top
	  mh-pb-0 | sm | md | lg                 Padding bottom

	Sizes and colours come from assets/css/tokens.css.
	Kadence puts a Section's padding and background on .kt-inside-inner-col, with
	two-class selectors; these use three so they win without !important.
*/

/* ---------- Width ---------- */

:is(.wp-block-kadence-column, .wp-block-group):is(.mh-width-reading, .mh-width-content, .mh-width-wide) {
	width: 100%;
	margin-inline: auto;
	box-sizing: border-box;
}
:is(.wp-block-kadence-column, .wp-block-group).mh-width-reading {
	max-width: var(--mh-reading-width, 50rem);
}
:is(.wp-block-kadence-column, .wp-block-group).mh-width-content {
	max-width: var(--mh-content-width, 70rem);
}
:is(.wp-block-kadence-column, .wp-block-group).mh-width-wide {
	max-width: var(--mh-wide-width, 85rem);
}

/* ---------- Padding ---------- */
/* Kadence Section: on the inner column. Group: on the block. */

.wp-block-kadence-column.mh-pt-0 > .kt-inside-inner-col,
.wp-block-group.mh-pt-0 {
	padding-top: 0;
}
.wp-block-kadence-column.mh-pt-sm > .kt-inside-inner-col,
.wp-block-group.mh-pt-sm {
	padding-top: var(--mh-section-space-sm, 1.5rem);
}
.wp-block-kadence-column.mh-pt-md > .kt-inside-inner-col,
.wp-block-group.mh-pt-md {
	padding-top: var(--mh-section-space, 3rem);
}
.wp-block-kadence-column.mh-pt-lg > .kt-inside-inner-col,
.wp-block-group.mh-pt-lg {
	padding-top: var(--mh-section-space-lg, 4.5rem);
}

.wp-block-kadence-column.mh-pb-0 > .kt-inside-inner-col,
.wp-block-group.mh-pb-0 {
	padding-bottom: 0;
}
.wp-block-kadence-column.mh-pb-sm > .kt-inside-inner-col,
.wp-block-group.mh-pb-sm {
	padding-bottom: var(--mh-section-space-sm, 1.5rem);
}
.wp-block-kadence-column.mh-pb-md > .kt-inside-inner-col,
.wp-block-group.mh-pb-md {
	padding-bottom: var(--mh-section-space, 3rem);
}
.wp-block-kadence-column.mh-pb-lg > .kt-inside-inner-col,
.wp-block-group.mh-pb-lg {
	padding-bottom: var(--mh-section-space-lg, 4.5rem);
}

/* ---------- Background ---------- */
/* A tinted section gets side padding and rounded corners so content doesn't touch the edges */

.wp-block-kadence-column:is(.mh-bg-surface, .mh-bg-peach, .mh-bg-navy) > .kt-inside-inner-col,
.wp-block-group:is(.mh-bg-surface, .mh-bg-peach, .mh-bg-navy) {
	padding-inline: var(--mh-gutter, 1.5rem);
	border-radius: var(--mh-radius-lg, 1rem);
}
/* Tinted with no padding chosen - default to Standard so the content isn't on the edge */
.wp-block-kadence-column:is(.mh-bg-surface, .mh-bg-peach, .mh-bg-navy):not([class*="mh-pt-"]) > .kt-inside-inner-col,
.wp-block-group:is(.mh-bg-surface, .mh-bg-peach, .mh-bg-navy):not([class*="mh-pt-"]) {
	padding-top: var(--mh-section-space, 3rem);
}
.wp-block-kadence-column:is(.mh-bg-surface, .mh-bg-peach, .mh-bg-navy):not([class*="mh-pb-"]) > .kt-inside-inner-col,
.wp-block-group:is(.mh-bg-surface, .mh-bg-peach, .mh-bg-navy):not([class*="mh-pb-"]) {
	padding-bottom: var(--mh-section-space, 3rem);
}
.wp-block-group.alignfull:is(.mh-bg-surface, .mh-bg-peach, .mh-bg-navy) {
	border-radius: 0;
}

.wp-block-kadence-column.mh-bg-surface > .kt-inside-inner-col,
.wp-block-group.mh-bg-surface {
	background-color: var(--mh-color-surface, #f5f7f9);
}
.wp-block-kadence-column.mh-bg-peach > .kt-inside-inner-col,
.wp-block-group.mh-bg-peach {
	background-color: var(--mh-color-peach-soft, #fdeee6);
}
.wp-block-kadence-column.mh-bg-navy > .kt-inside-inner-col,
.wp-block-group.mh-bg-navy {
	background-color: var(--mh-color-navy, #001131);
	color: #fff;
}
.wp-block-kadence-column.mh-bg-navy > .kt-inside-inner-col :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote, strong),
.wp-block-group.mh-bg-navy :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote, strong) {
	color: #fff;
}
.mh-bg-navy a:not(.wp-block-button__link):not(.kb-button) {
	color: #fff;
	text-decoration-color: var(--mh-color-accent, #f4a582);
}

/* ---------- Edges ---------- */
/* The section's padding is the gap - trim the outer margins of its first and last block */

.wp-block-kadence-column:is([class*="mh-pt-"], [class*="mh-bg-"]) > .kt-inside-inner-col > :first-child,
.wp-block-group:is([class*="mh-pt-"], [class*="mh-bg-"]) > :first-child,
.wp-block-group:is([class*="mh-pt-"], [class*="mh-bg-"]) > .wp-block-group__inner-container > :first-child {
	margin-top: 0;
}
.wp-block-kadence-column:is([class*="mh-pb-"], [class*="mh-bg-"]) > .kt-inside-inner-col > :last-child,
.wp-block-group:is([class*="mh-pb-"], [class*="mh-bg-"]) > :last-child,
.wp-block-group:is([class*="mh-pb-"], [class*="mh-bg-"]) > .wp-block-group__inner-container > :last-child {
	margin-bottom: 0;
}
