/* B3 Ads - Logo Size Adjustment for Better Balance with Leaderboard */

/* Make logo smaller and better proportioned */
.af-middle-container .logo {
    max-width: 500px !important;
    max-height: 150px !important;
    min-width: 200px !important;
    min-height: 80px !important;
}

/* Target all possible logo image selectors with maximum specificity */
.af-middle-container .logo img,
.af-middle-container .logo a img,
.af-middle-container .logo .custom-logo,
.af-middle-container .logo .custom-logo-link img,
.af-middle-container .site-branding img,
.logo img.custom-logo {
    width: auto !important;
    height: 150px !important;
    min-height: 150px !important;
    max-width: 500px !important;
    object-fit: contain !important;
    display: block !important;
}

.af-middle-container .logo .site-title {
    font-size: 24px !important;
    line-height: 1.2;
}

.af-middle-container .logo .site-description {
    font-size: 12px !important;
}

/* Ensure header container uses flexbox properly */
.af-middle-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px;
    flex-wrap: nowrap !important;
}

/* Leaderboard ad responsive */
.b3-header-leaderboard img {
    max-width: 100% !important;
    height: auto !important;
}

/* B3 Sidebar Ad - Center alignment */
.b3-sidebar-ad-widget {
    text-align: center !important;
    margin: 0 auto !important;
}

.b3-sidebar-ad-widget .af-widget-body {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
}

.b3-sidebar-ad-widget img {
    margin: 0 auto !important;
    display: block !important;
}

/* MOBILE RESPONSIVE - Stack vertically on small screens */
@media (max-width: 768px) {
    .af-middle-container {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 15px !important;
        padding: 15px 0 !important;
        flex-wrap: wrap !important;
    }
    
    .af-middle-container .logo {
        max-width: 350px !important;
        max-height: 100px !important;
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto !important;
        min-width: 250px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .af-middle-container .logo .site-branding {
        text-align: center !important;
        margin: 0 auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .af-middle-container .logo img,
    .af-middle-container .logo a img,
    .af-middle-container .logo .custom-logo,
    .af-middle-container .logo .custom-logo-link img,
    .af-middle-container .site-branding img,
    .logo img.custom-logo {
        height: 100px !important;
        min-height: 100px !important;
        margin: 0 auto !important;
        max-width: 350px !important;
    }
    
    .af-middle-container .logo a,
    .af-middle-container .logo .custom-logo-link {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
    }
    
    .header-promotion.b3-header-leaderboard {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        flex: none !important;
    }
}

/* Extra small mobile - even more compact */
@media (max-width: 480px) {
    .af-middle-container .logo {
        max-width: 280px !important;
        max-height: 80px !important;
    }
    
    .af-middle-container .logo img,
    .af-middle-container .logo a img,
    .af-middle-container .logo .custom-logo,
    .af-middle-container .logo .custom-logo-link img,
    .af-middle-container .site-branding img,
    .logo img.custom-logo {
        height: 80px !important;
        min-height: 80px !important;
        max-width: 280px !important;
    }
    
    .af-middle-container .logo .site-title {
        font-size: 18px !important;
    }
}
