/* =========================================================
   AIP HOME HERO - 3 IMAGE CSS SLIDER
========================================================= */

.home-hero-section {
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    min-height: 580px !important;
    height: 580px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    padding-top: 110px !important; /* Clears transparent header on mobile/tablet */
    padding-bottom: 0 !important;
}

@media (min-width: 1025px) {
    .home-hero-section {
        min-height: 650px !important;
        height: 650px !important;
        padding-top: 130px !important; /* Clears transparent header on desktop */
    }
}

/* =========================================================
   SHARED LAYER PROPERTIES
========================================================= */

.home-hero-section::before,
.home-hero-section::after,
.home-hero-section .hero-layer-3 {
    content: "";
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    pointer-events: none;
    will-change: opacity, transform;
}

/* =========================================================
   IMAGE 1 (::before)
========================================================= */

.home-hero-section::before {
    z-index: 1;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
        var(--hero-image-1);
    animation: 
        aip-fade-1 21s infinite ease-in-out,
        aip-zoom 21s infinite ease-in-out;
}

/* =========================================================
   IMAGE 2 (::after)
========================================================= */

.home-hero-section::after {
    z-index: 2;
    opacity: 0;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
        var(--hero-image-2);
    animation: 
        aip-fade-2 21s infinite ease-in-out,
        aip-zoom 21s infinite ease-in-out;
}

/* =========================================================
   IMAGE 3 (.hero-layer-3)
========================================================= */

.home-hero-section .hero-layer-3 {
    z-index: 3;
    opacity: 0;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
        var(--hero-image-3);
    animation: 
        aip-fade-3 21s infinite ease-in-out,
        aip-zoom 21s infinite ease-in-out;
}

/* =========================================================
   FOREGROUND CONTENT & TYPOGRAPHY
========================================================= */

.home-hero-section > .l-section-h {
    position: relative !important;
    width: 100% !important;
    z-index: 10 !important;
    padding-top: 0 !important;
    margin: 0 auto !important;
}

.home-hero-section .w-vwrapper {
    position: relative !important;
    z-index: 11 !important;
    margin-top: 0 !important;
}

/* Enforce Pure White Headline & Content */
.home-hero-section h1,
.home-hero-section h1 span,
.home-hero-section .bannertitel,
.home-hero-section .bannertitel * {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.40);
}

/* Fallback color prevents white flash during crossfade calculations */
.home-hero-section {
    background-color: #1a2530 !important;
}

/* =========================================================
   3-IMAGE SEAMLESS OVERLAP CYCLE (21s total)
========================================================= */

@keyframes aip-fade-1 {
    0%       { opacity: 1; }
    33.33%   { opacity: 1; }
    38%      { opacity: 0; }  /* Holds solid until Image 2 is fully visible */
    95.24%   { opacity: 0; }
    100%     { opacity: 1; }
}

@keyframes aip-fade-2 {
    0%       { opacity: 0; }
    28.57%   { opacity: 0; }
    33.33%   { opacity: 1; }
    66.67%   { opacity: 1; }
    71.5%    { opacity: 0; }  /* Holds solid until Image 3 is fully visible */
    100%     { opacity: 0; }
}

@keyframes aip-fade-3 {
    0%       { opacity: 0; }
    61.90%   { opacity: 0; }
    66.67%   { opacity: 1; }
    95.24%   { opacity: 1; }
    100%     { opacity: 0; }  /* Fades out as Image 1 takes over */
}

/* Subtle continuous zoom */
@keyframes aip-zoom {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* =========================================================
   ACCESSIBILITY: REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .home-hero-section::before {
        animation: none;
        transform: none;
        opacity: 1;
    }
    .home-hero-section::after,
    .home-hero-section .hero-layer-3 {
        display: none;
    }
}