/* EKL Back to Top v1.1.1 - native link, CSS-drawn white arrow, square corners. */
.ekl-back-to-top-start {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

html {
    scroll-behavior: smooth;
}

/* Explicit link-state styling prevents Hello Elementor/global link colors
   from changing the button appearance, including on hover and focus. */
a.ekl-back-to-top,
a.ekl-back-to-top:link,
a.ekl-back-to-top:visited,
a.ekl-back-to-top:hover,
a.ekl-back-to-top:focus,
a.ekl-back-to-top:active {
    box-sizing: border-box;
    position: fixed;
    right: calc(24px + env(safe-area-inset-right, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    margin: 0;
    border: 1px solid #002856;
    border-radius: 0;
    background-color: #002856;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 20, 43, .18);
    -webkit-tap-highlight-color: transparent;
    transition: background-color .18s ease, border-color .18s ease;
}

a.ekl-back-to-top:hover {
    background-color: #174969;
    border-color: #174969;
}

a.ekl-back-to-top:focus-visible {
    outline: 3px solid #d99b25;
    outline-offset: 3px;
}

/* CSS-only arrow: no SVG currentColor inheritance and no image/data URLs.
   Both pieces are white regardless of link and hover styles in the theme. */
a.ekl-back-to-top .ekl-back-to-top__arrow {
    display: block;
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    background: transparent;
    opacity: 1;
}

a.ekl-back-to-top .ekl-back-to-top__arrow::before {
    content: '';
    display: block;
    box-sizing: border-box;
    position: absolute;
    width: 11px;
    height: 11px;
    top: 4px;
    left: 50%;
    border-top: 2.5px solid #fff;
    border-left: 2.5px solid #fff;
    transform: translateX(-50%) rotate(45deg);
}

a.ekl-back-to-top .ekl-back-to-top__arrow::after {
    content: '';
    display: block;
    position: absolute;
    width: 2.5px;
    height: 16px;
    top: 4px;
    left: calc(50% - 1.25px);
    background-color: #fff;
}

/* Where supported, reveal after roughly 500px of scrolling.
   Other browsers retain the always-visible working button. */
@keyframes ekl-back-to-top-reveal {
    0%, 79% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }
}

@supports (animation-timeline: scroll()) and (animation-range: 0px 500px) {
    a.ekl-back-to-top {
        animation-name: ekl-back-to-top-reveal;
        animation-duration: 1ms;
        animation-fill-mode: both;
        animation-timing-function: linear;
        animation-timeline: scroll(root block);
        animation-range: 0px 500px;
    }
}

@media (max-width: 767px) {
    a.ekl-back-to-top,
    a.ekl-back-to-top:link,
    a.ekl-back-to-top:visited,
    a.ekl-back-to-top:hover,
    a.ekl-back-to-top:focus,
    a.ekl-back-to-top:active {
        right: calc(16px + env(safe-area-inset-right, 0px));
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    a.ekl-back-to-top {
        transition: none;
    }
}
