/*
 * KOPANIMATIES (17 november 2026)
 *
 * Elke animatie hoort bij een klasse die het thema op het kopvlak zet:
 *   .kop-animatie-fade       zacht verschijnen
 *   .kop-animatie-opkomen    van onderen opkomen
 *   .kop-animatie-scan       een lijn met gloed die van boven naar beneden loopt
 *   .kop-animatie-bubbels    bellen die opstijgen
 *   .kop-animatie-regen      schuine strepen die vallen
 *   .kop-animatie-sneeuw     vlokken die dwarrelen
 *   .kop-animatie-confetti   feestelijke snippers die vallen
 *   .kop-animatie-zoom       rustig inzoomen (alleen bij een afbeelding)
 *
 * KLEUREN KOMEN UIT DE SKIN (17 november 2026, op verzoek van de eigenaar):
 * alles leest --primary-color en --secondary-color. Verandert u van
 * kleurenpreset, dan veranderen de animaties mee.
 *
 * VEILIGHEIDSREGEL: een animatie raakt nooit de titel, de beschrijving of de
 * knoppen. Ze werkt op het vlak zelf of op de afbeelding, en staat onder de
 * donkere band (laag 1; de band is laag 2).
 */

/* 1. Zacht verschijnen ---------------------------------------------------- */
@keyframes sw87-kop-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.kop-animatie-fade {
    animation: sw87-kop-fade 1.2s ease-out both;
}

/* 2. Van onderen opkomen -------------------------------------------------- */
@keyframes sw87-kop-opkomen {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kop-animatie-opkomen {
    animation: sw87-kop-opkomen 1.1s ease-out both;
}

/* 3. Scanner: een lijn met een gloed die van boven naar beneden loopt ------
   De lijn is de onderkant van een doorschijnend vlak: zo lijkt het of er
   iets over het beeld heen scant. De kleur is de primaire kleur van de skin. */
@keyframes sw87-kop-scan {
    from { top: -120px; }
    to   { top: 100%; }
}

.kop-animatie-scan {
    position: relative;
}

.kop-animatie-scan::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -120px;
    height: 120px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom,
        color-mix(in srgb, var(--primary-color, #2271b1) 0%, transparent) 0%,
        color-mix(in srgb, var(--primary-color, #2271b1) 26%, transparent) 82%,
        color-mix(in srgb, var(--primary-color, #2271b1) 62%, transparent) 94%,
        color-mix(in srgb, var(--primary-color, #2271b1) 85%, white) 100%);
    animation: sw87-kop-scan 4.5s linear infinite;
}

/* 4. Bubbels: bellen die opstijgen ---------------------------------------- */
@keyframes sw87-kop-bubbels {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

.kop-animatie-bubbels {
    position: relative;
}

.kop-animatie-bubbels::before,
.kop-animatie-bubbels::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 200%;
    z-index: 1;
    pointer-events: none;
    background-repeat: repeat;
    background-image:
        radial-gradient(circle, color-mix(in srgb, var(--primary-color, #2271b1) 55%, white) 0 6px, transparent 7px),
        radial-gradient(circle, color-mix(in srgb, var(--secondary-color, #6cd100) 40%, white) 0 10px, transparent 11px),
        radial-gradient(circle, color-mix(in srgb, var(--primary-color, #2271b1) 30%, white) 0 15px, transparent 16px);
    background-size: 120px 170px, 190px 230px, 260px 310px;
    background-position: 20px 40px, 95px 130px, 160px 210px;
    animation: sw87-kop-bubbels 18s linear infinite;
    opacity: 0.9;
}

.kop-animatie-bubbels::after {
    animation-duration: 27s;
    animation-delay: -9s;
    opacity: 0.55;
    background-size: 160px 210px, 240px 290px, 320px 380px;
}

/* 5. Regen: schuine strepen die naar beneden lopen ------------------------- */
@keyframes sw87-kop-regen {
    from { background-position: 0 -240px, 0 -340px; }
    to   { background-position: -45px 240px, 30px 340px; }
}

.kop-animatie-regen {
    position: relative;
}

.kop-animatie-regen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.75;
    background-image:
        repeating-linear-gradient(104deg, color-mix(in srgb, var(--primary-color, #2271b1) 45%, white) 0 1px, transparent 1px 13px),
        repeating-linear-gradient(99deg, color-mix(in srgb, var(--primary-color, #2271b1) 25%, white) 0 1px, transparent 1px 19px);
    background-size: 140px 240px, 220px 340px;
    animation: sw87-kop-regen 0.85s linear infinite;
}

/* 6. Sneeuw: kleine vlokken die dwarrelend naar beneden gaan ---------------- */
@keyframes sw87-kop-sneeuw {
    from { background-position: 0 -200px, 40px -300px, 90px -420px; }
    to   { background-position: 22px 200px, -18px 300px, 64px 420px; }
}

.kop-animatie-sneeuw {
    position: relative;
}

.kop-animatie-sneeuw::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.95;
    background-image:
        radial-gradient(circle, color-mix(in srgb, var(--primary-color, #2271b1) 12%, white) 0 2px, transparent 3px),
        radial-gradient(circle, color-mix(in srgb, var(--primary-color, #2271b1) 20%, white) 0 1.5px, transparent 2.5px),
        radial-gradient(circle, color-mix(in srgb, var(--secondary-color, #6cd100) 12%, white) 0 1px, transparent 2px);
    background-size: 90px 140px, 140px 200px, 200px 260px;
    animation: sw87-kop-sneeuw 9s linear infinite;
}

/* 7. Confetti: feestelijke snippers die vallen ------------------------------
   EERST was dit één dicht vlak: de snippers herhaalden zich elke 9 px, dus
   het leek een gekleurde waas over de hele foto. Nu is elke laag een groot
   vlak (200 tot 300 px) met daarin één klein snipper, zodat het echt
   snippers zijn en de foto zichtbaar blijft. */
@keyframes sw87-kop-confetti {
    from { transform: translateY(-50%) rotate(-4deg); }
    to   { transform: translateY(0%) rotate(4deg); }
}

.kop-animatie-confetti {
    position: relative;
}

.kop-animatie-confetti::before {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    top: 0;
    height: 200%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.95;
    background-repeat: repeat;
    background-image:
        radial-gradient(ellipse 6px 10px at 30px 40px, var(--primary-color, #2271b1) 98%, transparent 100%),
        radial-gradient(ellipse 5px 8px at 120px 110px, var(--secondary-color, #6cd100) 98%, transparent 100%),
        radial-gradient(ellipse 7px 11px at 60px 170px, color-mix(in srgb, var(--primary-color, #2271b1) 55%, white) 98%, transparent 100%),
        radial-gradient(ellipse 4px 7px at 160px 60px, color-mix(in srgb, var(--secondary-color, #6cd100) 55%, white) 98%, transparent 100%);
    background-size: 240px 260px, 200px 230px, 280px 300px, 220px 240px;
    animation: sw87-kop-confetti 7s linear infinite;
}

/* 8. Rustig inzoomen (alleen bij een afbeelding) --------------------------- */
@keyframes sw87-kop-zoom {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}

.kop-animatie-zoom .featured-image-header img,
.kop-animatie-zoom img.wp-post-image {
    animation: sw87-kop-zoom 14s ease-in-out infinite alternate;
    transform-origin: center center;
}

/* Wie liever geen beweging wil (instelling in het besturingssysteem of de
   browser), krijgt geen beweging. */
@media (prefers-reduced-motion: reduce) {
    .kop-animatie-fade,
    .kop-animatie-opkomen,
    .kop-animatie-zoom img,
    .kop-animatie-scan::before,
    .kop-animatie-bubbels::before,
    .kop-animatie-bubbels::after,
    .kop-animatie-regen::before,
    .kop-animatie-sneeuw::before,
    .kop-animatie-confetti::before {
        animation: none !important;
    }
}

/* DE LANGZAME ZOOM ALS BASIS (17 november 2026)
   Deze staat los van de animaties: hij kan met elk effect samenwerken.
   Twintig seconden heen en terug -- langzaam, zodat je het bijna niet merkt
   maar de foto wel leeft. */
@keyframes sw87-kop-zoom-basis {
    from { transform: scale(1); }
    to   { transform: scale(1.12); }
}

.featured-image-header.kop-zoom img,
.kop-zoom .featured-image-header img,
.kop-zoom .kop-split-beeld img {
    animation: sw87-kop-zoom-basis 20s ease-in-out infinite alternate;
    transform-origin: center center;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .featured-image-header.kop-zoom img,
    .kop-zoom .featured-image-header img,
    .kop-zoom .kop-split-beeld img {
        animation: none !important;
    }
}
