/*
Theme Name: Divi Child
Description: Child theme of Divi 5 for elliechowns.org.uk.
Template: Divi
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 8.3
Text Domain: divi-child
*/

/*
 * Divi 5 writes the Theme Customizer fonts to CSS variables without a generic
 * fallback (e.g. `--et_global_body_font: 'Manrope'`). Google Fonts are disabled
 * in Divi's settings, so the named fonts never load and the browser falls back
 * to its default serif. Divi 4 included `sans-serif`; restore that here.
 */
html body,
html input,
html textarea,
html select {
	font-family: var(--et_global_body_font), sans-serif;
}

html h1,
html h2,
html h3,
html h4,
html h5,
html h6 {
	font-family: var(--et_global_heading_font), sans-serif;
}

/*
 * Divi 5 gives a row's custom gutter the same specificity as the global gutter
 * class on <body> (`et_pb_gutters2` here), so the global module spacing wins
 * over rows set to gutter width 1 (e.g. the Theme Builder header). Divi 4 used
 * `.et_pb_gutters1.et_pb_row`, which took precedence. Restore that behaviour.
 */
@media (min-width: 981px) {
	.et_pb_row.et_pb_gutters1 > .et_pb_column .et_pb_module {
		margin-bottom: 0;
	}
}

/*
 * Divi 4 wrapped Theme Builder header/footer layouts in `.et_pb_gutters2` (the
 * global gutter). Divi 5 drops that wrapper, so their rows inherit the page's
 * gutter instead (e.g. gutters3 on the home page, narrowing the footer
 * columns). Restore the Divi 4 gutters2 values for rows without their own
 * gutter. Only the column structures these layouts use are covered.
 */
@media (min-width: 981px) {
	.et-l--header .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column,
	.et-l--footer .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column {
		margin-right: 3%;
	}

	.et-l--header .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column:last-child,
	.et-l--footer .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column:last-child {
		margin-right: 0;
	}

	.et-l--header .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_1_4,
	.et-l--footer .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_1_4 {
		width: 22.75%;
	}

	.et-l--header .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_3_4,
	.et-l--footer .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_3_4 {
		width: 74.25%;
	}

	.et-l--header .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_1_4 .et_pb_module,
	.et-l--footer .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_1_4 .et_pb_module {
		margin-bottom: 6.593%;
	}

	.et-l--header .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_3_4 .et_pb_module,
	.et-l--footer .et_pb_row:not([class*="et_pb_gutters"]) > .et_pb_column_3_4 .et_pb_module {
		margin-bottom: 2.02%;
	}
}

/*
 * Divi 5's base blog grid title rule (`.et_pb_blog_grid .et_pb_post h2`, 18px)
 * now outranks the Theme Customizer's `.et_pb_blog_grid h2` (28px), so restore
 * the Customizer size.
 */
.et_pb_blog_grid .et_pb_post h2.entry-title {
	font-size: 28px;
}
