/* Move the photograph inside its existing figure, link or button. The pointer target,
   captions, play labels and gallery controls keep their layout and native actions. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    main :where(
        figure, picture, a, .photo, .bga-intro,
        button.photo-thumb, .image-controls > button
    ) {
        > img:not(:where(
            dialog img, [role="dialog"] img, .wp-lightbox-overlay img,
            .brand-logo img, .st-company-banner img,
            .bga-comparison img, .bga-handler-map img,
            .pga-operation-drawing img, .memtest-reference-figure img,
            .sa-image-drawing img, .sa-image-board img, .board-example-photo img,
            [src*="/ic-series-floating-original"], [src*="/ic-series-kelvin-original"],
            [src*="/ic-series-circuit-original"]
        )) {
            translate: var(--st-active-photo-offset, none);
            scale: var(--st-active-photo-scale, none);
            transition: translate 220ms cubic-bezier(.22,.68,.28,1),
                        scale 220ms cubic-bezier(.22,.68,.28,1);
        }

        &:hover > img {
            --st-active-photo-offset: var(--st-photo-offset, 0 -6px);
            --st-active-photo-scale: var(--st-photo-scale, 1.025);
        }
    }

    /* The model title link covers its whole row, including the photograph. */
    main .model-row:hover > figure {
        --st-active-photo-offset: 0 -6px;
        --st-active-photo-scale: 1.025;
    }

    /* The small images in a view selector and the linked poster stay centred. */
    main :where(.home-video-poster > a, .c-thumb > a, .thumbs > a,
                button.photo-thumb, .image-controls > button) {
        --st-photo-offset: none;
        --st-photo-scale: 1.045;
    }
    main .home-video-poster > a { overflow: hidden; }
}
