/* ==========================================================================
   1. HIB ARTIKKELLINK - BANNER BUTTON STYLES
   ==========================================================================
*/

/* Shared timing tokens also cover overlays rendered outside the card node. */
.hib-wrapper,
.hib-overlay-modal {
    --hib-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --hib-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --hib-hover-duration: 900ms;
    --hib-hover-ease: var(--hib-ease-out);
}

.hib-frontpage-container {
    --dom-r: 50;
    --dom-g: 50;
    --dom-b: 50;
    --dom-a: 1;
    --pd-sm: 20px;
    --pd-md: 40px;
    --pd-lg: 60px;
    --pd-xl: 120px;
    --hib-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --hib-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --hib-hover-duration: 900ms;
    --hib-hover-ease: var(--hib-ease-out);
    --hib-brightness: 1;
    --hib-saturation: 1;
    --hib-contrast: 1;
    --hib-image-blur: 0px;
    color: var(--text-color, #ffffff) !important;
    background-color: rgba(var(--dom-r), var(--dom-g), var(--dom-b), var(--dom-a, 1));

    position: relative !important;
    display: flex !important;
    width: 100% !important;
    max-width: var(--hib-max-width, 100%) !important;

    /* HØYDE & PROPOSJONER (STYRES VIA VARIABLER) */
    height: var(--hib-height, 360px) !important;
    min-height: var(--hib-min-height, 360px) !important;
    aspect-ratio: var(--hib-aspect-ratio, auto) !important;
    text-decoration: none !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-family: var(--hib-font, sans-serif) !important;

    /* Shared card motion: only animate properties that effects actually change. */
    transition: transform var(--hib-hover-duration) var(--hib-ease-out),
                box-shadow var(--hib-hover-duration) var(--hib-ease-out) !important;
    cursor: pointer;

    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: var(--hib-margin-left, auto) !important;
    margin-right: var(--hib-margin-right, auto) !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
    line-height: normal !important;

    /* Isolerer z-index */
    z-index: 0 !important;
}

.hib-frontpage-container .hib-title,
.hib-frontpage-container .hib-text,
.hib-frontpage-container .hib-text *,
.hib-frontpage-container .hib-arrow,
.hib-frontpage-container .hib-graphic,
.hib-frontpage-container .hib-link-type-icon,
.hib-frontpage-container .hib-link-type-icon i {
    color: var(--text-color, #ffffff) !important;
}

.hib-frontpage-container *,
.hib-frontpage-container *::before,
.hib-frontpage-container *::after {
    box-sizing: border-box !important;
}

.hib-wrapper,
.hib-block-editor-wrapper {
    container-type: inline-size;
}

/* HOVER EFFECTS (Desktop Only) */
@media (min-width: 769px) and (hover: hover), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-hover-shadow-none):hover {
        /* Default hover for older blocks */
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    }

    .hib-frontpage-container.hib-pointer-hover-active.hib-hover-shadow-soft:hover {
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18) !important;
    }

    .hib-frontpage-container.hib-pointer-hover-active.hib-hover-shadow-hard:hover {
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28) !important;
    }

    .hib-frontpage-container.hib-pointer-hover-active.hib-hover-shadow-glow:hover {
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16), 0 0 28px rgba(255, 255, 255, 0.2) !important;
    }

    .hib-frontpage-container.hib-pointer-hover-active.hib-hover-shadow-none:hover {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
        /* Keep base shadow */
    }
}

.hib-frontpage-container.hib-testimonials-slider,
.hib-frontpage-container.hib-latest-posts,
.hib-frontpage-container.hib-mode-cover {
    cursor: default !important;
}

/* --- BILDE --- */
.hib-bg-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;

    /* Default Scale 1.05 for at den kan synke tilbake til 1.0 */
    transform: scale(1.05);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    will-change: transform, opacity, filter;
    filter: blur(var(--hib-image-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast));

    transition: transform var(--hib-hover-duration) var(--hib-hover-ease),
                filter 760ms var(--hib-ease-in-out),
                opacity 760ms var(--hib-ease-in-out) !important;

    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    border: none !important;
    z-index: 0 !important;
}

.hib-bg-wrapper {
    position: absolute !important;
    top: 0 !important;
    height: 100% !important;
    z-index: 1 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: var(--bg-w, 100%) !important;
    transform: translateZ(0); /* Z-index fix for Safari hardware accel */
    backface-visibility: hidden;
}

.hib-bg-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(135deg, rgba(var(--dom-r), var(--dom-g), var(--dom-b), 0.16), rgba(8, 12, 20, 0.05));
    mix-blend-mode: soft-light;
    transition: opacity var(--hib-hover-duration) var(--hib-ease-in-out);
}

/* Fixed parallax uses a background layer instead of an img element. Give it
   the same predictable geometry so testimonial images cannot collapse. */
.hib-fixed-bg {
    position: absolute !important;
    inset: -30px !important;
    width: calc(100% + 60px) !important;
    height: calc(100% + 60px) !important;
    z-index: 1 !important;
    pointer-events: none !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center;
    background-attachment: fixed !important;
    transform: none;
    transform-origin: center;
    backface-visibility: hidden;
    will-change: scale, filter, opacity;
}

/* Gradient Overlay */
.hib-overlay-gradient {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 2 !important;
    background: var(--grad-bg, linear-gradient(to bottom, var(--c-start) var(--g-start, 20%), var(--c-mid) var(--g-mid, 60%), var(--c-end) var(--g-end, 100%))) !important;
    transform: translateZ(0); /* Fiks for Safari mobile: bevarer z-index mot parallax img */
    backface-visibility: hidden;
}

/* --- GLASSMORPHISM & GRADIENT STYLES --- */
.hib-style-glass .hib-overlay-gradient {
    /* Keep a subtle dark gradient to ensure text readability if the image is extremely bright */
    background: var(--grad-bg, linear-gradient(180deg, rgba(var(--dom-r), var(--dom-g), var(--dom-b), calc(var(--dom-a, 1) * 0.1)) var(--g-start, 0%), rgba(var(--dom-r), var(--dom-g), var(--dom-b), calc(var(--dom-a, 1) * 0.5)) var(--g-end, 100%))) !important;
}

.hib-style-glass .hib-content {
    background: rgba(var(--glass-bg-r, 255), var(--glass-bg-g, 255), var(--glass-bg-b, 255), var(--glass-opacity, 0.12)) !important;
    backdrop-filter: blur(var(--glass-blur, 12px));
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px));
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: var(--glass-radius, 16px) !important;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.35), 0 8px 32px 0 rgba(0, 0, 0, 0.22) !important;
    margin-top: var(--glass-margin, 30px) !important;
    margin-bottom: var(--glass-margin, 30px) !important;
    height: auto !important;
    max-height: calc(100% - calc(var(--glass-margin, 30px) * 2)) !important;
    align-self: center !important;
    width: var(--glass-width, 55%) !important;
    padding: var(--glass-pt, 40px) var(--glass-px, 40px) var(--glass-pb, 40px) var(--glass-px, 40px) !important;
    /* Tving maskinvareakselerasjon for smooth animasjon */
    will-change: transform, opacity, backdrop-filter, -webkit-backdrop-filter;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: opacity var(--anim-duration, 1.1s) var(--hib-ease-out),
                transform var(--anim-duration, 1.1s) var(--hib-ease-out),
                backdrop-filter var(--anim-duration, 1.1s) var(--hib-ease-out),
                -webkit-backdrop-filter var(--anim-duration, 1.1s) var(--hib-ease-out) !important;
}

@container (min-width: 600px) {
    .hib-layout-left.hib-style-glass .hib-content {
        margin-right: var(--glass-margin-x, 0px) !important;
    }

    .hib-layout-right.hib-style-glass .hib-content {
        margin-left: var(--glass-margin-x, 0px) !important;
    }

    .hib-layout-left.hib-glass-no-outer-radius .hib-content {
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    .hib-layout-right.hib-glass-no-outer-radius .hib-content {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }
}

@container (max-width: 599px) {
    .hib-style-glass .hib-content {
        margin: 15px var(--glass-margin-mobile-x, 15px) !important;
        width: calc(100% - calc(var(--glass-margin-mobile-x, 15px) * 2)) !important;
        max-height: none !important;
        align-self: flex-end !important;
        padding-top: 25px !important;
    }
}

/* ==========================================================================
   MOTION SYSTEM — ENTRANCE, HOVER, AND MICRO-INTERACTIONS
   ========================================================================== */
.hib-content {
    position: relative !important;
    z-index: 3 !important;
    width: 55% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 40px;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition: opacity var(--anim-duration, 1.1s) var(--hib-ease-out),
                transform var(--anim-duration, 1.1s) var(--hib-ease-out),
                backdrop-filter var(--anim-duration, 1.1s) var(--hib-ease-out),
                -webkit-backdrop-filter var(--anim-duration, 1.1s) var(--hib-ease-out) !important;
}

.hib-valign-top .hib-content { justify-content: flex-start !important; }
.hib-valign-center .hib-content { justify-content: center !important; }
.hib-valign-bottom .hib-content { justify-content: flex-end !important; }

.hib-frontpage-container.hib-animate .hib-testimonial-slide-content {
    transition: opacity var(--anim-duration, 1.1s) var(--hib-ease-out),
                transform var(--anim-duration, 1.1s) var(--hib-ease-out) !important;
}

/* Keep the entire content group on one compositor layer while it enters.
   Child layers are promoted only when their later hover interaction needs it. */
.hib-frontpage-container.hib-animate.is-entering .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.is-entering .hib-testimonial-slide-content {
    will-change: transform, opacity;
}

/* Entrance animations reveal once. JavaScript leaves is-visible in place. */
.hib-frontpage-container.hib-animate:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate:not(.is-visible) .hib-testimonial-slide-content {
    opacity: 0 !important;
}

.hib-frontpage-container.hib-style-glass.hib-animate:not(.is-visible) .hib-content {
    backdrop-filter: blur(0) !important;
    -webkit-backdrop-filter: blur(0) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-fade-up:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-fade-up:not(.is-visible) .hib-testimonial-slide-content {
    transform: translate3d(0, var(--anim-distance, 36px), 0) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-drop-down:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-drop-down:not(.is-visible) .hib-testimonial-slide-content {
    transform: translate3d(0, calc(0px - var(--anim-distance, 36px)), 0) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-slide-left:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-slide-left:not(.is-visible) .hib-testimonial-slide-content {
    transform: translate3d(var(--anim-distance, 36px), 0, 0) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-slide-right:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-slide-right:not(.is-visible) .hib-testimonial-slide-content {
    transform: translate3d(calc(0px - var(--anim-distance, 36px)), 0, 0) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-scale-up:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-scale-up:not(.is-visible) .hib-testimonial-slide-content {
    transform: scale(0.94) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-scale-down:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-scale-down:not(.is-visible) .hib-testimonial-slide-content {
    transform: scale(1.06) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-zoom-in:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-zoom-in:not(.is-visible) .hib-testimonial-slide-content {
    transform: scale(0.88) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-zoom-out:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-zoom-out:not(.is-visible) .hib-testimonial-slide-content {
    transform: scale(1.12) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-flip-up:not(.is-visible) .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-flip-up:not(.is-visible) .hib-testimonial-slide-content {
    transform: perspective(900px) rotateX(10deg) translate3d(0, var(--anim-distance-soft, 21.6px), 0) !important;
    transform-origin: center bottom;
}

.hib-frontpage-container.hib-animate.is-visible .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.is-visible .hib-testimonial-slide-content {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
}

.hib-frontpage-container.hib-animate.hib-entrance-flip-up.is-visible .hib-content,
.hib-frontpage-container.hib-testimonials-slider.hib-animate.hib-entrance-flip-up.is-visible .hib-testimonial-slide-content {
    transform: perspective(900px) rotateX(0) translate3d(0, 0, 0) !important;
}

/* Free Canvas contains independently animated Gutenberg blocks. Its parent
   content layer must remain neutral or those child effects finish invisibly. */
.hib-frontpage-container.hib-mode-cover.hib-animate .hib-content {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Animate the Free Canvas background shell instead. This isolates entrance
   motion from both inner blocks and the image's hover/parallax transform. */
.hib-frontpage-container.hib-mode-cover.hib-animate .hib-bg-wrapper {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center;
    transition: opacity var(--anim-duration, 1.1s) var(--hib-ease-out),
                transform var(--anim-duration, 1.1s) var(--hib-ease-out),
                filter var(--anim-duration, 1.1s) var(--hib-ease-in-out) !important;
}

.hib-frontpage-container.hib-mode-cover.hib-animate:not(.is-visible) .hib-bg-wrapper {
    opacity: 0.82;
    filter: blur(2.5px);
    transform: translate3d(0, 0, 0) scale(1.025);
}

/* Background reveal follows the content with a smaller, calmer movement. */
.hib-frontpage-container.hib-animate:not(.hib-mode-cover):not(.hib-parallax-enabled) .hib-bg-img,
.hib-frontpage-container.hib-testimonials-slider.hib-animate:not(.hib-parallax-enabled) .hib-testimonial-bg-img {
    transition: transform var(--anim-duration, 1.1s) var(--hib-ease-out),
                filter var(--anim-duration, 1.1s) var(--hib-ease-in-out),
                opacity var(--anim-duration, 1.1s) var(--hib-ease-in-out) !important;
}

.hib-frontpage-container.hib-animate:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-wrapper::after {
    opacity: 0.3;
}

.hib-frontpage-container.hib-animate:not(.hib-mode-cover):not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
    transform: scale(1.11) !important;
    opacity: 0.84 !important;
    filter: blur(3px) brightness(0.94) saturate(0.92) contrast(0.98) !important;
}

.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-fade-up:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
    transform: translate3d(0, var(--anim-distance-bg, 12.6px), 0) scale(1.11) !important;
}
.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-drop-down:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
    transform: translate3d(0, calc(0px - var(--anim-distance-bg, 12.6px)), 0) scale(1.11) !important;
}
.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-slide-left:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
    transform: translate3d(var(--anim-distance-bg, 12.6px), 0, 0) scale(1.11) !important;
}
.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-slide-right:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
    transform: translate3d(calc(0px - var(--anim-distance-bg, 12.6px)), 0, 0) scale(1.11) !important;
}
.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-scale-up:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img,
.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-zoom-in:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
    transform: scale(1.01) !important;
    filter: blur(1.5px) brightness(0.96) saturate(0.94) contrast(0.99) !important;
}
.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-scale-down:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img,
.hib-frontpage-container.hib-animate:not(.hib-mode-cover).hib-entrance-zoom-out:not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
    transform: scale(1.14) !important;
}

.hib-frontpage-container.hib-animate:not(.hib-mode-cover):not(.hib-parallax-enabled).is-visible .hib-bg-img {
    transform: scale(1.05) !important;
    opacity: 1 !important;
    filter: blur(var(--hib-image-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
}

.hib-frontpage-container.hib-testimonials-slider.hib-animate:not(.hib-parallax-enabled):not(.is-visible) .hib-testimonial-bg-img {
    transform: scale(1.19) !important;
    opacity: 0.9 !important;
    filter: blur(calc(var(--testi-bg-blur, 10px) + 3px)) brightness(0.94) saturate(0.92) contrast(0.98) !important;
}
.hib-frontpage-container.hib-testimonials-slider.hib-animate:not(.hib-parallax-enabled).is-visible .hib-testimonial-bg-img {
    transform: scale(1.15) !important;
    opacity: 1 !important;
    filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
}

@media (max-width: 768px) {
    .hib-frontpage-container.hib-animate:not(.hib-mode-cover):not(.hib-parallax-enabled):not(.is-visible) .hib-bg-img {
        filter: brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
}

/* Hover effects are fine-pointer interactions and compose predictably with shadows. */
@media (min-width: 769px) and (hover: hover) and (pointer: fine), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-frontpage-container.hib-hover-zoom-in,
    .hib-frontpage-container.hib-hover-zoom-out {
        --hib-hover-duration: 1600ms;
        --hib-hover-ease: cubic-bezier(0.22, 1, 0.36, 1);
    }

    .hib-frontpage-container.hib-hover-quick-zoom-in,
    .hib-frontpage-container.hib-hover-quick-zoom-out {
        --hib-hover-duration: 900ms;
    }

    .hib-frontpage-container.hib-pointer-hover-active[class*="hib-hover-"]:hover {
        --hib-saturation: 1.055;
        --hib-contrast: 1.025;
    }
    .hib-frontpage-container.hib-pointer-hover-active[class*="hib-hover-"]:hover .hib-bg-wrapper::after {
        opacity: 0.22;
    }

    .hib-frontpage-container:not(.hib-parallax-enabled).hib-hover-zoom-out .hib-bg-img {
        transform: scale(1.065) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-parallax-enabled).hib-hover-zoom-out:hover .hib-bg-img {
        transform: scale(1.035) !important;
    }
    .hib-frontpage-container:not(.hib-parallax-enabled).hib-hover-zoom-in .hib-bg-img {
        transform: scale(1.045) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-parallax-enabled).hib-hover-zoom-in:hover .hib-bg-img {
        transform: scale(1.075) !important;
    }

    /* The visible entrance state has more selector weight than the original
       hover rules. Repeat the image states with matching weight so entrance
       animation and desktop hover can coexist. */
    .hib-frontpage-container.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-parallax-enabled).hib-hover-zoom-out .hib-bg-img {
        transform: scale(1.065) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-parallax-enabled).hib-hover-zoom-out:hover .hib-bg-img {
        transform: scale(1.035) !important;
    }
    .hib-frontpage-container.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-parallax-enabled).hib-hover-zoom-in .hib-bg-img {
        transform: scale(1.045) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-parallax-enabled).hib-hover-zoom-in:hover .hib-bg-img {
        transform: scale(1.075) !important;
    }

    /* Free Canvas hover uses the independent scale property. The transform
       channel stays stable, so viewport replay cannot make the image jump. */
    .hib-frontpage-container.hib-mode-cover:not(.hib-parallax-enabled) .hib-bg-img {
        transform: translate3d(0, 0, 0) !important;
        scale: 1.05;
        transition: scale var(--hib-hover-duration) var(--hib-hover-ease),
                    filter 760ms var(--hib-ease-in-out),
                    opacity 760ms var(--hib-ease-in-out) !important;
    }
    .hib-frontpage-container.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-zoom-out .hib-bg-img {
        scale: 1.065;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-zoom-out:hover .hib-bg-img {
        scale: 1.035;
    }
    .hib-frontpage-container.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-zoom-in .hib-bg-img {
        scale: 1.045;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-zoom-in:hover .hib-bg-img {
        scale: 1.075;
    }

    .hib-frontpage-container.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-zoom-out .hib-testimonial-bg-img {
        transform: scale(1.175) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-zoom-out:hover .hib-testimonial-bg-img {
        transform: scale(1.15) !important;
    }
    .hib-frontpage-container.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-zoom-in .hib-testimonial-bg-img {
        transform: scale(1.15) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-zoom-in:hover .hib-testimonial-bg-img {
        transform: scale(1.18) !important;
    }

    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-blur-in:hover .hib-bg-img {
        filter: blur(3px) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container:not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-blur-out .hib-bg-img {
        filter: blur(3px) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-blur-out:hover .hib-bg-img {
        filter: blur(0) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-blur-in:hover .hib-bg-img {
        filter: blur(3px) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-blur-out .hib-bg-img {
        filter: blur(3px) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-blur-out:hover .hib-bg-img {
        filter: blur(0) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-blur-in:hover .hib-testimonial-bg-img {
        filter: blur(calc(var(--testi-bg-blur, 10px) + 3px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-blur-out .hib-testimonial-bg-img {
        filter: blur(calc(var(--testi-bg-blur, 10px) + 3px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-blur-out:hover .hib-testimonial-bg-img {
        filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-zoom-out .hib-testimonial-bg-img {
        transform: scale(1.175) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-zoom-out:hover .hib-testimonial-bg-img {
        transform: scale(1.15) !important;
    }
    .hib-frontpage-container.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-zoom-in .hib-testimonial-bg-img {
        transform: scale(1.15) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-zoom-in:hover .hib-testimonial-bg-img {
        transform: scale(1.18) !important;
    }

    /* Quick zoom preserves the previous speed and movement range. */
    .hib-frontpage-container:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-out .hib-bg-img,
    .hib-frontpage-container.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-out .hib-bg-img {
        transform: scale(1.08) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-out:hover .hib-bg-img,
    .hib-frontpage-container.hib-pointer-hover-active.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-out:hover .hib-bg-img {
        transform: scale(1.02) !important;
    }
    .hib-frontpage-container:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-in .hib-bg-img,
    .hib-frontpage-container.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-in .hib-bg-img {
        transform: scale(1.03) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-in:hover .hib-bg-img,
    .hib-frontpage-container.hib-pointer-hover-active.hib-animate.is-visible:not(.hib-mode-cover):not(.hib-testimonials-slider):not(.hib-parallax-enabled).hib-hover-quick-zoom-in:hover .hib-bg-img {
        transform: scale(1.10) !important;
    }

    .hib-frontpage-container.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-quick-zoom-out .hib-bg-img {
        scale: 1.08;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-quick-zoom-out:hover .hib-bg-img {
        scale: 1.015;
    }
    .hib-frontpage-container.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-quick-zoom-in .hib-bg-img {
        scale: 1.03;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-mode-cover:not(.hib-parallax-enabled).hib-hover-quick-zoom-in:hover .hib-bg-img {
        scale: 1.10;
    }

    .hib-frontpage-container.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-quick-zoom-out .hib-testimonial-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-quick-zoom-out .hib-testimonial-bg-img {
        transform: scale(1.19) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-quick-zoom-out:hover .hib-testimonial-bg-img,
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-quick-zoom-out:hover .hib-testimonial-bg-img {
        transform: scale(1.14) !important;
    }
    .hib-frontpage-container.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-quick-zoom-in .hib-testimonial-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-quick-zoom-in .hib-testimonial-bg-img {
        transform: scale(1.14) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider:not(.hib-parallax-enabled).hib-hover-quick-zoom-in:hover .hib-testimonial-bg-img,
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-quick-zoom-in:hover .hib-testimonial-bg-img {
        transform: scale(1.21) !important;
    }

    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-blur-in:hover .hib-testimonial-bg-img {
        filter: blur(calc(var(--testi-bg-blur, 10px) + 3px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-blur-out .hib-testimonial-bg-img {
        filter: blur(calc(var(--testi-bg-blur, 10px) + 3px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-testimonials-slider.hib-animate.is-visible:not(.hib-parallax-enabled).hib-hover-blur-out:hover .hib-testimonial-bg-img {
        filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-frontpage-container.hib-hover-brighten {
        --hib-brightness: 0.92;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-hover-brighten:hover {
        --hib-brightness: 1.14;
        --hib-saturation: 1.10;
        --hib-contrast: 1.04;
    }

    .hib-frontpage-container.hib-pointer-hover-active:not(.hib-parallax-enabled).hib-hover-lift:hover {
        transform: translate3d(0, -5px, 0) scale(1.006);
    }
}


.hib-content>*:last-child {
    margin-bottom: 0 !important;
}

/* --- TYPOGRAFI --- */
.hib-arrow {
    font-size: clamp(2.5rem, 4vw, 3.5rem) !important;
    transition: transform 720ms var(--hib-ease-out) !important;
    display: inline-block !important;
    color: inherit !important;
    line-height: 1 !important;
    margin-bottom: 15px !important;
    opacity: 0.9;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: none;
}

@media (min-width: 769px) and (hover: hover), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-frontpage-container.hib-pointer-hover-active.is-entry-complete:hover .hib-arrow {
        transform: translateX(5px);
    }
}

.hib-title {
    font-family: var(--hib-font, sans-serif) !important;
    font-size: clamp(2rem, 3.8vw, 3.8rem) !important;
    font-weight: 400 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.1 !important;
    color: inherit !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;

    /* Klargjør for hover */
    transition: transform 720ms var(--hib-ease-out) !important;
    transform-origin: left center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: none;
}

/* Juster transform origin basert på alignment */
.hib-align-center .hib-title {
    transform-origin: center center;
}

.hib-align-right .hib-title {
    transform-origin: right center;
}

.hib-graphic {
    display: block !important;
    height: auto !important;
    object-fit: contain !important;
    margin-bottom: 15px !important;
    transition: transform 720ms var(--hib-ease-out) !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transform: none;
}

.hib-text {
    font-family: var(--hib-font, sans-serif) !important;
    font-size: clamp(1rem, 1.2vw, 1.25rem) !important;
    line-height: 1.5 !important;
    margin: 0 0 20px 0 !important;
    opacity: 0.9 !important;
    color: inherit !important;
    padding: 0 !important;
    max-width: 90%;
    text-transform: none !important;
}

/* Tekst-animasjon (Wave) for underoverskrift på desktop-hover */
.hib-char-anim {
    display: inline-block;
    will-change: auto;
    transform-origin: bottom center;
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-frontpage-container.hib-pointer-hover-active.is-entry-complete:not(.hib-no-text-wave):hover .hib-char-anim {
        will-change: transform;
        animation: hib-text-wave 920ms var(--hib-ease-out) both;
        /* Starter etter 2 sekunder, pluss 0.08s per bokstav (gjort tregere) */
        animation-delay: calc(var(--char-index, 0) * 18ms);
    }
}

@media (hover: none), (pointer: coarse) {
    .hib-frontpage-container.is-focused:not(.hib-no-mobile-text-wave) .hib-char-anim {
        animation: hib-text-wave 850ms var(--hib-ease-out) both;
        /* Kortere delay på mobil siden elementet har kommet i fokus, pluss 0.08s per bokstav */
        animation-delay: calc(var(--char-index, 0) * 14ms);
    }
}

@keyframes hib-text-wave {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    46% { transform: translate3d(0, -3px, 0) scale(1.045); }
}

.hib-badge {
    font-family: var(--hib-font, sans-serif) !important;
    line-height: normal !important;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem) !important;
    text-transform: none !important;
    letter-spacing: 0.02em !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    background-color: var(--badge-bg, rgba(128, 128, 128, 0.15)) !important;
    color: var(--badge-color, inherit) !important;
    border: 1px solid currentColor !important;
    align-self: auto !important;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: transform var(--hib-hover-duration) var(--hib-ease-out), background-color 760ms var(--hib-ease-in-out), color 560ms ease, border-color 560ms ease, box-shadow var(--hib-hover-duration) var(--hib-ease-out), backdrop-filter 760ms var(--hib-ease-in-out), -webkit-backdrop-filter 760ms var(--hib-ease-in-out) !important;
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    /* Standard / Light text fallback for hover */
    .hib-frontpage-container.hib-pointer-hover-active.is-entry-complete:not(.hib-no-badge-hover):hover .hib-badge {
        box-shadow: 0 0 15px currentColor !important;
        background-color: var(--badge-hover-bg, rgba(0, 0, 0, 0.35)) !important;
        color: var(--badge-hover-color, inherit) !important;
        border-color: transparent !important; /* Hide solid border in favor of soft glow */
        transform: translateY(-2px);
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        text-shadow: 0 2px 5px var(--dynamic-shadow, rgba(0, 0, 0, 0.6)) !important;
    }

    /* Robust Dark text fallback for hover */
    .hib-frontpage-container.hib-pointer-hover-active.is-entry-complete.hib-text-dark:not(.hib-no-badge-hover):hover .hib-badge {
        background-color: var(--badge-hover-bg, rgba(255, 255, 255, 0.8)) !important;
        text-shadow: 0 2px 5px var(--dynamic-shadow, rgba(255, 255, 255, 0.8)) !important;
    }

    /* Robust Light text fallback for hover */
    .hib-frontpage-container.hib-pointer-hover-active.is-entry-complete.hib-text-light:not(.hib-no-badge-hover):hover .hib-badge {
        background-color: var(--badge-hover-bg, rgba(0, 0, 0, 0.35)) !important;
        text-shadow: 0 2px 5px var(--dynamic-shadow, rgba(0, 0, 0, 0.6)) !important;
    }

    /* Fjern badge-blur hvis head-containeren allerede har glassmorphism */
    .hib-frontpage-container.hib-pointer-hover-active.is-entry-complete.hib-style-glass:hover .hib-badge {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Mobil-spesifikk scroll-effekt for badge */
@media (hover: none), (pointer: coarse) {
    .hib-frontpage-container .hib-badge {
        /* Langsommere overgang for badge på mobil for en glattere inn/ut effekkt ved scroll */
        transition: transform 850ms var(--hib-ease-out), background-color 760ms var(--hib-ease-in-out), color 520ms ease, border-color 520ms ease, box-shadow 760ms var(--hib-ease-out) !important;
    }

    /* Standard / Light text fallback for mobile scroll */
    .hib-frontpage-container.is-focused:not(.hib-no-mobile-badge-hover) .hib-badge {
        box-shadow: 0 0 15px currentColor !important;
        background-color: var(--badge-hover-bg, rgba(0, 0, 0, 0.35)) !important;
        color: var(--badge-hover-color, inherit) !important;
        border-color: transparent !important;
        transform: translateY(-2px);
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        text-shadow: 0 2px 5px var(--dynamic-shadow, rgba(0, 0, 0, 0.6)) !important;
    }

    /* Robust Dark text fallback for mobile scroll */
    .hib-frontpage-container.hib-text-dark.is-focused:not(.hib-no-mobile-badge-hover) .hib-badge {
        background-color: var(--badge-hover-bg, rgba(255, 255, 255, 0.8)) !important;
        text-shadow: 0 2px 5px var(--dynamic-shadow, rgba(255, 255, 255, 0.8)) !important;
    }

    /* Robust Light text fallback for mobile scroll */
    .hib-frontpage-container.hib-text-light.is-focused:not(.hib-no-mobile-badge-hover) .hib-badge {
        background-color: var(--badge-hover-bg, rgba(0, 0, 0, 0.35)) !important;
        text-shadow: 0 2px 5px var(--dynamic-shadow, rgba(0, 0, 0, 0.6)) !important;
    }
    
    .hib-frontpage-container.is-focused.hib-style-glass:not(.hib-no-mobile-badge-hover) .hib-badge {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* --- RIBBON STYLE --- */
.hib-ribbon-wrapper {
    position: absolute !important;
    top: 0 !important;
    width: 150px !important;
    height: 150px !important;
    overflow: hidden !important;
    z-index: 25 !important;
    pointer-events: none !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

/* --- LINK TYPE INDICATOR (Bottom Right Icon) --- */
.hib-link-type-icon {
    position: absolute !important;
    bottom: 15px !important;
    right: 15px !important;
    z-index: 30 !important;
    color: rgba(255, 255, 255, 0.45) !important;
    /* Start slightly transparent */
    font-size: 0.9rem !important;
    /* Small and subtle */
    pointer-events: none !important;
    transition: transform 680ms var(--hib-ease-out), opacity 280ms ease, background-color 520ms ease, box-shadow 680ms var(--hib-ease-out) !important;
    background: rgba(0, 0, 0, 0.1) !important;
    padding: 6px !important;
    border-radius: 50% !important;
    background: transparent !important;
    /* Removed specific bg */
    padding: 0 !important;
    /* Removed padding */
    border-radius: 0 !important;
    /* Removed border-radius */
    width: auto !important;
    /* Auto width */
    height: auto !important;
    /* Auto height */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (min-width: 769px) and (hover: hover), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-frontpage-container.hib-pointer-hover-active.is-entry-complete:hover .hib-link-type-icon {
        color: rgba(255, 255, 255, 0.95) !important;
        /* Brighter on hover */
        background: transparent !important;
        /* No bg on hover either */
        transform: scale(1.2);
        /* Slightly larger scale since no bg */
    }
}

/* Mobile Adjustment for Link Icon */
@container (max-width: 599px) {
    .hib-link-type-icon {
        bottom: 6px !important;
        right: 6px !important;
        font-size: 0.9rem !important;
        /* Slightly smaller */
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }
}

.hib-ribbon {
    position: absolute !important;
    top: 35px !important;
    width: 250px !important;
    padding: 6px 0 !important;
    text-align: center !important;
    font-family: var(--hib-font, sans-serif) !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    line-height: normal !important;
}

.hib-ribbon-right,
.hib-ribbon-desktop-right {
    right: 0 !important;
    left: auto !important;
}

.hib-ribbon-right .hib-ribbon,
.hib-ribbon-desktop-right .hib-ribbon {
    right: -70px !important;
    left: auto !important;
    transform: rotate(45deg) translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

.hib-ribbon-left,
.hib-ribbon-desktop-left {
    left: 0 !important;
    right: auto !important;
}

.hib-ribbon-left .hib-ribbon,
.hib-ribbon-desktop-left .hib-ribbon {
    left: -70px !important;
    right: auto !important;
    transform: rotate(-45deg) translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

/* --- STORE CONTAINER LAYOUTS (> 600px - desktop/fullbredde) --- */
@container (min-width: 600px) {
    .hib-layout-right .hib-bg-wrapper {
        left: auto !important;
        right: var(--bg-x, 0%) !important;
        order: 2 !important;
    }

    .hib-layout-right {
        justify-content: flex-start !important;
        flex-direction: row !important;
    }

    .hib-layout-right .hib-content {
        order: 1 !important;
        margin-right: auto !important;
        margin-left: 0 !important;
    }

    .hib-layout-right .hib-overlay-gradient {
        background: var(--grad-bg, linear-gradient(to left, var(--c-start) var(--g-start, 20%), var(--c-mid) var(--g-mid, 60%), var(--c-end) var(--g-end, 100%))) !important;
    }

    .hib-layout-left .hib-bg-wrapper {
        left: var(--bg-x, 0%) !important;
        right: auto !important;
        order: 1 !important;
    }

    .hib-layout-left {
        justify-content: flex-end !important;
        flex-direction: row !important;
    }

    .hib-layout-left .hib-content {
        order: 2 !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    .hib-layout-left .hib-overlay-gradient {
        background: var(--grad-bg, linear-gradient(to right, var(--c-start) var(--g-start, 20%), var(--c-mid) var(--g-mid, 60%), var(--c-end) var(--g-end, 100%))) !important;
    }

    .hib-align-left .hib-content {
        text-align: left !important;
        align-items: flex-start !important;
    }

    .hib-align-center .hib-content {
        text-align: center !important;
        align-items: center !important;
    }

    .hib-align-right .hib-content {
        text-align: right !important;
        align-items: flex-end !important;
    }

    /* --- COVER MODE DESKTOP GRID ALIGNMENT --- */
    .hib-frontpage-container.hib-mode-cover {
        display: grid !important;
        height: auto !important;
        min-height: var(--hib-min-height, 360px) !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-valign-top .hib-content,
    .hib-frontpage-container.hib-mode-cover.hib-style-glass.hib-valign-top .hib-content {
        justify-content: flex-start !important;
        align-self: start !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-valign-center .hib-content,
    .hib-frontpage-container.hib-mode-cover.hib-style-glass.hib-valign-center .hib-content {
        justify-content: center !important;
        align-self: center !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-valign-bottom .hib-content,
    .hib-frontpage-container.hib-mode-cover.hib-style-glass.hib-valign-bottom .hib-content {
        justify-content: flex-end !important;
        align-self: end !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-halign-left .hib-content {
        align-items: flex-start !important;
        text-align: left !important;
        justify-self: flex-start !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-halign-center .hib-content {
        align-items: center !important;
        text-align: center !important;
        justify-self: center !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-halign-right .hib-content {
        align-items: flex-end !important;
        text-align: right !important;
        justify-self: flex-end !important;
    }

    .hib-frontpage-container.hib-mode-cover .hib-content {
        position: relative !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        max-width: var(--glass-width, 100%) !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-style-glass .hib-content {
        margin: var(--glass-margin, 30px) var(--glass-margin-x, 0) !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* ==========================================================================
   MOBILE SPECIFIC OVERRIDES (Bypassing Container query bugs in Safari)
   ========================================================================== */
@media (max-width: 599px) {
    .hib-frontpage-container.hib-mode-cover {
        /* Override generic gradient variable with the specific mobile user setting */
        --grad-bg: var(--grad-bg-mobile) !important;
    }
}

/* --- SMÅ CONTAINER LAYOUTS (<= 599px - mobil/kolonner) --- */
@container (max-width: 599px) {
    .hib-frontpage-container {
        display: block !important;
        position: relative !important;
        --pd-sm: 0 15px 10px 15px;
        --pd-md: 0 25px 15px 25px;
        --pd-lg: 0 35px 20px 35px;
        --pd-xl: 0 45px 30px 45px;
    }

    .hib-frontpage-container.hib-mode-cover {
        display: grid !important;
        height: auto !important;
        min-height: var(--hib-min-height, 360px) !important;
    }

    .hib-bg-wrapper {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
    }


    .hib-content {
        position: absolute !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;

        /* Reset default alignment */
        align-items: flex-start;
        text-align: left;
        justify-content: flex-end;

        z-index: 10 !important;
        pointer-events: none !important;
    }

    .hib-content>* {
        pointer-events: auto !important;
    }

    /* Padding i bunn for standard bannerlink modus */
    .hib-frontpage-container:not(.hib-mode-cover):not(.hib-style-glass) .hib-content {
        padding-bottom: 25px !important;
    }

    /* Dynamisk skygge på innhold og grafikk slik at det popper mer frem, basert på luminans */
    .hib-title,
    .hib-text,
    .hib-arrow,
    .hib-link-type-icon {
        text-shadow: 0 2px 12px var(--dynamic-shadow, rgba(0, 0, 0, 0.6)) !important;
    }

    .hib-graphic {
        filter: drop-shadow(0 4px 8px var(--dynamic-shadow, rgba(0, 0, 0, 0.45))) !important;
    }

    .hib-title {
        font-size: 2rem !important;
        margin-bottom: 10px !important;
    }

    .hib-text {
        font-size: 1rem !important;
        margin-bottom: 20px !important;
    }

    .hib-arrow {
        font-size: 2rem !important;
        margin-bottom: 10px !important;
    }

    .hib-badge {
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
    }

    /* FIX FOR MOBIL JUSTERING - Høy spesifisitet */
    .hib-frontpage-container.hib-mobile-align-left .hib-content {
        align-items: flex-start !important;
        text-align: left !important;
    }

    .hib-frontpage-container.hib-mobile-align-center .hib-content {
        align-items: center !important;
        text-align: center !important;
    }

    .hib-frontpage-container.hib-mobile-align-right .hib-content {
        align-items: flex-end !important;
        text-align: right !important;
    }

    /* Fritt Lerret (Cover) 9-Point Grid Justering på Mobil */
    .hib-frontpage-container.hib-mode-cover {
        display: grid !important;
        align-content: stretch !important;
        height: auto !important;
        min-height: var(--hib-min-height, 360px) !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-mobile-valign-top .hib-content,
    .hib-frontpage-container.hib-mode-cover.hib-style-glass.hib-mobile-valign-top .hib-content {
        justify-content: flex-start !important;
        align-self: start !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-mobile-valign-center .hib-content,
    .hib-frontpage-container.hib-mode-cover.hib-style-glass.hib-mobile-valign-center .hib-content {
        justify-content: center !important;
        align-self: center !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-mobile-valign-bottom .hib-content,
    .hib-frontpage-container.hib-mode-cover.hib-style-glass.hib-mobile-valign-bottom .hib-content {
        justify-content: flex-end !important;
        align-self: end !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-left .hib-content {
        align-items: flex-start !important;
        text-align: left !important;
        justify-self: flex-start !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-center .hib-content {
        align-items: center !important;
        text-align: center !important;
        justify-self: center !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-right .hib-content {
        align-items: flex-end !important;
        text-align: right !important;
        justify-self: flex-end !important;
    }

    .hib-frontpage-container.hib-mode-cover .hib-content {
        position: relative !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        max-width: var(--glass-width, 100%) !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-style-glass .hib-content {
        margin: var(--glass-margin-mobile, 25px) var(--glass-margin-mobile-x, 15px) !important;
        height: auto !important;
        width: calc(100% - calc(var(--glass-margin-mobile-x, 15px) * 2)) !important;
        max-height: none !important;
    }

    /* Mobil Ribbon placement */
    .hib-ribbon-wrapper.hib-ribbon-mobile-right {
        right: 0 !important;
        left: auto !important;
    }

    .hib-ribbon-wrapper.hib-ribbon-mobile-right .hib-ribbon {
        right: -70px !important;
        left: auto !important;
        transform: rotate(45deg) translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }

    .hib-ribbon-wrapper.hib-ribbon-mobile-left {
        left: 0 !important;
        right: auto !important;
    }

    .hib-ribbon-wrapper.hib-ribbon-mobile-left .hib-ribbon {
        left: -70px !important;
        right: auto !important;
        transform: rotate(-45deg) translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }
}

/* ==========================================================================
   2. OVERLAY STYLES
   ==========================================================================
*/

.hib-overlay-modal,
.hib-overlay-modal *,
.hib-overlay-modal *::after,
.hib-overlay-modal *::before {
    box-sizing: border-box !important;
}

.hib-overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    color: #fff;
    z-index: 2147483647 !important;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.3s ease;
    transform: translateY(0);
}

.hib-overlay-content-wrapper {
    width: 100%;
    box-sizing: border-box;
    padding: 60px 40px 120px 40px; /* Space out overlay title and prevent overlap with floating desktop close button */
}

.hib-overlay-modal.hidden {
    display: none !important;
}

.hib-overlay-modal.opacity-0 {
    opacity: 0;
    pointer-events: none;
}

.hib-overlay-modal.slide-out-up {
    transform: translateY(-100%) !important;
    transition: transform 0.6s cubic-bezier(0.5, 0, 0, 1) !important;
    opacity: 1 !important;
}

/* Desktop Lukkeknapp (Flytende bunn) */
.hib-desktop-close-trigger {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #e60000;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 360ms var(--hib-ease-out), transform 680ms var(--hib-ease-out), background-color 280ms ease, color 280ms ease, box-shadow 360ms var(--hib-ease-out);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hib-desktop-close-trigger.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.hib-desktop-close-trigger:hover {
    background-color: #ff3333;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    /* ========================================================
       COVER MODE - MOBIL LAYOUT (Flexbox-basert, pålitelig)
       Alignment settes på CONTAINEREN, ikke innholdet
       ======================================================== */
    .hib-frontpage-container.hib-mode-cover {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: var(--hib-min-height, 360px) !important;
        /* Standard: vertikal bunn (bakoverkompatibelt) */
        justify-content: flex-end !important;
        align-items: flex-start !important;
    }

    /* Vertikal justering via justify-content på containeren */
    .hib-frontpage-container.hib-mode-cover.hib-mobile-valign-top {
        justify-content: flex-start !important;
    }
    .hib-frontpage-container.hib-mode-cover.hib-mobile-valign-center {
        justify-content: center !important;
    }
    .hib-frontpage-container.hib-mode-cover.hib-mobile-valign-bottom {
        justify-content: flex-end !important;
    }

    /* Horisontal justering via align-items på containeren */
    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-left {
        align-items: flex-start !important;
    }
    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-center {
        align-items: center !important;
    }
    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-right {
        align-items: flex-end !important;
    }

    /* Innholdet er bare en fleksibel boks - ingen alignment her */
    .hib-frontpage-container.hib-mode-cover .hib-content {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        width: 100% !important;
        height: auto !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        flex-shrink: 0 !important;
        max-width: var(--glass-width, 100%) !important;
        align-self: auto !important;
    }

    /* Nullstill marger på selve overskriften for å garantere perfekt symmetri */
    .hib-frontpage-container.hib-mode-cover .hib-content h2,
    .hib-frontpage-container.hib-mode-cover .hib-content h2.wp-block-heading,
    .hib-frontpage-container.hib-mode-cover .hib-content h2.wp-block-heading.has-text-color,
    .hib-frontpage-container.hib-mode-cover .hib-content .hib-title {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Tekst-justering på innholdet basert på horisontal innstilling */
    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-left .hib-content {
        align-items: flex-start !important;
        text-align: left !important;
    }
    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-center .hib-content {
        align-items: center !important;
        text-align: center !important;
    }
    .hib-frontpage-container.hib-mode-cover.hib-mobile-halign-right .hib-content {
        align-items: flex-end !important;
        text-align: right !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-style-glass .hib-content {
        margin: var(--glass-margin-mobile, 25px) var(--glass-margin-mobile-x, 15px) !important;
        height: auto !important;
        width: calc(100% - calc(var(--glass-margin-mobile-x, 15px) * 2)) !important;
        max-height: none !important;
    }

    /* Mobil Ribbon placement */
    .hib-ribbon-wrapper.hib-ribbon-mobile-right {
        right: 0 !important;
        left: auto !important;
    }

    .hib-ribbon-wrapper.hib-ribbon-mobile-right .hib-ribbon {
        right: -70px !important;
        left: auto !important;
        transform: rotate(45deg) translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }

    .hib-ribbon-wrapper.hib-ribbon-mobile-left {
        left: 0 !important;
        right: auto !important;
    }

    .hib-ribbon-wrapper.hib-ribbon-mobile-left .hib-ribbon {
        left: -70px !important;
        right: auto !important;
        transform: rotate(-45deg) translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }

    /* ==========================================================================
       DEAKTIVER PRE-HOVER EFFEKTER PÅ MOBIL (Garanterer skarpe bilder med farge)
       ========================================================================== */
    .hib-frontpage-container[class*="hib-hover-"]:not(.hib-parallax-enabled).is-visible .hib-bg-img,
    .hib-frontpage-container[class*="hib-hover-"]:not(.hib-parallax-enabled).hib-animate.is-visible .hib-bg-img {
        filter: none !important;
        transform: scale(1.05) !important;
    }

    /* Testimonials (behold standard blur-mengde på bakgrunn, men deaktiver hover-endringer) */
    .hib-frontpage-container.hib-testimonials-slider[class*="hib-hover-"]:not(.hib-parallax-enabled).is-visible .hib-testimonial-bg-img,
    .hib-frontpage-container.hib-testimonials-slider[class*="hib-hover-"]:not(.hib-parallax-enabled).hib-animate.is-visible .hib-testimonial-bg-img {
        filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
        transform: scale(1.15) !important;
    }
}

/* Other Overlay Elements */
.hib-action-pill {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 38px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.2);
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    overflow: hidden;
    color: white;
}

.hib-action-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.95);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
}

.hib-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.hib-action-btn:active {
    transform: scale(0.92);
}

.hib-overlay-modal:focus {
    outline: none;
}

.hib-overlay-modal button:focus-visible,
.hib-overlay-modal a:focus-visible,
.hib-trigger-overlay:focus-visible,
.hib-frontpage-container:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55);
}

.hib-pill-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 2;
}

/* Mobil Pull Indicator */
.hib-pull-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: currentColor;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 40;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.hib-pull-indicator i {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* Alltid synlig stripe-indikator for å vise dra-funksjon */
.hib-bottom-drag-handle {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 5px;
    border-radius: 4px;
    background-color: currentColor;
    opacity: 0.25;
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Større knapper på desktop */
@media (min-width: 769px) {
    .hib-action-pill {
        top: 20px;
        right: 25px;
        height: 48px;
        border-radius: 24px;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.6),
            inset 0 0 0 1px rgba(255, 255, 255, 0.3),
            0 10px 30px rgba(0, 0, 0, 0.3);
    }
    .hib-action-btn {
        width: 48px;
        height: 48px;
    }
    .hib-action-btn svg, .hib-action-btn i {
        transform: scale(1.2);
    }
    .hib-pill-divider {
        height: 28px;
    }
    .hib-pull-indicator,
    .hib-bottom-drag-handle {
        display: none !important;
    }
}

.hib-dot-nav {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 50;
}

.hib-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 360ms var(--hib-ease-out), background-color 280ms ease, border-color 280ms ease, box-shadow 360ms var(--hib-ease-out);
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.hib-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.5);
}

.hib-dot.active {
    background-color: #e60000;
    transform: scale(1.28);
    box-shadow: 0 0 10px rgba(230, 0, 0, 0.5);
    border-color: transparent;
    border: 2px solid white;
}

/* TOAST MESSAGE */
.hib-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 300ms var(--hib-ease-out), transform 360ms var(--hib-ease-out);
    z-index: 100000;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hib-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hib-scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 40;
    opacity: 0;
    transition: opacity 680ms var(--hib-ease-out);
    animation: hib-scroll-cue 2.8s var(--hib-ease-in-out) 3 both;
    pointer-events: none;
}

.hib-scroll-down-indicator.visible {
    opacity: 1;
}

@keyframes hib-scroll-cue {
    0%, 30%, 100% {
        transform: translateX(-50%) translateY(0);
    }

    12% {
        transform: translateX(-50%) translateY(-6px);
    }

    22% {
        transform: translateX(-50%) translateY(-2px);
    }
}

.hib-scroll-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    color: inherit;
    scroll-behavior: smooth;
    overflow-x: hidden !important;
    /* VIKTIG: Hindre native bounce slik at pull-to-close føles naturlig */
    overscroll-behavior-y: none;
}

.hib-scroll-container::-webkit-scrollbar {
    display: none;
}

.hib-scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* SNAP-MODE: Hver slide fyller skjermen */
.hib-mode-snap>.wp-block-group,
.hib-mode-snap>.wp-block-cover,
.hib-mode-snap>section:not(.hib-scroll-sentinel) {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

/* FLOW-MODE: Innholdet flyter naturlig */
.hib-mode-flow {
    scroll-snap-type: none !important;
}

.hib-mode-flow>* {
    height: auto !important;
    min-height: 0 !important;
    scroll-snap-align: none !important;
    padding: 40px 20px;
    box-sizing: border-box !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.hib-scroll-sentinel {
    height: 1px;
    width: 100%;
    scroll-snap-align: none;
    padding: 0 !important;
    margin: 0 !important;
}

.hib-close-btn-bottom {
    background-color: #e60000;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.hib-close-btn-bottom:hover {
    background-color: #cc0000;
}

.hib-bounce-back {
    transition: transform 0.3s ease-out;
}

/* ==========================================================================
   7. Q&A STYLES (GOOGLE SHEETS)
   ==========================================================================
*/
.hib-qa-container {
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hib-qa-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

.hib-qa-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.hib-qa-question {
    background: none;
    border: none;
    color: white;
    width: 100%;
    text-align: left;
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    line-height: 1.4;
    transition: color 0.3s;
}

/* Hover effect ONLY for desktop/pointers */
@media (min-width: 769px) and (hover: hover) and (pointer: fine), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-qa-item:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .hib-qa-question:hover {
        color: #e60000;
    }
}

.hib-qa-icon {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s;
    margin-left: 15px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.hib-qa-item.active .hib-qa-icon {
    transform: rotate(45deg);
    color: #e60000;
}

.hib-qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.15);
}

.hib-qa-answer p {
    padding: 0 20px 20px 20px;
    margin: 0;
    padding-top: 5px;
    /* Slight top separation from question */
    line-height: 1.6;
    font-family: inherit;
}

/* --- OVERLAY MOBIL JUSTERINGER --- */
@media (max-width: 768px) {
    .hib-dot-nav {
        right: 4px !important;
    }
}

/* SHARE MENU STYLES */
.hib-share-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 100001;
    /* Higher than toast */
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hib-share-menu.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.hib-share-option {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    color: inherit;
    padding: 10px 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 0.95rem;
    font-family: inherit;
}

.hib-share-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hib-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
    color: inherit;
    opacity: 0.8;
}

/* Ensure mobile responsiveness */
@media (max-width: 768px) {
    .hib-share-menu {
        top: 60px;
        right: 20px;
        min-width: 200px;
    }
}

/* FIX: Hide Sentinel in Snap Mode to prevent overscroll / scroll chaining */
.hib-mode-snap .hib-scroll-sentinel {
    display: none !important;
}

/* ==========================================================================
   8. MOBILE PRESENTATION MODE (CARD DECK / HORIZONTAL)
   ==========================================================================
*/
@media (max-width: 768px) {

    /* Change Presentation Mode to Horizontal Scroll */
    /* Change Presentation Mode to Horizontal Scroll */
    .hib-mode-snap.hib-scroll-container {
        display: flex;
        flex-direction: row;
        overflow-x: scroll !important;
        /* Override global hidden !important */
        overflow-y: hidden;
        /* Lock vertical scroll on container */
        scroll-snap-type: x mandatory;
        height: 100vh;
        width: 100vw;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Make each slide full width */
    /* Make each slide full width */
    .hib-mode-snap.hib-scroll-container>* {
        min-width: 100vw !important;
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        scroll-snap-align: center;
        flex-shrink: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        position: relative;
        /* Fix for absolute positioned content inside slides */
        transform: translate3d(0, 0, 0);
        /* Hardware acceleration */
    }

    /* Move Dot Nav to Top Center Horizontal */
    .hib-dot-nav {
        top: 20px;
        left: 0;
        right: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        /* Robust centering */
        transform: none;
        /* Remove translateX */
        flex-direction: row;
        height: auto;
        gap: 8px;
        pointer-events: none;
        /* Let clicks pass through around dots */
    }

    .hib-dot-nav .hib-dot {
        margin: 0;
        width: 8px;
        height: 8px;
        pointer-events: auto;
        /* Re-enable clicks on dots */
        background: rgba(255, 255, 255, 0.3);
        /* Ensure visibility */
    }

    .hib-dot-nav .hib-dot.active {
        background: #fff;
        transform: scale(1.2);
    }

    /* Hide standard scroll indicator */
    .hib-scroll-down-indicator {
        display: none !important;
    }
}

/* Nav Arrows Styles (Mobile Only) */
.hib-nav-arrow {
    position: fixed;
    bottom: 25px;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: opacity 0.3s, background 0.3s, transform 0.2s;
    opacity: 0;
    pointer-events: none;
}

.hib-nav-arrow.visible {
    opacity: 1;
    pointer-events: auto;
}

.hib-nav-arrow:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.hib-nav-prev {
    left: 20px;
}

.hib-nav-next {
    right: 20px;
}

@media (min-width: 769px) {
    .hib-nav-arrow {
        display: none !important;
    }
}

/* LATEST POSTS LINK HOVER EFFECT */
.hib-latest-post-link {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: transform 720ms var(--hib-ease-out), background-color 680ms var(--hib-ease-in-out), color 520ms ease, border-color 520ms ease, box-shadow 720ms var(--hib-ease-out), backdrop-filter 680ms var(--hib-ease-in-out), -webkit-backdrop-filter 680ms var(--hib-ease-in-out) !important;
    padding: 10px 15px !important;
    background: var(--lp-bg, rgba(255, 255, 255, 0.05)) !important;
    border: var(--lp-bw, 1px) solid var(--lp-bc, rgba(255, 255, 255, 0.1)) !important;
    border-radius: var(--lp-br, 10px) !important;
    color: var(--lp-color, inherit) !important;
}

.hib-latest-post-link * {
    color: var(--lp-color, inherit) !important;
    transition: color 520ms ease !important;
}

.hib-latest-post-link:hover {
    background: var(--lp-hov-bg, rgba(255, 255, 255, 0.15)) !important;
    border-color: var(--lp-bc, rgba(255, 255, 255, 0.25)) !important;
    color: var(--lp-hov-color, inherit) !important;
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hib-latest-post-link:hover * {
    color: var(--lp-hov-color, inherit) !important;
}

.hib-latest-post-link-arrow i {
    transition: transform 720ms var(--hib-ease-out) !important;
}

.hib-latest-post-link:hover .hib-latest-post-link-arrow i {
    transform: translateX(5px) !important;
}

/* LATEST POSTS FULL BUTTON HOVER EFFECT */
.hib-latest-posts-btn {
    /* fjernet backdrop-filter for ytelse på animasjon */
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: transform 720ms var(--hib-ease-out), background-color 680ms var(--hib-ease-in-out), color 520ms ease, border-color 520ms ease, box-shadow 720ms var(--hib-ease-out), backdrop-filter 680ms var(--hib-ease-in-out), -webkit-backdrop-filter 680ms var(--hib-ease-in-out) !important;
}

.hib-latest-posts-btn:hover {
    background: var(--lp-hov-bg, rgba(255, 255, 255, 0.3)) !important;
    color: var(--lp-hov-color, inherit) !important;
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}


.hib-latest-posts-btn:hover .hib-latest-btn-icon {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .hib-overlay-content-wrapper {
        padding: 40px 20px 50px 20px !important;
    }
}


/* ==========================================================================
   PARALLAX COMPOSITION
   Scroll movement and hover scale use separate transform layers. This keeps
   requestAnimationFrame updates responsive while hover remains eased.
   ========================================================================== */
.hib-frontpage-container.hib-parallax-type-standard .hib-bg-img,
.hib-frontpage-container.hib-parallax-type-standard .hib-testimonial-bg-img {
    transform: translate3d(0, var(--parallax-y, 0px), 0) !important;
    scale: var(--hib-parallax-hover-scale, 1);
    filter: blur(var(--hib-image-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    height: calc(100% + var(--parallax-max, 100px)) !important;
    top: calc(var(--parallax-max, 100px) / -2) !important;
    width: calc(100% + 80px) !important;
    left: -40px !important;
    transition: transform 80ms linear, scale var(--hib-hover-duration) var(--hib-hover-ease), filter 760ms var(--hib-ease-in-out), opacity 760ms var(--hib-ease-in-out) !important;
}

.hib-frontpage-container.hib-parallax-type-scale-blur .hib-bg-img,
.hib-frontpage-container.hib-parallax-type-scale-fade .hib-bg-img,
.hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-blur .hib-testimonial-bg-img,
.hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-fade .hib-testimonial-bg-img {
    transform: scale(var(--parallax-scale, var(--parallax-max-scale, 1))) translate3d(0, 0, 0) !important;
    scale: var(--hib-parallax-hover-scale, 1);
    opacity: var(--parallax-opacity, var(--parallax-max-opacity, 1)) !important;
    height: 100% !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    transition: transform 90ms linear, scale var(--hib-hover-duration) var(--hib-hover-ease), filter 90ms linear, opacity 90ms linear !important;
}

.hib-frontpage-container.hib-parallax-type-scale-fade .hib-bg-img,
.hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-fade .hib-testimonial-bg-img {
    filter: blur(var(--hib-image-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
}

.hib-frontpage-container.hib-parallax-type-scale-blur .hib-bg-img,
.hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-blur .hib-testimonial-bg-img {
    filter: blur(var(--parallax-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
}

/* Testimonials retain their configured base blur in every parallax mode. */
.hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-standard .hib-testimonial-bg-img,
.hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-fade .hib-testimonial-bg-img {
    filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
}

.hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-blur .hib-testimonial-bg-img {
    filter: blur(calc(var(--testi-bg-blur, 10px) + var(--parallax-blur, 0px))) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
}

/* Fixed backgrounds stay anchored to the viewport while the card scrolls over
   them. The regular background wrapper uses a compositor transform, which
   prevents fixed background attachment in Chromium/WebKit, so disable it only
   for this effect. */
.hib-frontpage-container.hib-parallax-type-fixed .hib-bg-wrapper {
    transform: none !important;
    backface-visibility: visible;
}

.hib-frontpage-container.hib-parallax-type-fixed .hib-fixed-bg {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    scale: none;
    background-attachment: fixed !important;
    filter: blur(var(--testi-bg-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    transition: filter 760ms var(--hib-ease-in-out), opacity 760ms var(--hib-ease-in-out) !important;
    will-change: filter, opacity;
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-frontpage-container.hib-parallax-enabled.hib-hover-zoom-out {
        --hib-parallax-hover-scale: 1.035;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-parallax-enabled.hib-hover-zoom-out:hover {
        --hib-parallax-hover-scale: 1.01;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-parallax-enabled.hib-hover-zoom-in:hover {
        --hib-parallax-hover-scale: 1.04;
    }
    .hib-frontpage-container.hib-parallax-enabled.hib-hover-quick-zoom-out {
        --hib-parallax-hover-scale: 1.055;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-parallax-enabled.hib-hover-quick-zoom-out:hover {
        --hib-parallax-hover-scale: 1.01;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-parallax-enabled.hib-hover-quick-zoom-in:hover {
        --hib-parallax-hover-scale: 1.07;
    }
    .hib-frontpage-container.hib-pointer-hover-active.hib-parallax-enabled.hib-hover-brighten:hover {
        --hib-brightness: 1.14;
    }
}

/* ==========================================================================
   TYPE 3: STICKY REVEAL PARALLAX
   ========================================================================== */
.hib-sticky-parallax-wrapper {
    /* Height is set inline via PHP based on user settings */
}

.hib-sticky-parallax-wrapper>.hib-parallax-type-sticky {
    position: sticky !important;
    top: var(--hib-sticky-top-offset, 0px) !important;
    /* Keep the reveal fully visible below a fixed or sticky site header. */
    height: calc(100vh - var(--hib-sticky-top-offset, 0px)) !important;
    min-height: calc(100vh - var(--hib-sticky-top-offset, 0px)) !important;
    max-height: calc(100vh - var(--hib-sticky-top-offset, 0px)) !important;
    margin: 0 !important;
}

.hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-bg-img,
.hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-testimonial-bg-img {
    /* Background stands completely still */
    height: 100% !important;
    top: 0 !important;
    transform: none !important;
    scale: var(--hib-parallax-hover-scale, 1);
    filter: blur(var(--testi-bg-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    transition: scale var(--hib-hover-duration) var(--hib-hover-ease), filter 760ms var(--hib-ease-in-out) !important;
}

.hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-content,
.hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-testimonial-content,
.hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-bg-wrapper>*:not(.hib-bg-img) {
    /* Move the text layer dynamically based on progress of the wrapper 
       0 progress = top hit, 1 progress = bottom hit.
       We want it to scroll at a 1:1 speed with the page.
       Total scrollable distance is wrapper height minus the visible sticky
       height, including any detected header offset. */
    translate: 0 calc((0.5 - var(--sticky-progress, 0.5)) * (var(--parallax-sticky-h, 150) * 1vh - 100vh + var(--hib-sticky-top-offset, 0px)));
    transition: translate 0.1s linear !important;
}

/* Fallback for mobil. Touch-scrolling oppfører seg ofte rart med sticky. */
@media (max-width: 768px) {

    .hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-content,
    .hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-testimonial-content,
    .hib-sticky-parallax-wrapper>.hib-parallax-type-sticky .hib-bg-wrapper>*:not(.hib-bg-img) {
        /* På mobil setter vi oppførselen til å være mer tilgivende mtp viewport height (SVH/DVH) */
        translate: 0 calc((0.5 - var(--sticky-progress, 0.5)) * (var(--parallax-sticky-h, 150) * 1svh - 100svh + var(--hib-sticky-top-offset, 0px)));
    }
}

/* Mobile scroll effects use compositor-only transforms. Overscan on the fixed
   image layer keeps its edges outside the clipped banner while it glides. */
@media (max-width: 768px) {
    /* Every image-based effect uses the shared requestAnimationFrame motor. */
    .hib-frontpage-container.hib-parallax-type-standard .hib-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-standard .hib-testimonial-bg-img {
        transition: filter 760ms var(--hib-ease-in-out), opacity 760ms var(--hib-ease-in-out) !important;
        will-change: transform;
    }

    .hib-frontpage-container.hib-mode-cover.hib-parallax-type-sticky .hib-bg-img {
        transform: translate3d(0, 0, 0) !important;
        scale: 1.05 !important;
        opacity: 1 !important;
        filter: blur(var(--hib-image-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        transition: filter 760ms var(--hib-ease-in-out), opacity 760ms var(--hib-ease-in-out) !important;
    }

    .hib-frontpage-container.hib-parallax-type-fixed .hib-fixed-bg,
    .hib-frontpage-container.hib-mode-cover.hib-parallax-type-fixed .hib-fixed-bg,
    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-fixed .hib-fixed-bg {
        inset: -72px -24px !important;
        width: calc(100% + 48px) !important;
        height: calc(100% + 144px) !important;
        transform: translate3d(0, 0, 0) !important;
        scale: none !important;
        opacity: 1 !important;
        background-attachment: scroll !important;
        filter: blur(var(--hib-image-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
        transition: none !important;
        will-change: transform;
    }

    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-fixed .hib-fixed-bg {
        filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-sticky-parallax-wrapper > .hib-parallax-type-sticky {
        height: calc(100svh - var(--hib-sticky-top-offset, 0px)) !important;
        min-height: calc(100svh - var(--hib-sticky-top-offset, 0px)) !important;
        max-height: calc(100svh - var(--hib-sticky-top-offset, 0px)) !important;
    }
}

/* ==========================================================================
   WORDPRESS GROUP BLOCK / BORDER-RADIUS FIX
   ========================================================================== */
.wp-block-group[style*="border-radius"]:has(.hib-wrapper),
.wp-block-group.has-border-radius:has(.hib-wrapper) {
    overflow: hidden;
    /* Clip only groups that actually contain a FrontPage block. */
}

/* Kjede-arving av border-radius ned til vår innerste container */
.wp-block-hib-frontpage,
.hib-wrapper,
.hib-frontpage-container {
    border-radius: inherit;
}

/* --- YOUTUBE BAKGRUNN --- */
.hib-youtube-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hib-youtube-wrapper iframe, .hib-youtube-iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Bruker gigantiske dimensjoner (130% av viewport) i stedet for transform: scale(). 
       Dette dytter YouTube-logo og tittel ut av syne, MEN sørger for at YouTubes 
       interne play/pause ikon beholder sin normale, lille størrelse hvis Safari 
       pauser videoen i bakgrunnen. */
    width: 130vw;
    height: 73.125vw; /* 16:9 av 130vw */
    min-height: 130vh;
    min-width: 231.11vh; /* 16:9 av 130vh */
    transform: translate(-50%, -50%);
    pointer-events: none !important;
    border: 0;
}

/* Skjul Apple/Safari native play/pause overlay på bakgrunnsvideoer */
.hib-bg-wrapper video,
.hib-bg-wrapper img {
    pointer-events: none !important;
}

.hib-bg-wrapper video::-webkit-media-controls,
.hib-bg-wrapper video::-webkit-media-controls-enclosure,
.hib-bg-wrapper video::-webkit-media-controls-panel,
.hib-bg-wrapper video::-webkit-media-controls-play-button,
.hib-bg-wrapper video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none !important;
}
/* ==========================================================================
   TESTIMONIALS SLIDER LAYOUT & SCROLLING (Unified for Editor and Frontend)
   ========================================================================== */

/* Base layout and horizontal/vertical overflow safety for testimonials background image */
.hib-frontpage-container.hib-testimonials-slider .hib-testimonial-bg-img {
    position: absolute !important;
    top: -20px !important;
    left: -40px !important;
    width: calc(100% + 80px) !important;
    height: calc(100% + 40px) !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    border: none !important;
    z-index: 0 !important;
    transform: scale(1.15) !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    will-change: transform, opacity, filter;
    filter: blur(calc(var(--testi-bg-blur, 10px) + var(--hib-image-blur, 0px))) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast));
    transition: transform var(--hib-hover-duration) var(--hib-hover-ease), filter 760ms var(--hib-ease-in-out), opacity 760ms var(--hib-ease-in-out);
}


.hib-testimonial-overlay {
    opacity: var(--testi-overlay-opacity, 0.5);
    transition: opacity var(--hib-hover-duration) var(--hib-ease-in-out), background-color var(--hib-hover-duration) var(--hib-ease-in-out);
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine), (min-width: 769px) and (any-hover: hover) and (any-pointer: fine) {
    .hib-testimonials-slider[class*="hib-hover-"]:hover .hib-testimonial-overlay {
        opacity: min(1, calc(var(--testi-overlay-opacity, 0.5) + 0.04));
    }
}

/* Slide content scrolling container */
.hib-testimonial-slide-content {
    padding: 40px 15px; /* Single testimonials do not need reserved navigation space. */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 3;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Silky-smooth iOS touch momentum scrolling */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px, #000 calc(100% - 75px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 40px, #000 calc(100% - 75px), transparent 100%);
}

.hib-testimonials-slider.hib-testimonials-has-nav .hib-testimonial-slide-content {
    padding-bottom: 85px;
}

.hib-testimonials-slider.hib-testimonials-measured .hib-testimonial-slide-content:not(.is-scrollable) {
    overflow-y: hidden;
    -webkit-overflow-scrolling: auto;
    -webkit-mask-image: none;
    mask-image: none;
}

.hib-testimonials-slider.hib-testimonials-measured .hib-testimonial-slide-content.is-scrollable {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
}

.hib-testimonial-slide-content.is-scrollable .hib-testimonial-test-preview {
    margin-top: 0;
    margin-bottom: 0;
}

/* Intermediate fit mode: reclaim decorative spacing before enabling a nested
   scrollbar. This keeps normal cards airy and near-fit cards fully static. */
.hib-testimonial-slide-content.is-compact {
    padding-top: 16px;
    padding-bottom: 16px;
}

.hib-frontpage-container.hib-testimonials-slider.hib-testimonials-has-nav .hib-testimonial-slide-content.is-compact {
    padding-bottom: 58px;
}

.hib-testimonial-slide-content.is-compact .hib-testimonial-test-preview {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 22px;
}

.hib-testimonial-slide-content.is-compact .hib-test-profile-img {
    margin-bottom: 0;
}

@media (min-width: 769px) {
    .hib-testimonial-slide-content {
        padding: 40px 60px;
        justify-content: flex-start; /* Avoids flexbox overflow top-clipping bug */
    }

    .hib-testimonials-slider.hib-testimonials-has-nav .hib-testimonial-slide-content {
        padding-bottom: 95px;
    }
}

/* Slide inner preview layout */
.hib-testimonial-test-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 900px;
    padding: 20px;
    box-sizing: border-box;
    margin: auto 0; /* Centering helper that behaves gracefully under overflow */
    gap: 30px; /* Spacious vertical gap on mobile between author block and quote */
}

@media(min-width: 769px) {
    .hib-testimonial-test-preview {
        flex-direction: row;
        text-align: left;
        gap: 50px;
        align-items: center;
    }
}

/* Grouped profile & author credentials block */
.hib-testimonial-author-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    color: inherit;
    gap: 12px; /* Breathing room between profile image and text details */
}

@media(min-width: 769px) {
    .hib-testimonial-author-block {
        width: 180px; /* Fixed width on desktop for clean side-by-side display */
    }
}

/* Author Name and Profession */
.hib-testimonial-author-name {
    font-weight: bold;
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: inherit;
}

.hib-testimonial-author-profession {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
    color: inherit;
}

/* Circular Profile Image */
.hib-test-profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin: 0 auto 15px auto;
}

@media(min-width: 769px) {
    .hib-test-profile-img {
        width: 140px;
        height: 140px;
        margin: 0 auto 20px auto;
    }
}

/* Nav Buttons Base Position and Sizing */
.hib-testimonial-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 520ms ease, transform 680ms var(--hib-ease-out);
}

.hib-testimonial-nav-btn:hover {
    filter: brightness(1.2);
}

.hib-testimonial-autoplay-toggle {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    font-size: 0.62rem;
    transition: filter 280ms ease, transform 360ms var(--hib-ease-out);
}

.hib-testimonial-autoplay-toggle:hover {
    filter: brightness(1.2);
}

.hib-testimonial-autoplay-toggle[aria-pressed="true"] {
    transform: scale(1.08);
}

.hib-testimonial-prev {
    left: 15px;
}

.hib-testimonial-next {
    right: 15px;
}

/* Slide Positioning and Active State */
.hib-testimonial-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 850ms var(--hib-ease-in-out), transform 1050ms var(--hib-ease-out);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hib-testimonial-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* ==========================================================================
   MOBILE MOTION PERFORMANCE
   Keep desktop rendering untouched while reducing touch-scroll repaints.
   ========================================================================== */
@media (max-width: 768px) {
    .hib-content,
    .hib-style-glass .hib-content {
        will-change: auto;
        transition: opacity var(--anim-duration, 1.1s) var(--hib-ease-out),
                    transform var(--anim-duration, 1.1s) var(--hib-ease-out) !important;
    }

    .hib-frontpage-container.hib-style-glass.hib-animate:not(.is-visible) .hib-content {
        backdrop-filter: blur(var(--glass-blur, 12px)) !important;
        -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-animate .hib-bg-wrapper {
        filter: none !important;
        transition: opacity var(--anim-duration, 1.1s) var(--hib-ease-out),
                    transform var(--anim-duration, 1.1s) var(--hib-ease-out) !important;
    }

    .hib-frontpage-container.hib-mode-cover.hib-animate:not(.is-visible) .hib-bg-wrapper {
        filter: none !important;
        transform: translate3d(0, 0, 0) scale(1.018);
    }

    .hib-frontpage-container.hib-animate:not(.hib-mode-cover):not(.hib-parallax-enabled) .hib-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-animate:not(.hib-parallax-enabled) .hib-testimonial-bg-img {
        transition: transform var(--anim-duration, 1.1s) var(--hib-ease-out),
                    opacity var(--anim-duration, 1.1s) var(--hib-ease-in-out) !important;
    }

    .hib-frontpage-container.hib-parallax-type-standard .hib-bg-img,
    .hib-frontpage-container.hib-parallax-type-scale-blur .hib-bg-img,
    .hib-frontpage-container.hib-parallax-type-scale-fade .hib-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-standard .hib-testimonial-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-blur .hib-testimonial-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-fade .hib-testimonial-bg-img {
        will-change: transform;
        transition: none !important;
    }

    .hib-frontpage-container.hib-parallax-type-scale-blur .hib-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-blur .hib-testimonial-bg-img {
        filter: blur(var(--parallax-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-blur .hib-testimonial-bg-img {
        filter: blur(calc(var(--testi-bg-blur, 10px) + var(--parallax-blur, 0px))) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-frontpage-container.hib-parallax-type-scale-fade .hib-bg-img,
    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-type-scale-fade .hib-testimonial-bg-img {
        opacity: var(--parallax-opacity, 1) !important;
    }

    .hib-testimonials-slider .hib-testimonial-slide,
    .hib-testimonials-slider .hib-testimonial-slide.active,
    .hib-testimonials-slider .hib-testimonial-slide.exit,
    .hib-testimonials-slider .hib-testimonial-slide.exit-left {
        transform: translate3d(0, 0, 0) !important;
        transition: opacity 680ms cubic-bezier(0.22, 1, 0.36, 1) !important;
        backface-visibility: hidden;
    }

    .hib-frontpage-container.hib-testimonials-slider.hib-animate:not(.hib-parallax-enabled):not(.is-visible) .hib-testimonial-bg-img {
        filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-testimonial-bg-img,
    .hib-testimonials-slider .hib-fixed-bg {
        will-change: auto;
    }

    .hib-sticky-parallax-wrapper > .hib-parallax-type-sticky .hib-content,
    .hib-sticky-parallax-wrapper > .hib-parallax-type-sticky .hib-testimonial-content,
    .hib-sticky-parallax-wrapper > .hib-parallax-type-sticky .hib-bg-wrapper > *:not(.hib-bg-img) {
        transition: none !important;
        will-change: translate;
    }

    .hib-badge {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transition: transform 680ms var(--hib-ease-out),
                    background-color 520ms var(--hib-ease-in-out),
                    color 420ms ease,
                    border-color 420ms ease,
                    box-shadow 680ms var(--hib-ease-out) !important;
    }

    .hib-frontpage-container.is-focused:not(.hib-no-mobile-text-wave) .hib-char-anim {
        animation-name: hib-text-wave-mobile;
        animation-duration: 720ms;
        animation-delay: calc(var(--char-index, 0) * 10ms);
    }

    /* Per-block mobile opt-out. Desktop keeps the selected scroll effect, but
       touch-sized screens render the same image as a stable, static layer. */
    .hib-frontpage-container.hib-parallax-mobile-disabled .hib-bg-img,
    .hib-frontpage-container.hib-parallax-mobile-disabled .hib-testimonial-bg-img {
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        transform: scale(1.05) !important;
        scale: none !important;
        opacity: 1 !important;
        filter: blur(var(--hib-image-blur, 0px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
        transition: none !important;
        will-change: auto !important;
    }

    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-mobile-disabled .hib-testimonial-bg-img {
        filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-frontpage-container.hib-parallax-mobile-disabled .hib-fixed-bg {
        inset: -30px !important;
        width: calc(100% + 60px) !important;
        height: calc(100% + 60px) !important;
        transform: none !important;
        scale: none !important;
        opacity: 1 !important;
        background-attachment: scroll !important;
        transition: none !important;
        will-change: auto !important;
    }

    .hib-frontpage-container.hib-testimonials-slider.hib-parallax-mobile-disabled .hib-fixed-bg {
        filter: blur(var(--testi-bg-blur, 10px)) brightness(var(--hib-brightness)) saturate(var(--hib-saturation)) contrast(var(--hib-contrast)) !important;
    }

    .hib-sticky-parallax-wrapper.hib-mobile-parallax-disabled {
        height: auto !important;
    }

    .hib-sticky-parallax-wrapper.hib-mobile-parallax-disabled > .hib-parallax-type-sticky {
        position: relative !important;
        top: auto !important;
        height: var(--hib-height, auto) !important;
        min-height: var(--hib-min-height, 360px) !important;
        max-height: none !important;
    }

    .hib-sticky-parallax-wrapper.hib-mobile-parallax-disabled > .hib-parallax-type-sticky .hib-content,
    .hib-sticky-parallax-wrapper.hib-mobile-parallax-disabled > .hib-parallax-type-sticky .hib-testimonial-content,
    .hib-sticky-parallax-wrapper.hib-mobile-parallax-disabled > .hib-parallax-type-sticky .hib-testimonial-slide-content,
    .hib-sticky-parallax-wrapper.hib-mobile-parallax-disabled > .hib-parallax-type-sticky .hib-bg-wrapper > *:not(.hib-bg-img) {
        translate: none !important;
        transition: none !important;
        will-change: auto !important;
    }
}

@keyframes hib-text-wave-mobile {
    0%, 100% { transform: translate3d(0, 0, 0); }
    46% { transform: translate3d(0, -2px, 0); }
}

/* ==========================================================================
   ACCESSIBILITY & REDUCED MOTION (a11y)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .hib-animate,
    .hib-frontpage-container,
    .hib-bg-img,
    .hib-fixed-bg,
    .hib-content,
    .hib-title,
    .hib-badge,
    .hib-char-anim,
    .hib-testimonial-bg-img,
    .hib-testimonial-slide,
    .hib-scroll-down-indicator,
    .hib-latest-post-link,
    .hib-latest-posts-btn {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transform: none !important;
        scale: 1 !important;
    }

    .hib-frontpage-container.hib-animate .hib-content,
    .hib-frontpage-container.hib-animate .hib-testimonial-slide-content {
        opacity: 1 !important;
        transform: none !important;
    }
}
