/**
 * Sponsoren Banner Block Styles
 */

/* Google Fonts einbinden */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200;300;400;500;600;700&display=swap');

.wp-block-theme1-sponsor-banner {
    padding: 4rem 1.5rem;
    margin: 0; /* Kein Margin, da volle Breite */
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme1-sponsor-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.sponsor-banner-header {
    text-align: center;
    margin-bottom: 3rem;
}

.sponsor-banner-title {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--wp--preset--color--primary);
}

.sponsor-banner-subtitle {
    font-size: var(--wp--preset--font-size--medium);
    opacity: 0.75;
    max-width: 700px;
    margin: 0 auto;
    color: var(--wp--preset--color--text);
}

.sponsors-wrapper {
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
}

.sponsors-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
    transition: transform 0.5s ease-in-out;
}

.sponsor-item {
    flex: 1 1 200px;
    max-width: 250px;
    min-width: 150px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: transparent;
    position: relative;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.sponsor-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sponsor-logo {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    transition: all 0.8s ease-in-out;
    filter: grayscale(100%);
    opacity: 0.7;
}

.sponsor-item.active .sponsor-logo {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

.sponsor-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: var(--wp--custom--border-radius--small);
    text-align: center;
    padding: 1rem;
    font-weight: var(--wp--custom--font-weight--medium);
    color: var(--wp--preset--color--primary);
}

/* Animation Styles */
.wp-block-theme1-sponsor-banner.has-slide-animation .sponsors-container {
    flex-wrap: nowrap;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .wp-block-theme1-sponsor-banner {
        padding: 2rem 1rem;
        overflow: hidden; /* Verhindert Overflow auf Blockebene */
    }
    
    .theme1-sponsor-banner-inner {
        overflow: hidden; /* Verhindert Overflow auf Inhaltsebene */
    }
    
    .sponsors-wrapper {
        overflow: hidden; /* Verhindert jeglichen Overflow */
        position: relative;
        padding: 2rem 0;
    }
    
    /* Entferne die Slide-Animation und zeige stattdessen ein Grid mit 2 Spalten */
    .wp-block-theme1-sponsor-banner .sponsors-container,
    .wp-block-theme1-sponsor-banner.has-slide-animation .sponsors-container {
        justify-content: center;
        flex-wrap: wrap;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        transform: none !important; /* Verhindere die Slide-Animation */
        overflow: visible; /* Erlaube Overflow für die Trenner */
    }
    
    .wp-block-theme1-sponsor-banner .sponsor-item,
    .wp-block-theme1-sponsor-banner.has-slide-animation .sponsor-item {
        flex: 0 0 calc(50% - 1rem);
        max-width: 100%;
        width: 100%;
        height: 100px;
        overflow: hidden; /* Verhindert Overflow des Shine-Effekts */
        position: relative;
    }
    
    /* Angepasster Shine-Effekt für mobile Geräte */
    .sponsor-item::before {
        width: 40%; /* Kleinere Breite auf mobilen Geräten */
    }
    
    /* Sicherstellen, dass die aktiven Logos auf mobilen Geräten korrekt angezeigt werden */
    .sponsor-item.active .sponsor-logo {
        filter: grayscale(0%);
        opacity: 1;
        transform: scale(1.05);
    }
    
    /* Anpassung der Größe der Logos auf mobilen Geräten */
    .sponsor-logo {
        max-height: 80px;
    }
    
    /* Anpassung der Überschrift auf mobilen Geräten */
    .sponsor-banner-title {
        font-size: 2rem;
    }
    
    .sponsor-banner-subtitle {
        font-size: 1rem;
    }
    
    /* Anpassung der Trenner für die 2-spaltige Ansicht */
    .sponsor-item:nth-child(odd)::after {
        /* Trenner für die linke Spalte */
        content: '';
        position: absolute;
        right: -0.75rem;
        top: 50%;
        transform: translateY(-50%);
        height: 50px;
        width: 1px;
        background: linear-gradient(to bottom, 
            rgba(0, 0, 0, 0), 
            rgba(0, 0, 0, 0.1), 
            rgba(0, 0, 0, 0));
    }
    
    .sponsor-item:nth-child(even)::after {
        /* Kein Trenner für die rechte Spalte */
        display: none;
    }
    
    /* Horizontale Trenner für die Zeilen */
    .sponsor-item:nth-child(1)::after,
    .sponsor-item:nth-child(2)::after {
        content: '';
        position: absolute;
        bottom: -0.75rem;
        left: 25%;
        right: 25%;
        height: 1px;
        width: 50%;
        background: linear-gradient(to right, 
            rgba(0, 0, 0, 0), 
            rgba(0, 0, 0, 0.1), 
            rgba(0, 0, 0, 0));
        animation: none; /* Deaktiviere die Shine-Animation für diese Elemente */
        z-index: 1; /* Niedrigerer z-index als der Shine-Effekt */
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sponsor-item {
        flex: 1 1 180px;
        max-width: 200px;
    }
}

/* Farb-Varianten */
.wp-block-theme1-sponsor-banner.has-white-background-color {
    background-color: var(--wp--preset--color--white);
}

.wp-block-theme1-sponsor-banner.has-primary-background-color {
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

.wp-block-theme1-sponsor-banner.has-secondary-background-color {
    background-color: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--white);
}

.wp-block-theme1-sponsor-banner.has-accent-background-color {
    background-color: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--black);
}

.wp-block-theme1-sponsor-banner.has-light-background-color {
    background-color: var(--wp--preset--color--light);
    color: var(--wp--preset--color--primary);
}

/* Moderne Trenner zwischen den Sponsoren */
.sponsor-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    height: 50px;
    width: 1px;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0), 
        rgba(0, 0, 0, 0.1), 
        rgba(0, 0, 0, 0));
}

@media (max-width: 768px) {
    .sponsor-item:not(:last-child)::after {
        display: none;
    }
}

/* Übergänge und Animationen */
@keyframes slideBg {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.wp-block-theme1-sponsor-banner.has-accent-background-color {
    background: linear-gradient(135deg, 
        var(--wp--preset--color--accent) 0%, 
        rgba(255, 215, 0, 0.8) 50%, 
        var(--wp--preset--color--accent) 100%);
    background-size: 200% 200%;
    animation: slideBg 15s ease infinite;
}

/* Spotlight-Effekt */
.sponsor-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    z-index: 2;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 100%
    );
    transform: skewX(-25deg);
    opacity: 0;
    transition: all 0.7s ease;
}

.sponsor-item.active::before {
    animation: shine 1.2s;
}

@keyframes shine {
    100% {
        left: 125%;
        opacity: 1;
    }
}

/* Angepasste Animation für mobile Geräte */
@media (max-width: 768px) {
    @keyframes shine {
        0% {
            left: -40%;
            opacity: 0;
        }
        100% {
            left: 100%;
            opacity: 1;
        }
    }
    
    /* Angepasster Spotlight-Effekt für mobile Geräte */
    .sponsor-item::before {
        width: 40%;
        transform: skewX(-15deg); /* Weniger schräg auf mobilen Geräten */
        z-index: 3; /* Höherer z-index als die Trenner */
    }
    
    /* Deaktiviere die Shine-Animation für die horizontalen Trenner */
    .sponsor-item:nth-child(1)::after,
    .sponsor-item:nth-child(2)::after {
        animation: none !important;
    }
    
    /* Stelle sicher, dass die Shine-Animation innerhalb des Containers bleibt */
    .sponsor-item.active::before {
        animation: shine 1s ease-in-out; /* Kürzere Animation auf mobilen Geräten */
    }
} 