/**
 * EVD Füchse Theme - Sponsor Widget Styles (Modern Design)
 */

.evd-sponsor-widget {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: var(--bg-dunkel);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* Feste Gesamthöhe für einheitliche Ausrichtung */
    height: auto;
    min-height: 400px; /* Erhöht für feste Textbereiche */
}

.evd-sponsor-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Logo Link Styles */
.evd-sponsor-logo a {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.evd-sponsor-logo a:hover {
    opacity: 0.9;
}

/* Logo Bereich - Modern Card Style */
.evd-sponsor-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 240, 240, 0.9) 100%);
    padding: 40px 30px;
    margin-bottom: 0;
    min-height: 180px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.evd-sponsor-logo::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 1;
}

.evd-sponsor-logo img {
    max-width: 100%;
    max-height: 120px;
    height: auto;
    width: auto; /* Verhindert Verzerrung bei prozentualer Breite */
    display: block;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    /* transform: scale wird jetzt über Widget-Einstellung gesteuert */
    object-fit: contain;
}

.evd-sponsor-widget:hover .evd-sponsor-logo img {
    transform: scale(calc(var(--logo-scale, 1.8) * 1.05));
}

/* Content Bereich - Feste Struktur für einheitliche Höhen */
.evd-sponsor-content {
    padding: 25px 30px 30px;
    background: var(--bg-dunkel);
    display: flex;
    flex-direction: column;
    /* Entfernt flex: 1 um feste Höhen zu ermöglichen */
}

/* Überschrift Bereich - Feste Höhe für 2 Zeilen */
.evd-sponsor-heading {
    margin: 0 0 15px 0;
    margin-top: 1rem !important;
    color: var(--fuechse-rot);
    font-family: 'Redzone MediumReg', sans-serif;
    line-height: 1.3;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    /* Feste Höhe für genau 2 Zeilen */
    min-height: 4.68rem; /* 1.8rem * 1.3 line-height * 2 Zeilen = 4.68rem */
    max-height: 4.68rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-overflow: ellipsis;
}

.evd-sponsor-heading:empty {
    /* Auch wenn leer, behalte die Höhe für einheitliche Ausrichtung */
    min-height: 4.68rem;
    margin: 0 0 15px 0;
}

/* Text Bereich - Feste Höhe für 5 Zeilen */
.evd-sponsor-text {
    color: var(--text-grau);
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1rem;
    /* Feste Höhe für genau 5 Zeilen */
    min-height: 8rem; /* 1rem * 1.6 line-height * 5 Zeilen = 8rem */
    max-height: 8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Auch wenn Text leer ist, behalte die Höhe für einheitliche Ausrichtung */
.evd-sponsor-text:empty::before {
    content: " ";
    min-height: 8rem;
    display: block;
}

/* Social Media Icons - Füchse CI Design */
.evd-sponsor-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(223, 9, 20, 0.2);
}

.evd-sponsor-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--fuechse-grau);
    border: 2px solid var(--fuechse-rot);
    border-radius: 4px;
    color: var(--fuechse-rot);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.evd-sponsor-social a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--fuechse-rot);
    transition: left 0.3s ease;
    z-index: 1;
}

.evd-sponsor-social a:hover::before {
    left: 0;
}

.evd-sponsor-social a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-color: var(--fuechse-rot);
}

.evd-sponsor-social a i {
    font-size: 16px;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.evd-sponsor-social a:hover i {
    color: #ffffff;
}

/* Content Link Styles */
.evd-sponsor-content-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.evd-sponsor-content-link:hover {
    text-decoration: none;
    color: inherit;
}

.evd-sponsor-content-link .evd-sponsor-content {
    transition: all 0.3s ease;
}

.evd-sponsor-content-link:hover .evd-sponsor-content {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.evd-sponsor-content-link:hover .evd-sponsor-heading {
    color: var(--fuechse-rot);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

/* Ausrichtungsoptionen */
.evd-sponsor-widget[style*="text-align: left"] .evd-sponsor-heading,
.evd-sponsor-widget[style*="text-align: left"] .evd-sponsor-text {
    text-align: left;
}

.evd-sponsor-widget[style*="text-align: left"] .evd-sponsor-social {
    justify-content: flex-start;
}

.evd-sponsor-widget[style*="text-align: right"] .evd-sponsor-heading,
.evd-sponsor-widget[style*="text-align: right"] .evd-sponsor-text {
    text-align: right;
}

.evd-sponsor-widget[style*="text-align: right"] .evd-sponsor-social {
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
    .evd-sponsor-widget {
        min-height: 350px; /* Angepasst für feste Textbereiche */
    }
    
    .evd-sponsor-logo {
        padding: 30px 20px;
        min-height: 140px;
    }
    .evd-sponsor-logo img {
        max-height: 90px; /* etwas größer erlaubt */
        height: auto;
        max-width: 100%;
        object-fit: contain;
        /* Kantenglättung */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: auto;
    }
    /* Hover-Scaling bleibt deaktiviert auf Touch, aber Nutzer kann über responsive Controls skalieren */
    .evd-sponsor-widget:hover .evd-sponsor-logo img { transform: none; }
    
    .evd-sponsor-content {
        padding: 20px 25px 25px;
    }
    .evd-sponsor-heading {
        font-size: clamp(1.2rem, 3.6vw, 1.5rem);
        margin-bottom: 12px;
        /* Bis zu 3 Zeilen auf Mobil erlauben; automatische Schriftverkleinerung via clamp */
        min-height: auto;
        max-height: none;
    display: -webkit-box;
        -webkit-line-clamp: 3;
    line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        /* Flex-Ausrichtung des Desktops überschreiben */
        align-items: initial;
        justify-content: initial;
    }
    .evd-sponsor-heading:empty {
        min-height: 0;
        margin: 0 0 12px 0;
    }
    
    .evd-sponsor-text {
        margin-bottom: 20px;
        font-size: 14px;
        /* Angepasste Höhe für 5 Zeilen bei kleinerer Schrift */
        min-height: 7rem; /* 0.875rem * 1.6 line-height * 5 Zeilen ≈ 7rem */
        max-height: 7rem;
    }
      .evd-sponsor-social {
        gap: 6px;
        padding-top: 15px;
    }
    
    .evd-sponsor-social a {
        width: 36px;
        height: 36px;
    }
    
    .evd-sponsor-social a i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .evd-sponsor-widget {
        min-height: 320px; /* Angepasst für feste Textbereiche */
    }
    
    .evd-sponsor-logo {
        padding: 25px 15px;
        min-height: 120px;
    }
    .evd-sponsor-logo img {
        max-height: 70px; /* etwas größer erlaubt */
        height: auto;
        max-width: 100%;
        object-fit: contain;
    }
    .evd-sponsor-widget:hover .evd-sponsor-logo img { transform: none; }
    
    .evd-sponsor-content {
        padding: 15px 20px 20px;
    }
    .evd-sponsor-heading {
        font-size: clamp(1.05rem, 5vw, 1.3rem);
        /* Bis zu 3 Zeilen auf sehr kleinen Bildschirmen */
        min-height: auto;
        max-height: none;
    display: -webkit-box;
        -webkit-line-clamp: 3;
    line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        align-items: initial;
        justify-content: initial;
    }
    .evd-sponsor-heading:empty {
        min-height: 0;
    }
    
    .evd-sponsor-text {
        /* Angepasste Höhe für 5 Zeilen bei noch kleinerer Schrift */
        min-height: 6.5rem; /* Etwas kleiner für sehr kleine Bildschirme */
        max-height: 6.5rem;
    }
    
    .evd-sponsor-social a {
        width: 32px;
        height: 32px;
    }
    
    .evd-sponsor-social a i {
        font-size: 12px;
    }
}

/* Widget nur mit Logo (ohne Content) - Kompaktere Darstellung */
.evd-sponsor-widget:not(:has(.evd-sponsor-content)) {
    min-height: auto;
}

.evd-sponsor-widget:not(:has(.evd-sponsor-content)) .evd-sponsor-logo {
    border-radius: 10px; /* Gleicher Radius wie das Widget */
}

/* Widget ohne Logo - Kompaktere Darstellung */
.evd-sponsor-widget:not(:has(.evd-sponsor-logo)) {
    min-height: auto;
}

.evd-sponsor-widget:not(:has(.evd-sponsor-logo)) .evd-sponsor-content {
    border-radius: 10px; /* Gleicher Radius wie das Widget */
    margin: 0; /* Kein Margin zwischen Logo und Content */
}

/* Fallback für Browser ohne :has() Support */
.evd-sponsor-widget.logo-only {
    min-height: auto;
}

.evd-sponsor-widget.logo-only .evd-sponsor-logo {
    border-radius: 10px;
}

.evd-sponsor-widget.no-logo {
    min-height: auto;
}

.evd-sponsor-widget.no-logo .evd-sponsor-content {
    border-radius: 10px;
    margin: 0;
}
