/* ==========================================================================
   Far West on Divi — loaded last.
   1. Divi's section / row / column / module wrappers around the Far West sections are made neutral,
      so the Far West CSS (written for the block theme) lays them out exactly as before.
   2. Divi's global element styles (body 14px Open Sans, heading padding and colour, paragraph padding,
      link colour, list padding) are replaced by the Far West base at (0,0,2) specificity: above Divi's
      plain element rules, still below every class rule of the Far West CSS.
   ========================================================================== */

/* ---------- 1. Neutral Divi wrappers (CSS class "fw-dv", set on every converted section) ---------- */
.et-db #et-boc .et-l .et_pb_section.fw-dv,
.et_pb_section.fw-dv {
	padding: 0 !important;
	margin: 0 !important;
	background: none !important;
	min-height: 0;
	display: block;
}
.et-db #et-boc .et-l .et_pb_row.fw-dv,
.et_pb_row.fw-dv {
	width: 100% !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
	display: block;
}
.et_pb_column.fw-dv,
.et_pb_row.fw-dv > .et_pb_column {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none;
}
.et_pb_module.fw-dv {
	margin: 0 !important;
	padding: 0 !important;
	background: none;
	animation: none;
}
.et_pb_module.fw-dv > .et_pb_text_inner,
.et_pb_module.fw-dv > .et_pb_code_inner { display: contents; }
.et_pb_section.fw-dv::before, .et_pb_section.fw-dv::after,
.et_pb_row.fw-dv::before, .et_pb_row.fw-dv::after { display: none; }
/* Divi's content wrappers inside <main>. */
.fw-divi-main > .et-l--post,
.fw-divi-main .et_builder_inner_content { display: contents; }
#page-container, #et-boc { padding: 0 !important; margin: 0; overflow: visible; }

/* Sections people add later with Divi's own modules sit in the page gutter, like the design. */
.fw-divi-main .et_pb_section:not(.fw-dv) .et_pb_row { max-width: calc(var(--fw-max) + 2 * var(--fw-gutter)); width: 100%; padding-left: var(--fw-gutter); padding-right: var(--fw-gutter); }

/* ---------- 2. Base typography over Divi's global element styles ---------- */
html:where(.fw-ed) body {
	font-family: var(--fw-font-body);
	font-size: var(--wp--preset--font-size--medium); /* theme.json body size, as in the block theme */
	font-weight: 400;
	line-height: 1.6;
	color: var(--fw-ink);
	background: var(--fw-paper);
}
html:where(.fw-ed) :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--fw-font-display);
	font-stretch: var(--fw-display-stretch);
	font-weight: 650;
	line-height: 1.08;
	letter-spacing: -0.012em;
	padding: 0;
	color: inherit;
}
html:where(.fw-ed) h1 { font-size: clamp(2.1rem, 1.6rem + 2vw, 3.25rem); font-weight: var(--ed-display-weight); font-stretch: 100%; letter-spacing: -0.03em; line-height: .98; }
html:where(.fw-ed) h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.1rem); line-height: 1.12; font-weight: 400; letter-spacing: -0.015em; }
html:where(.fw-ed) h3 { font-size: clamp(1.2rem, 1.1rem + .45vw, 1.5rem); line-height: 1.2; }
html:where(.fw-ed) h4 { font-size: clamp(1.05rem, 1rem + .2vw, 1.2rem); line-height: 1.25; }
html:where(.fw-ed) h5 { font-size: 1.1rem; line-height: 1.3; }
html:where(.fw-ed) h6 { font-size: 1rem; line-height: 1.3; font-weight: 600; }
html:where(.fw-ed) p { padding-bottom: 0; }
html:where(.fw-ed) a { color: inherit; }
html:where(.fw-ed) :is(ul, ol) { padding-bottom: 0; line-height: inherit; }

/* Divi's Text module sets its own line-height, size and colour, and adds 1em under lists. */
.et_pb_module.fw-dv { line-height: inherit; font-size: inherit; color: inherit; }
.et_pb_text.fw-dv :is(ul, ol) { padding-bottom: 0; }
/* In the block theme every top-level section is a direct child of the page flow (.fw-flow > *, .fw-main > *),
   which resets their outer margins; inside Divi they're children of the Text module instead. */
.fw-divi-main .et_pb_module.fw-dv > .et_pb_text_inner > * { margin-block: 0 !important; }
/* The width rule for the page heading looks for the page text as a direct child of <main>. */
.fw-divi-main:has(.fw-page-body .fw-prose) .ed-pagehead > .fw-container { max-width: calc(var(--fw-read) + 2 * var(--fw-gutter)); }
/* Empty paragraphs Divi's automatic paragraphs leave around a live part ([fw_projects] etc.). */
.fw-divi-main .et_pb_text_inner p:empty { display: none; }
/* Galleries: WordPress prints this gap per gallery for the block theme; same value for all. */
.wp-block-gallery { --wp--style--unstable-gallery-gap: var(--wp--style--gallery-gap-default, var(--gallery-block--gutter-size, var(--wp--style--block-gap, 0.5em))); }
/* Divi's social-icon strip (not part of the Far West design). */
.et_customizer_social_icons { display: none !important; }
/* Divi's reset sets figure margins to 0; WordPress's block styles give figures (images, galleries) 1em below. */
html:where(.fw-ed) figure { margin: 0 0 1em; }
