/**
 * TrainWerk image areas and the master's slow background zoom.
 * Copyright (C) 2026 Hans-Josef Pesch / TrainWerk
 * License: TrainWerk Open Use License 1.0
 */

.tw-image-hero,
.tw-image-box,
.tw-image-slider {
    --tw-image-width: var(--tw-image-width-desktop, 100%);
    --tw-image-height: var(--tw-image-height-desktop, auto);
    --tw-image-fit: var(--tw-image-fit-desktop, cover);
    --tw-image-x: var(--tw-image-x-desktop, var(--tw-image-default-x, 50%));
    --tw-image-y: var(--tw-image-y-desktop, var(--tw-image-default-y, 50%));
    --tw-image-animation: var(--tw-image-animation-desktop, none);
    width: var(--tw-image-width);
    max-width: 100%;
    margin-inline: auto;
}

.tw-image-hero {
    min-height: var(--tw-image-height-desktop, 960px);
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
}

.tw-image-hero:not(.tw-slide) {
    display: grid;
}

.tw-image-hero > .tw-image-hero-content {
    min-width: 0;
    padding-block: var(--tw-image-padding-desktop, 8rem);
}

.tw-image-hero > .tw-hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    /* Centering stays identical; the longest service title still fits 960px. */
    padding-block: var(--tw-image-padding-desktop, 4rem);
}

.tw-image-hero > .tw-hero-grid > *,
.tw-image-hero > .tw-home-master-grid > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tw-image-hero .tw-hero-grid h1 {
    font-size: 3.75rem;
    line-height: 1.25;
    letter-spacing: -0.025em;
    hyphens: auto;
}

.tw-image-hero .tw-eyebrow {
    margin-top: 0;
}

.tw-image-hero .tw-page-hero-copy h1 {
    max-width: 896px;
    font-size: 3.75rem;
    line-height: 1.25;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.tw-image-hero .tw-page-hero-copy > .tw-lead {
    max-width: 768px;
}

.tw-image-hero .tw-image-layer {
    position: absolute;
    inset: 0;
    background-image: var(--tw-hero-image);
    background-repeat: no-repeat;
    background-size: var(--tw-image-fit);
    background-position: var(--tw-image-x) var(--tw-image-y);
    transform-origin: center center;
    animation-name: var(--tw-image-animation);
    animation-duration: var(--tw-zoom-duration, 8s);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
}

.tw-faq-page .tw-image-hero {
    --tw-image-default-x: 28%;
    --tw-image-default-y: 54%;
}

.tw-image-video,
.tw-image-box > img {
    width: 100%;
    height: 100%;
    object-fit: var(--tw-image-fit);
    object-position: var(--tw-image-x) var(--tw-image-y);
}

.tw-image-hero > .tw-image-video {
    position: absolute;
    inset: 0;
    z-index: -3;
}

.tw-editorial-image.tw-image-box {
    min-height: var(--tw-image-height-desktop, 460px);
    height: var(--tw-image-height);
}

.tw-home-master-card-media.tw-image-box {
    height: var(--tw-image-height);
}

.tw-image-slider > .tw-slide.tw-image-hero {
    width: 100%;
    margin-inline: 0;
}

/* Only the image moves; copy, overlay and all controls stay in place. */
@keyframes tw-hero-image-enter {
    from { transform: scale(1.035) translate3d(-0.6%, 0.4%, 0); }
    to { transform: scale(var(--tw-zoom-end, 1.085)) translate3d(0, -0.35%, 0); }
}

[data-tw-motion="off"] > .tw-image-video,
html.tw-a11y-motion .tw-image-video {
    display: none;
}

html.tw-a11y-motion .tw-image-layer,
html.tw-a11y-contrast-high .tw-image-layer {
    animation: none !important;
    transform: none !important;
}

@media (max-width: 1023px) {
    .tw-image-hero,
    .tw-image-box,
    .tw-image-slider {
        --tw-image-width: var(--tw-image-width-mobile, 100%);
        --tw-image-height: var(--tw-image-height-mobile, auto);
        --tw-image-fit: var(--tw-image-fit-mobile, var(--tw-image-fit-desktop, cover));
        --tw-image-x: var(--tw-image-x-mobile, var(--tw-image-x-desktop, var(--tw-image-default-x, 50%)));
        --tw-image-y: var(--tw-image-y-mobile, var(--tw-image-y-desktop, var(--tw-image-default-y, 50%)));
        --tw-image-animation: var(--tw-image-animation-mobile, none);
    }

    .tw-image-hero {
        min-height: var(--tw-image-height-mobile, auto);
    }

    .tw-image-hero > .tw-image-hero-content {
        padding-block: var(--tw-image-padding-mobile, 5rem);
        grid-template-columns: minmax(0, 1fr);
    }

    .tw-image-hero .tw-page-hero-copy h1 {
        font-size: 3rem;
    }

    .tw-image-hero .tw-hero-grid h1 {
        font-size: 3rem;
    }

    .tw-editorial-image.tw-image-box {
        min-height: var(--tw-image-height-mobile, 380px);
    }
}

@media (max-width: 639px) {
    .tw-image-hero > .tw-image-hero-content {
        padding-block: var(--tw-image-padding-mobile, 4rem);
    }

    .tw-image-hero .tw-page-hero-copy h1 {
        font-size: 2.25rem;
    }

    .tw-image-hero .tw-hero-grid h1 {
        font-size: 1.875rem;
    }

    .tw-editorial-image.tw-image-box {
        min-height: var(--tw-image-height-mobile, 280px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tw-image-hero .tw-image-layer {
        animation: none !important;
        transform: none !important;
    }

    .tw-image-video {
        display: none !important;
    }
}
