/*
 * Elementor-side additions. Loaded only when Elementor is active, after main.css and theme.css.
 * Three jobs: (1) neutralise Elementor's own front-end CSS where it collides with the compiled
 * utilities inside the widget hosts; (2) restyle the classic Accordion widget, which no page uses
 * today but an administrator can still reach; (3) editor-only rules.
 * Every rule is scoped to the oh-* class contract; nothing here touches editor-added sections.
 */

/* --------------------------------------------- containers: let the utilities decide again */
/* main.css keeps its utilities in @layer utilities; Elementor's container rules are unlayered and set the
   real longhands (padding-block-start: var(--padding-top) ...), so they would beat py-28, px-5, p-8, mt-16,
   min-h-*, overflow-hidden, rounded-* on every contract container. revert-layer hands those properties back
   to the utilities layer (or to the UA default when no utility applies). Specificity (0,2,1) beats
   Elementor's .e-con-full.e-flex (0,2,0); Elementor's per-element CSS only writes the --variables. */
body .e-con[class*="oh-"] {
	padding-block-start: revert-layer;
	padding-block-end: revert-layer;
	padding-inline-start: revert-layer;
	padding-inline-end: revert-layer;
	margin-block-start: revert-layer;
	margin-block-end: revert-layer;
	margin-inline-start: revert-layer;
	margin-inline-end: revert-layer;
	min-height: revert-layer;
	height: revert-layer;
	max-width: revert-layer;
	width: revert-layer;
	overflow: revert-layer;
	border-radius: revert-layer;
	z-index: revert-layer;
	position: revert-layer;
}
body .e-con[class*="oh-"] > .elementor-widget {
	max-width: revert-layer;
	margin-block-end: revert-layer;
	margin-block-start: revert-layer;
}
.e-con[class*="oh-"] {
	--padding-top: 0;
	--padding-right: 0;
	--padding-bottom: 0;
	--padding-left: 0;
	--margin-top: 0;
	--margin-right: 0;
	--margin-bottom: 0;
	--margin-left: 0;
	--min-height: 0;
	--row-gap: 0;
	--column-gap: 0;
	--gap: 0;
	--overflow: visible;
	--position: relative;
	transition: none;
}
.e-con[class*="oh-"] > .elementor-widget {
	margin-block-end: 0;
	/* Elementor transitions transform on widget wrappers; that freezes GSAP's scroll reveals mid-way. */
	transition: none;
}
.e-con.e-flex[class*="oh-"] {
	--align-items: stretch;
	--justify-content: flex-start;
}
/* Theme widgets dropped into a boxed container break out to the viewport, so editors never see a squeezed
   section. --oh-vw is the scrollbar-free viewport width, set by site.js (falls back to 100vw). */
.e-con-inner > .elementor-widget[class*="elementor-widget-oakhive-"] {
	width: var(--oh-vw, 100vw);
	max-width: var(--oh-vw, 100vw);
	margin-inline-start: calc(50% - var(--oh-vw, 100vw) / 2);
}

/* Elementor gives widget containers height:100%, which blocks the last child's margin from collapsing
   through - the line-mask headings rely on that. */
.e-con[class*="oh-"] > .elementor-widget,
.e-con[class*="oh-"] > .elementor-widget > .elementor-widget-container {
	height: auto;
}
/* The last line-mask's negative margin cannot collapse through the widget wrapper; fold it into the padding. */
.elementor-widget-oakhive-lines-heading .line-mask:last-child {
	margin-bottom: 0;
	padding-bottom: 0.06em;
}

/* ------------------------------------------------------------ element resets vs utilities */
.elementor a.underline { text-decoration-line: underline; }
.elementor .decoration-transparent { text-decoration-color: transparent; }
.elementor .decoration-1 { text-decoration-thickness: 1px; }
.elementor .decoration-2 { text-decoration-thickness: 2px; }
.elementor .decoration-coral { text-decoration-color: var(--color-coral); }
.elementor .decoration-chalk { text-decoration-color: var(--color-chalk); }
.elementor .decoration-\[rgba\(246\,243\,238\,0\.4\)\] { text-decoration-color: rgba(246, 243, 238, 0.4); }
.elementor .decoration-\[var\(--rule-strong\)\] { text-decoration-color: var(--rule-strong); }
@media (hover: hover) {
	.elementor .hover\:decoration-coral:hover { text-decoration-color: var(--color-coral); }
	.elementor .hover\:decoration-chalk:hover { text-decoration-color: var(--color-chalk); }
}
.elementor img.h-full { height: 100%; }
.elementor img.w-full { width: 100%; }
.elementor .elementor-widget-heading .elementor-heading-title,
.elementor .elementor-widget-text-editor,
.elementor .elementor-widget-text-editor p { color: inherit; font-family: inherit; }

/* ------------------------------------------------------------- the FAQ (classic Accordion) */
.oh-faq .elementor-accordion {
	border-top: 1px solid rgba(246, 243, 238, 0.2);
}
.oh-faq .elementor-accordion-item {
	border: 0;
	border-bottom: 1px solid rgba(246, 243, 238, 0.2);
	background: transparent;
}
.oh-faq .elementor-tab-title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1.5rem 0;
	margin: 0;
	border: 0;
	background: transparent;
	color: inherit;
	line-height: 1.25;
	font-weight: 700;
	cursor: pointer;
	position: relative;
}
.oh-faq .elementor-accordion-title {
	font-family: var(--font-display);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: inherit;
	transition: color 0.3s;
}
.oh-faq .elementor-tab-title:hover .elementor-accordion-title { color: var(--color-lagoon); }
.oh-faq .elementor-accordion-icon { display: none; }
.oh-faq .elementor-tab-title::before,
.oh-faq .elementor-tab-title::after {
	content: "";
	position: absolute;
	right: 0;
	top: calc(1.5rem + 0.25rem + 0.5rem);
	background: var(--color-coral);
}
.oh-faq .elementor-tab-title::before {
	width: 1rem;
	height: 2px;
	transform: translateY(-50%);
}
.oh-faq .elementor-tab-title::after {
	width: 2px;
	height: 1rem;
	right: calc(0.5rem - 1px);
	transform: translateY(-50%) scaleY(1);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.oh-faq .elementor-tab-title.elementor-active::after { transform: translateY(-50%) scaleY(0); }
.oh-faq .elementor-accordion-title { padding-right: 2.5rem; }
.oh-faq .elementor-tab-content {
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	color: inherit;
}
.oh-faq .elementor-tab-content p { margin-bottom: 0; }
.oh-faq .elementor-tab-title:focus-visible,
.oh-faq .elementor-accordion-title:focus-visible {
	outline: 2px solid var(--color-coral);
	outline-offset: 3px;
	border-radius: 2px;
}

/* -------------------------------------------------------------------- editor only */
body.elementor-editor-active header.fixed { position: static; }
body.elementor-editor-active [data-hive-field] { display: none; }
body.elementor-editor-active .e-con.oh-widget-host { min-height: 4rem; }
