/*
 * Page content lines up with the header: the header's content (logo left edge to nav right
 * edge) is 1530px wide, so page sections are never wider than it. See inc/new-pages.php.
 */

/* Boxed sections on every Elementor page/post: same width as the header's content (Elementor's
   site default was 1550px). Sections given their own narrower width keep it. */
:where([data-elementor-type="wp-page"], [data-elementor-type="wp-post"]) > .e-con.e-con-boxed {
	--container-max-width: 1530px;
}
body :where([data-elementor-type="wp-page"], [data-elementor-type="wp-post"]) > .elementor-section.elementor-section-boxed > .elementor-container {
	max-width: 1530px;
}

/* Forms (WPForms, site-wide): dropdowns were 31px tall against 45px text boxes, and dropdowns and
   message boxes had a different border colour. Match them to the text boxes. */
div.wpforms-container-full .wpforms-form select,
div.wpforms-container .wpforms-form select {
	height: 45px !important;
	min-height: 45px !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	padding-left: 10px !important;
	line-height: 43px !important;
	border-color: rgb(225, 226, 227) !important;
	padding-right: 34px !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	background-color: #fff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23595959' stroke-width='1.5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	background-size: 12px 8px !important;
}
div.wpforms-container .wpforms-form :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"]) {
	height: 45px !important;
	min-height: 45px !important;
}
div.wpforms-container-full .wpforms-form textarea,
div.wpforms-container .wpforms-form textarea {
	border-color: rgb(225, 226, 227) !important;
	padding: 12px 10px !important;
}

/* New homepage: "Follow and Connect" Instagram strip was full screen width. */
body.cs-header-aligned .elementor-element-4430c47 > .elementor-container {
	max-width: 1530px;
	margin-left: auto;
	margin-right: auto;
}

/* Desktop screens narrower than the header (under ~1570px): the header keeps a 20px margin each
   side, so boxed sections do too (whatever padding the section itself has). */
@media (min-width: 1025px) {
	:where([data-elementor-type="wp-page"], [data-elementor-type="wp-post"]) > .e-con.e-con-boxed {
		--container-max-width: min(1530px, calc(100% + var(--padding-left, 0px) + var(--padding-right, 0px) - 40px));
	}
	body :where([data-elementor-type="wp-page"], [data-elementor-type="wp-post"]) > .elementor-section.elementor-section-boxed > .elementor-container,
	body.cs-header-aligned .elementor-element-4430c47 > .elementor-container {
		max-width: min(1530px, calc(100% - 40px));
	}
}

/* Half photo / half text sections: start the text at the logo (text on the left) or end it at
   the nav (text on the right), whatever the screen width. 50cqw - 765px = the header's edge. */
@media (min-width: 1025px) {
	body.cs-header-aligned :is(
		.elementor-element-2e2785b, .elementor-element-b5b187f, .elementor-element-21fd772,
		.elementor-element-061221a, .elementor-element-707df33, .elementor-element-7db293f
	),
	body.page .elementor-element-c35349f {
		container-type: inline-size;
	}

	/* Text on the left (new pages; Contact page hero) */
	body.cs-header-aligned :is(.elementor-element-434d37c, .elementor-element-a1235d7, .elementor-element-98e8412),
	body.page .elementor-element-85e50ae {
		padding-left: max(20px, calc(50cqw - 765px)) !important;
		align-items: stretch !important;
	}
	body.cs-header-aligned :is(.elementor-element-55473cc, .elementor-element-9e213b0, .elementor-element-e28194b) > .e-con-inner {
		margin-left: 0 !important;
		margin-right: auto !important;
	}

	/* Two-column sections (Home "Why Work with Us", About "Our Journey"): outer edges flush. */
	body.cs-header-aligned :is(.elementor-element-75a9b18, .elementor-element-cf5da8d) > .elementor-widget-wrap { padding-left: 0 !important; }
	body.cs-header-aligned :is(.elementor-element-37946be, .elementor-element-17c2da8) > .elementor-widget-wrap { padding-right: 0 !important; }

	/* Contact page hero: the text column was 80% wide and centred in its half. */
	body.page .elementor-element-85e50ae {
		width: 100% !important;
		justify-self: stretch !important;
		padding-right: 60px !important;
	}

	/* Contact page: content edges flush with the logo / nav (columns had 10-50px inner padding). */
	body.page .elementor-element-8fe284d > .elementor-container {
		max-width: min(1530px, calc(100% - 40px)) !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}
	body.page .elementor-element-8fe284d { padding-left: 0 !important; padding-right: 0 !important; } /* was 5px / 20px */
	body.page .elementor-element-8c01552 > .elementor-widget-wrap { padding-left: 0 !important; }
	body.page .elementor-element-8e32faa > .elementor-widget-wrap { padding-right: 0 !important; }
	body.page :is(.elementor-element-73afa1c, .elementor-element-d4e7380) { padding-left: 0 !important; }
	body.page :is(.elementor-element-f14686d, .elementor-element-51493d3, .elementor-element-acdf849) { padding-right: 0 !important; }

	/* Text on the right */
	body.cs-header-aligned :is(.elementor-element-dd5a778, .elementor-element-d1429b2, .elementor-element-58bc6d3) {
		padding-right: max(20px, calc(50cqw - 765px)) !important;
		align-items: stretch !important;
	}
	/* (these carry a "mi-0" class whose CSS zeroes the margins with !important) */
	body.cs-header-aligned :is(.elementor-element-e4e4475, .elementor-element-4876b50, .elementor-element-d2a59fb) > .e-con-inner {
		margin-left: auto !important;
		margin-right: 0 !important;
	}
}
