/*
 * CMS draft-preview bar. Shared, because it is CMS chrome rather than template design: it used to be
 * copied into five template stylesheets, where a template author could change or break it by accident.
 *
 * The 'basic' template keeps its own variant (sticky at the top, in normal flow) and does not load this
 * file. It can afford that because it has no sticky header; every other template pins its header to the
 * top, so the bar goes to the bottom instead and has to be positioned rather than flow.
 */

/*
 * z-index sits inside the Bootstrap band on purpose:
 *   1030 fixed/sticky site header   -> the bar must be above it
 *   1040 offcanvas backdrop         -> above, so the bar stays readable next to an open drawer
 *   1045 offcanvas panel            -> BELOW, so the navigation drawer covers the bar instead of the
 *                                      other way round. At z-index 2000 the bar sat on top of the
 *                                      drawer and made its last menu item impossible to tap, which is
 *                                      the defect this value fixes.
 *   1050+ modals                    -> untouched.
 */
.cms-preview-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1042;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    align-items: center;
    padding: .55rem 16px;
    background: #fff4d6;
    color: #5a4300;
    border-top: 1px solid #f0d58a;
    font: 13px/1.4 system-ui, sans-serif;
}

.cms-preview-bar a {
    margin-left: auto;
    color: #5a4300;
    font-weight: 600;
    text-decoration: underline;
}

/*
 * Space kept free at the end of the page so the bar does not cover the last of the content.
 *
 * The bar wraps: it carries a label, a detail line, sometimes a warning that custom site JS was
 * skipped, and a link back to the Page Builder. On a narrow screen that becomes three or four lines,
 * which is how a 44px reservation ended up hiding content on a phone. CSS cannot measure the rendered
 * height, so the narrow reservation deliberately covers the worst case: reserving too much only adds a
 * little empty scroll at the end, while reserving too little hides content the editor came to check.
 */
.has-preview-bar {
    padding-bottom: 44px;
}

@media (max-width: 767.98px) {
    .has-preview-bar {
        padding-bottom: 7.5rem;
    }
}
