/* ==========================================================================
   Hero-rotator — roterende achtergrondfoto's met diagonale scan-wipe
   Gedeeld door alle pagina's van ai-2-go.nl.
   Gebruik: voeg class "hero-rotator" toe aan de hero/header-sectie en plaats
   direct na de openingstag het .hero-slides-blok (5 slides + .hero-scanbar).
   Laad hierna hero-rotator.js (defer).
   ========================================================================== */

.hero-rotator {
    position: relative;
    overflow: hidden;
}

/* Bestaande hero-content boven de foto's houden.
   De slides vormen een eigen stacking context op z-index 0, dus 1 volstaat. */
.hero-rotator > :not(.hero-slides) {
    position: relative;
    z-index: 1;
}

/* Leesbaarheid van de tekst over de foto's */
.hero-rotator h1 { text-shadow: 0 2px 12px rgba(0,0,0,0.45); }
.hero-rotator p  { text-shadow: 0 1px 8px rgba(0,0,0,0.4); }

.hero-rotator .hero-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-rotator .hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.07);
    z-index: 1;
}

.hero-rotator .hero-slide.is-entering {
    opacity: 1;
    z-index: 2;
    clip-path: polygon(0 0, 0 0, -15% 100%, 0 100%);
}

.hero-rotator .hero-slide.is-active {
    opacity: 1;
    z-index: 2;
    clip-path: polygon(0 0, 115% 0, 100% 100%, 0 100%);
    transform: scale(1);
    /* zoom (6,5 s) is klaar vóór de wissel (7 s), dus geen sprong bij vertrek */
    transition: clip-path 1.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 6.5s ease-out;
}

.hero-rotator .hero-slide.is-leaving {
    opacity: 1;
    z-index: 1;
    transform: scale(1); /* eindstand van de zoom vasthouden tijdens de wipe */
}

/* Donkere overlay boven de foto's, onder de tekst */
.hero-rotator .hero-slides::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    background: linear-gradient(180deg, rgba(16, 42, 67, 0.60), rgba(30, 90, 125, 0.35));
}

/* Gloeiende scanlijn die schuin met de diagonale wipe meeloopt */
.hero-rotator .hero-scanbar {
    position: absolute;
    top: -6%;
    bottom: -6%;
    left: -10%;
    width: 16px;
    z-index: 6;
    opacity: 0;
    pointer-events: none;
    transform: skewX(-24deg);
    background: linear-gradient(90deg, rgba(99, 224, 255, 0), rgba(190, 242, 255, 0.95) 45%, rgba(99, 224, 255, 0.85) 55%, rgba(99, 224, 255, 0));
    box-shadow: 0 0 28px 7px rgba(99, 224, 255, 0.55);
}

.hero-rotator .hero-scanbar.is-scanning {
    animation: heroScan 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes heroScan {
    0%   { left: -6%; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { left: 106%; opacity: 0; }
}

/* Vonkjes die achter de scanlijn aan dwarrelen */
.hero-rotator .scan-spark {
    position: absolute;
    border-radius: 50%;
    background: #d9f7ff;
    box-shadow: 0 0 10px 2px rgba(99, 224, 255, 0.85);
    opacity: 0;
}

.hero-rotator .is-scanning .scan-spark {
    animation: sparkTwinkle 0.8s ease-out both;
}

@keyframes sparkTwinkle {
    0%   { opacity: 0; transform: translateX(0) scale(0.4); }
    25%  { opacity: 1; transform: translateX(-8px) scale(1.15); }
    100% { opacity: 0; transform: translateX(-48px) scale(0.2); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-rotator .hero-slide,
    .hero-rotator .hero-slide.is-active {
        transition: opacity 0.8s ease;
        transform: none;
        clip-path: none;
    }
    .hero-rotator .hero-slide.is-entering { opacity: 0; }
    .hero-rotator .hero-scanbar { display: none; }
}
