/* ========================================================================
   MSB Music 10.9.79 — canonical fixed-player content clearance
   Geometry only: shared by dark/light. No palette changes, no JS, no network.

   The fixed mini-player is ~64px high on desktop. On mobile it sits above the
   bottom navigation, and theme-switcher already measures their real union.
   Content therefore needs that live measured scrollable tail,
   otherwise the final card can be covered by fixed UI. Earlier mobile rules
   were also being overridden at <=480px, which reduced the clearance to only
   a few pixels.
   ======================================================================== */
:root {
    --msb-content-player-gap: 8px;
    --msb-desktop-fixed-ui-clearance: 62px;
    --msb-mobile-fixed-ui-clearance: max(
        var(--msb-mobile-player-clearance, 138px),
        calc(132px + env(safe-area-inset-bottom, 0px))
    );
}

/* One owner for the fixed-UI reserve: the canonical main-content opened by
   header.php. Page templates must not create another .main-content wrapper.
   This is shared by dark/light and prevents both doubled empty tails and
   theme-specific underlap beneath the fixed player. */
.main-container {
    padding-bottom: 0 !important;
}

/* Term archives live directly in the canonical shell. Keep their own tail neutral;
   the shell below is the only player-safe-area owner. */
.msb-term-archive {
    margin-bottom: 0 !important;
}

@media (min-width: 992px) {
    .main-content {
        padding-bottom: var(--msb-desktop-fixed-ui-clearance) !important;
    }
    html {
        scroll-padding-bottom: var(--msb-desktop-fixed-ui-clearance);
    }
}

@media (max-width: 991px) {
    .main-content,
    body.msb-artist-profile-active .main-content.msb-artist-profile-main {
        padding-bottom: var(--msb-mobile-fixed-ui-clearance) !important;
    }

    /* The tail must remain document-flow space, not a min-height trick. */
    .app-wrapper,
    .main-container {
        height: auto !important;
    }

    html {
        scroll-padding-bottom: var(--msb-mobile-fixed-ui-clearance);
    }
}

/* Very small screens use the same physical fixed UI height; do not collapse
   the reserve at <=480px. */
@media (max-width: 480px) {
    .main-content,
    body.msb-artist-profile-active .main-content.msb-artist-profile-main {
        padding-bottom: var(--msb-mobile-fixed-ui-clearance) !important;
    }
}


/* 10.9.79.26 — page tails must not reserve fixed UI a second time. */
@media (max-width: 991px) {
    .main-content .dashboard-modern { padding-bottom: 12px !important; }
    .msb-home-content { padding-bottom: 0 !important; }
    .main-content > :last-child,
    .msb-home-content > :last-child,
    .dashboard-modern > :last-child { margin-bottom: 0 !important; }

    body.msb-artists-archive-active .main-container.msb-artists-archive-shell,
    body.msb-artist-profile-active .main-container { padding-bottom: 0 !important; }

    body.msb-artists-archive-active .main-content.msb-artists-archive-content,
    body.msb-artist-profile-active .main-content.msb-artist-profile-main {
        padding-bottom: var(--msb-mobile-fixed-ui-clearance) !important;
    }

    body.msb-playlist-archive-page .playlist-page { padding-bottom: 10px !important; }
}
