/* Kirst Core 3.1 integration fixes. */

/* Elementor wrappers must not introduce a vertical offset in Astra Header Builder. */
.elementor-widget-kirst-header-contact,
.elementor-widget-kirst-header-contact > .elementor-widget-container,
.elementor-widget-kirst-header-contact .elementor-widget-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100% !important;
    line-height: 1 !important;
}

.kirst-header-contact {
    width: var(--kirst-contact-button-size, 58px) !important;
    height: var(--kirst-contact-button-size, 58px) !important;
    vertical-align: middle !important;
    align-self: center !important;
    top: auto !important;
    bottom: auto !important;
    transform: translate3d(0, var(--kirst-contact-button-offset-y, 0px), 0) !important;
}

.kirst-header-contact__trigger {
    width: var(--kirst-contact-button-size, 58px) !important;
    min-width: var(--kirst-contact-button-size, 58px) !important;
    height: var(--kirst-contact-button-size, 58px) !important;
    min-height: var(--kirst-contact-button-size, 58px) !important;
    line-height: 1 !important;
}

@media (max-width: 921px) {
    .kirst-header-contact,
    .kirst-header-contact__trigger {
        width: var(--kirst-contact-button-mobile-size, 54px) !important;
        min-width: var(--kirst-contact-button-mobile-size, 54px) !important;
        height: var(--kirst-contact-button-mobile-size, 54px) !important;
        min-height: var(--kirst-contact-button-mobile-size, 54px) !important;
    }
}

/* Keep Astra Back to Top clickable above page effects, but below full-screen panels. */
#ast-scroll-top,
.ast-scroll-top-icon,
[class*="ast-scroll-top"] {
    pointer-events: auto !important;
    z-index: 99990 !important;
}

body.kirst-contact-panel-active #ast-scroll-top,
body.kirst-mobile-contact-open #ast-scroll-top {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Stable editor preview: complex widgets remain visible while editing. */
.elementor-editor-active .kirst-beyond__intro,
.elementor-editor-active .kirst-beyond__headline,
.elementor-editor-active .kirst-beyond__disciplines,
.elementor-editor-active .kirst-beyond__final,
.elementor-editor-active .kat-bridge__intro,
.elementor-editor-active .kat-bridge__headline,
.elementor-editor-active .kat-bridge__values,
.elementor-editor-active .kat-bridge__final,
.elementor-editor-active .kes-bridge__intro,
.elementor-editor-active .kes-bridge__headline,
.elementor-editor-active .kes-bridge__values,
.elementor-editor-active .kes-bridge__final,
.elementor-editor-active .kin-bridge__intro,
.elementor-editor-active .kin-bridge__headline,
.elementor-editor-active .kin-bridge__values,
.elementor-editor-active .kin-bridge__final {
    opacity: 1 !important;
    visibility: visible !important;
}

/* =========================================================
   WEBKIT / IOS PERFORMANCE PROFILE — KIRST CORE 3.1.3

   Safari keeps sticky scrolling on a compositor thread. Avoid turning the
   sticky viewport itself into another transformed layer; animate children
   instead. This removes the vertical "catch-up" / bounce seen on Mac Safari
   and iPhone while preserving the scroll-driven design.
========================================================= */

html.kirst-webkit-engine #kirst-beyond-property {
    --kb-sticky-overscan: 0px;
}

html.kirst-webkit-engine .kirst-beyond__sticky,
html.kirst-webkit-engine .kgv6-sticky,
html.kirst-webkit-engine .kes-bridge__sticky,
html.kirst-webkit-engine .kat-bridge__sticky,
html.kirst-webkit-engine .kin-bridge__sticky,
html.kirst-webkit-engine .kep6-sticky,
html.kirst-webkit-engine .katp-sticky,
html.kirst-webkit-engine .kinp-sticky {
    -webkit-transform: none !important;
    transform: none !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    will-change: auto !important;
    contain: none !important;
}

/* Large decorative layers stay visually equivalent without permanent layer
   promotion. Radial gradients remain intact; only forced compositing is cut. */
html.kirst-webkit-engine .kirst-beyond__backdrop,
html.kirst-webkit-engine .kes-bridge__ambient-glow,
html.kirst-webkit-engine .kat-bridge__ambient-glow,
html.kirst-webkit-engine .kin-bridge__glow,
html.kirst-webkit-engine .kes-bridge__ambient-circle,
html.kirst-webkit-engine .kat-bridge__ambient-circle,
html.kirst-webkit-engine .kin-bridge__orbit {
    will-change: auto !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
}

/* iOS has a much smaller layer/GPU budget than desktop Safari. Keep all
   typography/geometry animations, but remove effects that repaint large
   surfaces every scroll frame. */
html.kirst-webkit-engine .kirst-beyond__discipline,
html.kirst-webkit-engine .kirst-beyond__final,
html.kirst-webkit-engine .kes-bridge__value,
html.kirst-webkit-engine .kes-bridge__final,
html.kirst-webkit-engine .kat-bridge__value,
html.kirst-webkit-engine .kat-bridge__final,
html.kirst-webkit-engine .kin-bridge__value,
html.kirst-webkit-engine .kin-bridge__final,
html.kirst-webkit-engine .kin-bridge__curve-shadow {
    filter: none !important;
}

html.kirst-ios-device #kirst-investment-process-v1 svg * {
    filter: none !important;
}

html.kirst-ios-device #kirst-estate-services-v3 .kest-svc__hero-num,
html.kirst-ios-device #kirst-estate-services-v3 .kest-svc__num {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html.kirst-ios-device .kirst-portal__symbol,
html.kirst-ios-device .kirst-portal__category {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

@media (max-width: 767px) {
    html.kirst-ios-device .kgv6-sticky,
    html.kirst-ios-device .kes-bridge__sticky,
    html.kirst-ios-device .kat-bridge__sticky,
    html.kirst-ios-device .kin-bridge__sticky,
    html.kirst-ios-device .kep6-sticky,
    html.kirst-ios-device .katp-sticky,
    html.kirst-ios-device .kinp-sticky,
    html.kirst-ios-device .kirst-beyond__sticky {
        text-rendering: auto !important;
    }
}

/* Safari/WebKit sticky stability.
   Keep the scroll section itself out of the overflow chain. The sticky
   viewport already clips the artwork, so horizontal section clipping is
   unnecessary and can create a secondary scrolling ancestor in WebKit. */
html.kirst-webkit-engine #kirst-estate-services-bridge,
html.kirst-webkit-engine #kirst-atelier-services-bridge,
html.kirst-webkit-engine #kirst-investment-strategy-bridge {
    overflow: visible !important;
}

/* The component JavaScript deliberately freezes a pixel viewport height.
   Do not let 100lvh override that measurement on WebKit while browser chrome
   expands/collapses. */
html.kirst-webkit-engine .kes-bridge__sticky {
    height: var(--kes-viewport-height) !important;
    min-height: var(--kes-viewport-height) !important;
}

html.kirst-webkit-engine .kat-bridge__sticky {
    height: var(--kat-viewport-height) !important;
    min-height: var(--kat-viewport-height) !important;
}

/* geometricPrecision is noticeably more expensive on transformed type in
   WebKit. Font size/weight/spacing stay identical; only the rendering hint is
   relaxed while the section is moving. */
html.kirst-webkit-engine .kgv6-sticky,
html.kirst-webkit-engine .kes-bridge__sticky,
html.kirst-webkit-engine .kat-bridge__sticky,
html.kirst-webkit-engine .kin-bridge__sticky,
html.kirst-webkit-engine .kep6-sticky,
html.kirst-webkit-engine .katp-sticky,
html.kirst-webkit-engine .kinp-sticky,
html.kirst-webkit-engine .kirst-beyond__sticky {
    text-rendering: auto !important;
}


/* =========================================================
   WEBKIT STICKY HOST HARDENING — 3.1.3
   Keep Elementor's immediate widget wrappers out of the containing-block and
   clipping chains while Kirst sections are pinned. This is scoped to Kirst
   widgets only and does not touch ordinary Elementor sections.
========================================================= */
html.kirst-webkit-engine .elementor-widget-kirst-beyond-property,
html.kirst-webkit-engine .elementor-widget-kirst-estate-bridge,
html.kirst-webkit-engine .elementor-widget-kirst-atelier-bridge,
html.kirst-webkit-engine .elementor-widget-kirst-investment-bridge,
html.kirst-webkit-engine .elementor-widget-kirst-estate-process,
html.kirst-webkit-engine .elementor-widget-kirst-atelier-process,
html.kirst-webkit-engine .elementor-widget-kirst-investment-process,
html.kirst-webkit-engine .elementor-widget-kirst-beyond-property > .elementor-widget-container,
html.kirst-webkit-engine .elementor-widget-kirst-estate-bridge > .elementor-widget-container,
html.kirst-webkit-engine .elementor-widget-kirst-atelier-bridge > .elementor-widget-container,
html.kirst-webkit-engine .elementor-widget-kirst-investment-bridge > .elementor-widget-container,
html.kirst-webkit-engine .elementor-widget-kirst-estate-process > .elementor-widget-container,
html.kirst-webkit-engine .elementor-widget-kirst-atelier-process > .elementor-widget-container,
html.kirst-webkit-engine .elementor-widget-kirst-investment-process > .elementor-widget-container {
    overflow: visible !important;
    contain: none !important;
    -webkit-transform: none !important;
    transform: none !important;
}

/* Safari desktop can use Lenis, but iOS stays fully native. */
html.kirst-safari-lenis {
    scroll-behavior: auto !important;
}
