/*
 * Home hero component
 * -------------------
 * The hero image lives inside a dedicated media viewport. The section uses CSS
 * Grid to overlay the full-width .wwts-inner content on top of that viewport.
 * The image keeps its intrinsic aspect ratio and therefore remains the primary
 * source of the hero height, while the viewport clips the scaled motion layer.
 */

.wwts-home-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;

    /* Width is controlled by the media/inner below; outer gutter comes from .wwts-section. */
    gap: 0 !important;
}

.wwts-home-hero__media,
.wwts-home-hero > .wwts-home-hero__image,
.wwts-home-hero__inner {
    grid-area: 1 / 1;
    min-width: 0;
}

/*
 * Dedicated motion viewport
 * -------------------------
 * Match the visible project width used by header .wwts-inner. The scaled image
 * may move a few pixels inside this frame, but overflow is clipped before it
 * can escape the full-width Hero shell.
 */
.wwts-home-hero__media {
    align-self: stretch;
    justify-self: center;

    width: 100% !important;
    max-width: var(--wwts-shell-max-width, 100%) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
}

/* Temporary layout compatibility for translated Home documents that still
 * have the image as a direct Hero child. They keep the old visual geometry
 * until their Elementor structure receives .wwts-home-hero__media. */
.wwts-home-hero > .wwts-home-hero__image {
    align-self: stretch;
    justify-self: center;
    width: 100% !important;
    max-width: var(--wwts-shell-max-width, 100%) !important;
}

.wwts-home-hero__image {
    --wwts-home-hero-shift-x: 0px;
    --wwts-home-hero-shift-y: 0px;
    --wwts-home-hero-scroll-y: 0px;
    --wwts-home-hero-scale: 1.065;
}

img.wwts-home-hero__image,
.wwts-home-hero__image img {
    display: block;
    width: 100% !important;
    height: auto;
    margin: 0 !important;

    /* Elementor's generic image rule must not shrink the motion layer below
       the viewport width before the transform is applied. */
    max-width: var(--wwts-shell-max-width, 100%) !important;

    transform:
        translate3d(
            var(--wwts-home-hero-shift-x),
            calc(var(--wwts-home-hero-shift-y) + var(--wwts-home-hero-scroll-y)),
            0
        )
        scale(var(--wwts-home-hero-scale)) !important;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

/*
 * Content overlay
 * ---------------
 * Atomic layout rules can affect flex/grid self-alignment on the content block.
 * The inner shell therefore becomes the positioning reference and the content
 * is centered explicitly against the same visible area as the hero image.
 */
.wwts-home-hero__inner {
    position: relative !important;
    z-index: 1;

    align-self: stretch;
    justify-self: center;

    width: 100% !important;
    max-width: var(--wwts-shell-max-width, 100%) !important;
    margin: 0 auto !important;
    padding-inline: 25px !important;
}

.wwts-home-hero__content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;

    display: flex !important;
    flex-direction: column;
    align-items: center;

    width: min(calc(100% - 50px), 860px) !important;
    max-width: 860px !important;
    margin: 0 !important;
    padding: clamp(24px, 4vw, 56px);

    text-align: center;
    isolation: isolate;
}

/*
 * Soft readability haze from the approved visual direction.
 * This is intentionally a broad light veil rather than text-shadow: the PDF
 * reference brightens the image underneath the whole copy block, not just the
 * glyph edges.
 */
.wwts-home-hero__content::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;

    top: 50%;
    left: 50%;
    width: 118%;
    height: 150%;
    transform: translate(-50%, -50%);

    background:
        radial-gradient(
            ellipse at center,
            rgba(255, 250, 242, 0.62) 0%,
            rgba(255, 249, 240, 0.45) 38%,
            rgba(255, 248, 238, 0.20) 60%,
            rgba(255, 248, 238, 0) 80%
        );
    filter: blur(10px);
}

.wwts-home-hero__title,
.wwts-home-hero__title .elementor-heading-title,
.wwts-home-hero__subtitle,
.wwts-home-hero__subtitle p {
    margin-block: 0;
}

/*
 * Hero typography
 * ---------------
 * Font families/weights/colors still come from the Elementor Kit. The hero
 * component owns only its local scale, line-height and spacing.
 */
.wwts-home-hero__title,
.wwts-home-hero__title .elementor-heading-title {
    max-width: 820px;
    font-size: clamp(46px, 4.25vw, 62px);
    line-height: 0.98;
    text-align: center;
}

.wwts-home-hero__subtitle,
.wwts-home-hero__subtitle p {
    max-width: 700px;
    font-size: clamp(17px, 1.45vw, 21px);
    line-height: 1.3;
    text-align: center;
}

.wwts-home-hero__subtitle {
    margin-top: clamp(14px, 1.4vw, 20px) !important;
}

.wwts-home-hero__content .wwts-button--hero {
    margin-top: clamp(24px, 2.2vw, 34px) !important;
}

@media (max-width: 1024px) {
    .wwts-home-hero__media {
        width: 100% !important;
    }

    .wwts-home-hero__image {
        --wwts-home-hero-scale: 1.07;
    }

    .wwts-home-hero__inner {
        width: 100% !important;
        padding-inline: 20px !important;
    }

    .wwts-home-hero__content {
        width: min(calc(100% - 40px), 760px) !important;
        max-width: 760px !important;
        padding: clamp(22px, 4vw, 40px);
    }

    .wwts-home-hero__title,
    .wwts-home-hero__title .elementor-heading-title {
        max-width: 700px;
        font-size: clamp(40px, 5.2vw, 52px);
    }

    .wwts-home-hero__subtitle,
    .wwts-home-hero__subtitle p {
        max-width: 620px;
        font-size: clamp(16px, 2vw, 19px);
    }
}

@media (max-width: 767px) {
    .wwts-home-hero__media {
        width: 100% !important;
        min-height: 350px;
    }

    .wwts-home-hero__image {
        --wwts-home-hero-scale: 1.075;
    }

    img.wwts-home-hero__image,
    .wwts-home-hero__image img {
        min-height: 350px;
        object-fit: cover;
        object-position: center;
    }

    .wwts-home-hero__inner {
        width: 100% !important;
        padding-inline: 15px !important;
    }

    .wwts-home-hero__content {
        width: min(calc(100% - 30px), 620px) !important;
        max-width: 620px !important;
        padding: 20px;
    }

    .wwts-home-hero__content::before {
        width: 112%;
        height: 140%;
        filter: blur(8px);
    }

    .wwts-home-hero__title,
    .wwts-home-hero__title .elementor-heading-title {
        max-width: 540px;
        font-size: clamp(32px, 8vw, 42px);
        line-height: 1;
    }

    .wwts-home-hero__subtitle,
    .wwts-home-hero__subtitle p {
        max-width: 520px;
        font-size: 16px;
        line-height: 1.35;
    }

    .wwts-home-hero__subtitle {
        margin-top: 12px !important;
    }

    .wwts-home-hero__content .wwts-button--hero {
        margin-top: 22px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wwts-home-hero__image {
        --wwts-home-hero-scale: 1;
        --wwts-home-hero-shift-x: 0px !important;
        --wwts-home-hero-shift-y: 0px !important;
        --wwts-home-hero-scroll-y: 0px !important;
    }

    img.wwts-home-hero__image,
    .wwts-home-hero__image img {
        transform: none !important;
        will-change: auto;
    }
}
