.vilifa-hero {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    margin-block: 0;
    aspect-ratio: var(--vilifa-hero-ratio, 64 / 23);
    overflow: hidden;
    background: #e6f3ec;
}
.vilifa-hero > .wp-block-image {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0 !important;
    opacity: 0;
    transition: opacity .8s ease;
}
.vilifa-hero > .wp-block-image:first-child,
.vilifa-hero > .wp-block-image.is-current {
    opacity: 1;
}
.vilifa-hero.is-running > .wp-block-image:first-child:not(.is-current) {
    opacity: 0;
}
.vilifa-hero > .wp-block-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
@media (prefers-reduced-motion: reduce) {
    .vilifa-hero > .wp-block-image {
        transition: none;
    }
}


.vilifa-hero-editor img { display: block; width: 100%; height: auto; }

.vilifa-hero--scenic {
    position: relative;
    isolation: isolate;
    container-type: size;
    height: 100vh;
    height: 100svh;
    aspect-ratio: auto;
    background: #192c27;
}

/* Both copies share the same 16:9 plane so the outline stays registered when cropped. */
.vilifa-hero--scenic > :is(.wp-block-image, .vilifa-hero__foreground) {
    position: absolute;
    inset: 0 auto 0 50%;
    width: max(100cqw, calc(100cqh * 16 / 9));
    height: 100%;
    translate: -50% 0;
}
.vilifa-hero--scenic > :is(.wp-block-image, .vilifa-hero__foreground) img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The isolated foreground and background retain the same 16:9 coordinates. */
.vilifa-hero__foreground {
    z-index: 2;
    pointer-events: none;
}
.vilifa-hero__copy {
    --hero-word-size: clamp(40px, min(7.65vw, 14svh), 132px);
    position: absolute;
    inset: calc(49.7% - var(--hero-word-size)) 6% auto;
    text-align: center;
}
.vilifa-hero__heading,
.vilifa-hero__description {
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 2px 18px #0b221bb3;
    overflow-wrap: anywhere;
}
.vilifa-hero__heading {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    line-height: 1.04;
}
.vilifa-hero__word,
.vilifa-hero__subtitle {
    position: relative;
    display: block;
}
.vilifa-hero__word {
    z-index: 1;
    font-size: var(--hero-word-size);
    letter-spacing: -.045em;
}
.vilifa-hero__subtitle {
    z-index: 3;
    margin-top: .35em;
    font-size: clamp(20px, 3.3vw, 54px);
    letter-spacing: -.025em;
}
.vilifa-hero__description {
    position: relative;
    z-index: 3;
    max-width: 40ch;
    margin-inline: auto;
    margin-top: clamp(16px, 2.2vw, 36px);
    font-size: clamp(14px, 1.4vw, 23px);
    font-weight: 500;
    letter-spacing: .09em;
    line-height: 1.4;
}
@media (max-width: 767px) {
    .vilifa-hero__copy {
        --hero-word-size: clamp(28px, 10.3vw, 58px);
        inset-block-start: calc(55.3% - var(--hero-word-size));
    }
    .vilifa-hero__subtitle { font-size: clamp(16px, 5.45vw, 30px); }
    .vilifa-hero__description { max-width: 32ch; }
}
@media (max-height: 430px) {
    .vilifa-hero__copy { inset-block-start: 36%; }
}
.vilifa-hero-editor { position: relative; }
.vilifa-hero-editor__text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    place-content: center;
    gap: .3em;
    color: #fff;
    text-shadow: 0 2px 12px #0b221b;
    text-align: center;
    pointer-events: none;
}
.vilifa-hero-editor__text strong { font-size: clamp(28px, 7vw, 100px); }
.vilifa-hero-editor__text span { font-size: clamp(18px, 3vw, 38px); }
.vilifa-hero-editor__text small { font-size: clamp(13px, 1.8vw, 22px); }
