/* 1. GLOBALE EINSTELLUNGEN & VARIABLEN */
html {
    scroll-behavior: smooth;
}

:root {
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    /* Dynamische Farben aus dem Admin-Panel (werden im Layout überschrieben) */
    --afro-primary: #004a99;
    --afro-secondary: #002a55;
    --afro-tertiary: #001a20;
    --afro-text: #ffffff;
    --afro-gradient: linear-gradient(135deg, var(--afro-primary), var(--afro-secondary));

    /* Systemfarben */
    --afro-bg: #faf7f3;
    --afro-surface: rgba(255,255,255,.85);
    --afro-border: rgba(17, 24, 39, .08);

    /* Marken-Akzente (Pan-African) */
    --afro-green: #145c2c;
    --afro-red: #e53935;
    --afro-gold: #f4c842;

    --text: #111827;
    --muted: rgba(17,24,39,.62);

    --radius-xl: 22px;
    --radius-lg: 16px;
}

html, body {
    font-family: var(--font-sans), sans-serif;
    color: var(--text);
    line-height: 1.55;
    background-color: var(--afro-bg);
}

/* Container rechts ausrichten */
.afro-auth-container {
    display: flex;
    align-items: center;
}

/* Die kleine Benutzer-Pille */
.auth-pill-small {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem; /* Kleinere Schrift */
}

.user-name-small {
    color: var(--afro-text);
    opacity: 0.9;
    font-weight: 500;
}

/* Vertikale Trennlinie */
.auth-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 10px;
}

/* Icon-Links Styling */
.auth-icon-link {
    color: var(--afro-text) !important;
    opacity: 0.7;
    font-size: 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.auth-icon-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* Spezielle Farben für Admin & Logout */
.admin-btn { color: #ffca28 !important; } /* Goldgelb für Admin */
.logout-btn { color: #ff5252 !important; } /* Soft-Rot für Logout */

/* Login Link (wenn nicht eingeloggt) */
.login-link-minimal {
    font-size: 0.85rem;
    color: var(--afro-text) !important;
    text-decoration: none;
    opacity: 0.8;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 6px;
}

.login-link-minimal:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* 2. LAYOUT-KOMPONENTEN */
.afro-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding-top: 1rem;
}

/* Der schlanke Header für Unterseiten */
.afro-header-system, .afro-header-compact {
    position: sticky;
    top: 0;
    z-index: 20000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* Sticky Header (neues Layout: Topbar + Nav bleiben beim Scrollen sichtbar) */
.afro-topbar{
    position: sticky;
    top: 0;
    z-index: 50000;
    overflow: visible;
    isolation: isolate;

    background: rgba(255,255,255,0.10); /* glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

/* NAVIGATION (Glas-Effekt) */
.main-nav-bar, .afro-nav-glass, .afro-nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 5px 15px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    gap: 0.25rem;
}

/* HERO-BEREICH (Startseite) */
.afro-hero {
    background: var(--afro-gradient);
    color: white;
    padding: 4rem 0;
    position: relative;
}

.afro-hero-title {
    font-weight: 800;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
}

/* 5. SEKTIONEN & KARTEN */
.afro-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.afro-section::before {
    content: "";
    position: absolute;
    left: 0; top: 0; width: 4px; height: 100%;
    background: linear-gradient(to bottom, var(--afro-red), var(--afro-gold), var(--afro-green));
}

/* 6. AUTH & LOGIN */
.afro-auth-overlay .btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 999px;
}

/* Container für das Logo im Hero */
.hero-logo-wrapper {
    display: inline-block;
}

/* Das große Home-Logo */
.hero-logo-large {
    /* Größe deutlich erhöhen */
    height: 180px;
    width: auto;
    object-fit: contain;

    /* Glas-Effekt (Glassmorphism) */
    background: rgba(255, 255, 255, 0.15); /* Sehr leichte weiße Füllung */
    backdrop-filter: blur(12px);           /* Macht den Hintergrund unter dem Logo unscharf */
    -webkit-backdrop-filter: blur(12px);

    /* Rahmen und Abrundung */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 20px;

    /* Schatten für mehr Tiefe auf dem Gradienten */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

    /* Animation beim Drüberfahren */
    transition: all 0.3s ease-in-out;
}

.hero-logo-large:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}


/* Den Header schmal halten */
.afro-header-compact {
    width: 100%;
    min-height: 70px; /* Schmale Höhe erzwingen */
    background: var(--afro-gradient);
    color: var(--afro-text);
    z-index: 1000;
}

/* Sicherstellen, dass der Body Platz hat */
.afro-main-content {
    flex: 1;
    width: 100%;
    background-color: #faf7f3; /* Dein Hintergrund */
    padding-bottom: 5rem;
    z-index: 1; !important
}


/* Nav */
.afro-nav-wrapper{
    position: relative;
    z-index: 50001;
}

.afro-nav {
    background-color: #ffffff;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: .4rem .75rem;
    gap: .25rem;
}

/* Sektionen als Karten mit akzentfarbener Linie */
.afro-section {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.afro-section::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #e53935, #f4c842, #145c2c);
}

.afro-section .card-body {
    padding: 1.5rem 1.75rem;
}

.afro-section-title {
    margin-bottom: .75rem;
    font-weight: 700;
    color: #222;
}

.afro-subnav-item {
    display: block;
    margin-bottom: 8px;
}

.afro-subnav-item:last-child {
    margin-bottom: 0;
}

.manage-nav {
    border-radius: 18px;
}

.manage-nav-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.manage-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons */
.manage-nav .nav-link {
    border-radius: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 10px 12px;
}

/* Buttons im Hero */
.btn-afro-primary {
    background-color: #145c2c;
    border-color: #145c2c;
    color: #fff;
    font-weight: 600;
}

.btn-afro-primary:hover {
    background-color: #0f4520;
    border-color: #0f4520;
}

.btn-afro-nav {
    border-radius: 999px;
    padding: .35rem .9rem;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border: none;
    background: transparent;
    color: #444;
    font-weight: 600;
}

.btn-afro-nav:hover {
    background: rgba(20, 92, 44, 0.08);
    color: #145c2c;
}

/* Active */
.manage-nav .nav-link.active {
    color: #fff;
    background: rgba(0,0,0,0.35);
    border-color: rgba(0,0,0,0.25);
}

/* Hover */
.manage-nav .nav-link:hover {
    color: #fff;
    background: rgba(0,0,0,0.18);
}

/* Mobile: horizontal scroll statt hässlich untereinander */
@media (max-width: 992px) {
    .manage-nav-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .manage-nav .nav-item {
        flex: 0 0 auto;
    }

    .manage-nav .nav-link {
        white-space: nowrap;
    }
}

/* Die Pille dunkler machen für besseren Kontrast */
.auth-pill-modern {
    background: rgba(0, 0, 0, 0.25); /* Dunklerer Hintergrund */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Texte besser lesbar machen */
.user-name-small {
    color: #ffffff !important;
    font-size: 0.82rem;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* Schatten für Lesbarkeit */
}

.user-email-tiny {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    margin-top: 2px;
}

/* Icons schärfer machen */
.auth-icon-btn {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
}

.auth-icon-btn:hover {
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Spezielle Hover-Effekte */
.admin-glow:hover { color: #ffca28 !important; }
.logout-hover:hover { color: #ff5252 !important; }

.auth-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
}

.login-btn-glass {
    color: white !important;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: background 0.2s;
}

.login-btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===  Header Customization === */
/* Basis-Klasse für den dynamischen Hintergrund */
.custom-header-bg {
    background-position: center center;
    transition: background-image 0.3s ease;
}

/* Modus: Bild deckt alles ab (Cover) */
.bg-mode-cover {
    background-size: cover;
    background-repeat: no-repeat;
}

/* Modus: Bild wiederholt sich (Muster/Textur) */
.bg-mode-repeat {
    background-size: auto; /* Bild behält Originalgröße */
    background-repeat: repeat;
}

/* Klasse für das dynamische Logo */
.custom-logo {
    height: auto;
    width: var(--logo-size, 40px); /* Fallback 40px */
    transition: width 0.2s ease;   /* Smoothe Änderung bei Einstellung */
    display: block;
}

.newsletter-widget {
    background-color: #f8f9fa; /* Hellgrau oder passend zum Footer */
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

.widget-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.x-small {
    font-size: 0.75rem;
}

/* Button Farbe anpassen (Beispiel Grün) */
.btn-afro-primary {
    background-color: #198754;
    border-color: #198754;
    color: white;
}
.btn-afro-primary:hover {
    background-color: #157347;
}

/* --- PARTNER MARQUEE (Laufband) --- */
.partner-marquee {
    overflow: hidden;
    background: #fff;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    position: relative;
}

.marquee-track {
    display: inline-flex;
    align-items: center;
    gap: 60px; /* Abstand zwischen Logos */
    animation: scroll 30s linear infinite; /* 30s Laufzeit */
}

/* duplizieren den Inhalt, damit es endlos wirkt */
.marquee-track:hover {
    animation-play-state: paused; /* Stoppt beim Mauszeiger */
}

/* --- PARTNER MARQUEE (Laufband) --- */
.partner-marquee {
    overflow: hidden;         /* Versteckt alles, was rausläuft */
    position: relative;
    width: 100%;
    background: #fff;         /* Weißer Hintergrund */
    padding: 10px 0;
}

.marquee-track {
    display: inline-flex;     /* Nebeneinander */
    align-items: center;
    gap: 40px;                /* Abstand zwischen Logos */
    white-space: nowrap;      /* Kein Umbruch */
    animation: scroll 40s linear infinite; /* Die Bewegung */
}

/* Stoppt Animation bei Mouse-Over */
.marquee-track:hover {
    animation-play-state: paused;
}

.partner-logo {
    height: 50px;             /* WICHTIG: Feste Höhe, sonst 0px */
    width: auto;
    object-fit: contain;
    /* Optional: Grau bis Hover */
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === Globales Muster (Umgebung) === */
.afro-page.site-shell {
    min-height: 100vh;
    padding: 28px 14px;

    background-image:
            radial-gradient(1100px 600px at 50% -200px, rgba(255,255,255,0.26), transparent 60%),
            radial-gradient(900px 600px at 85% 30%, rgba(0,0,0,0.16), transparent 55%),
            url('/bg/tile.png');

    background-repeat: no-repeat, no-repeat, repeat;
    background-size: cover, cover, 120px;   /* Tile-Größe */
    background-position: center, center, center;
    background-attachment: fixed, fixed, scroll;
}

/* === Mittlerer "Papier"-Container === */
.site-frame {
    max-width: 1180px;
    margin: 0 auto;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 18px;
    box-shadow: 0 20px 70px rgba(0,0,0,0.16);
    overflow: hidden;
}

/* Mobile */
@media (max-width: 768px) {
    .afro-page.site-shell { padding: 16px 10px; }
    .site-frame { border-radius: 14px; }
}


/* ==============================================
   NACHTRAG: NAVIGATION POPOVER & LINKS
   ============================================== */

/* 1. Basis-Container für Nav (Positionierung) */
.afro-nav-area {
    position: relative;
    overflow: visible;
    z-index: 20000;
}

/* 2. Das Popover-Menü (Die weiße Box) */
.afro-subnav-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 320px;
    min-width: 200px;

    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.25);
    z-index: 99999;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Das kleine Dreieck oben an der Box */
.afro-subnav-popover::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    width: 14px;
    height: 14px;
    background: #fff;
    border-left: 1px solid rgba(0,0,0,0.08);
    border-top: 1px solid rgba(0,0,0,0.08);
    transform: translateX(-50%) rotate(45deg);
}

/* Die rechte Box (3. Ebene) */
.afro-subnav-popover--right {
    top: -10px;
    left: calc(100% + 5px);
    transform: none;
}
.afro-subnav-popover--right::before { display: none; }

/* 3. LINK-STYLING (WICHTIG!)
   Hier überschreiben wir Bootstrap-Links (blau/unterstrichen) 
   und machen sie zu Buttons (schwarz/sauber).
*/
.afro-nav-area .afro-subnav-popover a,
.afro-nav-area .afro-subnav-popover a:visited,
.afro-nav-area .afro-subnav-popover .afro-subnav-link {
    color: #2e2828 !important;        /* WICHTIG: Dunkle Farbe erzwingen */
    text-decoration: none !important; /* WICHTIG: Unterstrich entfernen */

    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;

    background: transparent;
    border: none;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover-Effekt (Maus drüber) */
.afro-nav-area .afro-subnav-popover a:hover,
.afro-nav-area .afro-subnav-popover .afro-subnav-link:hover {
    background-color: rgba(0, 0, 0, 0.06) !important;
    color: #000 !important;
}

/* Active-Effekt (Aktuelle Seite) */
.afro-nav-area .afro-subnav-popover a.active {
    background-color: rgba(0, 0, 0, 0.08) !important;
    font-weight: 700 !important;
}

/* Kleiner Pfeil für Untermenüs */
.afro-subnav-caret {
    opacity: 0.6;
    padding-left: 12px;
}

/* ==============================================
   MOBILE ANPASSUNGEN (Responsive)
   ============================================== */
@media (max-width: 991.98px) {
    .afro-nav-mobilebar {
        display: flex;
        align-items: center;
    }

    .afro-nav-collapse {
        display: none;
        margin-top: 0.5rem;
    }
    .afro-nav-collapse.open { display: block; }

    /* Nav-Container Mobile */
    .afro-nav {
        background: #fff;
        border-radius: 18px;
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    }

    .afro-nav-item {
        display: block;
        width: 100%;
        margin-bottom: 4px;
    }

    .btn-afro-nav {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 10px 12px;
        border-radius: 10px;
    }

    /* Popover Mobile: Inline statt schwebend */
    .afro-subnav-popover {
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 5px 0 5px 15px;
        backdrop-filter: none;
    }

    .afro-subnav-popover::before { display: none; }

    .afro-subnav-popover--right {
        border-left: 2px solid rgba(0,0,0,0.1);
        padding-left: 15px;
        margin-left: 5px;
    }
}

/* 1. Das Vorschaubild ganz oben in der Karte */
.news-img-top img,
.news-img-top video {
    width: 100% !important;
    height: 220px !important;       /* Zwingt das Bild auf diese Höhe */
    object-fit: cover !important;   /* Schneidet Überreste ab */
    object-position: center top !important; /* Fokus oben */
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    display: block !important;
}

/* 2. Bilder im Text (wenn aufgeklappt) */
.news-content img,
.news-excerpt img {
    max-width: 100% !important;
    width: 100% !important;         /* Zieht kleine Bilder breit */
    height: auto !important;        /* Hier erlauben wir natürliche Höhe, DAMIT MAN ALLES SIEHT */
    max-height: 400px !important;   /* ABER: Nicht höher als 400px, sonst scrollt man ewig */
    object-fit: cover !important;
    border-radius: 12px !important;
    margin: 15px 0 !important;
}

/* Sicherheitsnetz: Verhindert, dass Bilder aus der Karte ragen */
.news-card-clean {
    overflow: hidden !important;
}