/* ==========================================================================
   SERENA — Elementor integration
   Keeps Elementor's wrappers neutral so the section widgets use the theme
   layout exactly as designed.
   ========================================================================== */

/* Widgets never add their own margins; each section owns its rhythm. */
.elementor-widget[class*="elementor-widget-serena_"] .elementor-widget-container {
  margin: 0;
  padding: 0;
}

.elementor-widget[class*="elementor-widget-serena_"] .elementor-widget-container > :first-child {
  margin-top: 0;
}

.elementor-section.elementor-section-full_width > .elementor-container {
  max-width: none;
}

.elementor-section.elementor-section-full_width > .elementor-container > .elementor-column > .elementor-element-populated {
  padding: 0;
}

/* The header is rendered before main; make the whole layout part sticky. */
.serena-layout-part--header {
  position: sticky;
  top: 0;
  z-index: 50;
}

body.admin-bar .serena-layout-part--header,
body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .serena-layout-part--header,
  body.admin-bar .site-header {
    top: 46px;
  }
}

.serena-header-section {
  position: static;
}

.serena-header-section .site-header {
  position: static;
}

.serena-footer-section {
  margin: 0;
}

/* Inner page two-column layout: 660px prose + 340px sidebar. */
.serena-page-body > .elementor-container {
  padding-block: var(--section-y);
  padding-inline: var(--gutter);
}

.serena-page-split > .elementor-container {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(32px, 5vw, 80px);
}

.serena-page-split .elementor-column {
  width: auto !important;
  flex: 0 1 auto;
  min-width: 0;
}

.serena-page-split .elementor-column:first-child {
  flex-grow: 1;
  max-width: 660px;
}

.serena-page-split .elementor-column:last-child {
  flex: 0 0 340px;
  max-width: 340px;
}

.serena-page-split .elementor-column > .elementor-element-populated {
  padding: 0;
}

.serena-page-split .elementor-widget-wrap {
  align-content: flex-start;
}

/* The closing CTA centres its button. */
.page-cta .wp-block-buttons,
.serena-cta-button {
  display: flex;
  justify-content: center;
}

.serena-cta-button .wp-block-buttons {
  margin: 0;
}

/* Elementor's global kit can change the body type; restore the theme voice. */
body.elementor-page,
body.elementor-template-full-width,
body.elementor-template-canvas {
  background: var(--ivory);
  color: var(--ink-soft);
  font-family: var(--font-body);
}

/* Keep the theme voice for widget headings, but never force the ink colour:
   headings on the dark bands and the footer rely on their own colour rules. */
.elementor-widget[class*="elementor-widget-serena_"] h1,
.elementor-widget[class*="elementor-widget-serena_"] h2,
.elementor-widget[class*="elementor-widget-serena_"] h3 {
  font-family: var(--font-display);
}

/* In the editor, never hide a freshly added widget behind the reveal animation. */
.elementor-editor-active .reveal,
.elementor-editor-active [data-reveal] {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .serena-page-split > .elementor-container {
    flex-wrap: wrap;
  }

  .serena-page-split .elementor-column:first-child,
  .serena-page-split .elementor-column:last-child {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100% !important;
  }
}
