html:has(body.admin-bar){
    --abm-admin-offset:var(--wp-admin--admin-bar--height,32px);
}

@media(max-width:782px){
    html:has(body.admin-bar){
        --abm-admin-offset:var(--wp-admin--admin-bar--height,46px);
    }
}

@media(max-width:600px){
    /* À cette largeur la barre d’administration WordPress défile avec la page. */
    html:has(body.admin-bar){--abm-admin-offset:0px}
}

@media(width > 900px){
    html:has(body.abm-pin-desktop){
        scroll-padding-top:calc(76px + var(--abm-admin-offset,0px));
    }
    .abm-pin-desktop .site-header,
    .abm-home.abm-pin-desktop .site-header{
        position:sticky;
        top:var(--abm-admin-offset,0px);
    }
    .abm-home.abm-pin-desktop .site-header{
        margin-bottom:-76px;
        background:rgba(19,19,19,.97);
    }
    .abm-pin-desktop .site-header .brand{margin:6px 0}
    .abm-pin-desktop .site-header .brand img{width:80px;height:64px}
}

@media(max-width:900px){
    /* Sans JS, la navigation mobile reste ouverte dans le flux. */
    html:has(body.abm-pin-mobile .site-header.nav-ready){
        scroll-padding-top:calc(88px + var(--abm-admin-offset,0px));
    }
    .abm-pin-mobile .site-header.nav-ready{
        position:sticky;
        top:var(--abm-admin-offset,0px);
    }
    .abm-home.abm-pin-mobile .site-header.nav-ready{
        margin-bottom:-88px;
        background:rgba(19,19,19,.97);
    }
    .abm-pin-mobile .site-header.nav-ready .brand img{height:76px}
    .abm-pin-mobile .site-header.nav-ready nav.is-open{
        max-height:calc(100dvh - 88px - var(--abm-admin-offset,0px));
    }
}
