/* ==========================================================================
   Elementor compatibility layer
   Keeps imported sections pixel-identical to the theme design once Elementor
   wraps every element in .elementor-section / .elementor-column / .elementor-widget
   ========================================================================== */

/* 1. Our sections control their own width — never let Elementor box them in */
.wpd-el-section > .elementor-container,
.wpd-el-inner > .elementor-container {
  max-width: none;
  width: 100%;
}

/* 2. Elementor's default 20px gap between widgets would double the theme spacing */
.wpd-el-section .elementor-widget:not(:last-child),
.wpd-el-inner .elementor-widget:not(:last-child) {
  margin-bottom: 0;
  margin-block-end: 0;
}
.wpd-el-section .elementor-element,
.wpd-el-inner .elementor-element {
  --widgets-spacing: 0px;
  --widgets-spacing-row: 0px;
  --widgets-spacing-column: 0px;
}

/* 3. Columns carry the theme's .container class — no extra padding wanted */
.wpd-el-col > .elementor-widget-wrap,
.wpd-el-col > .elementor-element-populated {
  padding: 0;
}
.wpd-el-col > .elementor-widget-wrap > .elementor-element {
  width: 100%;
}

/* 4. Headings: Elementor forces line-height:1 — restore the theme scale */
.wpd-el-section .elementor-heading-title,
.wpd-el-inner .elementor-heading-title {
  font-family: inherit;
  line-height: var(--lh-tight, 1.15);
  color: inherit;
}
.wpd-el-section h1.elementor-heading-title,
.wpd-el-inner h1.elementor-heading-title,
.wpd-el-section h2.elementor-heading-title,
.wpd-el-inner h2.elementor-heading-title,
.wpd-el-section h3.elementor-heading-title,
.wpd-el-inner h3.elementor-heading-title,
.wpd-el-section h4.elementor-heading-title,
.wpd-el-inner h4.elementor-heading-title {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 700;
  letter-spacing: -.02em;
}
.section--dark .elementor-heading-title,
.hero .elementor-heading-title,
.page-hero .elementor-heading-title { color: #fff; }

/* 5. Text-editor widgets keep the theme's paragraph colour/size */
.wpd-el-section .elementor-widget-text-editor,
.wpd-el-inner .elementor-widget-text-editor { color: inherit; }
.wpd-el-section .elementor-widget-text-editor p:last-child,
.wpd-el-inner .elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* 6. HTML widgets must not clip the theme's absolutely-positioned decoration */
.wpd-el-section .elementor-widget-html,
.wpd-el-inner .elementor-widget-html { width: 100%; }

/* 7. Hero/dark sections: the Elementor wrapper must not create a stacking bug */
.wpd-el-section.hero,
.wpd-el-section.page-hero { position: relative; }

/* 8. Editor-only helper — makes empty spacing obvious while building */
.elementor-editor-active .wpd-el-section { min-height: 1px; }
