/* The composition occupies the full header; its inner layout belongs to Composer. */
.rdmmb-header,
.rdmmb-header > .rdmmb-slot {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
}

.rdmmb-header > .rdmmb-slot {
    display: flow-root;
}

/* Page-specific theme skins can otherwise inset #masthead on desktop and mobile. */
#masthead.rdmmb-header {
    width: 100% !important;
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Root rows have no outer column gutter to compensate for. */
.rdmmb-slot > .vc_row {
    margin-left: 0;
    margin-right: 0;
}

.rdmmb-slot > :last-child {
    margin-bottom: 0;
}

/* Each mode has its own initial position; Fixed never passes through Sticky. */
#masthead.rdmmb-header[data-rdmmb-position] {
    position: sticky !important;
    top: calc(var(--rdmmb-admin-offset, 0px) + var(--rdmmb-topbar-height, 0px)) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    z-index: 1200;
    overflow-anchor: none;
    transition: box-shadow 280ms ease, background-color 280ms ease;
}

/* Fixed floats over the page; backgrounds belong to the Composer composition. */
#masthead.rdmmb-header[data-rdmmb-position="fixed"] {
    position: fixed !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.admin-bar #masthead.rdmmb-header[data-rdmmb-position] {
    top: calc(var(--rdmmb-admin-offset, 32px) + var(--rdmmb-topbar-height, 0px)) !important;
}

@media (max-width: 782px) {
    body.admin-bar #masthead.rdmmb-header[data-rdmmb-position] {
        top: calc(var(--rdmmb-admin-offset, 46px) + var(--rdmmb-topbar-height, 0px)) !important;
    }
}

@media (max-width: 600px) {
    body.admin-bar #masthead.rdmmb-header[data-rdmmb-position] {
        top: calc(var(--rdmmb-admin-offset, 0px) + var(--rdmmb-topbar-height, 0px)) !important;
    }
}

#masthead.rdmmb-header[data-rdmmb-position].rdmmb-is-fixed {
    position: fixed !important;
}

body.rdmmb-position-static #masthead.rdmmb-header[data-rdmmb-position="static"] {
    position: relative !important;
    top: auto !important;
}

.rdmmb-position-anchor {
    display: block;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow-anchor: none;
    pointer-events: none;
}

body.rdmmb-positioned > .rdm-header-spacer { height: 0 !important; }

#masthead.rdmmb-header[data-rdmmb-position].rdmmb-is-stuck {
    box-shadow: var(--rdmmb-stuck-shadow, 0 8px 26px rgba(0, 0, 0, .12));
}

#masthead.rdmmb-header.rdmmb-enter-fixed {
    animation: rdmmb-header-enter 360ms cubic-bezier(.22, 1, .36, 1) both;
}

#masthead.rdmmb-header.rdmmb-return-sticky {
    animation: rdmmb-header-return 220ms ease-out both;
}

@keyframes rdmmb-header-enter {
    from { opacity: .55; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rdmmb-header-return {
    from { opacity: .85; }
    to { opacity: 1; }
}

html.rdmmb-scroll-managed { scroll-padding-top: var(--rdmmb-scroll-offset, 100px); }

#masthead.rdmmb-header.rdmmb-is-tall {
    max-height: calc(100dvh - var(--rdmmb-admin-offset, 0px) - var(--rdmmb-topbar-height, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
    #masthead.rdmmb-header[data-rdmmb-position] {
        animation: none;
        transition: none;
    }
}
