/*
 * Macro Micro UI Polish
 * Module 03: Homepage Brands — v1.3.2
 * Unified compact grid. Other plugins/data remain untouched.
 */

body.home .mm-ui-original-brand-area-hidden{
    display:none!important;
}

body.home a.mm-ui-legacy-brand-hidden{
    display:none!important;
}

body.home .mm-ui-legacy-brand-wrapper-hidden{
    display:none!important;
}

/* Do not paint/rebuild the section; only correct text legibility inside its existing dark theme. */
body.home .mm-ui-brand-section-shell h1,
body.home .mm-ui-brand-section-shell h2,
body.home .mm-ui-brand-section-shell h3,
body.home .mm-ui-brand-section-shell h4{
    color:#f5f6f7!important;
}

body.home .mm-ui-canonical-brand-grid{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:10px 0!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
}

body.home .mm-ui-canonical-brand-card{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:0!important;
    min-height:46px!important;
    padding:7px 9px!important;
    border:1px solid rgba(255,255,255,.11)!important;
    border-radius:11px!important;
    background:rgba(255,255,255,.025)!important;
    color:#fff!important;
    text-decoration:none!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important;
    box-sizing:border-box!important;
    transition:transform .18s ease,border-color .18s ease,background .18s ease!important;
}

body.home .mm-ui-canonical-brand-card:hover{
    transform:translateY(-2px)!important;
    border-color:rgba(255,255,255,.20)!important;
    background:rgba(255,255,255,.05)!important;
}

body.home .mm-ui-canonical-brand-name{
    display:block!important;
    width:100%!important;
    color:#fff!important;
    font-size:clamp(8px,.76vw,11.5px)!important;
    line-height:1.08!important;
    font-weight:850!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
}

/* 6+ brands: add rows only when needed. */
@media(max-width:900px){
    body.home .mm-ui-canonical-brand-grid{
        gap:7px!important;
    }
}

@media(max-width:600px){
    body.home .mm-ui-canonical-brand-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:7px!important;
        margin:9px 0!important;
    }

    body.home .mm-ui-canonical-brand-card{
        min-height:44px!important;
        padding:6px 7px!important;
        border-radius:10px!important;
    }

    body.home .mm-ui-canonical-brand-name{
        font-size:10px!important;
        white-space:normal!important;
        text-overflow:clip!important;
    }
}

/* On very small phones 2 columns still fit; section grows only by required rows. */
@media(max-width:360px){
    body.home .mm-ui-canonical-brand-card{
        min-height:42px!important;
    }
    body.home .mm-ui-canonical-brand-name{
        font-size:9px!important;
    }
}
