/*
 * Elementor compatibility layer.
 *
 * Page sections are Elementor flexbox containers carrying the original Tailwind utility classes.
 * Elementor gives every container padding / gap / flex-direction / width defaults through CSS
 * variables; neutralise them so the utility classes (loaded after Elementor) fully control layout.
 */

/* --- 1. Remove Elementor's default spacing ------------------------------------------------ */
:root,
.elementor-kit-0,
body[class*="elementor-kit-"] {
  --container-default-padding-top: 0px;
  --container-default-padding-right: 0px;
  --container-default-padding-bottom: 0px;
  --container-default-padding-left: 0px;
  --widgets-spacing: 0px;
  --widgets-spacing-row: 0px;
  --widgets-spacing-column: 0px;
  --kit-widget-spacing: 0px;
}

/* --- 2. Containers behave like plain blocks until a utility class says otherwise -------------- */
body .e-con.e-con.e-con.jc-c {
  --display: block;
  --flex-direction: row;
  --flex-wrap-mobile: nowrap;
  --width: auto;
  --flex-grow: 0;
  --flex-shrink: 1;
  --flex-basis: auto;
  --align-items: normal;
  --justify-content: normal;
  --position: static;
  --gap: 0px;
  --row-gap: 0px;
  --column-gap: 0px;
  --margin-top: 0px;
  --margin-right: 0px;
  --margin-bottom: 0px;
  --margin-left: 0px;
}
/* Elementor's .e-con-full.e-flex sets flex-direction from a variable at higher specificity than
   utilities, so express the common flex utilities through the variables as well. */
body .e-con.e-con.e-con.jc-c.flex-col { --flex-direction: column; }
body .e-con.e-con.e-con.jc-c.flex-row { --flex-direction: row; }
body .e-con.e-con.e-con.jc-c.flex-col-reverse { --flex-direction: column-reverse; }
body .e-con.e-con.e-con.jc-c.flex-row-reverse { --flex-direction: row-reverse; }
body .e-con.e-con.e-con.jc-c.flex-1 { --flex-grow: 1; --flex-shrink: 1; --flex-basis: 0%; }
body .e-con.e-con.e-con.jc-c.flex-none { --flex-grow: 0; --flex-shrink: 0; --flex-basis: auto; }
body .e-con.e-con.e-con.jc-c.flex-auto { --flex-grow: 1; --flex-shrink: 1; --flex-basis: auto; }
body .e-con.e-con.e-con.jc-c.shrink-0 { --flex-shrink: 0; }
body .e-con.e-con.e-con.jc-c.grow { --flex-grow: 1; }
@media (min-width: 640px) {
  body .e-con.e-con.e-con.jc-c.sm\:flex-row { --flex-direction: row; }
  body .e-con.e-con.e-con.jc-c.sm\:flex-col { --flex-direction: column; }
}
@media (min-width: 768px) {
  body .e-con.e-con.e-con.jc-c.md\:flex-row { --flex-direction: row; }
  body .e-con.e-con.e-con.jc-c.md\:flex-col { --flex-direction: column; }
}
@media (min-width: 1024px) {
  body .e-con.e-con.e-con.jc-c.lg\:flex-row { --flex-direction: row; }
  body .e-con.e-con.e-con.jc-c.lg\:flex-col { --flex-direction: column; }
}
@media (min-width: 1280px) {
  body .e-con.e-con.e-con.jc-c.xl\:flex-row { --flex-direction: row; }
  body .e-con.e-con.e-con.jc-c.xl\:flex-col { --flex-direction: column; }
}
/* Block-level anchors converted to containers. */
body a.e-con.jc-c { text-decoration: none; color: inherit; }

/* --- 3. Leaf widgets are transparent wrappers around the original element ---------------------- */
body:not(.elementor-editor-active) .jc-w:not(.jc-img):not(.jc-box),
body:not(.elementor-editor-active) .jc-w:not(.jc-img):not(.jc-box) > .elementor-widget-container,
body:not(.elementor-editor-active) .jc-w:not(.jc-img):not(.jc-box) .elementor-text-editor,
body:not(.elementor-editor-active) .jc-w:not(.jc-img):not(.jc-box) .elementor-widget-container > .elementor-html {
  display: contents;
}
/* …except when the parent relies on `space-y-*` / `divide-*` (needs a real box to carry the margin). */
body .jc-w.jc-box,
body .jc-w.jc-box > .elementor-widget-container {
  display: block;
}
.jc-w .elementor-widget-container p:empty { display: none; }
.elementor-widget.jc-w { width: auto; max-width: none; }

body:not(.elementor-editor-active) .elementor-widget.jc-w { position: static; }

/* Images keep the sizing classes of the original <img> */
.elementor-widget-image.jc-img { display: block; }
.elementor-widget-image.jc-img img { width: 100%; height: 100%; object-fit: inherit; object-position: inherit; }
.elementor-widget-image.jc-img.w-auto img { width: auto; }
body:not(.elementor-editor-active) .elementor-widget-image.jc-img > .elementor-widget-container { height: 100%; }

/* --- 4. Elementor editor: show animated blocks, keep layers pickable ---------------------------- */
body.elementor-editor-active .reveal,
body.elementor-editor-active .reveal-image,
body.elementor-editor-active .reveal-mask > span {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  transition: none !important;
}
body.elementor-editor-active #jc-header { position: absolute; }

/* --- 5. Theme chrome ------------------------------------------------------------------------- */
#jc-header [hidden] { display: none !important; }
#jc-mobile-toggle .jc-ico-close { display: none; }
#jc-mobile-toggle.jc-open .jc-ico-close { display: block; }
#jc-mobile-toggle.jc-open .jc-ico-open { display: none; }
body.admin-bar #jc-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar #jc-header { top: 46px; } }
html { scroll-behavior: smooth; }
#jc-main-wrap > main { display: block; }
.elementor-page main#primary,
main#primary.site-main { display: block; }

/* Make Elementor's own edit overlay not eat the layout. */
.elementor-section-wrap > .e-con { width: 100%; }

/* --- 6. Elementor kit typography / colour defaults must not leak into converted markup ---------- */
body .elementor-widget.jc-w,
body .elementor-widget.jc-w > .elementor-widget-container,
body .elementor-widget.jc-w .elementor-text-editor {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: inherit;
  text-decoration: inherit;
}

/* --- 7. Interactive widgets --------------------------------------------------------------- */
body:not(.elementor-editor-active) .jc-sw-off { display: none !important; }
/* inquiry form: swap the form for the success panel */
.jc-form-wrap .jc-form-success { display: none; }
.jc-form-wrap.jc-form-done .jc-form-success { display: block; }
.jc-form-wrap.jc-form-done form { display: none; }
