/**
 * Elementor bridge.
 *
 * Aligns Elementor output with the theme's layout tokens. Loaded only when
 * Elementor renders a page or the editor preview is active.
 */

.elementor-section.elementor-section-boxed > .elementor-container {
  max-width: var(--blaze-container, 1400px);
}

.elementor-widget-container img {
  max-width: 100%;
  height: auto;
}

/*
   Editor preview wrapper: gives Elementor a drop target on empty documents.
   Header clearance comes from the .archive-header the canvas renders, since
   .site-header is absolutely positioned and would otherwise cover the first
   section.
*/
.blaze-elementor-canvas {
  width: 100%;
  min-height: 60vh;
}

/* Content slots already reserved by the listing page templates. */
.services-page__elementor-content:empty,
.blog-page__elementor-content:empty,
.detail-content__elementor:empty {
  display: none;
}

.services-page__elementor-content:not(:empty),
.blog-page__elementor-content:not(:empty) {
  margin-block: clamp(1.5rem, 3vw, 3rem);
}

/*
   Detail pages already space the title from .detail-content via
   .detail-section { gap: 24px }. Extra slot margin stacked on top of Elementor's
   default container padding and looked like a large gap under the h1.
*/
.detail-content__elementor:not(:empty) {
  margin-top: 0;
}

/* ==========================================
   Theme-rendered Elementor content

   Matches the .about-page-section rhythm so Elementor pages sit on the same
   grid as the hand-built templates. `.entry-content > *` clamps children to
   760px, which Elementor must opt out of since it manages its own width.
========================================== */

.entry-content > .elementor,
.services-page__elementor-content > .elementor,
.blog-page__elementor-content > .elementor {
  width: 100%;
  max-width: none;
}

/*
   Page-level rhythm only. The CPT detail slot also carries .entry-content (so it
   escapes the 760px clamp above), but it sits inside .detail-content next to ACF
   copy, where this spacing would dwarf the surrounding text — it keeps the
   smaller margin set on .detail-content__elementor instead.
*/
.entry-content:not(.detail-content__elementor) > .elementor {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 24px;
  margin-block: 80px;
}

/*
   Elementor gives every container 10px of default inline padding, and nested
   containers stack it, so Elementor text sat indented from headings the theme
   renders (.detail-title, .services-page__intro-title). Zeroing the default —
   rather than the padding itself — keeps padding set per container in Elementor
   working, so this only removes the unasked-for indent.
*/

.entry-content > .elementor,
.detail-content__elementor,
.services-page__elementor-content,
.blog-page__elementor-content {
  --container-default-padding-left: 0px;
  --container-default-padding-right: 0px;
}

/* Detail slot: also drop Elementor's default top padding so the first heading
   lines up under .detail-title the same way ACF copy does. Editor-set padding
   still wins because it writes --padding-top directly. */
.detail-content__elementor {
  --container-default-padding-top: 0px;
}

.detail-content__elementor .e-con-inner > :first-child,
.detail-content__elementor :is(h1, h2, h3, h4, h5, h6):first-child {
  margin-block-start: 0;
}

/*
   Typography defaults use :where() so they carry zero specificity. Elementor's
   atomic base classes only set margin and display, so these apply out of the
   box, while anything styled per element in Elementor still overrides them.
*/

:where(.entry-content > .elementor, .detail-content__elementor) :is(h1, h2, h3) {
  font-family: var(--blaze-font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: #111;
}

:where(.entry-content > .elementor, .detail-content__elementor) :is(h4, h5, h6) {
  font-family: var(--blaze-font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  color: #111;
}

:where(.entry-content > .elementor, .detail-content__elementor) p {
  font-size: 16px;
  line-height: 24px;
  color: var(--blaze-color-black);
  text-align: justify;
}

:where(.entry-content > .elementor, .detail-content__elementor) img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 991px) {
  :where(.entry-content > .elementor, .detail-content__elementor) :is(h1, h2, h3) {
    font-size: 42px;
  }
}

@media (max-width: 767px) {
  :where(.entry-content > .elementor, .detail-content__elementor) :is(h1, h2, h3) {
    font-size: 20px;
    font-weight: 600;
  }

  :where(.entry-content > .elementor, .detail-content__elementor) :is(h4, h5, h6) {
    font-size: 18px;
    font-weight: 700;
  }
}

@media (max-width: 600px) {
  .entry-content:not(.detail-content__elementor) > .elementor {
    gap: 16px;
    padding-block: 16px;
    margin-block: 32px;
  }
}
