/* Block: Full Image */

.block-full-image {
    --bio-full-image-max-height: 110dvh;
    width: 100%;
}

.block-full-image__frame {
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    position: relative;
    container-type: inline-size;
    container-name: bio-fullimage-frame;
}

/* Video: the <video> is position:absolute; inset:0 (video-surface.css) and
   matches the same box as the poster <img>. The frame must NOT use
   width:100% on the <img> while the frame is shrink-wrapped: that
   creates a % ↔ max-content loop and the frame collapses (tiny “1px” box).
   width: min(100%, max-content) caps to the content column; flex centers
   the image when the block uses justify-content on the parent. */
.block-full-image__frame.has-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(100%, max-content);
    max-width: 100%;
    min-width: 0;
    height: auto;
}

.block-full-image img {
    height: auto;
    width: 100%;
    max-height: var(--bio-full-image-max-height);
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.block-full-image__frame.has-video .block-full-image__image {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: auto;
    max-height: var(--bio-full-image-max-height);
    object-fit: cover;
}

/* Short viewports (≤ 700px tall) — drop the cap so the image/video can use
   its full natural aspect instead of getting squished. */
@media (max-height: 700px) {
    .block-full-image {
        --bio-full-image-max-height: none;
    }
}

.block-full-image__frame:hover img {
    transform: scale(1.02);
}

/* Skip the hover-scale when a video carries the feedback */
.block-full-image__frame.has-video:hover .block-full-image__image {
    transform: none;
}

/*

SCALE ON SCROLL EFFECT
- No hover zoom; stable transform-origin before/during GSAP.
*/

.block-full-image--scale-on-scroll img {
    transition: none;
    will-change: transform;
}

.block-full-image--scale-on-scroll .block-full-image__frame:hover img {
    transform: none;
}

/* ORIGIN TRANSFORMS */
.block-full-image--origin-top-center .block-full-image__frame img {
    transform-origin: 50% 0%;
}

.block-full-image--origin-center .block-full-image__frame img {
    transform-origin: 50% 50%;
}

.block-full-image--origin-bottom-center .block-full-image__frame img {
    transform-origin: 50% 100%;
}

/*

MOBILE

*/
@container page-content (max-width: 1024px) {
    .block-full-image__frame { border-radius: var(--border-radius-md); }
}

@container page-content (max-width: 768px) {
    .block-full-image { padding: 0 10px; }
    .block-full-image__frame { border-radius: var(--border-radius-sm); }
}

/* Mobile shape — driven by data-mobile-shape on .block-full-image (emitted
   by block.php for the 'default' effect; absent for 'scale-on-scroll',
   which has its own geometry). */
@container page-content (max-width: 768px) {
    .block-full-image:not([data-mobile-shape]) img,
    .block-full-image[data-mobile-shape="square"] img {
        aspect-ratio: 1 / 1;
    }
    .block-full-image[data-mobile-shape="square"] .block-full-image__frame.has-video {
        aspect-ratio: 1 / 1;
        max-height: unset;
    }

    .block-full-image[data-mobile-shape="vertical"] img {
        aspect-ratio: 9 / 16;
        height: 100%;
    }
    .block-full-image[data-mobile-shape="vertical"] .block-full-image__frame.has-video {
        aspect-ratio: 9 / 16;
        max-height: unset;
        width: 100%;
        height: calc(100dvh - var(--bio-header-h, 0px) - var(--bio-mini-menu-h, 0px));
    }
}
