/*
 * Reset layer for sections rebuilt from the GHL site.
 *
 * Elementor atomic elements ship base styles (padding, margins, button colours) and
 * the generic .e-con container rules. On the live site the same markup only had
 * browser defaults, so these rules revert Elementor's values back to browser defaults.
 *
 * Specificity: reset rules are (0,2,1) to beat Elementor base styles (0,2,0);
 * the converted block CSS is raised to at least (0,3,0) so it always wins over this file.
 */

/* Atomic containers: undo base padding/min-width and the .e-con flex/width variables. */
body .elementor .e-div-block-base {
	display: revert;
	min-width: revert;
	width: revert;
	max-width: revert;
	padding: revert;
	margin: revert;
	position: revert;
	gap: revert;
	flex-direction: revert;
	flex-wrap: revert;
	justify-content: revert;
	align-items: revert;
	align-content: revert;
	text-align: revert;
	border-radius: revert;
	transition: revert;
}

/* Headings and paragraphs keep the browser's default margins, as on the live site. */
body .elementor .e-heading-base,
body .elementor .e-paragraph-base {
	margin: revert;
}

/* Text elements ignore theme/kit typography and inherit like plain HTML did on the live site. */
body .elementor .e-heading-base,
body .elementor .e-paragraph-base,
body .elementor .e-button-base {
	color: revert;
	font-family: revert;
	font-size: revert;
	font-weight: revert;
	line-height: revert;
	letter-spacing: revert;
	text-transform: revert;
	text-decoration: revert;
}

/* Images go back to inline replaced elements. */
body .elementor .e-image-base {
	display: revert;
}

/* Buttons/links lose Elementor's blue button skin. */
body .elementor .e-button-base {
	display: revert;
	text-align: revert;
	padding: revert;
	border-radius: revert;
	border-width: revert;
	background-color: revert;
}

/* Paragraph widgets that replace a <div> keep block behaviour without paragraph margins. */
body .elementor [data-psi-tag="div"] {
	display: block;
	margin: 0;
}

body .elementor [data-psi-tag="span"],
body .elementor [data-psi-tag="strong"],
body .elementor [data-psi-tag="b"],
body .elementor [data-psi-tag="em"],
body .elementor [data-psi-tag="small"] {
	margin: 0;
}

/*
 * Lists rebuilt as Div blocks get the browser's list defaults. Specificity (0,3,1) beats the reset
 * above, while the original CSS (raised to at least (0,3,1) and loaded later) still overrides it.
 */
body .elementor .e-div-block-base[data-psi-tag="ul"],
body .elementor .e-div-block-base[data-psi-tag="ol"] {
	display: block;
	list-style-type: disc;
	margin-block: 1em;
	padding-inline-start: 40px;
}

body .elementor .e-div-block-base[data-psi-tag="ol"] {
	list-style-type: decimal;
}

body .elementor .e-div-block-base[data-psi-tag="li"],
body .elementor .e-paragraph-base[data-psi-tag="li"] {
	display: list-item;
	text-align: match-parent;
}

/* Div blocks standing in for <span> stay inline, as the original spans were. */
body .elementor .e-div-block-base[data-psi-tag="span"] {
	display: inline;
}

/* Dividers start from the browser's <hr> defaults instead of Elementor's divider skin. */
body .elementor .e-divider-base {
	width: revert;
	height: revert;
	border: revert;
	background-color: revert;
	margin: revert;
}

/* Paragraph widgets standing in for block elements (nav, section, header...) stay block-level. */
body .elementor .e-paragraph-base:is([data-psi-tag="nav"], [data-psi-tag="section"], [data-psi-tag="header"], [data-psi-tag="footer"], [data-psi-tag="article"], [data-psi-tag="aside"], [data-psi-tag="main"]) {
	display: block;
	margin: 0;
}

/* Embeds keep their natural size; the theme caps them at 100% width. */
body .elementor .psi-ghl-block :is(iframe, video, embed, object) {
	max-width: revert;
}

/* Loose text runs (between an icon and other text) take no box of their own, like a plain text node. */
body .elementor .e-paragraph-base[data-psi-tag="text"] {
	display: contents;
}

/*
 * Div blocks standing in for <p>/<h1>-<h6> (when they hold icons) get the browser defaults.
 * (0,3,1) beats the reset above; the original CSS, raised and loaded later, still wins.
 */
body .elementor .e-div-block-base:is([data-psi-tag="p"], [data-psi-tag="h1"], [data-psi-tag="h2"], [data-psi-tag="h3"], [data-psi-tag="h4"], [data-psi-tag="h5"], [data-psi-tag="h6"]) {
	display: block;
	font-weight: bold;
}

body .elementor .e-div-block-base[data-psi-tag="p"] { font-weight: inherit; margin-block: 1em; }
body .elementor .e-div-block-base[data-psi-tag="h1"] { font-size: 2em; margin-block: 0.67em; }
body .elementor .e-div-block-base[data-psi-tag="h2"] { font-size: 1.5em; margin-block: 0.83em; }
body .elementor .e-div-block-base[data-psi-tag="h3"] { font-size: 1.17em; margin-block: 1em; }
body .elementor .e-div-block-base[data-psi-tag="h4"] { margin-block: 1.33em; }
body .elementor .e-div-block-base[data-psi-tag="h5"] { font-size: 0.83em; margin-block: 1.67em; }
body .elementor .e-div-block-base[data-psi-tag="h6"] { font-size: 0.67em; margin-block: 2.33em; }

/* Restore the browser's default emphasis for <strong>/<b>/<em> replaced by spans. */
body .elementor [data-psi-tag="strong"],
body .elementor [data-psi-tag="b"] {
	font-weight: bolder;
}

body .elementor [data-psi-tag="em"] {
	font-style: italic;
}

body .elementor [data-psi-tag="small"] {
	font-size: smaller;
}

/* Classic HTML widgets hold small fragments (icons, svg, form controls) and must not create a box. */
body .elementor .elementor-widget-html.psi-island {
	display: contents;
}

/* Each converted GHL block is a plain full-width wrapper. */
body .elementor .psi-ghl-block {
	display: block;
	width: 100%;
	max-width: none;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
	/* The live blocks inherit text-align: start; the theme sets left. */
	text-align: start;
}

/* Images: drop the theme's responsive-image defaults the live site did not have. */
body .elementor .e-image-base {
	max-width: revert;
	height: revert;
}

/* Raw HTML fragments (form controls, lists, links) start from browser defaults, not theme styles. */
body .elementor .psi-ghl-block :is(button, input, label, select, textarea, ul, ol, li) {
	all: revert;
}

body .elementor .psi-ghl-block :where(a) {
	color: revert;
	text-decoration: revert;
	font-family: revert;
	font-size: revert;
	font-weight: revert;
}

/* GHL keeps 1rem = 16px at every width; Astra shrinks the root size on tablets and phones. */
html:root {
	font-size: 100%;
}

/* The GHL header section turns fixed once the page scrolls (see sticky-header.js). */
.elementor-location-header.psi-header-fixed {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99;
}

body.admin-bar .elementor-location-header.psi-header-fixed {
	top: var(--wp-admin--admin-bar--height, 32px);
}

/* Elementor editor: AOS scroll animations are shown in their final state so content is editable. */
body.elementor-editor-active [data-aos] {
	opacity: 1 !important;
	transform: none !important;
}

/* GHL page background layer (see psi_ghl_bridge_page_background). */
.psi-page-bg {
	position: fixed;
	inset: 0;
	z-index: -1;
	background-color: #ffffff;
	pointer-events: none;
}
