/* Drift Hero v2.2 — Flux iframe + Scale + CSS Filters + Mobile Fallback */

.drift-hero {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: #000;
    pointer-events: none;

    --dh-scale-d: 100;
    --dh-scale-t: 60;
    --dh-scale-m: 40;
    --dh-filter: none;
    --dh-opacity: 1;
}

.drift-hero ~ .row-inner {
    position: relative;
    z-index: 2;
}

/* ── Fixed-Modus: Animation bleibt stehen, Content scrollt darüber ── */
.drift-hero.drift-fixed {
    position: fixed;
    z-index: 0;
}

/* Mobile: fixed → absolute (iOS Safari repaint-Bug mit fixed iframes) */
@media (max-width: 768px) {
    .drift-hero.drift-fixed {
        position: absolute;
        z-index: 1;
    }
}

/* ── Fallback (statisches Bild, sichtbar wenn iframe versteckt) ── */
.drift-hero.drift-fallback {
    background-size: cover;
    background-position: center;
}

.drift-hero.drift-fallback .drift-hero-frame {
    display: none;
}

/* Subtile CSS-Animation auf dem Fallback-Bild */
.drift-hero.drift-fallback::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: inherit;
    background-position: inherit;
    animation: driftFallbackShift 30s ease-in-out infinite alternate;
    filter: var(--dh-filter, none);
    opacity: var(--dh-opacity, 1);
}

@keyframes driftFallbackShift {
    0%   { transform: scale(1.05) translate(0, 0); }
    50%  { transform: scale(1.1) translate(-2%, 1%); }
    100% { transform: scale(1.05) translate(1%, -1%); }
}

/* ── iframe (Desktop / Tablet — Flux aktiv) ── */
.drift-hero-frame,
.drift-hero-frame:focus,
.drift-hero-frame:focus-visible {
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
    width:  calc(100% * 100 / var(--dh-scale-d));
    height: calc(100% * 100 / var(--dh-scale-d));
    transform: scale(calc(var(--dh-scale-d) / 100));
    transform-origin: 0 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    display: block;
    filter: var(--dh-filter, none);
    opacity: 1;
}

/* Animation-Endwert = opacity aus Settings */
@keyframes driftFadeIn {
    to { opacity: var(--dh-opacity, 1); }
}

/* ── Tablet ── */
@media (max-width: 1024px) {
    .drift-hero-frame {
        width:  calc(100% * 100 / var(--dh-scale-t));
        height: calc(100% * 100 / var(--dh-scale-t));
        transform: scale(calc(var(--dh-scale-t) / 100));
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .drift-hero-frame {
        width:  calc(100% * 100 / var(--dh-scale-m));
        height: calc(100% * 100 / var(--dh-scale-m));
        transform: scale(calc(var(--dh-scale-m) / 100));
    }
}

@media (prefers-reduced-motion: reduce) {
    .drift-hero-frame {
        animation: none;
        opacity: var(--dh-opacity, 1);
    }
    .drift-hero.drift-fallback::after {
        animation: none;
    }
}
